qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: More displaystate fallout?


From: Stefano Stabellini
Subject: Re: [Qemu-devel] Re: More displaystate fallout?
Date: Thu, 29 Jan 2009 14:55:03 +0000
User-agent: Thunderbird 2.0.0.14 (X11/20080505)

I did not receive any input on this but since I believe this patch fixes
a real problem I am going to send it to the list anyway.

This patch fixes an initialization issue in case there is no graphic
card (-vga none) and the first console has a fixed size, bigger than
640x480 (-monitor 800x600).

Signed-off-by: Stefano Stabellini <address@hidden>

---

diff --git a/console.c b/console.c
index dbb3b70..e02cf63 100644
--- a/console.c
+++ b/console.c
@@ -1419,13 +1419,22 @@ CharDriverState *text_console_init(const char *p)
 void text_consoles_set_display(DisplayState *ds)
 {
     int i;
+    TextConsole *s;
 
     for (i = 0; i < n_text_consoles; i++) {
         text_console_do_init(text_consoles[i], ds, text_console_strs[i]);
         qemu_free(text_console_strs[i]);
     }
-
     n_text_consoles = 0;
+
+    /* If there are no graphic cards and the first console has a fixed
+     * size we need to resize the screen surface according to the size
+     * of the first console */
+    s = consoles[0];
+    if (s && s->console_type == TEXT_CONSOLE_FIXED_SIZE) {
+        ds->surface = qemu_resize_displaysurface(ds->surface, s->g_width, 
s->g_height, 32, 4 * s->g_width);
+        dpy_resize(ds);
+    }
 }
 
 void qemu_console_resize(DisplayState *ds, int width, int height)







reply via email to

[Prev in Thread] Current Thread [Next in Thread]