From 7407479717e54978dc997ae1bff6f3cbe36d49fd Mon Sep 17 00:00:00 2001 From: Naomi Luis Date: Tue, 31 Jan 2012 11:22:45 -0800 Subject: [PATCH] libhwcomposer: Unlock video layers below the SKIP_LAYER. If there is any video layer below the HWC_SKIP_LAYER, we compose that video layer using the GPU. Unlock any previous video buffer that were sent to the overlay. CRs-fixed: 333974 Change-Id: I1937ca8b139f40453a3bccb0b490fd4d65fa1f52 (cherry picked from commit 48a3996a2178244ce6365f97212c55e7ab33752a) (cherry picked from commit f4a08165b2d3be97b72287fc4001cb5c90d57c07) --- libhwcomposer/hwcomposer.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libhwcomposer/hwcomposer.cpp b/libhwcomposer/hwcomposer.cpp index a7051a1..4ec477f 100755 --- a/libhwcomposer/hwcomposer.cpp +++ b/libhwcomposer/hwcomposer.cpp @@ -849,8 +849,15 @@ static int hwc_prepare(hwc_composer_device_t *dev, hwc_layer_list_t* list) { // Mark every layer below the SKIP layer to be composed by the GPU while (layer_countdown >= 0) { + private_handle_t *countdown_handle = + (private_handle_t *)list->hwLayers[layer_countdown].handle; + if (countdown_handle && (countdown_handle->bufferType == BUFFER_TYPE_VIDEO) + && (yuvBufferCount == 1)) { + unlockPreviousOverlayBuffer(ctx); + skipComposition = false; + } list->hwLayers[layer_countdown].compositionType = HWC_FRAMEBUFFER; - list->hwLayers[i].hints &= ~HWC_HINT_CLEAR_FB; + list->hwLayers[layer_countdown].hints &= ~HWC_HINT_CLEAR_FB; layer_countdown--; } continue;