Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Imre Deak cbbf2df8 7dbfba0b

+16
+13
drivers/gpu/drm/i915/display/intel_dp.c
··· 2419 2419 return dsc_enabled_on_crtc || intel_dsc_enabled_on_link(crtc_state); 2420 2420 } 2421 2421 2422 + void intel_dp_dsc_reset_config(struct intel_crtc_state *crtc_state) 2423 + { 2424 + crtc_state->fec_enable = false; 2425 + 2426 + crtc_state->dsc.compression_enable = false; 2427 + crtc_state->dsc.compressed_bpp_x16 = 0; 2428 + 2429 + memset(&crtc_state->dsc.slice_config, 0, sizeof(crtc_state->dsc.slice_config)); 2430 + memset(&crtc_state->dsc.config, 0, sizeof(crtc_state->dsc.config)); 2431 + } 2432 + 2422 2433 int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, 2423 2434 struct intel_crtc_state *pipe_config, 2424 2435 struct drm_connector_state *conn_state, ··· 2860 2849 struct link_config_limits limits; 2861 2850 bool dsc_needed, joiner_needs_dsc; 2862 2851 int ret = 0; 2852 + 2853 + intel_dp_dsc_reset_config(pipe_config); 2863 2854 2864 2855 joiner_needs_dsc = intel_dp_joiner_needs_dsc(display, num_joined_pipes); 2865 2856
+1
drivers/gpu/drm/i915/display/intel_dp.h
··· 75 75 struct drm_connector_state *conn_state); 76 76 bool intel_dp_needs_8b10b_fec(const struct intel_crtc_state *crtc_state, 77 77 bool dsc_enabled_on_crtc); 78 + void intel_dp_dsc_reset_config(struct intel_crtc_state *crtc_state); 78 79 int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, 79 80 struct intel_crtc_state *pipe_config, 80 81 struct drm_connector_state *conn_state,
+2
drivers/gpu/drm/i915/display/intel_dp_mst.c
··· 610 610 bool dsc_needed, joiner_needs_dsc; 611 611 int ret = 0; 612 612 613 + intel_dp_dsc_reset_config(pipe_config); 614 + 613 615 joiner_needs_dsc = intel_dp_joiner_needs_dsc(display, num_joined_pipes); 614 616 615 617 dsc_needed = joiner_needs_dsc || intel_dp->force_dsc_en ||