From 3853e4180ada1aaf4dbcc41ba6fbf94dbe57d83f Mon Sep 17 00:00:00 2001 From: Raj Kamal Date: Mon, 23 Apr 2012 21:20:16 +0530 Subject: [PATCH] Avoid 3D video layer for GPU composition libhwcomposer: Donot mark the 3D layer below HWC_SKIP_LAYER for GPU composition. In these cases, let the layer be composed through composition type decided in hwc_prepare. This helps us in avoiding the cases where 3D videos cannot be composed through GPU. CRs-Fixed: 346973 (cherry picked from commit 0331f07ed4b5a3cf5a2e358c8417ac9e8103bc07) Change-Id: I9f6c53cc2da35109fe789074a9d1accc11372dd8 --- libhwcomposer/hwcomposer.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/libhwcomposer/hwcomposer.cpp b/libhwcomposer/hwcomposer.cpp index 2f77fb6..54fdfed 100644 --- a/libhwcomposer/hwcomposer.cpp +++ b/libhwcomposer/hwcomposer.cpp @@ -649,12 +649,25 @@ static inline bool isBufferLocked(const private_handle_t* hnd) { return (hnd && (private_handle_t::PRIV_FLAGS_HWC_LOCK & hnd->flags)); } -//Marks layers for GPU composition +static int getLayerS3DFormat (hwc_layer_t &layer) { + int s3dFormat = 0; + private_handle_t *hnd = (private_handle_t *)layer.handle; + if (hnd) + s3dFormat = FORMAT_3D_INPUT(hnd->format); + return s3dFormat; +} + +//Mark layers for GPU composition but not if it is a 3D layer. static inline void markForGPUComp(const hwc_context_t *ctx, hwc_layer_list_t* list, const int limit) { for(int i = 0; i < limit; i++) { - list->hwLayers[i].compositionType = HWC_FRAMEBUFFER; - list->hwLayers[i].hints &= ~HWC_HINT_CLEAR_FB; + if( getLayerS3DFormat( list->hwLayers[i] ) ) { + continue; + } + else { + list->hwLayers[i].compositionType = HWC_FRAMEBUFFER; + list->hwLayers[i].hints &= ~HWC_HINT_CLEAR_FB; + } } } @@ -996,13 +1009,6 @@ static int getS3DFormat (const hwc_layer_list_t* list) { } -static int getLayerS3DFormat (hwc_layer_t &layer) { - int s3dFormat = 0; - private_handle_t *hnd = (private_handle_t *)layer.handle; - if (hnd) - s3dFormat = FORMAT_3D_INPUT(hnd->format); - return s3dFormat; -} static bool isS3DCompositionRequired() { #ifdef HDMI_AS_PRIMARY return overlay::is3DTV();