The PCON DSC encoder is only used when the PCON re-encodes the DP stream
as DSC 1.2 for the HDMI sink. Otherwise the PCON either decodes the
stream, or there is no DSC at all.

Currently the encoder is enabled with PPS override parameters whenever
the PCON and the HDMI sink support DSC 1.2, even for streams that do not
need it, and it is never disabled again.

Program the encoder only for the decode and re-encode operation, and
explicitly disable it for all the other operations.

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

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c 
b/drivers/gpu/drm/i915/display/intel_dp.c
index 999faf29be45..a469766c0a6b 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -4610,6 +4610,13 @@ intel_dp_pcon_dsc_configure(struct intel_dp *intel_dp,
            !hdmi_is_dsc_1_2)
                return;
 
+       if (crtc_state->pcon_config.dsc_op != INTEL_PCON_DSC_DECODE_ENCODE) {
+               ret = drm_dp_pcon_dsc_enc_disable(&intel_dp->aux);
+               if (ret < 0)
+                       drm_dbg_kms(display->drm, "Failed to disable pcon DSC 
encoder\n");
+               return;
+       }
+
        slice_height = intel_dp_pcon_dsc_enc_slice_height(crtc_state);
        if (!slice_height)
                return;
-- 
2.50.1

Reply via email to