]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/dp_mst: Move the joiner dependent code together
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Mon, 2 Feb 2026 10:37:21 +0000 (16:07 +0530)
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Tue, 3 Feb 2026 08:17:05 +0000 (13:47 +0530)
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 <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-8-ankit.k.nautiyal@intel.com
drivers/gpu/drm/i915/display/intel_dp_mst.c

index ec6882af0631aa7d8540d952f4009cf4f4dd4d5c..fc9367cc42ec67665580af2fb8f9e76716b41f84 100644 (file)
@@ -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);