summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2026-03-02 12:28:38 +0200
committerImre Deak <imre.deak@intel.com>2026-03-03 11:31:43 +0200
commitcbbf2df81dd9ed1623bf290a799d4e6b77fedd29 (patch)
tree9deb5cac7aebd69c8073318e8643618f77c1cea9 /drivers/gpu
parent7dbfba0ba0b99661266c93cd9025d47197241511 (diff)
drm/i915/dp: Fix DSC state computation
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
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/display/intel_dp.c13
-rw-r--r--drivers/gpu/drm/i915/display/intel_dp.h1
-rw-r--r--drivers/gpu/drm/i915/display/intel_dp_mst.c2
3 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 025e906b63a9..a202b8fe246a 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -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 ||
diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
index b0bbd5981f57..2849b9ecdc71 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 fb5396a46d1b..0bb39f9bd74e 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 ||