drm/amd/display: Pass override OUI in to dc_init_data

[WHY]
Vendor dongle requires propietary OUI and handshake sequence.

[HOW]
Add a new structure to dc_init_data, to allow creator to pass
an override vendor_oui. This value will be written to DP_SOURCE_OUI
instead of AMD signature, when dpcd_set_source_specific_data is
called.

Signed-off-by: Calvin Hou <Calvin.Hou@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Calvin Hou 2020-01-27 14:40:41 -05:00 committed by Alex Deucher
parent 5c4a6d6297
commit 0136684f9b
4 changed files with 40 additions and 17 deletions

View File

@ -701,7 +701,7 @@ static bool dc_construct(struct dc *dc,
dc_ctx->created_bios = true;
}
dc->vendor_signature = init_params->vendor_signature;
/* Create GPIO service */
dc_ctx->gpio_service = dal_gpio_service_create(

View File

@ -4179,9 +4179,10 @@ void dp_set_fec_enable(struct dc_link *link, bool enable)
void dpcd_set_source_specific_data(struct dc_link *link)
{
struct dpcd_amd_signature amd_signature;
const uint32_t post_oui_delay = 30; // 30ms
if (!link->dc->vendor_signature.is_valid) {
struct dpcd_amd_signature amd_signature;
amd_signature.AMD_IEEE_TxSignature_byte1 = 0x0;
amd_signature.AMD_IEEE_TxSignature_byte2 = 0x0;
amd_signature.AMD_IEEE_TxSignature_byte3 = 0x1A;
@ -4199,6 +4200,12 @@ void dpcd_set_source_specific_data(struct dc_link *link)
(uint8_t *)(&amd_signature),
sizeof(amd_signature));
} else {
core_link_write_dpcd(link, DP_SOURCE_OUI,
link->dc->vendor_signature.data.raw,
sizeof(link->dc->vendor_signature.data.raw));
}
// Sink may need to configure internals based on vendor, so allow some
// time before proceeding with possibly vendor specific transactions
msleep(post_oui_delay);

View File

@ -527,6 +527,7 @@ struct dc {
struct compressor *fbc_compressor;
struct dc_debug_data debug_data;
struct dpcd_vendor_signature vendor_signature;
const char *build_id;
struct vm_helper *vm_helper;
@ -573,6 +574,7 @@ struct dc_init_data {
* available in FW
*/
const struct gpu_info_soc_bounding_box_v1_0 *soc_bounding_box;
struct dpcd_vendor_signature vendor_signature;
};
struct dc_callback_init {

View File

@ -432,6 +432,20 @@ struct dp_sink_hw_fw_revision {
uint8_t ieee_fw_rev[2];
};
struct dpcd_vendor_signature {
bool is_valid;
union dpcd_ieee_vendor_signature {
struct {
uint8_t ieee_oui[3];/*24-bit IEEE OUI*/
uint8_t ieee_device_id[6];/*usually 6-byte ASCII name*/
uint8_t ieee_hw_rev;
uint8_t ieee_fw_rev[2];
};
uint8_t raw[12];
} data;
};
struct dpcd_amd_signature {
uint8_t AMD_IEEE_TxSignature_byte1;
uint8_t AMD_IEEE_TxSignature_byte2;