drm/amd/display: add DalEnableHDMI20 key support
authorCharlene Liu <charlene.liu@amd.com>
Tue, 26 Jun 2018 22:49:32 +0000 (18:49 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 Jul 2018 19:51:11 +0000 (14:51 -0500)
[why]
"DalEnableHDMI20" set to 0, disallow HDMI YCbCr420 and  pixel clock > 340Mhz
Default is enabled.

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c

index ede3489b4f37df3390265b3019dd9a5d3c4a099e..721c5cdff38fe1307df6418f874dadfb47368150 100644 (file)
@@ -251,6 +251,7 @@ struct dc_debug {
        bool recovery_enabled;
        bool avoid_vbios_exec_table;
        bool scl_reset_length10;
+       bool hdmi20_disable;
 
 };
 struct dc_state;
index dbe3b26b6d9eb6134bf34f184827a19841d28cbd..60e3c6a73d370c7ecbad78ee664beb3d9d19833a 100644 (file)
@@ -646,6 +646,9 @@ static bool dce110_link_encoder_validate_hdmi_output(
        if (!enc110->base.features.flags.bits.HDMI_6GB_EN &&
                adjusted_pix_clk_khz >= 300000)
                return false;
+       if (enc110->base.ctx->dc->debug.hdmi20_disable &&
+               crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
+               return false;
        return true;
 }
 
@@ -773,6 +776,9 @@ void dce110_link_encoder_construct(
                                __func__,
                                result);
        }
+       if (enc110->base.ctx->dc->debug.hdmi20_disable) {
+               enc110->base.features.flags.bits.HDMI_6GB_EN = 0;
+       }
 }
 
 bool dce110_link_encoder_validate_output_with_stream(
index be78ccb439e95ae27636bdce08fcda58dcb8346c..6f675206a136a7406859f5486ef5400893f75b11 100644 (file)
@@ -596,6 +596,9 @@ static bool dcn10_link_encoder_validate_hdmi_output(
        if (!enc10->base.features.flags.bits.HDMI_6GB_EN &&
                adjusted_pix_clk_khz >= 300000)
                return false;
+       if (enc10->base.ctx->dc->debug.hdmi20_disable &&
+               crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
+               return false;
        return true;
 }
 
@@ -728,6 +731,9 @@ void dcn10_link_encoder_construct(
                                __func__,
                                result);
        }
+       if (enc10->base.ctx->dc->debug.hdmi20_disable) {
+               enc10->base.features.flags.bits.HDMI_6GB_EN = 0;
+       }
 }
 
 bool dcn10_link_encoder_validate_output_with_stream(