am 288cb24b: am dc80f522: gralloc-qsd8k: If using gpu composition, request rgba8888 instead of rgbx8888

Merge commit '288cb24be01d065843a2a98ed6c0fdbb5faa8268' into eclair-mr2-plus-aosp

* commit '288cb24be01d065843a2a98ed6c0fdbb5faa8268':
  gralloc-qsd8k: If using gpu composition, request rgba8888 instead of rgbx8888
This commit is contained in:
Dima Zavin 2009-12-04 20:28:16 -08:00 committed by Android Git Automerger
commit af9a41610e

View File

@ -20,6 +20,7 @@
#include <cutils/ashmem.h>
#include <cutils/log.h>
#include <cutils/properties.h>
#include <hardware/hardware.h>
#include <hardware/gralloc.h>
@ -217,7 +218,15 @@ int mapFrameBufferLocked(struct private_module_t* module)
info.blue.length = 8;
info.transp.offset = 0;
info.transp.length = 0;
module->fbFormat = HAL_PIXEL_FORMAT_RGBX_8888;
/* Note: the GL driver does not have a r=8 g=8 b=8 a=0 config, so if we do
* not use the MDP for composition (i.e. hw composition == 0), ask for
* RGBA instead of RGBX. */
char property[PROPERTY_VALUE_MAX];
if (property_get("debug.sf.hw", property, NULL) > 0 && atoi(property) == 0)
module->fbFormat = HAL_PIXEL_FORMAT_RGBX_8888;
else
module->fbFormat = HAL_PIXEL_FORMAT_RGBA_8888;
/*
* Request NUM_BUFFERS screens (at lest 2 for page flipping)