diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp index 35b7e7b..d292ea4 100644 --- a/libhwcomposer/hwc_mdpcomp.cpp +++ b/libhwcomposer/hwc_mdpcomp.cpp @@ -125,6 +125,15 @@ void MDPComp::timeout_handler(void *udata) { proc->invalidate(proc); } +void MDPComp::reset_comp_type(hwc_layer_list_t* list) { + for(uint32_t i = 0 ; i < list->numHwLayers; i++ ) { + hwc_layer_t* l = &list->hwLayers[i]; + + if(l->compositionType == HWC_OVERLAY) + l->compositionType = HWC_FRAMEBUFFER; + } +} + void MDPComp::reset( hwc_context_t *ctx, hwc_layer_list_t* list ) { sCurrentFrame.count = 0; free(sCurrentFrame.pipe_layer); @@ -333,8 +342,7 @@ int MDPComp::prepare(hwc_context_t *ctx, hwc_layer_t *layer, * 5. Overlay in use */ -bool MDPComp::is_doable(hwc_composer_device_t *dev, - const hwc_layer_list_t* list) { +bool MDPComp::is_doable(hwc_composer_device_t *dev, hwc_layer_list_t* list) { hwc_context_t* ctx = (hwc_context_t*)(dev); if(!ctx) { @@ -355,6 +363,7 @@ bool MDPComp::is_doable(hwc_composer_device_t *dev, //FB composition on idle timeout if(sIdleFallBack) { + reset_comp_type(list); ALOGD_IF(isDebug(), "%s: idle fallback",__FUNCTION__); return false; } diff --git a/libhwcomposer/hwc_mdpcomp.h b/libhwcomposer/hwc_mdpcomp.h index 199204c..2c50cd1 100644 --- a/libhwcomposer/hwc_mdpcomp.h +++ b/libhwcomposer/hwc_mdpcomp.h @@ -180,8 +180,7 @@ private: mdp_pipe_info& mdp_info); /* checks for conditions where mdpcomp is not possible */ - static bool is_doable(hwc_composer_device_t *dev, - const hwc_layer_list_t* list); + static bool is_doable(hwc_composer_device_t *dev, hwc_layer_list_t* list); static bool setup(hwc_context_t* ctx, hwc_layer_list_t* list); @@ -210,6 +209,8 @@ private: /* reset state */ static void reset( hwc_context_t *ctx, hwc_layer_list_t* list ); + /* reset compostiion type to default */ + static void reset_comp_type(hwc_layer_list_t* list); /* Is feature enabled */ static bool isEnabled() { return sMaxLayers ? true : false; };