Skip to contentSkip to conversation

Fix display resize bugs introduced after recent console revamp

PATCH In review Igor Mitsyanko 2 participants 4 messages Mar 19, 2013 – Mar 20, 2013 Arm Samsung Exynos

lore
Share & tools
lore
#0 lore raw

cover Fix display resize bugs introduced after recent console revamp

Bad things were happening in display update functions every time a screen has to be resized.

Igor Mitsyanko (2):
exynos4210_fimd.c: fix display resize bug introduced after console
revamp
hw/vmware_vga.c: fix screen resize bug introduced after console
revamp

 hw/exynos4210_fimd.c |    7 ++++---
 hw/vmware_vga.c      |    3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/2 exynos4210_fimd.c: fix display resize bug introduced after console revamp

In exynos4210 display update function, we were acquiring DisplaySurface pointer before calling screen resize function, not paying attention that resize procedure can replace current DisplaySurface with newly allocated one. Right thing to do is to initialize DisplaySurface AFTER a call to resize function.

---
 hw/exynos4210_fimd.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
hw/exynos4210_fimd.c +4 -3
index bf316c6..333456a 100644
@@ -1243,7 +1243,7 @@ static void exynos4210_update_resolution(Exynos4210fimdState *s)
 static void exynos4210_fimd_update(void *opaque)
 {
     Exynos4210fimdState *s = (Exynos4210fimdState *)opaque;
-    DisplaySurface *surface = qemu_console_surface(s->console);
+    DisplaySurface *surface;
     Exynos4210fimdWindow *w;
     int i, line;
     hwaddr fb_line_addr, inc_size;
@@ -1256,11 +1256,12 @@ static void exynos4210_fimd_update(void *opaque)
     const int global_height = ((s->vidtcon[2] >> FIMD_VIDTCON2_VER_SHIFT) &
             FIMD_VIDTCON2_SIZE_MASK) + 1;
 
-    if (!s || !s->console || !surface_bits_per_pixel(surface) ||
-            !s->enabled) {
+    if (!s || !s->console || !s->enabled ||
+        surface_bits_per_pixel(qemu_console_surface(s->console)) == 0) {
         return;
     }
     exynos4210_update_resolution(s);
+    surface = qemu_console_surface(s->console);
 
     for (i = 0; i < NUM_OF_WINDOWS; i++) {
         w = &s->window[i];
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 2/2 hw/vmware_vga.c: fix screen resize bug introduced after console revamp

In reply to Igor Mitsyanko

In vmsvga display update function, a pointer to DisplaySurface must be acquired after a call to vmsvga_check_size since this function might replace current DisplaySurface with a new one.

---
 hw/vmware_vga.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
hw/vmware_vga.c +2 -1
index 5b9ce8f..c0aac31 100644
@@ -995,7 +995,7 @@ static inline void vmsvga_check_size(struct vmsvga_state_s *s)
 static void vmsvga_update_display(void *opaque)
 {
     struct vmsvga_state_s *s = opaque;
-    DisplaySurface *surface = qemu_console_surface(s->vga.con);
+    DisplaySurface *surface;
     bool dirty = false;
 
     if (!s->enable) {
@@ -1004,6 +1004,7 @@ static void vmsvga_update_display(void *opaque)
     }
 
     vmsvga_check_size(s);
+    surface = qemu_console_surface(s->vga.con);
 
     vmsvga_fifo_run(s);
     vmsvga_update_rect_flush(s);
Signature · 1 line
1.7.5.4
#3 lore raw
In reply to Igor Mitsyanko
Quoted 2 lines · Igor Mitsyanko

Bad things were happening in display update functions every time a screen has to be resized.

Good catch, added to the console patches.

thanks,
Gerd