Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Medium] drm/i915/dp: PCON DSC mode_valid misses per-mode DP DSC and FEC checks - [Medium] drm/i915/dp: FRL training skips rate reduction for PCON DSC modes - [Medium] drm/i915/dp: PCON DSC compute omits sink/PCON format, bpc, and PPS caps --
commit bc75fbbf3bd6bf6b6b5b7a81601106a79bf3cab6 Author: Ankit Nautiyal <[email protected]> drm/i915/dp: Allow PCON DSC modes through the FRL bw check This commit updates intel_dp_mode_valid_downstream() to accept modes that exceed uncompressed HDMI FRL bandwidth when both connector DP DSC and PCON HDMI DSC encoding are available, and removes the corresponding FIXME comment in intel_dp_frl_bw_valid(). > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c > b/drivers/gpu/drm/i915/display/intel_dp.c > index 94744ead1a6e9..be40a882e90da 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp.c [ ... ] > @@ -1339,12 +1338,22 @@ intel_dp_mode_valid_downstream(struct intel_connector > *connector, > { > struct intel_dp *intel_dp = intel_attached_dp(connector); > int bpc = 8; /* Assume 8bpc for the DP++/HDMI/DVI TMDS/FRL bw check */ > + enum drm_mode_status status; > > if (intel_dp->dfp.max_dotclock && > target_clock > intel_dp->dfp.max_dotclock) > return MODE_CLOCK_HIGH; > > - return intel_dp_hdmi_bw_valid(intel_dp, target_clock, bpc, sink_format, > true); > + status = intel_dp_hdmi_bw_valid(intel_dp, target_clock, bpc, > sink_format, true); > + if (status != MODE_CLOCK_HIGH) > + return status; > + > + /* The PCON may be able to compress the stream for the HDMI link */ > + if (intel_dp_has_dsc(connector) && > + intel_dp_hdmi_dsc_possible(intel_dp, mode, target_clock, bpc, > sink_format)) > + return MODE_OK; > + > + return status; > } [Severity: Medium] Is checking intel_dp_has_dsc() sufficient here to guarantee that DP DSC can be enabled for the mode? intel_dp_has_dsc() only checks static connector capabilities and skips FEC support, intel_dp_mode_valid_with_dsc(), joiner needs, and DSC bubble dotclock limits. In intel_dp_mode_valid_format(), a mode that fits the DP link uncompressed still reaches here even when local dsc is false. At modeset time, intel_dp_compute_formats() with respect_downstream_limits set requires DP DSC and fails, for example in intel_dp_supports_dsc() without FEC. intel_dp_compute_config() then falls back to ignoring downstream limits and either fails with -EINVAL or drives an out-of-spec uncompressed FRL link. [Severity: Medium] Does switching from an uncompressed mode to one of these PCON DSC modes leave the HDMI FRL link running above the sink's DSC_Max_FRL_Rate? intel_dp_pcon_compute_config() selects the lower dsc_max_frl_rate for PCON DSC streams, but intel_dp_check_frl_training() skips retraining whenever frl.trained_rate_gbps >= pcon_config.frl_rate_gbps. intel_dp_pcon_is_frl_trained() similarly accepts any higher trained mask. On an HDMI 2.1 sink where dsc_max_frl_rate is below max_frl_rate (such as 40 Gbps vs 48 Gbps), switching from an uncompressed mode to a PCON DSC mode leaves the FRL link above the sink's DSC limit, which can cause the sink to reject or corrupt the compressed stream. [Severity: Medium] Can intel_dp_hdmi_dsc_possible() accept YCbCr 4:2:0 or deep-color modes that exceed the HDMI sink's or PCON's DSC encoder capabilities? intel_dp_pcon_dsc_enc_compute() never checks sink_format against hdmi.dsc_cap.native_420 or DP_PCON_DSC_ENC_COLOR_FMT_CAP, nor bpc against hdmi.dsc_cap.bpc_supported or DP_PCON_DSC_ENC_COLOR_DEPTH_CAP. intel_dp_pcon_can_encode_dsc() also omits DP_PCON_DSC_ENCODER_SUPPORTED and DP_PCON_DSC_PPS_ENC_OVERRIDE, even though intel_dp_pcon_dsc_configure() programs PPS override parameters. On a sink that advertises DSC 1.2 without Native 4:2:0 DSC, or only 8 bpc DSC while supporting 10/12 bpc uncompressed, unsupported modes pass validation and get programmed into the PCON, causing blank or corrupted output. -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=15
