Replace the ST_MAINLINK_READY check here with a check for sink count. Since atomic_check() fails if the link isn't ready, we technically don't need a check against ST_MAINLINK_READY. The hpd_state should also never really hit ST_DISPLAY_OFF since atomic_enable() shouldn't be called twice in a row without an atomic_disable() in between.
That being said, it is possible for the cable to be disconnected after atomic_check() but before atomic_enable(). So let's change this check to guard against sink_count instead. Signed-off-by: Jessica Zhang <jessica.zh...@oss.qualcomm.com> --- drivers/gpu/drm/msm/dp/dp_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index dd3fdeaacc91..82f0b6bdbf39 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1444,7 +1444,7 @@ void msm_dp_bridge_atomic_enable(struct drm_bridge *drm_bridge, } hpd_state = msm_dp_display->hpd_state; - if (hpd_state != ST_DISPLAY_OFF && hpd_state != ST_MAINLINK_READY) + if (msm_dp_display->link->sink_count == 0) return; rc = msm_dp_display_set_mode(dp, &msm_dp_display->msm_dp_mode); -- 2.50.1