Commit 71d7e890 authored by Leo (Hanghong) Ma's avatar Leo (Hanghong) Ma Committed by Alex Deucher

drm/amd/display: Add HDMI manufacturer OUI and device id read

[Why && How]
Add support to read manufacturer OUI
and device id from HDMI SCDC.
Reviewed-by: default avatarWenjing Liu <Wenjing.Liu@amd.com>
Acked-by: default avatarQingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: default avatarLeo (Hanghong) Ma <hanghong.ma@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent af23aee9
...@@ -1044,6 +1044,20 @@ static void verify_link_capability(struct dc_link *link, struct dc_sink *sink, ...@@ -1044,6 +1044,20 @@ static void verify_link_capability(struct dc_link *link, struct dc_sink *sink,
verify_link_capability_non_destructive(link); verify_link_capability_non_destructive(link);
} }
static void read_scdc_caps(struct ddc_service *ddc_service, struct dc_sink *sink)
{
uint8_t slave_address = HDMI_SCDC_ADDRESS;
uint8_t offset = HDMI_SCDC_MANUFACTURER_OUI;
link_query_ddc_data(ddc_service, slave_address, &offset,
sizeof(offset), sink->scdc_caps.manufacturer_OUI.byte,
sizeof(sink->scdc_caps.manufacturer_OUI.byte));
offset = HDMI_SCDC_DEVICE_ID;
link_query_ddc_data(ddc_service, slave_address, &offset,
sizeof(offset), &(sink->scdc_caps.device_id.byte), sizeof(sink->scdc_caps.device_id.byte));
}
/** /**
* detect_link_and_local_sink() - Detect if a sink is attached to a given link * detect_link_and_local_sink() - Detect if a sink is attached to a given link
...@@ -1287,6 +1301,9 @@ static bool detect_link_and_local_sink(struct dc_link *link, ...@@ -1287,6 +1301,9 @@ static bool detect_link_and_local_sink(struct dc_link *link,
if (sink->edid_caps.panel_patch.skip_scdc_overwrite) if (sink->edid_caps.panel_patch.skip_scdc_overwrite)
link->ctx->dc->debug.hdmi20_disable = true; link->ctx->dc->debug.hdmi20_disable = true;
if (dc_is_hdmi_signal(link->connector_signal))
read_scdc_caps(link->ddc, link->local_sink);
if (link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT && if (link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT &&
sink_caps.transaction_type == sink_caps.transaction_type ==
DDC_TRANSACTION_TYPE_I2C_OVER_AUX) { DDC_TRANSACTION_TYPE_I2C_OVER_AUX) {
......
...@@ -1505,6 +1505,11 @@ struct dc_sink_fec_caps { ...@@ -1505,6 +1505,11 @@ struct dc_sink_fec_caps {
bool is_topology_fec_supported; bool is_topology_fec_supported;
}; };
struct scdc_caps {
union hdmi_scdc_manufacturer_OUI_data manufacturer_OUI;
union hdmi_scdc_device_id_data device_id;
};
/* /*
* The sink structure contains EDID and other display device properties * The sink structure contains EDID and other display device properties
*/ */
...@@ -1518,6 +1523,7 @@ struct dc_sink { ...@@ -1518,6 +1523,7 @@ struct dc_sink {
struct stereo_3d_features features_3d[TIMING_3D_FORMAT_MAX]; struct stereo_3d_features features_3d[TIMING_3D_FORMAT_MAX];
bool converter_disable_audio; bool converter_disable_audio;
struct scdc_caps scdc_caps;
struct dc_sink_dsc_caps dsc_caps; struct dc_sink_dsc_caps dsc_caps;
struct dc_sink_fec_caps fec_caps; struct dc_sink_fec_caps fec_caps;
......
...@@ -69,6 +69,9 @@ static const uint8_t dp_hdmi_dongle_signature_str[] = "DP-HDMI ADAPTOR"; ...@@ -69,6 +69,9 @@ static const uint8_t dp_hdmi_dongle_signature_str[] = "DP-HDMI ADAPTOR";
#define HDMI_SCDC_ERR_DETECT 0x50 #define HDMI_SCDC_ERR_DETECT 0x50
#define HDMI_SCDC_TEST_CONFIG 0xC0 #define HDMI_SCDC_TEST_CONFIG 0xC0
#define HDMI_SCDC_MANUFACTURER_OUI 0xD0
#define HDMI_SCDC_DEVICE_ID 0xDB
union hdmi_scdc_update_read_data { union hdmi_scdc_update_read_data {
uint8_t byte[2]; uint8_t byte[2];
struct { struct {
...@@ -111,4 +114,21 @@ union hdmi_scdc_ced_data { ...@@ -111,4 +114,21 @@ union hdmi_scdc_ced_data {
} fields; } fields;
}; };
union hdmi_scdc_manufacturer_OUI_data {
uint8_t byte[3];
struct {
uint8_t Manufacturer_OUI_1:8;
uint8_t Manufacturer_OUI_2:8;
uint8_t Manufacturer_OUI_3:8;
} fields;
};
union hdmi_scdc_device_id_data {
uint8_t byte;
struct {
uint8_t Hardware_Minor_Rev:4;
uint8_t Hardware_Major_Rev:4;
} fields;
};
#endif /* DC_HDMI_TYPES_H */ #endif /* DC_HDMI_TYPES_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment