summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher N. Hesse <raymanfx@gmail.com>2016-06-27 14:08:13 +0200
committerAndreas Schneider <asn@cryptomilk.org>2016-06-29 07:52:13 +0200
commit5ebb207c1ad0c2062e4649e20051d3cdb84977b2 (patch)
tree50434c2c10b877fb1a74934904268427fa416c6a
parente9bd84e36f79ee97c2561537356c2c9c58955a8b (diff)
downloadandroid_hardware_samsung_slsi_exynos5430-5ebb207c1ad0c2062e4649e20051d3cdb84977b2.tar.gz
android_hardware_samsung_slsi_exynos5430-5ebb207c1ad0c2062e4649e20051d3cdb84977b2.tar.xz
android_hardware_samsung_slsi_exynos5430-5ebb207c1ad0c2062e4649e20051d3cdb84977b2.zip
gralloc: Add BGRA_8888 fb format support
BGRA offers better GL readback performance over RGBA on ARM Mali GPUs. Change-Id: If397e3509f68a5685d63a3926d21db5faf088a3a
-rw-r--r--gralloc/Android.mk7
-rw-r--r--gralloc/framebuffer.cpp4
2 files changed, 10 insertions, 1 deletions
diff --git a/gralloc/Android.mk b/gralloc/Android.mk
index 0090051..6268513 100644
--- a/gralloc/Android.mk
+++ b/gralloc/Android.mk
@@ -32,8 +32,13 @@ LOCAL_SRC_FILES := \
framebuffer.cpp \
mapper.cpp
+LOCAL_CFLAGS := -DLOG_TAG=\"gralloc\"
+
+ifeq ($(BOARD_USE_BGRA_8888),true)
+LOCAL_CFLAGS += -DUSE_BGRA_8888
+endif
+
LOCAL_MODULE := gralloc.exynos5
-LOCAL_CFLAGS:= -DLOG_TAG=\"gralloc\"
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_OWNER := samsung_arm
diff --git a/gralloc/framebuffer.cpp b/gralloc/framebuffer.cpp
index 63f2e65..85457f3 100644
--- a/gralloc/framebuffer.cpp
+++ b/gralloc/framebuffer.cpp
@@ -257,8 +257,12 @@ int fb_device_open(hw_module_t const* module, const char* name,
int format = HAL_PIXEL_FORMAT_RGB_565;
#else
int bits_per_pixel = 32;
+#ifdef USE_BGRA_8888
+ int format = HAL_PIXEL_FORMAT_BGRA_8888;
+#else
int format = HAL_PIXEL_FORMAT_RGBA_8888;
#endif
+#endif
alloc_device_t* gralloc_device;
status = gralloc_open(module, &gralloc_device);