Read the downstream port info and set the subconnector type accordingly. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> --- Dependencies: https://patchwork.freedesktop.org/series/123221/ --- drivers/gpu/drm/msm/dp/dp_display.c | 9 ++++++++- drivers/gpu/drm/msm/dp/dp_panel.c | 5 +++++ drivers/gpu/drm/msm/dp/dp_panel.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 96bbf6fec2f1..8abeae658200 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -372,8 +372,12 @@ static int dp_display_send_hpd_notification(struct dp_display_private *dp, } /* reset video pattern flag on disconnect */ - if (!hpd) + if (!hpd) { dp->panel->video_test = false; + drm_dp_set_subconnector_property(dp->dp_display.connector, + connector_status_disconnected, + dp->panel->dpcd, dp->panel->downstream_ports); + } dp->dp_display.is_connected = hpd; @@ -401,6 +405,9 @@ static int dp_display_process_hpd_high(struct dp_display_private *dp) dp_link_process_request(dp->link); + drm_dp_set_subconnector_property(dp->dp_display.connector, connector_status_connected, + dp->panel->dpcd, dp->panel->downstream_ports); + edid = dp->panel->edid; dp->dp_display.psr_supported = dp->panel->psr_cap.version && psr_enabled; diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c index 97ba41593820..1cb54f26f5aa 100644 --- a/drivers/gpu/drm/msm/dp/dp_panel.c +++ b/drivers/gpu/drm/msm/dp/dp_panel.c @@ -162,6 +162,11 @@ int dp_panel_read_sink_caps(struct dp_panel *dp_panel, } } + rc = drm_dp_read_downstream_info(panel->aux, dp_panel->dpcd, + dp_panel->downstream_ports); + if (rc) + return rc; + kfree(dp_panel->edid); dp_panel->edid = NULL; diff --git a/drivers/gpu/drm/msm/dp/dp_panel.h b/drivers/gpu/drm/msm/dp/dp_panel.h index 3cb1f8dcfd3b..a0dfc579c5f9 100644 --- a/drivers/gpu/drm/msm/dp/dp_panel.h +++ b/drivers/gpu/drm/msm/dp/dp_panel.h @@ -36,6 +36,7 @@ struct dp_panel_psr { struct dp_panel { /* dpcd raw data */ u8 dpcd[DP_RECEIVER_CAP_SIZE]; + u8 downstream_ports[DP_MAX_DOWNSTREAM_PORTS]; struct dp_link_info link_info; struct drm_dp_desc desc; -- 2.39.2