Currently the FRL bandwidth check rejects every mode whose uncompressed
bandwidth exceeds the FRL rate, even though an HDMI 2.1 PCON can decode
the DP stream and encode DSC 1.2 for the HDMI sink. High bandwidth modes
(e.g. 4k120, 8k60) get pruned for such PCONs, although the PCON and the
sink can carry them. The previous change lets the bpc selection use the
DSC encoder of the PCON, but the mode valid check still prunes such
modes.

Accept such a mode in the mode valid check if the HDMI link can carry it
compressed, and the DP stream can be compressed too: the PCON can't
encode an uncompressed stream. This is the same check that the bpc
selection uses, so a mode that is listed can also be configured.

The DP spec defines the decoding and re-encoding only for a DSC v1.1
source, and the pass-through for a DSC v1.2a (or higher) one. The
pass-through is not handled here, so a DSC 1.2a stream is re-encoded as
well for now.

Tested with a BizLink USB-C to DP80 cable (PCON) and an HDMI 2.1 panel

This takes care of the FIXME in the FRL bandwidth check.

Signed-off-by: Ankit Nautiyal <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c 
b/drivers/gpu/drm/i915/display/intel_dp.c
index 94744ead1a6e..be40a882e90d 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1225,7 +1225,6 @@ intel_dp_frl_bw_valid(struct intel_dp *intel_dp, int 
target_clock,
        /* check for MAX FRL BW for both PCON and HDMI2.1 sink */
        max_frl_bw = intel_dp_hdmi_frl_payload_bw(intel_dp, false);
 
-       /* #FIXME check bandwidth with DSC if both PCON and HDMI sink support 
DSC */
        if (target_bw > max_frl_bw)
                return MODE_CLOCK_HIGH;
 
@@ -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;
 }
 
 static enum drm_mode_status
-- 
2.50.1

Reply via email to