From: Zhikai Zhai <[email protected]>

[WHY]
Previously we would start the asynchronous detection
timer after resuming from S0i3, the sequence for
eDP power up when resume from S0i3 is:
1. eDP power up when link enable
2. Timer trigger async detect for eDP
3. The AUPI could read successfully in display detect
Currently
1. eDP detection runs from the display detect path
2. AUPI read fail as HPD low when eDP link detect
3. Link enable to power up eDP

[HOW]
Power up eDP when detect link for aux read.

Cc: Wenjing Liu <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: [email protected]
Signed-off-by: Zhikai Zhai <[email protected]>
Signed-off-by: James Lin <[email protected]>
---
 .../gpu/drm/amd/display/dc/link/link_detection.c  | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_detection.c 
b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
index 9bd24b3e4291..dae9e6840272 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_detection.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
@@ -1153,11 +1153,16 @@ static bool detect_link_and_local_sink(struct dc_link 
*link,
                (!link->dc->config.allow_edp_hotplug_detection)) &&
                link->local_sink) {
                // need to re-write OUI and brightness in resume case
-               if (link->connector_signal == SIGNAL_TYPE_EDP &&
-                       (link->dpcd_sink_ext_caps.bits.oled == 1)) {
-                       dpcd_set_source_specific_data(link);
-                       msleep(post_oui_delay);
-                       set_default_brightness_aux(link);
+               if (link->connector_signal == SIGNAL_TYPE_EDP) {
+                       if (!link->dc->config.edp_no_power_sequencing)
+                               link->dc->hwss.edp_power_control(link, true);
+                       link->dc->hwss.edp_wait_for_hpd_ready(link, true);
+
+                       if (link->dpcd_sink_ext_caps.bits.oled == 1) {
+                               dpcd_set_source_specific_data(link);
+                               msleep(post_oui_delay);
+                               set_default_brightness_aux(link);
+                       }
                }
 
                return true;
-- 
2.43.0

Reply via email to