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_utils.h b/libhwcomposer/hwc_utils.h
index 29b38fc..2503e43 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -142,7 +142,11 @@
LayerRotMap() { reset(); }
enum { MAX_SESS = 3 };
void add(hwc_layer_1_t* layer, overlay::Rotator *rot);
+ //Resets the mapping of layer to rotator
void reset();
+ //Clears mappings and existing rotator fences
+ //Intended to be used during errors
+ void clear();
uint32_t getCount() const;
hwc_layer_1_t* getLayer(uint32_t index) const;
overlay::Rotator* getRot(uint32_t index) const;