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/liboverlay/overlayRotator.cpp b/liboverlay/overlayRotator.cpp
index 7b3dda1..4b6a8bc 100644
--- a/liboverlay/overlayRotator.cpp
+++ b/liboverlay/overlayRotator.cpp
@@ -107,6 +107,12 @@
mRelFence[mCurrOffset] = fence;
}
+void RotMem::Mem::resetReleaseFd() {
+ //Will wait for previous offline rotation to finish, close fence fd
+ //and reset
+ setReleaseFd(-1);
+}
+
//============RotMgr=========================
RotMgr::RotMgr() {