diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2011-03-31 19:34:19 -0700 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2011-03-31 19:58:27 -0700 |
commit | cd347fdf74d5f2e0af856455c514e655f40a6fdb (patch) | |
tree | a19f5a7537958e81d2f1bbd5878b4eb41a05d956 | |
parent | 25b68b5c24e443c326af73a33cea6dc45e845254 (diff) | |
download | libhardware-gingerbread-release.tar.gz |
Allow to force 16bpp when 32bpp has problemsandroid-sdk-2.3.4_r1android-cts-2.3_r5android-cts-2.3_r4android-cts-2.3_r3android-2.3.7_r1android-2.3.6_r1android-2.3.6_r0.9android-2.3.5_r1android-2.3.4_r1android-2.3.4_r0.9gingerbread-releasegingerbread-mr4-release
Bug: 4197654
Change-Id: Icf1e8793d6a4d2e070a8f232efd4136d79339496
-rw-r--r-- | modules/gralloc/Android.mk | 3 | ||||
-rw-r--r-- | modules/gralloc/framebuffer.cpp | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/modules/gralloc/Android.mk b/modules/gralloc/Android.mk index ac09e5a7..cbfd82b9 100644 --- a/modules/gralloc/Android.mk +++ b/modules/gralloc/Android.mk @@ -32,5 +32,8 @@ LOCAL_CFLAGS:= -DLOG_TAG=\"gralloc\" ifeq ($(BOARD_NO_PAGE_FLIPPING),true) LOCAL_CFLAGS += -DNO_PAGE_FLIPPING endif +ifeq ($(BOARD_NO_32BPP),true) +LOCAL_CFLAGS += -DNO_32BPP +endif include $(BUILD_SHARED_LIBRARY) diff --git a/modules/gralloc/framebuffer.cpp b/modules/gralloc/framebuffer.cpp index e1323c2f..fe57a8a0 100644 --- a/modules/gralloc/framebuffer.cpp +++ b/modules/gralloc/framebuffer.cpp @@ -176,6 +176,21 @@ int mapFrameBufferLocked(struct private_module_t* module) info.yoffset = 0; info.activate = FB_ACTIVATE_NOW; +#if defined(NO_32BPP) + /* + * Explicitly request 5/6/5 + */ + info.bits_per_pixel = 16; + info.red.offset = 11; + info.red.length = 5; + info.green.offset = 5; + info.green.length = 6; + info.blue.offset = 0; + info.blue.length = 5; + info.transp.offset = 0; + info.transp.length = 0; +#endif + /* * Request NUM_BUFFERS screens (at lest 2 for page flipping) */ @@ -342,6 +357,9 @@ int fb_device_open(hw_module_t const* module, const char* name, int format = (m->info.bits_per_pixel == 32) ? HAL_PIXEL_FORMAT_RGBX_8888 : HAL_PIXEL_FORMAT_RGB_565; +#ifdef NO_32BPP + format = HAL_PIXEL_FORMAT_RGB_565; +#endif const_cast<uint32_t&>(dev->device.flags) = 0; const_cast<uint32_t&>(dev->device.width) = m->info.xres; const_cast<uint32_t&>(dev->device.height) = m->info.yres; |