hwc: Delay HDMI/WFD connection request by one frame
This change introduces hdmi pending state, where we allow
frames to fall back to FB, closing all MDP pipes.
Pipes could be used by primary (mixer 0) in which case moving
them to external (mixer 1) involves unsetting them and setting
them in the same round which is not recommended by the driver.
It will fall back to GPU till HDMI is configured on a connect
event.
CRs-Fixed: 430057
Change-Id: I4b6677883c499f6d15656c3578190be1115ee6b4
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index c8410c9..2c63e46 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -154,6 +154,7 @@
VideoOverlay::prepare(ctx, list, dpy);
ctx->mFBUpdate[dpy]->prepare(ctx, fbLayer);
ctx->mLayerCache[dpy]->updateLayerCache(list);
+ ctx->mExtDispConfiguring = false;
}
}
return 0;
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index 3bca539..a3d7b28 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -264,6 +264,12 @@
return false;
}
+ if(ctx->mExtDispConfiguring) {
+ ALOGD_IF( isDebug(),"%s: External Display connection is pending",
+ __FUNCTION__);
+ return false;
+ }
+
if(isSecuring(ctx)) {
ALOGD_IF(isDebug(), "%s: MDP securing is active", __FUNCTION__);
return false;
diff --git a/libhwcomposer/hwc_uevents.cpp b/libhwcomposer/hwc_uevents.cpp
index 3d121ef..334df26 100644
--- a/libhwcomposer/hwc_uevents.cpp
+++ b/libhwcomposer/hwc_uevents.cpp
@@ -67,6 +67,7 @@
if(connected != -1) { //either we got switch_state connected or disconnect
ctx->dpyAttr[HWC_DISPLAY_EXTERNAL].connected = connected;
if (connected) {
+ ctx->mExtDispConfiguring = true;
ctx->mExtDisplay->processUEventOnline(udata);
ctx->mFBUpdate[HWC_DISPLAY_EXTERNAL] =
IFBUpdate::getObject(ctx->dpyAttr[HWC_DISPLAY_EXTERNAL].xres,
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index 7ae4afd..5dddd64 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -74,7 +74,7 @@
pthread_mutex_init(&(ctx->vstate.lock), NULL);
pthread_cond_init(&(ctx->vstate.cond), NULL);
ctx->vstate.enable = false;
-
+ ctx->mExtDispConfiguring = false;
ALOGI("Initializing Qualcomm Hardware Composer");
ALOGI("MDP version: %d", ctx->mMDP.version);
}
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index f3a0fd6..14d4357 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -230,6 +230,8 @@
//Securing in progress indicator
bool mSecuring;
+ //External Display configuring progress indicator
+ bool mExtDispConfiguring;
//Display in secure mode indicator
bool mSecureMode;
//Lock to prevent set from being called while blanking