Переглянути джерело

disp: msm: dp: resend hpd notification to usermode

This change adds robustness to hpd notification by resending
it if there was no action in 2 seconds, just in case, the
first notification didn't make it to the usermode.

Change-Id: Iaf00669ec77e8c50618ee5618735a98518ad7f1a
Signed-off-by: Rajkumar Subbiah <[email protected]>
Rajkumar Subbiah 2 роки тому
батько
коміт
ecaabfefc9
1 змінених файлів з 12 додано та 2 видалено
  1. 12 2
      msm/dp/dp_display.c

+ 12 - 2
msm/dp/dp_display.c

@@ -983,8 +983,18 @@ static int dp_display_send_hpd_notification(struct dp_display_private *dp, bool
 			(!!dp_display_state_is(DP_STATE_ENABLED) == hpd))
 		goto skip_wait;
 
-	if (!wait_for_completion_timeout(&dp->notification_comp,
-						HZ * 5)) {
+	// wait 2 seconds
+	if (wait_for_completion_timeout(&dp->notification_comp, HZ * 2))
+		goto skip_wait;
+
+	//resend notification
+	if (dp->mst.mst_active)
+		dp->mst.cbs.hpd(&dp->dp_display, hpd);
+	else
+		dp_display_send_hpd_event(dp);
+
+	// wait another 3 seconds
+	if (!wait_for_completion_timeout(&dp->notification_comp, HZ * 3)) {
 		DP_WARN("%s timeout\n", hpd ? "connect" : "disconnect");
 		ret = -EINVAL;
 	}