Another patch that seems to work tries to remember the old surface:
diff --git a/hw/display/vga.c b/hw/display/vga.c index ed476e4e80..1aae6a6d3b 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -1554,7 +1554,8 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) height != s->last_height || s->last_depth != depth || s->last_byteswap != byteswap || - share_surface != is_buffer_shared(surface)) { + share_surface != is_buffer_shared(surface) || + s->last_surface != surface) { /* display parameters changed -> need new display surface */ s->last_scr_width = disp_width; s->last_scr_height = height; @@ -1563,8 +1564,10 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) s->last_line_offset = s->line_offset; s->last_depth = depth; s->last_byteswap = byteswap; + s->last_surface = surface; full_update = 1; } + fprintf(stderr, "%p vs %p share_surface: %d surface: %p\n", surface_data(surface), s->vram_ptr + (s->start_addr * 4), share_surface, surface); if (surface_data(surface) != s->vram_ptr + (s->start_addr * 4) && is_buffer_shared(surface)) { /* base address changed (page flip) -> shared display surfaces diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h index f8fcf62a56..91afc52b0e 100644 --- a/hw/display/vga_int.h +++ b/hw/display/vga_int.h @@ -122,6 +122,7 @@ typedef struct VGACommonState { uint32_t last_width, last_height; /* in chars or pixels */ uint32_t last_scr_width, last_scr_height; /* in pixels */ uint32_t last_depth; /* in bits */ + void *last_surface; bool last_byteswap; bool force_shadow; uint8_t cursor_start, cursor_end;
Another patch that seems to work tries to remember the old surface:
diff --git a/hw/display/vga.c b/hw/display/vga.c .1aae6a6d3b 100644 graphic( VGACommonState *s, int full_update)
s->last_ depth != depth ||
s->last_ byteswap != byteswap || shared( surface) ) { shared( surface) ||
s->last_ scr_width = disp_width;
s->last_ scr_height = height; graphic( VGACommonState *s, int full_update)
s->last_ line_offset = s->line_offset;
s->last_ depth = depth;
s->last_ byteswap = byteswap;
full_ update = 1; data(surface) , s->vram_ptr + (s->start_addr * 4), share_surface, surface); data(surface) != s->vram_ptr + (s->start_addr * 4) shared( surface) ) { vga_int. h b/hw/display/ vga_int. h .91afc52b0e 100644 vga_int. h vga_int. h
index ed476e4e80.
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -1554,7 +1554,8 @@ static void vga_draw_
height != s->last_height ||
- share_surface != is_buffer_
+ share_surface != is_buffer_
+ s->last_surface != surface) {
/* display parameters changed -> need new display surface */
@@ -1563,8 +1564,10 @@ static void vga_draw_
+ s->last_surface = surface;
}
+ fprintf(stderr, "%p vs %p share_surface: %d surface: %p\n", surface_
if (surface_
&& is_buffer_
/* base address changed (page flip) -> shared display surfaces
diff --git a/hw/display/
index f8fcf62a56.
--- a/hw/display/
+++ b/hw/display/
@@ -122,6 +122,7 @@ typedef struct VGACommonState {
uint32_t last_width, last_height; /* in chars or pixels */
uint32_t last_scr_width, last_scr_height; /* in pixels */
uint32_t last_depth; /* in bits */
+ void *last_surface;
bool last_byteswap;
bool force_shadow;
uint8_t cursor_start, cursor_end;