diff mbox

Align dummy display to fixed-size active console

Message ID 4DFDC6FE.1080307@web.de
State New
Headers show

Commit Message

Jan Kiszka June 19, 2011, 9:53 a.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

This fixes e.g. '-vga none -monitor vc:120Cx50C'.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 console.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

Comments

Stefan Hajnoczi June 23, 2011, 1:32 p.m. UTC | #1
On Sun, Jun 19, 2011 at 11:53:02AM +0200, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> This fixes e.g. '-vga none -monitor vc:120Cx50C'.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  console.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)

Thanks, applied to the trivial patches tree:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/trivial-patches

Stefan
diff mbox

Patch

diff --git a/console.c b/console.c
index 9c6addf..acd8ca1 100644
--- a/console.c
+++ b/console.c
@@ -1349,8 +1349,15 @@  static struct DisplayAllocator default_allocator = {
 static void dumb_display_init(void)
 {
     DisplayState *ds = qemu_mallocz(sizeof(DisplayState));
+    int width = 640;
+    int height = 480;
+
     ds->allocator = &default_allocator;
-    ds->surface = qemu_create_displaysurface(ds, 640, 480);
+    if (is_fixedsize_console()) {
+        width = active_console->g_width;
+        height = active_console->g_height;
+    }
+    ds->surface = qemu_create_displaysurface(ds, width, height);
     register_displaystate(ds);
 }