aboutsummaryrefslogtreecommitdiffstats
path: root/android/display-core.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-01-16 01:42:37 +0100
committerDavid 'Digit' Turner <digit@android.com>2011-01-18 20:53:34 +0100
commit97d795c955f8d261a0a5294d49ea06d5a473ed03 (patch)
treec38306a988e9cbe8514827efd62e92cd7021c8fa /android/display-core.c
parent9cf288a4a03f6745a81b35e8022aab3d1d5f2247 (diff)
downloadexternal_qemu-97d795c955f8d261a0a5294d49ea06d5a473ed03.zip
external_qemu-97d795c955f8d261a0a5294d49ea06d5a473ed03.tar.gz
external_qemu-97d795c955f8d261a0a5294d49ea06d5a473ed03.tar.bz2
Add support for 32-bit framebuffers.
This modifies the emulator so support 32-bit framebuffers. You can create such a frame-buffer using one of these methods: - Add a "bpp 32" line to the "display" element of your skin - Use the new 'magic' skin option format: e.g. -skin 320x480x32 Note that the result will be hideous since the kernel driver still thinks the hardware is only 16-bits. This will be addressed in a later patch to hw/goldfish_fb.c and to the kernel driver ($KERNEL/drivers/video/goldfishfb.c) Change-Id: I0fc700c4a4cb8521076605324e15ed34e5d01136
Diffstat (limited to 'android/display-core.c')
-rw-r--r--android/display-core.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/android/display-core.c b/android/display-core.c
index 1efb4a2..0b2a869 100644
--- a/android/display-core.c
+++ b/android/display-core.c
@@ -79,14 +79,24 @@ coredisplay_fb_done(void* opaque)
void
coredisplay_init(DisplayState* ds)
{
+ int format;
+
core_display.ds = ds;
/* Create and initialize framebuffer instance that will be used for core
* display.
*/
ANEW0(core_display.fb);
core_display.core_fb = NULL;
+
+ /* In the core, there is no skin to parse and the format of ds->surface
+ * is determined by the -android-gui option.
+ */
+ format = QFRAME_BUFFER_RGB565;
+ if (ds->surface->pf.bytes_per_pixel == 4)
+ format = QFRAME_BUFFER_RGBX_8888;
+
qframebuffer_init(core_display.fb, ds->surface->width, ds->surface->height,
- 0, QFRAME_BUFFER_RGB565 );
+ 0, format);
qframebuffer_fifo_add(core_display.fb);
/* Register core display as the client for the framebuffer, so we can start
* receiving framebuffer notifications. Note that until UI connects to the