drm/amd/display: Add link encoder dp_ycbcr420_supported feature flag
authorEric Bernstein <eric.bernstein@amd.com>
Tue, 25 Sep 2018 19:56:41 +0000 (15:56 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 5 Nov 2018 19:20:46 +0000 (14:20 -0500)
[Why]
Need separate feature flag for DP 4:2:0 support, since existing
flag is used for HDMI

[How]
Added dp_ycbcr420_supported to struct encoder_feature_support

Signed-off-by: Eric Bernstein <eric.bernstein@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h

index b0df6dc9a775f061120fbad6837e92f483317aea..d223218d097d6ebb72407634bbe7b132dd0aaa68 100644 (file)
@@ -3779,12 +3779,12 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
        case DRM_MODE_CONNECTOR_HDMIA:
                aconnector->base.polled = DRM_CONNECTOR_POLL_HPD;
                aconnector->base.ycbcr_420_allowed =
-                       link->link_enc->features.ycbcr420_supported ? true : false;
+                       link->link_enc->features.hdmi_ycbcr420_supported ? true : false;
                break;
        case DRM_MODE_CONNECTOR_DisplayPort:
                aconnector->base.polled = DRM_CONNECTOR_POLL_HPD;
                aconnector->base.ycbcr_420_allowed =
-                       link->link_enc->features.ycbcr420_supported ? true : false;
+                       link->link_enc->features.dp_ycbcr420_supported ? true : false;
                break;
        case DRM_MODE_CONNECTOR_DVID:
                aconnector->base.polled = DRM_CONNECTOR_POLL_HPD;
index 366bc8c2c643dd0383a4f5643daf06f64da164f3..3e18ea84b1f961ef7ddfd5b701e91e62f5e8852c 100644 (file)
@@ -645,7 +645,7 @@ static bool dce110_link_encoder_validate_hdmi_output(
                return false;
 
        /* DCE11 HW does not support 420 */
-       if (!enc110->base.features.ycbcr420_supported &&
+       if (!enc110->base.features.hdmi_ycbcr420_supported &&
                        crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
                return false;
 
index b3d00d7e51fa02f56bfe31df9a05d7d0f96e6488..e73b1392bed92f257953a27575cb6b29b5846664 100644 (file)
@@ -551,7 +551,8 @@ static struct transform *dce112_transform_create(
 static const struct encoder_feature_support link_enc_feature = {
                .max_hdmi_deep_color = COLOR_DEPTH_121212,
                .max_hdmi_pixel_clock = 600000,
-               .ycbcr420_supported = true,
+               .hdmi_ycbcr420_supported = true,
+               .dp_ycbcr420_supported = false,
                .flags.bits.IS_HBR2_CAPABLE = true,
                .flags.bits.IS_HBR3_CAPABLE = true,
                .flags.bits.IS_TPS3_CAPABLE = true,
index 512a22d9fea810e4c099136c82c87266ce895d5e..a69e89f779de3917fd7368a2619beb25146c3687 100644 (file)
@@ -607,7 +607,8 @@ static struct audio *create_audio(
 static const struct encoder_feature_support link_enc_feature = {
                .max_hdmi_deep_color = COLOR_DEPTH_121212,
                .max_hdmi_pixel_clock = 600000,
-               .ycbcr420_supported = true,
+               .hdmi_ycbcr420_supported = true,
+               .dp_ycbcr420_supported = false,
                .flags.bits.IS_HBR2_CAPABLE = true,
                .flags.bits.IS_HBR3_CAPABLE = true,
                .flags.bits.IS_TPS3_CAPABLE = true,
index ba6a8686062f27e235799e44eaf95d4d03d39778..477ab922221626dd47026d1874383418d0542cc9 100644 (file)
@@ -589,7 +589,7 @@ static bool dcn10_link_encoder_validate_hdmi_output(
                return false;
 
        /* DCE11 HW does not support 420 */
-       if (!enc10->base.features.ycbcr420_supported &&
+       if (!enc10->base.features.hdmi_ycbcr420_supported &&
                        crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
                return false;
 
@@ -606,8 +606,10 @@ bool dcn10_link_encoder_validate_dp_output(
        const struct dcn10_link_encoder *enc10,
        const struct dc_crtc_timing *crtc_timing)
 {
-       if (crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
-               return false;
+       if (crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420) {
+               if (!enc10->base.features.dp_ycbcr420_supported)
+                       return false;
+       }
 
        return true;
 }
index 55d2d1766c2404f3b4c50102b577a2d743882f07..3d9118e1ee105fc1aeee84fb357d926f916dbd11 100644 (file)
@@ -719,7 +719,8 @@ static struct timing_generator *dcn10_timing_generator_create(
 static const struct encoder_feature_support link_enc_feature = {
                .max_hdmi_deep_color = COLOR_DEPTH_121212,
                .max_hdmi_pixel_clock = 600000,
-               .ycbcr420_supported = true,
+               .hdmi_ycbcr420_supported = true,
+               .dp_ycbcr420_supported = false,
                .flags.bits.IS_HBR2_CAPABLE = true,
                .flags.bits.IS_HBR3_CAPABLE = true,
                .flags.bits.IS_TPS3_CAPABLE = true,
index e28e9770e0a3638cca907b213a63aceb5787588e..c20fdcaac53bb7e29e51ad7eccdbb58d0292e65a 100644 (file)
@@ -65,7 +65,8 @@ struct encoder_feature_support {
 
        enum dc_color_depth max_hdmi_deep_color;
        unsigned int max_hdmi_pixel_clock;
-       bool ycbcr420_supported;
+       bool hdmi_ycbcr420_supported;
+       bool dp_ycbcr420_supported;
 };
 
 union dpcd_psr_configuration {