summaryrefslogtreecommitdiff
authorTing Li <ting.li@amlogic.com>2016-04-13 08:50:46 (GMT)
committer Ting Li <ting.li@amlogic.com>2016-04-13 08:50:46 (GMT)
commitd14a335461528b0d7ae0d6627e011b487cde671d (patch)
treed5611ea69650d7e99532c89784071b45c55902ba
parenta6faf517e6f1a9450f351a933e44fb465ab19ffe (diff)
downloadgralloc-d14a335461528b0d7ae0d6627e011b487cde671d.zip
gralloc-d14a335461528b0d7ae0d6627e011b487cde671d.tar.gz
gralloc-d14a335461528b0d7ae0d6627e011b487cde671d.tar.bz2
pd#123026 fix bug of osd2 bmp-color display
Change-Id: I6dd883c05638535bc066aa41ec5b3b1e1e9dde0e
Diffstat
-rw-r--r--framebuffer.cpp63
1 files changed, 61 insertions, 2 deletions
diff --git a/framebuffer.cpp b/framebuffer.cpp
index c081343..b92e16d 100644
--- a/framebuffer.cpp
+++ b/framebuffer.cpp
@@ -119,7 +119,36 @@ int update_cursor_buffer_locked(struct framebuffer_info_t* cbinfo, int xres, int
ALOGE("vinfo. %d %d", info.xres, info.yres);
info.xoffset = info.yoffset = 0;
- info.bits_per_pixel = 32;
+ if (bits_per_pixel() == 16)
+ {
+ /*
+ * 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;
+ }
+ else
+ {
+ /*
+ * Explicitly request 8/8/8/8
+ */
+ info.bits_per_pixel = 32;
+ info.red.offset = 0;
+ info.red.length = 8;
+ info.green.offset = 8;
+ info.green.length = 8;
+ info.blue.offset = 16;
+ info.blue.length = 8;
+ info.transp.offset = 24;
+ info.transp.length = 8;
+ }
info.xres_virtual = info.xres = xres;
info.yres_virtual = info.yres = yres;
@@ -224,7 +253,37 @@ int init_cursor_buffer_locked(struct framebuffer_info_t* cbinfo)
ALOGE("vinfo. %d %d", info.xres, info.yres);
info.xoffset = info.yoffset = 0;
- info.bits_per_pixel = 32;
+
+ if (bits_per_pixel() == 16)
+ {
+ /*
+ * 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;
+ }
+ else
+ {
+ /*
+ * Explicitly request 8/8/8/8
+ */
+ info.bits_per_pixel = 32;
+ info.red.offset = 0;
+ info.red.length = 8;
+ info.green.offset = 8;
+ info.green.length = 8;
+ info.blue.offset = 16;
+ info.blue.length = 8;
+ info.transp.offset = 24;
+ info.transp.length = 8;
+ }
if (ioctl(fd, FBIOPUT_VSCREENINFO, &info) == -1)
{