hwc : Skip panel reset sequence if panel is already off
Do not proceed with panel recovery sequence if panel is already off.
Proceeding with reset sequence, if panel is already off, results in
race conditions.
One e.g., there is race condition between early suspend triggered
by pressing power key and panel recovery triggeredby ESD uevent.
If pressing power key happens exactly at kernel DSI driver is
reporting ESD uevent, it's likely that panel will be unexpectedly
on by ESD uevent after having blanked the screen by early suspend.
This change avoids unintentional panel recovery in the case above.
Change-Id: I19022691ec3c178f62f392913435ddc032ee1ab2
CRs-Fixed: 613155
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index 1de864a..5c1b093 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -437,8 +437,11 @@
int ret = 0;
hwc_context_t* ctx = (hwc_context_t*)(dev);
- if (!ctx->mPanelResetStatus)
+ if (!ctx->dpyAttr[HWC_DISPLAY_PRIMARY].isActive) {
+ ALOGD ("%s : Display OFF - Skip BLANK & UNBLANK", __FUNCTION__);
+ ctx->mPanelResetStatus = false;
return;
+ }
ALOGD("%s: calling BLANK DISPLAY", __FUNCTION__);
ret = hwc_blank(dev, HWC_DISPLAY_PRIMARY, 1);