qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Hervé Poussineau" <hpoussin@reactos.org>
To: qemu-devel@nongnu.org
Cc: "Anthony Liguori" <aliguori@us.ibm.com>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Stefano Stabellini" <stefano.stabellini@eu.citrix.com>
Subject: [Qemu-devel] [RFC] sdl: initialize all graphic consoles
Date: Thu, 23 Feb 2012 22:39:19 +0100	[thread overview]
Message-ID: <1330033159-15860-2-git-send-email-hpoussin@reactos.org> (raw)
In-Reply-To: <1330033159-15860-1-git-send-email-hpoussin@reactos.org>

MIPS Jazz emulation registers two graphical consoles, but second one stays black.
This patch repairs it.

Other display methods (cocoa, vnc...) also probably require the same kind of fix.
---
 console.c |    3 +++
 vl.c      |   30 +++++++++++++++++++++---------
 2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/console.c b/console.c
index 135394f..2c413a7 100644
--- a/console.c
+++ b/console.c
@@ -1376,6 +1376,9 @@ DisplayState *get_displaystate(void)
     if (!display_state) {
         dumb_display_init ();
     }
+    if (active_console && active_console->ds) {
+        return active_console->ds;
+    }
     return display_state;
 }
 
diff --git a/vl.c b/vl.c
index 7a8cc08..98e0091 100644
--- a/vl.c
+++ b/vl.c
@@ -3451,8 +3451,14 @@ int main(int argc, char **argv, char **envp)
 #endif
 #if defined(CONFIG_SDL)
     case DT_SDL:
-        sdl_display_init(ds, full_screen, no_frame);
+    {
+        DisplayState *ds2 = ds;
+        while (ds2) {
+            sdl_display_init(ds2, full_screen, no_frame);
+            ds2 = ds2->next;
+        }
         break;
+    }
 #elif defined(CONFIG_COCOA)
     case DT_SDL:
         cocoa_display_init(ds, full_screen);
@@ -3484,15 +3490,21 @@ int main(int argc, char **argv, char **envp)
 #endif
 
     /* display setup */
-    dpy_resize(ds);
-    dcl = ds->listeners;
-    while (dcl != NULL) {
-        if (dcl->dpy_refresh != NULL) {
-            ds->gui_timer = qemu_new_timer_ms(rt_clock, gui_update, ds);
-            qemu_mod_timer(ds->gui_timer, qemu_get_clock_ms(rt_clock));
-            break;
+    {
+        DisplayState *ds2 = ds;
+        while (ds2 != NULL) {
+            dpy_resize(ds2);
+            dcl = ds2->listeners;
+            while (dcl != NULL) {
+                if (dcl->dpy_refresh != NULL) {
+                    ds2->gui_timer = qemu_new_timer_ms(rt_clock, gui_update, ds2);
+                    qemu_mod_timer(ds2->gui_timer, qemu_get_clock_ms(rt_clock));
+                    break;
+                }
+                dcl = dcl->next;
+            }
+            ds2 = ds2->next;
         }
-        dcl = dcl->next;
     }
     text_consoles_set_display(ds);
 
-- 
1.7.9

  reply	other threads:[~2012-02-23 21:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23 21:39 [Qemu-devel] [BUG] Multiple graphical consoles are broken (black screen) Hervé Poussineau
2012-02-23 21:39 ` Hervé Poussineau [this message]
2012-02-23 22:18   ` [Qemu-devel] [RFC] sdl: initialize all graphic consoles Anthony Liguori
2012-02-24 14:10     ` Stefano Stabellini

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=1330033159-15860-2-git-send-email-hpoussin@reactos.org \
    --to=hpoussin@reactos.org \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).