aboutsummaryrefslogtreecommitdiff
path: root/hw/vga.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-10-10 13:05:05 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-11-01 14:00:04 +0100
commit1fd2510a3786fb557919cdd71e8e65c504439ddc (patch)
tree66cf5f89e2789a01bce05243391e3340e15a8f6c /hw/vga.c
parentb6e9f63711ea19b110574e384477bad4ea74f4a2 (diff)
vga: stop direct access to DisplaySurface fields.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/vga.c')
-rw-r--r--hw/vga.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/vga.c b/hw/vga.c
index f31dbdd652..1188463208 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1709,8 +1709,13 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
s->last_depth = depth;
full_update = 1;
} else if (is_buffer_shared(s->ds->surface) &&
- (full_update || s->ds->surface->data != s->vram_ptr + (s->start_addr * 4))) {
- s->ds->surface->data = s->vram_ptr + (s->start_addr * 4);
+ (full_update || ds_get_data(s->ds) != s->vram_ptr
+ + (s->start_addr * 4))) {
+ 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));
dpy_gfx_setdata(s->ds);
}