libhwcomposer: Reset composition types on idle timeout.
SurfaceFlinger re-creates HWC worklist only for new frame and on layer geometry
change. Invalidate triggered by idle timeout refreshes the existing worklist
retaining its previous composition type. So its MDP comp's responsibility to
clear layer composition types to HWC_FRAMEBUFFER on timeout.
Change-Id: I2407c44f6aa3b11365586364e5865ae629d5326a
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index 787ba9b..7f80be6 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -125,7 +125,13 @@
proc->invalidate(proc);
}
-void MDPComp::reset( hwc_context_t *ctx, hwc_display_contents_1_t* list ) {
+void MDPComp::reset(hwc_context_t *ctx, hwc_display_contents_1_t* list ) {
+ //Reset flags and states
+ unsetMDPCompLayerFlags(ctx, list);
+ if(sMDPCompState == MDPCOMP_ON) {
+ sMDPCompState = MDPCOMP_OFF_PENDING;
+ }
+
sCurrentFrame.count = 0;
free(sCurrentFrame.pipe_layer);
sCurrentFrame.pipe_layer = NULL;
@@ -137,12 +143,6 @@
#if SUPPORT_4LAYER
configure_var_pipe(ctx);
#endif
-
- //Reset flags and states
- unsetMDPCompLayerFlags(ctx, list);
- if(sMDPCompState == MDPCOMP_ON) {
- sMDPCompState = MDPCOMP_OFF_PENDING;
- }
}
void MDPComp::setLayerIndex(hwc_layer_1_t* layer, const int pipe_index)
@@ -334,7 +334,7 @@
*/
bool MDPComp::is_doable(hwc_composer_device_1_t *dev,
- const hwc_display_contents_1_t* list) {
+ hwc_display_contents_1_t* list) {
hwc_context_t* ctx = (hwc_context_t*)(dev);
if(!ctx) {
@@ -657,6 +657,10 @@
if(list->hwLayers[l_index].flags & HWC_MDPCOMP) {
list->hwLayers[l_index].flags &= ~HWC_MDPCOMP;
}
+
+ if(list->hwLayers[l_index].compositionType == HWC_OVERLAY) {
+ list->hwLayers[l_index].compositionType = HWC_FRAMEBUFFER;
+ }
}
}