hwc: Reset layer-to-rotator map and fences on configuration failure
When a rotator or mdp configuration for a display fails, reset the
layer-to-rotator mappings for that display and reset the release
fences for the rotator objects used for that display.
Note: The rotator itself is offline and not tied to any mixer. It is
from the mappings that we deduce which rotator object was used for
layers of which display. Also we don't delete rotator objects held
for a specific display, since during stability runs, failures could
repeat each round and we end up allocating and deallocating memory
unnecessarily. The rotator objects will be deleted automatically
when not required anymore.
Change-Id: I9a67f02574be30be3b96b3575f60530cb1c89e10
diff --git a/libhwcomposer/hwc_fbupdate.cpp b/libhwcomposer/hwc_fbupdate.cpp
index ce18695..dde4815 100644
--- a/libhwcomposer/hwc_fbupdate.cpp
+++ b/libhwcomposer/hwc_fbupdate.cpp
@@ -168,6 +168,8 @@
sourceCrop, mdpFlags, rotFlags);
if(!ret) {
ALOGE("%s: preRotate for external Failed!", __FUNCTION__);
+ ctx->mOverlay->clear(mDpy);
+ ctx->mLayerRotMap[mDpy]->clear();
return false;
}
//For the mdp, since either we are pre-rotating or MDP does flips
@@ -182,6 +184,7 @@
if(configMdp(ctx->mOverlay, parg, orient, sourceCrop, displayFrame,
NULL, mDest) < 0) {
ALOGE("%s: configMdp failed for dpy %d", __FUNCTION__, mDpy);
+ ctx->mLayerRotMap[mDpy]->clear();
ret = false;
}
}
@@ -353,6 +356,9 @@
ALOGE("%s: commit fails for right", __FUNCTION__);
ret = false;
}
+ if(ret == false) {
+ ctx->mLayerRotMap[mDpy]->clear();
+ }
}
return ret;
}