The first part of this series, which reworks the HDMI DSC helpers and fixes the FRL/TMDS downstream bandwidth checks of a DP->HDMI 2.1 PCON, is already merged. This is the rest of it, the PCON DSC operations.
A DP->HDMI 2.1 PCON that gets a compressed DP stream either decodes it, if the HDMI link doesn't need DSC, or decodes it and encodes it again for the HDMI sink, which is also how a DSC 1.1 stream is converted to the DSC 1.2 that HDMI 2.1 needs. The driver doesn't pick the operation, doesn't program the PCON DSC encoder per stream, and doesn't check that the compressed bpp fits the FRL configuration. The DP spec has three DSC operations for a PCON: pass-through, decoding, and decoding with re-encoding. The re-encoding is defined only for a DSC v1.1 source, and a DSC v1.2a (or higher) stream is meant to be passed through. This series doesn't handle the pass-through: with the external DP-HDMI 2.1 PCON dongle I tested (BizLink) it doesn't come up, and the PCON drops the HPD and resets itself some seconds after the enable. Decoding and re-encoding with the same dongle works, so the series re-encodes a DSC 1.2a stream too, which is outside what the spec defines. The pass-through can be added later, for the PCONs on which it works. Tested with that external dongle and a 4k 240Hz HDMI 2.1 sink on PTL: 4k 60, 120 and 165Hz (decode), and 200 and 240Hz (decode and re-encode) come up. Rev2: - Rebase and address comments from Suraj. - Drop drm/i915/dp: Use FRL pair check for the DFP dotclock limit as no longer required. Rev3: - Address Comments from Sashiko. - Account for FRL encoding overhead during bw calculation. - Pass pixel clock instead of using mode->crtc_clock to make it work with mode-valid case. - Clamp the target bpp only when it equals the pipe bpp to avoid missing the case when dsc min_bpp and max_bpp are same. Rev4: - Add the PCON DSC operations as per DP Spec: decode, decode and re-encode, and pass-through for a DSC 1.2a stream. - Add the PCON DSC state to crtc_state, compute the operation and the PCON DSC encoder parameters in compute_config, and only program them at enable. Disable the PCON DSC encoder unless it is needed. - Enable DSC pass-through in the PCON, and limit the slice count and the compressed bpp of the DP stream to what the HDMI sink supports. - Store the FRL rate in crtc_state, use the regular or the DSC max FRL rate depending on the stream on the HDMI link, and retrain the FRL link from the link check work. - Use link bpp instead of pipe bpp in the target_bpp clamp patch and reuse intel_dp_output_format_link_bpp_x16(). (Suraj) Rev5: - Rebase. The first part of the series is merged. - Drop the pass-through patches: pass-through of a DSC 1.2a stream doesn't work with the external PCON dongle I tested, decode and re-encode does, so use that for a DSC 1.2a stream too. - Add a patch to forget the PCON FRL training state on a long HPD. - Keep the FRL 16b/18b overhead in the uncompressed FRL check: without it 4k 165Hz at 10bpc and 4k 200Hz at 8bpc are accepted and don't come up. - Add a helper for the FRL payload bandwidth, used for the compressed bpp clamp and the check. - Reword the commit messages: a DSC 1.1 stream is converted to DSC 1.2, as HDMI 2.1 supports DSC 1.2 and beyond only. Ankit Nautiyal (15): drm/i915/dp: Forget the PCON FRL training state on a long HPD drm/i915/dp: Account for FRL 16b/18b encoding overhead drm/i915/hdmi: Clamp the target_bpp only when it equals the link bpp drm/i915/dp: Add PCON DSC state to crtc_state drm/dp: Add a helper to disable the PCON DSC encoder drm/i915/dp: Compute the PCON DSC operation drm/i915/dp: Disable the PCON DSC encoder unless it is needed drm/i915/dp: Clamp PCON DSC bpp to the FRL link bandwidth drm/i915/dp: Add a helper for the FRL payload bandwidth drm/i915/dp: Compute the PCON DSC encoder parameters drm/i915/dp: Retrain the PCON FRL link from the link check work drm/i915/dp: Store the PCON FRL rate in the crtc state drm/i915/dp: Use the FRL rate of the stream on the HDMI link drm/i915/dp: Pick the bpc for a PCON DSC stream drm/i915/dp: Allow PCON DSC modes through the FRL bw check drivers/gpu/drm/display/drm_dp_helper.c | 23 ++ drivers/gpu/drm/i915/display/g4x_dp.c | 2 +- .../drm/i915/display/intel_crtc_state_dump.c | 16 + drivers/gpu/drm/i915/display/intel_ddi.c | 4 +- .../drm/i915/display/intel_display_types.h | 29 ++ drivers/gpu/drm/i915/display/intel_dp.c | 383 ++++++++++++------ drivers/gpu/drm/i915/display/intel_dp.h | 5 +- .../drm/i915/display/intel_dp_link_training.c | 5 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 23 +- drivers/gpu/drm/i915/display/intel_hdmi.h | 3 +- include/drm/display/drm_dp_helper.h | 1 + 11 files changed, 370 insertions(+), 124 deletions(-) -- 2.50.1
