OSDN Git Service

drm/amd/display: USB-c DP-HDMI dongle shows garbage on Sony TV
authorCharlene Liu <charlene.liu@amd.com>
Fri, 21 Apr 2017 21:15:40 +0000 (17:15 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 22:06:35 +0000 (18:06 -0400)
Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/dc_dp_types.h
drivers/gpu/drm/amd/display/dc/dc_types.h

index 4ef3fec..953e201 100644 (file)
@@ -1951,14 +1951,33 @@ static void get_active_converter_info(
                        link->dpcd_caps.dongle_type =
                                DISPLAY_DONGLE_DP_HDMI_CONVERTER;
 
+                       link->dpcd_caps.dongle_caps.dongle_type = link->dpcd_caps.dongle_type;
                        if (ds_port.fields.DETAILED_CAPS) {
 
                                union dwnstream_port_caps_byte3_hdmi
                                        hdmi_caps = {.raw = det_caps[3] };
+                               union dwnstream_port_caps_byte1
+                                       hdmi_color_caps = {.raw = det_caps[2] };
+                               link->dpcd_caps.dongle_caps.dp_hdmi_max_pixel_clk =
+                                       det_caps[1] * 25000;
 
-                               link->dpcd_caps.is_dp_hdmi_s3d_converter =
+                               link->dpcd_caps.dongle_caps.is_dp_hdmi_s3d_converter =
                                        hdmi_caps.bits.FRAME_SEQ_TO_FRAME_PACK;
+                               link->dpcd_caps.dongle_caps.is_dp_hdmi_ycbcr422_pass_through =
+                                       hdmi_caps.bits.YCrCr422_PASS_THROUGH;
+                               link->dpcd_caps.dongle_caps.is_dp_hdmi_ycbcr420_pass_through =
+                                       hdmi_caps.bits.YCrCr420_PASS_THROUGH;
+                               link->dpcd_caps.dongle_caps.is_dp_hdmi_ycbcr422_converter =
+                                       hdmi_caps.bits.YCrCr422_CONVERSION;
+                               link->dpcd_caps.dongle_caps.is_dp_hdmi_ycbcr420_converter =
+                                       hdmi_caps.bits.YCrCr420_CONVERSION;
+
+                               link->dpcd_caps.dongle_caps.dp_hdmi_max_bpc =
+                                       hdmi_color_caps.bits.MAX_BITS_PER_COLOR_COMPONENT;
+
+                               link->dpcd_caps.dongle_caps.extendedCapValid = true;
                        }
+
                        break;
                }
        }
index 1b3fd79..d35fa01 100644 (file)
@@ -623,7 +623,7 @@ struct dpcd_caps {
        union sink_count sink_count;
        /* If dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER,
        indicates 'Frame Sequential-to-lllFrame Pack' conversion capability.*/
-       bool is_dp_hdmi_s3d_converter;
+       struct dc_dongle_caps dongle_caps;
 
        bool allow_invalid_MSA_timing_param;
        bool panel_mode_edp;
index cd2323a..77e2de6 100644 (file)
@@ -255,7 +255,7 @@ enum dpcd_downstream_port_detailed_type {
        DOWN_STREAM_DETAILED_DP_PLUS_PLUS
 };
 
-union dwnstream_port_caps_byte2 {
+union dwnstream_port_caps_byte1 {
        struct {
                uint8_t MAX_BITS_PER_COLOR_COMPONENT:2;
                uint8_t RESERVED:6;
@@ -287,7 +287,11 @@ union dwnstream_port_caps_byte3_dvi {
 union dwnstream_port_caps_byte3_hdmi {
        struct {
                uint8_t FRAME_SEQ_TO_FRAME_PACK:1;
-               uint8_t RESERVED:7;
+               uint8_t YCrCr422_PASS_THROUGH:1;
+               uint8_t YCrCr420_PASS_THROUGH:1;
+               uint8_t YCrCr422_CONVERSION:1;
+               uint8_t YCrCr420_CONVERSION:1;
+               uint8_t RESERVED:3;
        } bits;
        uint8_t raw;
 };
index e0436e3..2ba02b5 100644 (file)
@@ -338,6 +338,26 @@ enum {
        LAYER_INDEX_PRIMARY = -1,
 };
 
+enum dpcd_downstream_port_max_bpc {
+       DOWN_STREAM_MAX_8BPC = 0,
+       DOWN_STREAM_MAX_10BPC,
+       DOWN_STREAM_MAX_12BPC,
+       DOWN_STREAM_MAX_16BPC
+};
+struct dc_dongle_caps {
+       /* dongle type (DP converter, CV smart dongle) */
+       enum display_dongle_type dongle_type;
+       bool extendedCapValid;
+       /* If dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER,
+       indicates 'Frame Sequential-to-lllFrame Pack' conversion capability.*/
+       bool is_dp_hdmi_s3d_converter;
+       bool is_dp_hdmi_ycbcr422_pass_through;
+       bool is_dp_hdmi_ycbcr420_pass_through;
+       bool is_dp_hdmi_ycbcr422_converter;
+       bool is_dp_hdmi_ycbcr420_converter;
+       uint32_t dp_hdmi_max_bpc;
+       uint32_t dp_hdmi_max_pixel_clk;
+};
 /* Scaling format */
 enum scaling_transformation {
        SCALING_TRANSFORMATION_UNINITIALIZED,