summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Gynther <pgynther@google.com>2023-11-10 17:49:32 -0800
committerPetri Gynther <pgynther@google.com>2023-11-13 22:38:28 +0000
commit40d0affedac4446a6db627846ab0f1585ba9460f (patch)
treefb648a0adc69d9c0801e7baf7f59d6c486a6c379
parent96940bb2ff57cb06f05f731b83568035c85f6de6 (diff)
downloadcommon-40d0affedac4446a6db627846ab0f1585ba9460f.tar.gz
libhwc2.1: fix ExynosExternalDisplay::disable()
When DP cable is connected, the initial state of external display is: mHpdStatus = true mEnabled = false External display will remain in the above state until DP mirroring has been confirmed via UI dialog. If DP cable is disconnected in this state, or if the sink unexpectedly sends a quick HPD unplug event, external display state changes back to: mHpdStatus = false mEnabled = false and SurfaceFlinger subsequently calls: ExynosExternalDisplay::setPowerMode(OFF) ExynosExternalDisplay::disable() We need to do full power-down in disable() when mHpdStatus = false. We cannot skip it just because mEnabled = false. This change fixes the handling of unexpected rapid sequence of: HPD plug -> HPD unplug -> HPD plug that various sinks and hubs use to reset their internal state. Bug: 310693327 Test: manual testing with USB hub and monitor Change-Id: Ieffea865b19c802c6903591a2356a7ccb3c1775d
-rw-r--r--libhwc2.1/libexternaldisplay/ExynosExternalDisplay.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/libhwc2.1/libexternaldisplay/ExynosExternalDisplay.cpp b/libhwc2.1/libexternaldisplay/ExynosExternalDisplay.cpp
index 84a6971..6aa34db 100644
--- a/libhwc2.1/libexternaldisplay/ExynosExternalDisplay.cpp
+++ b/libhwc2.1/libexternaldisplay/ExynosExternalDisplay.cpp
@@ -448,11 +448,16 @@ int ExynosExternalDisplay::disable()
{
ALOGI("[ExternalDisplay] %s +", __func__);
- if (!mEnabled)
- return HWC2_ERROR_NONE;
-
if (mHpdStatus) {
- clearDisplay(false);
+ /*
+ * DP cable is connected and link is up
+ *
+ * Currently, we don't power down here for two reasons:
+ * - power up would require DP link re-training (slow)
+ * - DP audio can continue playing while display is blank
+ */
+ if (mEnabled)
+ clearDisplay(false);
return HWC2_ERROR_NONE;
}