From c80311c04331f2f42446eac21d7c3528c2e3c062 Mon Sep 17 00:00:00 2001 From: Ankit Nautiyal Date: Mon, 2 Feb 2026 16:07:21 +0530 Subject: [PATCH] drm/i915/dp_mst: Move the joiner dependent code together Move the calculation of num_joined_pipes and other constraints that depend on it, into a single block in mst_stream_compute_config(). This groups all joiner-dependent logic together, preparing the code for a future loop-based evaluation of multiple joiner configurations. Signed-off-by: Ankit Nautiyal Reviewed-by: Imre Deak Link: https://patch.msgid.link/20260202103731.357416-8-ankit.k.nautiyal@intel.com --- drivers/gpu/drm/i915/display/intel_dp_mst.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index ec6882af0631..fc9367cc42ec 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -619,16 +619,16 @@ static int mst_stream_compute_config(struct intel_encoder *encoder, if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) return -EINVAL; + pipe_config->sink_format = INTEL_OUTPUT_FORMAT_RGB; + pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; + pipe_config->has_pch_encoder = false; + num_joined_pipes = intel_dp_num_joined_pipes(intel_dp, connector, adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_clock); if (num_joined_pipes > 1) pipe_config->joiner_pipes = GENMASK(crtc->pipe + num_joined_pipes - 1, crtc->pipe); - pipe_config->sink_format = INTEL_OUTPUT_FORMAT_RGB; - pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; - pipe_config->has_pch_encoder = false; - joiner_needs_dsc = intel_dp_joiner_needs_dsc(display, num_joined_pipes); dsc_needed = joiner_needs_dsc || intel_dp->force_dsc_en || @@ -685,6 +685,10 @@ static int mst_stream_compute_config(struct intel_encoder *encoder, pipe_config->dp_m_n.tu); } + if (ret) + return ret; + + ret = intel_dp_compute_min_hblank(pipe_config, conn_state); if (ret) return ret; @@ -695,10 +699,6 @@ static int mst_stream_compute_config(struct intel_encoder *encoder, pipe_config->lane_lat_optim_mask = bxt_dpio_phy_calc_lane_lat_optim_mask(pipe_config->lane_count); - ret = intel_dp_compute_min_hblank(pipe_config, conn_state); - if (ret) - return ret; - intel_vrr_compute_config(pipe_config, conn_state); intel_dp_audio_compute_config(encoder, pipe_config, conn_state);