On 3/2/2026 3:58 PM, Imre Deak wrote:
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 <[email protected]>
Signed-off-by: Imre Deak <[email protected]>

LGTM.

Reviewed-by: Ankit Nautiyal <[email protected]>


---
  drivers/gpu/drm/i915/display/intel_dp.c     | 13 +++++++++++++
  drivers/gpu/drm/i915/display/intel_dp.h     |  1 +
  drivers/gpu/drm/i915/display/intel_dp_mst.c |  2 ++
  3 files changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c 
b/drivers/gpu/drm/i915/display/intel_dp.c
index 6c25c7595c48..2d9ce21e5bbe 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -2457,6 +2457,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,
@@ -2888,6 +2899,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 ||
diff --git a/drivers/gpu/drm/i915/display/intel_dp.h 
b/drivers/gpu/drm/i915/display/intel_dp.h
index 57fac7fb837f..fbe43ca3d99f 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.h
+++ b/drivers/gpu/drm/i915/display/intel_dp.h
@@ -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,
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c 
b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index e73ae4956f9b..90349819dcfb 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -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 ||

Reply via email to