Skip to content

Commit e8a767e

Browse files
Kuogee Hsiehrobclark
authored andcommitted
drm/msm/dp: update is_connected status base on sink count at dp_pm_resume()
Currently at dp_pm_resume() is_connected state is decided base on hpd connection status only. This will put is_connected in wrongly "true" state at the scenario that dongle attached to DUT but without hmdi cable connecting to it. Fix this problem by adding read sink count from dongle and decided is_connected state base on both sink count and hpd connection status. Changes in v2: -- remove dp_get_sink_count() cand call drm_dp_read_sink_count() Changes in v3: -- delete status local variable from dp_pm_resume() Changes in v4: -- delete un necessary comment at dp_pm_resume() Fixes: d9aa657 ("drm/msm/dp: check sink_count before update is_connected status") Signed-off-by: Kuogee Hsieh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Stephen Boyd <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent 5bccb94 commit e8a767e

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

drivers/gpu/drm/msm/dp/dp_display.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,7 @@ static int dp_pm_resume(struct device *dev)
12781278
struct platform_device *pdev = to_platform_device(dev);
12791279
struct msm_dp *dp_display = platform_get_drvdata(pdev);
12801280
struct dp_display_private *dp;
1281-
u32 status;
1281+
int sink_count = 0;
12821282

12831283
dp = container_of(dp_display, struct dp_display_private, dp_display);
12841284

@@ -1292,14 +1292,25 @@ static int dp_pm_resume(struct device *dev)
12921292

12931293
dp_catalog_ctrl_hpd_config(dp->catalog);
12941294

1295-
status = dp_catalog_link_is_connected(dp->catalog);
1295+
/*
1296+
* set sink to normal operation mode -- D0
1297+
* before dpcd read
1298+
*/
1299+
dp_link_psm_config(dp->link, &dp->panel->link_info, false);
1300+
1301+
if (dp_catalog_link_is_connected(dp->catalog)) {
1302+
sink_count = drm_dp_read_sink_count(dp->aux);
1303+
if (sink_count < 0)
1304+
sink_count = 0;
1305+
}
12961306

1307+
dp->link->sink_count = sink_count;
12971308
/*
12981309
* can not declared display is connected unless
12991310
* HDMI cable is plugged in and sink_count of
13001311
* dongle become 1
13011312
*/
1302-
if (status && dp->link->sink_count)
1313+
if (dp->link->sink_count)
13031314
dp->dp_display.is_connected = true;
13041315
else
13051316
dp->dp_display.is_connected = false;

0 commit comments

Comments
 (0)