Skip to content

Commit

Permalink
Merge "libhwcomposer: Disable FB fetch if there is only one video lay…
Browse files Browse the repository at this point in the history
…er." into ics_chocolate
  • Loading branch information
Linux Build Service Account authored and QuIC Gerrit Code Review committed Mar 7, 2012
2 parents 01d3062 + 65dee76 commit dccd5b6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libhwcomposer/hwcomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ static int hwc_closeOverlayChannels(hwc_context_t* ctx) {
/*
* Configures mdp pipes
*/
static int prepareOverlay(hwc_context_t *ctx, hwc_layer_t *layer, const bool waitForVsync) {
static int prepareOverlay(hwc_context_t *ctx, hwc_layer_t *layer, const int flags) {
int ret = 0;

#ifdef COMPOSITION_BYPASS
Expand Down Expand Up @@ -623,7 +623,7 @@ static int prepareOverlay(hwc_context_t *ctx, hwc_layer_t *layer, const bool wai
hdmiConnected = (int)ctx->mHDMIEnabled;
#endif
ret = ovLibObject->setSource(info, layer->transform,
hdmiConnected, waitForVsync);
hdmiConnected, flags);
if (!ret) {
LOGE("prepareOverlay setSource failed");
return -1;
Expand Down Expand Up @@ -1021,11 +1021,12 @@ static int hwc_prepare(hwc_composer_device_t *dev, hwc_layer_list_t* list) {
continue;
}
if (hnd && (hnd->bufferType == BUFFER_TYPE_VIDEO) && (yuvBufferCount == 1)) {
bool waitForVsync = true;
int flags = WAIT_FOR_VSYNC;
flags |= (1 == list->numHwLayers) ? DISABLE_FRAMEBUFFER_FETCH : 0;
if (!isValidDestination(hwcModule->fbDevice, list->hwLayers[i].displayFrame)) {
list->hwLayers[i].compositionType = HWC_FRAMEBUFFER;
#ifdef USE_OVERLAY
} else if(prepareOverlay(ctx, &(list->hwLayers[i]), waitForVsync) == 0) {
} else if(prepareOverlay(ctx, &(list->hwLayers[i]), flags) == 0) {
list->hwLayers[i].compositionType = HWC_USE_OVERLAY;
list->hwLayers[i].hints |= HWC_HINT_CLEAR_FB;
// We've opened the channel. Set the state to open.
Expand Down

0 comments on commit dccd5b6

Please sign in to comment.