summaryrefslogtreecommitdiffstats
path: root/modules/gralloc/framebuffer.cpp
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2011-01-27 09:18:13 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-27 09:18:13 -0800
commit91f7fab20b9fd783e66591acfb683c568d1b1eed (patch)
tree32702cdff2579ee3b3cdaa693a094fedc8b334cb /modules/gralloc/framebuffer.cpp
parenta80988c7745bf3186fba4f6b4e5ef00d609242dc (diff)
parent25b68b5c24e443c326af73a33cea6dc45e845254 (diff)
downloadhardware_libhardware-91f7fab20b9fd783e66591acfb683c568d1b1eed.zip
hardware_libhardware-91f7fab20b9fd783e66591acfb683c568d1b1eed.tar.gz
hardware_libhardware-91f7fab20b9fd783e66591acfb683c568d1b1eed.tar.bz2
am 25b68b5c: gralloc: Add support for 32-bit framebuffers.
* commit '25b68b5c24e443c326af73a33cea6dc45e845254': gralloc: Add support for 32-bit framebuffers.
Diffstat (limited to 'modules/gralloc/framebuffer.cpp')
-rw-r--r--modules/gralloc/framebuffer.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/modules/gralloc/framebuffer.cpp b/modules/gralloc/framebuffer.cpp
index 59c5001..e1323c2 100644
--- a/modules/gralloc/framebuffer.cpp
+++ b/modules/gralloc/framebuffer.cpp
@@ -177,19 +177,6 @@ int mapFrameBufferLocked(struct private_module_t* module)
info.activate = FB_ACTIVATE_NOW;
/*
- * 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;
-
- /*
* Request NUM_BUFFERS screens (at lest 2 for page flipping)
*/
info.yres_virtual = info.yres * NUM_BUFFERS;
@@ -352,11 +339,14 @@ int fb_device_open(hw_module_t const* module, const char* name,
status = mapFrameBuffer(m);
if (status >= 0) {
int stride = m->finfo.line_length / (m->info.bits_per_pixel >> 3);
+ int format = (m->info.bits_per_pixel == 32)
+ ? HAL_PIXEL_FORMAT_RGBX_8888
+ : HAL_PIXEL_FORMAT_RGB_565;
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;
const_cast<int&>(dev->device.stride) = stride;
- const_cast<int&>(dev->device.format) = HAL_PIXEL_FORMAT_RGB_565;
+ const_cast<int&>(dev->device.format) = format;
const_cast<float&>(dev->device.xdpi) = m->xdpi;
const_cast<float&>(dev->device.ydpi) = m->ydpi;
const_cast<float&>(dev->device.fps) = m->fps;