libhwcomposer: Reset layer list before clearing MDP states.

This change resets layers flags and composition types
before clearing MDP states.

Change-Id: I03ec173df7dec67348942f307079b506649f592b
This commit is contained in:
Jeykumar Sankaran 2012-08-13 18:15:48 -07:00 committed by Andrew Sutherland
parent 43dfffc8d6
commit 0d7fad0878
2 changed files with 7 additions and 19 deletions

View File

@ -126,16 +126,10 @@ 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 ) {
//Reset flags and states
unsetMDPCompLayerFlags(ctx, list);
sCurrentFrame.count = 0;
free(sCurrentFrame.pipe_layer);
sCurrentFrame.pipe_layer = NULL;
@ -147,12 +141,6 @@ void MDPComp::reset( hwc_context_t *ctx, hwc_layer_list_t* list ) {
#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_t* layer, const int pipe_index)
@ -372,7 +360,6 @@ bool MDPComp::is_doable(hwc_composer_device_t *dev, hwc_layer_list_t* list) {
//FB composition on idle timeout
if(sIdleFallBack) {
reset_comp_type(list);
ALOGD_IF(isDebug(), "%s: idle fallback",__FUNCTION__);
return false;
}
@ -675,6 +662,10 @@ void MDPComp::unsetMDPCompLayerFlags(hwc_context_t* ctx, hwc_layer_list_t* list)
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;
}
}
}

View File

@ -101,7 +101,6 @@ class MDPComp {
enum State {
MDPCOMP_ON = 0,
MDPCOMP_OFF,
MDPCOMP_OFF_PENDING,
};
enum {
@ -209,8 +208,6 @@ 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; };