diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp index 55b900b..4c1acce 100644 --- a/libhwcomposer/hwc_utils.cpp +++ b/libhwcomposer/hwc_utils.cpp @@ -130,6 +130,7 @@ void getLayerStats(hwc_context_t *ctx, const hwc_layer_list_t *list) int extLayerIndex = -1; //ext-only or block except closed caption int extCount = 0; //ext-only except closed caption bool isExtBlockPresent = false; //is BLOCK layer present + bool yuvSecure = false; for (size_t i = 0; i < list->numHwLayers; i++) { private_handle_t *hnd = @@ -147,8 +148,11 @@ void getLayerStats(hwc_context_t *ctx, const hwc_layer_list_t *list) //second video pipLayerIndex = i; } + yuvLayerIndex = i; + yuvSecure = isSecureBuffer(hnd); //Animating - if (isSkipLayer(&list->hwLayers[i])) { + //Do not mark as SKIP if it is secure buffer + if (isSkipLayer(&list->hwLayers[i]) && !yuvSecure) { isYuvLayerSkip = true; } } else if(UNLIKELY(isExtCC(hnd))) { @@ -164,9 +168,12 @@ void getLayerStats(hwc_context_t *ctx, const hwc_layer_list_t *list) } else if (isSkipLayer(&list->hwLayers[i])) { //Popups //If video layer is below a skip layer if(yuvLayerIndex != -1 && yuvLayerIndex < (ssize_t)i) { - isYuvLayerSkip = true; + //Do not mark as SKIP if it is secure buffer + if (!yuvSecure) { + isYuvLayerSkip = true; + skipCount++; + } } - skipCount++; } } diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h index 6ed830d..51c9491 100644 --- a/libhwcomposer/hwc_utils.h +++ b/libhwcomposer/hwc_utils.h @@ -95,6 +95,10 @@ static inline bool isYuvBuffer(const private_handle_t* hnd) { return (hnd && (hnd->bufferType == BUFFER_TYPE_VIDEO)); } +// Returns true if the buffer is secure +static inline bool isSecureBuffer(const private_handle_t* hnd) { + return (hnd && (private_handle_t::PRIV_FLAGS_SECURE_BUFFER & hnd->flags)); +} //Return true if buffer is marked locked static inline bool isBufferLocked(const private_handle_t* hnd) { return (hnd && (private_handle_t::PRIV_FLAGS_HWC_LOCK & hnd->flags));