From 99e0c3cdbe7278cea88ada37aaa24ae0a51cabb5 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Sun, 17 Aug 2014 21:41:25 -0700 Subject: [PATCH] Handle sRGB gralloc formats. gralloc: recognize and allocate sRGB_{A,X}_8888 hwcomposer: punt sRGB formats to FRAMEBUFFER composition - This would happen already due to the format-supported test, this change just avoids an unrecognized-format log warning from exynos5_format_to_bpp(). Bug: 10134664 Change-Id: I78b7791217cbde28d5bc7d02caf6a955960828ce --- gralloc/gralloc.cpp | 2 ++ libhwc/hwc.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gralloc/gralloc.cpp b/gralloc/gralloc.cpp index 3c56a1e..b5f269b 100644 --- a/gralloc/gralloc.cpp +++ b/gralloc/gralloc.cpp @@ -152,6 +152,8 @@ static int gralloc_alloc_rgb(int ionfd, int w, int h, int format, int usage, case HAL_PIXEL_FORMAT_RGBA_8888: case HAL_PIXEL_FORMAT_RGBX_8888: case HAL_PIXEL_FORMAT_BGRA_8888: + case HAL_PIXEL_FORMAT_sRGB_A_8888: + case HAL_PIXEL_FORMAT_sRGB_X_8888: bpp = 4; break; case HAL_PIXEL_FORMAT_RGB_888: diff --git a/libhwc/hwc.cpp b/libhwc/hwc.cpp index 94e8c59..dca45ef 100644 --- a/libhwc/hwc.cpp +++ b/libhwc/hwc.cpp @@ -799,10 +799,6 @@ bool exynos5_supports_overlay(hwc_layer_1_t &layer, size_t i, return false; } - if (exynos5_visible_width(layer, handle->format, pdev) < BURSTLEN_BYTES) { - ALOGV("\tlayer %u: visible area is too narrow", i); - return false; - } if (exynos5_requires_gscaler(layer, handle->format)) { if (!exynos5_supports_gscaler(layer, handle->format, false)) { ALOGV("\tlayer %u: gscaler required but not supported", i); @@ -814,6 +810,10 @@ bool exynos5_supports_overlay(hwc_layer_1_t &layer, size_t i, return false; } } + if (exynos5_visible_width(layer, handle->format, pdev) < BURSTLEN_BYTES) { + ALOGV("\tlayer %u: visible area is too narrow", i); + return false; + } if (!exynos5_blending_is_supported(layer.blending)) { ALOGV("\tlayer %u: blending %d not supported", i, layer.blending); return false; -- 2.20.1