Handle sRGB gralloc formats.
authorJesse Hall <jessehall@google.com>
Mon, 18 Aug 2014 04:41:25 +0000 (21:41 -0700)
committerJesse Hall <jessehall@google.com>
Mon, 18 Aug 2014 04:41:25 +0000 (21:41 -0700)
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
libhwc/hwc.cpp

index 3c56a1e7556432a0a8474162d08af3f5f0fca915..b5f269bf242be4d31fa40cd1bb914956cb801aac 100644 (file)
@@ -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:
index 94e8c597ac9ec246748c8b18dcbcf8c141a129cc..dca45ef852c63dda104e4c2c2e2308e55430bed6 100644 (file)
@@ -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;