diff options
author | Greg Hackmann <ghackmann@google.com> | 2013-08-27 17:14:27 -0700 |
---|---|---|
committer | Greg Hackmann <ghackmann@google.com> | 2013-08-28 10:00:27 -0700 |
commit | efe80f0e5961d233e54c788d51d08fbd689297a5 (patch) | |
tree | 5804119f687a874516ea10eee9ee9e614b72d260 | |
parent | 5752d65d5209598b0d7c3752ee0d3d39a78af73b (diff) | |
download | exynos5-efe80f0e5961d233e54c788d51d08fbd689297a5.tar.gz |
gralloc: use BGRA byte order for framebuffer target
Bug: 10429036
Change-Id: Idac73fd588cca70e075c017af00dd590b14b0c7e
Signed-off-by: Greg Hackmann <ghackmann@google.com>
-rw-r--r-- | gralloc/gralloc.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gralloc/gralloc.cpp b/gralloc/gralloc.cpp index 93efb7e..58e17cb 100644 --- a/gralloc/gralloc.cpp +++ b/gralloc/gralloc.cpp @@ -138,6 +138,13 @@ static int gralloc_alloc_rgb(int ionfd, int w, int h, int format, int usage, int bpp = 0, vstride, fd, err; unsigned int heap_mask = _select_heap(usage); + if (format == HAL_PIXEL_FORMAT_RGBA_8888 && (usage & GRALLOC_USAGE_HW_FB)) { + ALOGW_IF(usage & (GRALLOC_USAGE_SW_READ_MASK | + GRALLOC_USAGE_SW_WRITE_MASK), + "framebuffer target should not have SW usage bits; ignoring"); + format = HAL_PIXEL_FORMAT_BGRA_8888; + } + switch (format) { case HAL_PIXEL_FORMAT_RGBA_8888: case HAL_PIXEL_FORMAT_RGBX_8888: |