From: Simon Shields Date: Tue, 13 Feb 2018 09:38:27 +0000 (+1100) Subject: gralloc: fix internal_format in YUV alloc cases X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cbe3a2c75dfea17c39704491a091a9b953804e17;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos.git gralloc: fix internal_format in YUV alloc cases if internal_format is left unset, the EGL blobs will be very unhappy because they can't figure out how many planes are needed. We call gralloc_select_format and check_for_compression to pick internal_format, as is done in gralloc_alloc_rgb. Change-Id: I3f9e5d1dca5fc07753e6837d1e9e405b7cd83fb7 --- diff --git a/gralloc/gralloc.cpp b/gralloc/gralloc.cpp index d028d15..5b1bc0d 100644 --- a/gralloc/gralloc.cpp +++ b/gralloc/gralloc.cpp @@ -275,8 +275,8 @@ static int gralloc_alloc_framework_yuv(int ionfd, int w, int h, int format, int size_t size=0, ext_size=256; int err, fd; unsigned int heap_mask = _select_heap(usage); - int is_compressible = 0; - uint64_t internal_format = 0; + int is_compressible = check_for_compression(w, h, format, usage); + uint64_t internal_format = gralloc_select_format(format, usage, is_compressible); switch (format) { case HAL_PIXEL_FORMAT_YV12: @@ -350,6 +350,9 @@ static int gralloc_alloc_yuv(int ionfd, int w, int h, int format, } else if (usage & GRALLOC_USAGE_CAMERA_RESERVED) ion_flags |= ION_EXYNOS_MFC_OUTPUT_MASK; + is_compressible = check_for_compression(w, h, format, usage); + internal_format = gralloc_select_format(format, usage, is_compressible); + switch (format) { case HAL_PIXEL_FORMAT_EXYNOS_YV12_M: case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_P_M: