From 4995114d386182efd8f680aa8486a371da9f6b27 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sat, 18 Dec 2010 21:58:43 -0800 Subject: [PATCH] Add BOARD_HAS_JANKY_BACKBUFFER for terrible Galaxy Tabs. Change-Id: I72e7a8aaf65c97d4cd2b77ff92cf7232f8c9e7a7 --- minui/Android.mk | 4 ++++ minui/graphics.c | 4 ++++ roots.c | 16 ++++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/minui/Android.mk b/minui/Android.mk index 10f0f3f..d71cea2 100644 --- a/minui/Android.mk +++ b/minui/Android.mk @@ -11,6 +11,10 @@ ifneq ($(BOARD_LDPI_RECOVERY),) LOCAL_CFLAGS += -DBOARD_LDPI_RECOVERY='"$(BOARD_LDPI_RECOVERY)"' endif +ifneq ($(BOARD_HAS_JANKY_BACKBUFFER),) + LOCAL_CFLAGS += -DBOARD_HAS_JANKY_BACKBUFFER +endif + LOCAL_MODULE := libminui include $(BUILD_STATIC_LIBRARY) diff --git a/minui/graphics.c b/minui/graphics.c index a96342f..8125b92 100644 --- a/minui/graphics.c +++ b/minui/graphics.c @@ -101,7 +101,11 @@ static int get_framebuffer(GGLSurface *fb) fb->width = vi.xres; fb->height = vi.yres; fb->stride = fi.line_length/2; +#ifdef BOARD_HAS_JANKY_BACKBUFFER + fb->data = (void*) (((unsigned) bits) + vi.yres * fi.line_length); +#else fb->data = (void*) (((unsigned) bits) + vi.yres * fi.line_length / 2); +#endif fb->format = GGL_PIXEL_FORMAT_RGB_565; memset(fb->data, 0, vi.yres * vi.xres * 2); diff --git a/roots.c b/roots.c index 70d5578..0f6b3d7 100644 --- a/roots.c +++ b/roots.c @@ -157,6 +157,22 @@ int ensure_path_mounted(const char* path) { if (result == 0) return 0; } + LOGE("failed to mount %s (%s)\n", v->mount_point, strerror(errno)); + return -1; + } else { + // let's just give it a shot and see what happens... + result = mount(v->device, v->mount_point, v->fs_type, + MS_NOATIME | MS_NODEV | MS_NODIRATIME, ""); + if (result == 0) return 0; + + if (v->device2) { + LOGW("failed to mount %s (%s); trying %s\n", + v->device, strerror(errno), v->device2); + result = mount(v->device2, v->mount_point, v->fs_type, + MS_NOATIME | MS_NODEV | MS_NODIRATIME, ""); + if (result == 0) return 0; + } + LOGE("failed to mount %s (%s)\n", v->mount_point, strerror(errno)); return -1; }