]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/dp: Fix DSC state computation
authorImre Deak <imre.deak@intel.com>
Mon, 2 Mar 2026 10:28:38 +0000 (12:28 +0200)
committerImre Deak <imre.deak@intel.com>
Tue, 3 Mar 2026 09:31:43 +0000 (11:31 +0200)
When computing the encoder/CRTC state multiple times, such as during
iteration over the possible pipe joiner configurations, it must be
ensured that all state is explicitly initialized each time. At the
moment, this is not guaranteed for the DSC/FEC state within the
encoder/CRTC state. In one iteration trying a pipe joiner configuration,
the DSC state may get initialized without computing the full
CRTC/encoder state due to the given joiner configuration being
impossible. When the same CRTC/encoder state is recomputed in a
subsequent iteration, the previously set non-zero - now stale - DSC/FEC
state may still be present, which is unexpected if a non-DSC
configuration is being computed.

This can lead to a DSC state mismatch error if multiple joiner
configurations are evaluated and the working configuration ultimately
turns out to be a non-DSC one.

Follow the existing pattern and compute the full (DSC/FEC) state on all
code paths (including now the non-DSC path as well) to fix the issue.

Fixes: 1f1e3e5c65f6 ("drm/i915/dp: Rework pipe joiner logic in compute_config")
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/7512
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260302102838.1522499-1-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_dp.c
drivers/gpu/drm/i915/display/intel_dp.h
drivers/gpu/drm/i915/display/intel_dp_mst.c

index 025e906b63a97d37e0c3260a147f0a9f57b1de1e..a202b8fe246ab150f2981dc6701df6cad5d7ad75 100644 (file)
@@ -2419,6 +2419,17 @@ bool intel_dp_needs_8b10b_fec(const struct intel_crtc_state *crtc_state,
        return dsc_enabled_on_crtc || intel_dsc_enabled_on_link(crtc_state);
 }
 
+void intel_dp_dsc_reset_config(struct intel_crtc_state *crtc_state)
+{
+       crtc_state->fec_enable = false;
+
+       crtc_state->dsc.compression_enable = false;
+       crtc_state->dsc.compressed_bpp_x16 = 0;
+
+       memset(&crtc_state->dsc.slice_config, 0, sizeof(crtc_state->dsc.slice_config));
+       memset(&crtc_state->dsc.config, 0, sizeof(crtc_state->dsc.config));
+}
+
 int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
                                struct intel_crtc_state *pipe_config,
                                struct drm_connector_state *conn_state,
@@ -2850,6 +2861,8 @@ intel_dp_compute_link_for_joined_pipes(struct intel_encoder *encoder,
        bool dsc_needed, joiner_needs_dsc;
        int ret = 0;
 
+       intel_dp_dsc_reset_config(pipe_config);
+
        joiner_needs_dsc = intel_dp_joiner_needs_dsc(display, num_joined_pipes);
 
        dsc_needed = joiner_needs_dsc || intel_dp->force_dsc_en ||
index b0bbd5981f57311b933c88d5c16a13ed44be8d89..2849b9ecdc71adcbdc6ff08a21e7c7d68e6995b3 100644 (file)
@@ -75,6 +75,7 @@ int intel_dp_compute_config(struct intel_encoder *encoder,
                            struct drm_connector_state *conn_state);
 bool intel_dp_needs_8b10b_fec(const struct intel_crtc_state *crtc_state,
                              bool dsc_enabled_on_crtc);
+void intel_dp_dsc_reset_config(struct intel_crtc_state *crtc_state);
 int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
                                struct intel_crtc_state *pipe_config,
                                struct drm_connector_state *conn_state,
index fb5396a46d1b9f9e3dde4ae39ab0d24004d07f43..0bb39f9bd74ef42115733b29baad65ce137d0efa 100644 (file)
@@ -610,6 +610,8 @@ static int mst_stream_compute_link_for_joined_pipes(struct intel_encoder *encode
        bool dsc_needed, joiner_needs_dsc;
        int ret = 0;
 
+       intel_dp_dsc_reset_config(pipe_config);
+
        joiner_needs_dsc = intel_dp_joiner_needs_dsc(display, num_joined_pipes);
 
        dsc_needed = joiner_needs_dsc || intel_dp->force_dsc_en ||