From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH 7 of 13] fix console switch
Date: Mon, 2 Mar 2009 17:13:34 +0000 [thread overview]
Message-ID: <49AC13BE.7020803@eu.citrix.com> (raw)
Import some console switch improvements and fixes from qemu mainstream.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
diff -r db86b9f0df7c console.c
--- a/console.c Mon Feb 16 12:18:33 2009 +0000
+++ b/console.c Mon Feb 16 16:36:58 2009 +0000
@@ -1190,7 +1190,7 @@
} else {
/* HACK: Put graphical consoles before text consoles. */
for (i = nb_consoles; i > 0; i--) {
- if (!consoles[i - 1]->console_type == GRAPHIC_CONSOLE)
+ if (consoles[i - 1]->console_type == GRAPHIC_CONSOLE)
break;
consoles[i] = consoles[i - 1];
}
@@ -1258,6 +1258,8 @@
static void text_console_do_init(CharDriverState *chr, DisplayState *ds, const char *p)
{
TextConsole *s;
+ unsigned width;
+ unsigned height;
static int color_inited;
s = new_console(ds, (p == 0) ? TEXT_CONSOLE : TEXT_CONSOLE_FIXED_SIZE);
@@ -1277,15 +1279,36 @@
if (!color_inited) {
color_inited = 1;
- console_color_init(ds);
+ console_color_init(s->ds);
}
s->y_displayed = 0;
s->y_base = 0;
s->total_height = DEFAULT_BACKSCROLL;
s->x = 0;
s->y = 0;
- s->g_width = ds_get_width(s->ds);
- s->g_height = ds_get_height(s->ds);
+ width = ds_get_width(s->ds);
+ height = ds_get_height(s->ds);
+ if (p != 0) {
+ width = strtoul(p, (char **)&p, 10);
+ if (*p == 'C') {
+ p++;
+ width *= FONT_WIDTH;
+ }
+ if (*p == 'x') {
+ p++;
+ height = strtoul(p, (char **)&p, 10);
+ if (*p == 'C') {
+ p++;
+ height *= FONT_HEIGHT;
+ }
+ }
+ }
+ s->g_width = width;
+ s->g_height = height;
+
+ s->hw_invalidate = text_console_invalidate;
+ s->hw_text_update = text_console_update;
+ s->hw = s;
/* Set text attribute defaults */
s->t_attrib_default.bold = 0;
reply other threads:[~2009-03-02 17:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49AC13BE.7020803@eu.citrix.com \
--to=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.