From: Abhinav Kumar <quic_abhin...@quicinc.com> ST_DISPLAY_OFF check in msm_dp_bridge_atomic_enable() is used to check that if the display was disabled while still hotplugged, phy needs to be re-initialized. This can be replaced with a different check as it just means the hpd_state was still ST_CONNECTED but without display being powered on. Replace the ST_DISPLAY_OFF check with a combination of connected and power_on checks.
Since all consumers of ST_DISPLAY_OFF have now been removed, drop ST_DISPLAY_OFF from the list of hpd_states as technically this was never a 'hpd' state anyway. Signed-off-by: Abhinav Kumar <quic_abhin...@quicinc.com> Reviewed-by: Dmitry Baryshkov <dmitry.barysh...@linaro.org> Signed-off-by: Jessica Zhang <jessica.zh...@oss.qualcomm.com> --- drivers/gpu/drm/msm/dp/dp_display.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 785c813d2b31..6f05a939ce9e 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -50,7 +50,6 @@ enum { ST_MAINLINK_READY, ST_CONNECTED, ST_DISCONNECT_PENDING, - ST_DISPLAY_OFF, }; enum { @@ -1526,7 +1525,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) { + if (hpd_state == ST_CONNECTED && !dp->power_on) { msm_dp_display_host_phy_init(msm_dp_display); force_link_train = true; } @@ -1584,8 +1583,6 @@ void msm_dp_bridge_atomic_post_disable(struct drm_bridge *drm_bridge, if (hpd_state == ST_DISCONNECT_PENDING) { /* completed disconnection */ msm_dp_display->hpd_state = ST_DISCONNECTED; - } else { - msm_dp_display->hpd_state = ST_DISPLAY_OFF; } drm_dbg_dp(dp->drm_dev, "type=%d Done\n", dp->connector_type); -- 2.49.0