Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39a87768 authored by Padmanabhan Komanduru's avatar Padmanabhan Komanduru Committed by Tatenda Chipeperekwa
Browse files

drm/msm/dp: check for sink count before enabling post_open callback



When the DP cable is disconnected at the sink side with the type-C cable
connected to the device, some dongles retain the hpd_high variable to
'true' but change the sink count to zero as part of the attention
callback. Check for sink count reported by the dongle in addition to
hpd_high status variable before enabling post_open callback during DP
disable sequence.

Change-Id: I002d039f79543eb6176df2eb2b6c648f586be429
Signed-off-by: default avatarPadmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: default avatarTatenda Chipeperekwa <tatendac@codeaurora.org>
parent 458033d0
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1369,7 +1369,8 @@ static int dp_display_pre_disable(struct dp_display *dp_display, void *panel)
			dp->hdcp.ops->off(dp->hdcp.data);
	}

	if (dp->usbpd->hpd_high && dp->usbpd->alt_mode_cfg_done) {
	if (dp->usbpd->hpd_high && !dp_display_is_sink_count_zero(dp) &&
			dp->usbpd->alt_mode_cfg_done) {
		if (dp_panel->audio_supported)
			dp_panel->audio->off(dp_panel->audio);

@@ -1427,8 +1428,8 @@ static int dp_display_disable(struct dp_display *dp_display, void *panel)
	 * any notification from driver. Initialize post_open callback to notify
	 * DP connection once framework restarts.
	 */
	if (dp->usbpd->hpd_high && dp->usbpd->alt_mode_cfg_done &&
			!dp->mst.mst_active) {
	if (dp->usbpd->hpd_high && !dp_display_is_sink_count_zero(dp) &&
			dp->usbpd->alt_mode_cfg_done && !dp->mst.mst_active) {
		dp_display->post_open = dp_display_post_open;
		dp->dp_display.is_connected = false;
		dp->dp_display.is_sst_connected = false;