summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Ward <mikeward@google.com>2011-06-24 04:28:53 +0200
committerMichael Ward <mikeward@google.com>2011-06-24 20:06:01 +0200
commit3dbe66b71d38e9edd8cf9afcbc02c264addbec89 (patch)
tree59ae5022b76cf7c1111676385bfd2537de61248f
parentfix adb root in recovery (diff)
downloadandroid_bootable_recovery-3dbe66b71d38e9edd8cf9afcbc02c264addbec89.tar
android_bootable_recovery-3dbe66b71d38e9edd8cf9afcbc02c264addbec89.tar.gz
android_bootable_recovery-3dbe66b71d38e9edd8cf9afcbc02c264addbec89.tar.bz2
android_bootable_recovery-3dbe66b71d38e9edd8cf9afcbc02c264addbec89.tar.lz
android_bootable_recovery-3dbe66b71d38e9edd8cf9afcbc02c264addbec89.tar.xz
android_bootable_recovery-3dbe66b71d38e9edd8cf9afcbc02c264addbec89.tar.zst
android_bootable_recovery-3dbe66b71d38e9edd8cf9afcbc02c264addbec89.zip
-rw-r--r--minui/graphics.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/minui/graphics.c b/minui/graphics.c
index 741d69f46..b79631a31 100644
--- a/minui/graphics.c
+++ b/minui/graphics.c
@@ -74,13 +74,48 @@ static int get_framebuffer(GGLSurface *fb)
return -1;
}
- if (ioctl(fd, FBIOGET_FSCREENINFO, &fi) < 0) {
+ if (ioctl(fd, FBIOGET_VSCREENINFO, &vi) < 0) {
perror("failed to get fb0 info");
close(fd);
return -1;
}
- if (ioctl(fd, FBIOGET_VSCREENINFO, &vi) < 0) {
+ vi.bits_per_pixel = PIXEL_SIZE * 8;
+ if (PIXEL_FORMAT == GGL_PIXEL_FORMAT_BGRA_8888) {
+ vi.red.offset = 8;
+ vi.red.length = 8;
+ vi.green.offset = 16;
+ vi.green.length = 8;
+ vi.blue.offset = 24;
+ vi.blue.length = 8;
+ vi.transp.offset = 0;
+ vi.transp.length = 8;
+ } else if (PIXEL_FORMAT == GGL_PIXEL_FORMAT_RGBX_8888) {
+ vi.red.offset = 24;
+ vi.red.length = 8;
+ vi.green.offset = 16;
+ vi.green.length = 8;
+ vi.blue.offset = 8;
+ vi.blue.length = 8;
+ vi.transp.offset = 0;
+ vi.transp.length = 8;
+ } else { /* RGB565*/
+ vi.red.offset = 11;
+ vi.red.length = 5;
+ vi.green.offset = 5;
+ vi.green.length = 6;
+ vi.blue.offset = 0;
+ vi.blue.length = 5;
+ vi.transp.offset = 0;
+ vi.transp.length = 0;
+ }
+ if (ioctl(fd, FBIOPUT_VSCREENINFO, &vi) < 0) {
+ perror("failed to put fb0 info");
+ close(fd);
+ return -1;
+ }
+
+ if (ioctl(fd, FBIOGET_FSCREENINFO, &fi) < 0) {
perror("failed to get fb0 info");
close(fd);
return -1;