am bd94d9af: part of fix [2186418] switch qsd8k devices to 24-bits framebuffer

Merge commit 'bd94d9af5cc7067b0e849af076183626b4c32e4e' into eclair-plus-aosp

* commit 'bd94d9af5cc7067b0e849af076183626b4c32e4e':
  part of fix [2186418] switch qsd8k devices to 24-bits framebuffer
This commit is contained in:
Mathias Agopian 2009-11-24 14:43:44 -08:00 committed by Android Git Automerger
commit e31aa77918
3 changed files with 27 additions and 17 deletions

View File

@ -59,7 +59,8 @@ struct fb_context_t {
/*****************************************************************************/
static void
msm_copy_buffer(buffer_handle_t handle, int fd, int width, int height,
msm_copy_buffer(buffer_handle_t handle, int fd,
int width, int height, int format,
int x, int y, int w, int h);
static int fb_setSwapInterval(struct framebuffer_device_t* dev,
@ -120,9 +121,6 @@ static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer)
m->currentBuffer = buffer;
} else {
// If we can't do the page_flip, just copy the buffer to the front
// FIXME: use copybit HAL instead of memcpy
void* fb_vaddr;
void* buffer_vaddr;
@ -138,8 +136,9 @@ static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer)
//memcpy(fb_vaddr, buffer_vaddr, m->finfo.line_length * m->info.yres);
msm_copy_buffer(m->framebuffer, m->framebuffer->fd,
m->info.xres, m->info.yres,
msm_copy_buffer(
m->framebuffer, m->framebuffer->fd,
m->info.xres, m->info.yres, m->fbFormat,
m->info.xoffset, m->info.yoffset,
m->info.width, m->info.height);
@ -199,18 +198,26 @@ int mapFrameBufferLocked(struct private_module_t* module)
info.yoffset = 0;
info.activate = FB_ACTIVATE_NOW;
/* Interpretation of offset for color fields: All offsets are from the right,
* inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
* can use the offset as right argument to <<). A pixel afterwards is a bit
* stream and is written to video memory as that unmodified. This implies
* big-endian byte order if bits_per_pixel is greater than 8.
*/
/*
* Explicitly request 5/6/5
* Explicitly request RGBA_8888
*/
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.bits_per_pixel = 32;
info.red.offset = 24;
info.red.length = 8;
info.green.offset = 16;
info.green.length = 8;
info.blue.offset = 8;
info.blue.length = 8;
info.transp.offset = 0;
info.transp.length = 0;
module->fbFormat = HAL_PIXEL_FORMAT_RGBX_8888;
/*
* Request NUM_BUFFERS screens (at lest 2 for page flipping)
@ -378,7 +385,7 @@ int fb_device_open(hw_module_t const* module, const char* name,
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) = m->fbFormat;
const_cast<float&>(dev->device.xdpi) = m->xdpi;
const_cast<float&>(dev->device.ydpi) = m->ydpi;
const_cast<float&>(dev->device.fps) = m->fps;
@ -400,7 +407,8 @@ int fb_device_open(hw_module_t const* module, const char* name,
/* Copy a pmem buffer to the framebuffer */
static void
msm_copy_buffer(buffer_handle_t handle, int fd, int width, int height,
msm_copy_buffer(buffer_handle_t handle, int fd,
int width, int height, int format,
int x, int y, int w, int h)
{
struct {
@ -425,7 +433,7 @@ msm_copy_buffer(buffer_handle_t handle, int fd, int width, int height,
blit.req.dst.height = height;
blit.req.dst.offset = 0;
blit.req.dst.memory_id = fd;
blit.req.dst.format = MDP_RGB_565;
blit.req.dst.format = format;
blit.req.src_rect.x = blit.req.dst_rect.x = x;
blit.req.src_rect.y = blit.req.dst_rect.y = y;

View File

@ -104,6 +104,7 @@ struct private_module_t HAL_MODULE_INFO_SYM = {
perform: gralloc_perform,
},
framebuffer: 0,
fbFormat: 0,
flags: 0,
numBuffers: 0,
bufferMask: 0,

View File

@ -38,6 +38,7 @@ struct private_module_t {
gralloc_module_t base;
struct private_handle_t* framebuffer;
uint32_t fbFormat;
uint32_t flags;
uint32_t numBuffers;
uint32_t bufferMask;