aboutsummaryrefslogtreecommitdiff
path: root/hw/vga.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/vga.c')
-rw-r--r--hw/vga.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/hw/vga.c b/hw/vga.c
index f20c6cc..8604eb5 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1161,7 +1161,10 @@ static inline int get_depth_index(DisplayState *s)
case 16:
return 2;
case 32:
- return 3;
+ if (is_surface_bgr(s->surface))
+ return 4;
+ else
+ return 3;
}
}
@@ -1627,7 +1630,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
if (depth == 32) {
#endif
if (is_graphic_console()) {
- qemu_free_displaysurface(s->ds->surface);
+ qemu_free_displaysurface(s->ds);
s->ds->surface = qemu_create_displaysurface_from(disp_width, height, depth,
s->line_offset,
s->vram_ptr + (s->start_addr * 4));
@@ -2619,7 +2622,7 @@ static void vga_screen_dump_common(VGAState *s, const char *filename,
dcl.dpy_resize = vga_save_dpy_resize;
dcl.dpy_refresh = vga_save_dpy_refresh;
register_displaychangelistener(ds, &dcl);
- ds->surface = qemu_create_displaysurface(w, h, 32, 4 * w);
+ ds->surface = qemu_create_displaysurface(ds, w, h);
s->ds = ds;
s->graphic_mode = -1;
@@ -2627,7 +2630,7 @@ static void vga_screen_dump_common(VGAState *s, const char *filename,
ppm_save(filename, ds->surface);
- qemu_free_displaysurface(ds->surface);
+ qemu_free_displaysurface(ds);
s->ds = saved_ds;
}