Hi,

There once be a similar patch(
http://code.google.com/p/patch-hosting-for-android-x86-support/downloads/detail?name=32bpp.patch)
but
not for Android 2.1.

Android 2.1 has changed much so i rewrote a patch to make Android Support
32bpp mode.
If you want to use default 16bpp, redefine the HAVE_ANDROID_32BPP 0.

==============
Index: system/core/include/arch/linux-arm/AndroidConfig.h
===================================================================
--- system/core/include/arch/linux-arm/AndroidConfig.h (revision 4)
+++ system/core/include/arch/linux-arm/AndroidConfig.h (working copy)
@@ -207,6 +207,11 @@
 #define HAVE_ANDROID_OS 1

 /*
+ * Define If we support Android 32BPP mode.
+ */
+#define HAVE_ANDROID_32BPP 1
+
+/*
  * Define if we have Linux-style non-filesystem Unix Domain Sockets
  */
 #define HAVE_LINUX_LOCAL_SOCKET_NAMESPACE 1
Index: hardware/libhardware/modules/gralloc/framebuffer.cpp
===================================================================
--- hardware/libhardware/modules/gralloc/framebuffer.cpp (revision 4)
+++ hardware/libhardware/modules/gralloc/framebuffer.cpp (working copy)
@@ -184,6 +184,7 @@
     /*
      * Explicitly request 5/6/5
      */
+#ifndef HAVE_ANDROID_32BPP
     info.bits_per_pixel = 16;
     info.red.offset     = 11;
     info.red.length     = 5;
@@ -193,6 +194,17 @@
     info.blue.length    = 5;
     info.transp.offset  = 0;
     info.transp.length  = 0;
+#else
+    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;
+#endif

     /*
      * Request NUM_BUFFERS screens (at lest 2 for page flipping)
@@ -358,7 +370,11 @@
             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;
+#ifndef HAVE_ANDROID_32BP
+    const_cast<int&>(dev->device.format) = HAL_PIXEL_FORMAT_RGB_565;
+#else
+    const_cast<int&>(dev->device.format) = HAL_PIXEL_FORMAT_RGBA_8888;
+#endif
             const_cast<float&>(dev->device.xdpi) = m->xdpi;
             const_cast<float&>(dev->device.ydpi) = m->ydpi;
             const_cast<float&>(dev->device.fps) = m->fps;

Thanks
Keroid
-- 
A Linux Kernel Android Developer

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to