From: Yury Smirnov <[email protected]>

A long HPD pulse only sends a hotplug event. When the sink is replugged
while the output stays enabled with an unchanged mode, the compositor
might not do any modeset and the link is never trained again, so the
sink shows no signal.

On a long pulse with the link enabled and the sink present, retrain
the link if its status shows it lost.

Signed-off-by: Yury Smirnov <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
---
 drivers/gpu/drm/bridge/synopsys/dw-dp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c 
b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
index bf3a53463394..b245d6200913 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
@@ -2394,6 +2394,12 @@ static void dw_dp_hpd_work(struct work_struct *work)
                                dev_warn(dp->dev, "Retrain link failed\n");
                }
        } else {
+               if (dp->link.enabled && dw_dp_hpd_detect(dp)) {
+                       ret = dw_dp_link_retrain(dp);
+                       if (ret)
+                               dev_warn(dp->dev, "Retrain link failed\n");
+               }
+
                drm_helper_hpd_irq_event(dp->bridge.dev);
        }
 }

-- 
2.53.0

Reply via email to