From cf67073149e466211f5d3c0ce55a5bb2eae4af3f Mon Sep 17 00:00:00 2001 From: Naomi Luis Date: Thu, 12 Jan 2012 10:46:08 -0800 Subject: [PATCH] libhwcomposer: Mark all layers below the SKIP layer for GPU composition. If there is a SKIP layer present, the SKIP layers are first composited using the GPU. If there any layer below the SKIP layer that performs any operations on the FrameBuffer, it results in undesireable results on the screen e.g. artifacts, since SurfaceFlinger draws the SKIP layers before the HWComposer. Change-Id: I198236673e2a0bd19a6087ff01049061547abb47 CRs-fixed: 327392 --- libhwcomposer/hwcomposer.cpp | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/libhwcomposer/hwcomposer.cpp b/libhwcomposer/hwcomposer.cpp index 822d64e..a20283f 100755 --- a/libhwcomposer/hwcomposer.cpp +++ b/libhwcomposer/hwcomposer.cpp @@ -847,26 +847,13 @@ static int hwc_prepare(hwc_composer_device_t *dev, hwc_layer_list_t* list) { if (isS3DCompositionNeeded) markUILayerForS3DComposition(list->hwLayers[i], s3dVideoFormat); - if (hwcModule->compositionType - & (COMPOSITION_TYPE_C2D | COMPOSITION_TYPE_MDP)) { - // Ensure that HWC_OVERLAY layers below skip layers do not - // overwrite GPU composed skip layers. - ssize_t layer_countdown = ((ssize_t)i) - 1; - while (layer_countdown >= 0) - { - // Mark every non-mdp overlay layer below the - // skip-layer for GPU composition. - switch(list->hwLayers[layer_countdown].compositionType) { - case HWC_FRAMEBUFFER: - case HWC_USE_OVERLAY: - break; - case HWC_USE_COPYBIT: - default: - list->hwLayers[layer_countdown].compositionType = HWC_FRAMEBUFFER; - break; - } - layer_countdown--; - } + ssize_t layer_countdown = ((ssize_t)i) - 1; + // Mark every layer below the SKIP layer to be composed by the GPU + while (layer_countdown >= 0) + { + list->hwLayers[layer_countdown].compositionType = HWC_FRAMEBUFFER; + list->hwLayers[i].hints &= ~HWC_HINT_CLEAR_FB; + layer_countdown--; } continue; }