Commit 180c4592 authored by Wenjing Liu's avatar Wenjing Liu Committed by Alex Deucher

drm/amd/display: add support for handling 128b/132b link training test request

[why]
DP2.x added new enum values for UHBR link rates in link training test
request for test automation. We need to add UHBR link rates test request
support in preparation for compliance test automation.

[how]
added a function that translate test link rate to dc link rate.  Call
the translation function to decide the requested test link rate.
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: default avatarGeorge Shen <George.Shen@amd.com>
Acked-by: default avatarTom Chung <chiahsuan.chung@amd.com>
Signed-off-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent bb90786f
...@@ -4085,9 +4085,32 @@ static bool handle_hpd_irq_psr_sink(struct dc_link *link) ...@@ -4085,9 +4085,32 @@ static bool handle_hpd_irq_psr_sink(struct dc_link *link)
return false; return false;
} }
static enum dc_link_rate get_link_rate_from_test_link_rate(uint8_t test_rate)
{
switch (test_rate) {
case DP_TEST_LINK_RATE_RBR:
return LINK_RATE_LOW;
case DP_TEST_LINK_RATE_HBR:
return LINK_RATE_HIGH;
case DP_TEST_LINK_RATE_HBR2:
return LINK_RATE_HIGH2;
case DP_TEST_LINK_RATE_HBR3:
return LINK_RATE_HIGH3;
case DP_TEST_LINK_RATE_UHBR10:
return LINK_RATE_UHBR10;
case DP_TEST_LINK_RATE_UHBR20:
return LINK_RATE_UHBR20;
case DP_TEST_LINK_RATE_UHBR13_5:
return LINK_RATE_UHBR13_5;
default:
return LINK_RATE_UNKNOWN;
}
}
static void dp_test_send_link_training(struct dc_link *link) static void dp_test_send_link_training(struct dc_link *link)
{ {
struct dc_link_settings link_settings = {0}; struct dc_link_settings link_settings = {0};
uint8_t test_rate = 0;
core_link_read_dpcd( core_link_read_dpcd(
link, link,
...@@ -4097,8 +4120,9 @@ static void dp_test_send_link_training(struct dc_link *link) ...@@ -4097,8 +4120,9 @@ static void dp_test_send_link_training(struct dc_link *link)
core_link_read_dpcd( core_link_read_dpcd(
link, link,
DP_TEST_LINK_RATE, DP_TEST_LINK_RATE,
(unsigned char *)(&link_settings.link_rate), &test_rate,
1); 1);
link_settings.link_rate = get_link_rate_from_test_link_rate(test_rate);
/* Set preferred link settings */ /* Set preferred link settings */
link->verified_link_cap.lane_count = link_settings.lane_count; link->verified_link_cap.lane_count = link_settings.lane_count;
......
...@@ -133,6 +133,16 @@ enum dp_link_encoding { ...@@ -133,6 +133,16 @@ enum dp_link_encoding {
DP_128b_132b_ENCODING = 2, DP_128b_132b_ENCODING = 2,
}; };
enum dp_test_link_rate {
DP_TEST_LINK_RATE_RBR = 0x06,
DP_TEST_LINK_RATE_HBR = 0x0A,
DP_TEST_LINK_RATE_HBR2 = 0x14,
DP_TEST_LINK_RATE_HBR3 = 0x1E,
DP_TEST_LINK_RATE_UHBR10 = 0x01,
DP_TEST_LINK_RATE_UHBR20 = 0x02,
DP_TEST_LINK_RATE_UHBR13_5 = 0x03,
};
struct dc_link_settings { struct dc_link_settings {
enum dc_lane_count lane_count; enum dc_lane_count lane_count;
enum dc_link_rate link_rate; enum dc_link_rate link_rate;
...@@ -620,7 +630,7 @@ union test_request { ...@@ -620,7 +630,7 @@ union test_request {
uint8_t LINK_TEST_PATTRN :1; uint8_t LINK_TEST_PATTRN :1;
uint8_t EDID_READ :1; uint8_t EDID_READ :1;
uint8_t PHY_TEST_PATTERN :1; uint8_t PHY_TEST_PATTERN :1;
uint8_t RESERVED :1; uint8_t PHY_TEST_CHANNEL_CODING_TYPE :2;
uint8_t AUDIO_TEST_PATTERN :1; uint8_t AUDIO_TEST_PATTERN :1;
uint8_t TEST_AUDIO_DISABLED_VIDEO :1; uint8_t TEST_AUDIO_DISABLED_VIDEO :1;
} bits; } bits;
......
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