All of lore.kernel.org
 help / color / mirror / Atom feed
From: Riku Voipio <riku.voipio@iki.fi>
To: qemu-devel@nongnu.org
Cc: stefano.stabellini@eu.citrix.com
Subject: Re: [Qemu-devel] [6344] graphical_console_init change (Stefano Stabellini)
Date: Mon, 9 Feb 2009 13:38:53 +0200	[thread overview]
Message-ID: <20090209113853.GA11874@kos.to> (raw)
In-Reply-To: <E1LNtzL-0002pj-7r@cvs.savannah.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 4066 bytes --]

On Fri, Jan 16, 2009 at 07:04:15PM +0000, Anthony Liguori wrote:
> --- trunk/hw/blizzard.c	2009-01-16 18:13:32 UTC (rev 6343)
> +++ trunk/hw/blizzard.c	2009-01-16 19:04:14 UTC (rev 6344)
> @@ -72,7 +72,6 @@
>      uint8_t iformat;
>      uint8_t source;
>      DisplayState *state;
> -    QEMUConsole *console;
>      blizzard_fn_t *line_fn_tab[2];
>      void *fb;
>  
> @@ -896,7 +895,7 @@
>  
>      if (s->x != ds_get_width(s->state) || s->y != ds_get_height(s->state)) {
>          s->invalidate = 1;
> -        qemu_console_resize(s->console, s->x, s->y);
> +        qemu_console_resize(s->state, s->x, s->y);
>      }
>  
>      if (s->invalidate) {
> @@ -954,11 +953,10 @@
>  #define DEPTH 32
>  #include "blizzard_template.h"
>  
> -void *s1d13745_init(qemu_irq gpio_int, DisplayState *ds)
> +void *s1d13745_init(qemu_irq gpio_int)
>  {
>      struct blizzard_s *s = (struct blizzard_s *) qemu_mallocz(sizeof(*s));
>  
> -    s->state = ds;
>      s->fb = qemu_malloc(0x180000);
>  
>      switch (ds_get_bits_per_pixel(s->state)) {

What is this switch going to do after the line removal few lines above?
A quick fix in the end of this message...

> @@ -993,9 +991,9 @@
>  
>      blizzard_reset(s);
>  
> -    s->console = graphic_console_init(s->state, blizzard_update_display,
> -                                      blizzard_invalidate_display,
> -                                      blizzard_screen_dump, NULL, s);
> +    s->state = graphic_console_init(blizzard_update_display,
> +                                 blizzard_invalidate_display,
> +                                 blizzard_screen_dump, NULL, s);
>  
>      return s;
>  }


From 532ae1dc0dc37ea1e19877ebe3a0ec0dd83c3e05 Mon Sep 17 00:00:00 2001
From: Riku Voipio <riku.voipio@iki.fi>
Date: Mon, 9 Feb 2009 13:08:12 +0200
Subject: [PATCH] Fix displaystate (r6344) regression in blizzard

Testcase:

qemu-system-arm -M n810 -kernel /dev/null -m 130

Without this patch, we get a segfault.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 hw/blizzard.c |    8 ++++----
 hw/nseries.c  |    3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/hw/blizzard.c b/hw/blizzard.c
index 83f13bc..0f68016 100644
--- a/hw/blizzard.c
+++ b/hw/blizzard.c
@@ -959,6 +959,10 @@ void *s1d13745_init(qemu_irq gpio_int)
 
     s->fb = qemu_malloc(0x180000);
 
+    s->state = graphic_console_init(blizzard_update_display,
+                                 blizzard_invalidate_display,
+                                 blizzard_screen_dump, NULL, s);
+
     switch (ds_get_bits_per_pixel(s->state)) {
     case 0:
         s->line_fn_tab[0] = s->line_fn_tab[1] =
@@ -991,9 +995,5 @@ void *s1d13745_init(qemu_irq gpio_int)
 
     blizzard_reset(s);
 
-    s->state = graphic_console_init(blizzard_update_display,
-                                 blizzard_invalidate_display,
-                                 blizzard_screen_dump, NULL, s);
-
     return s;
 }
diff --git a/hw/nseries.c b/hw/nseries.c
index b4f2951..32aaead 100644
--- a/hw/nseries.c
+++ b/hw/nseries.c
@@ -1273,7 +1273,7 @@ static void n8x0_init(ram_addr_t ram_size, const char *boot_device,
     struct n800_s *s = (struct n800_s *) qemu_mallocz(sizeof(*s));
     int sdram_size = binfo->ram_size;
     int onenandram_size = 0x00010000;
-    DisplayState *ds = get_displaystate();
+    DisplayState *ds;
 
     if (ram_size < sdram_size + onenandram_size + OMAP242X_SRAM_SIZE) {
         fprintf(stderr, "This architecture uses %i bytes of memory\n",
@@ -1361,6 +1361,7 @@ static void n8x0_init(ram_addr_t ram_size, const char *boot_device,
     /* FIXME: We shouldn't really be doing this here.  The LCD controller
        will set the size once configured, so this just sets an initial
        size until the guest activates the display.  */
+    ds = get_displaystate();
     ds->surface = qemu_resize_displaysurface(ds->surface, 800, 480, 32, 4 * 800);
     dpy_resize(ds);
 }
-- 
1.5.6.3


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2009-02-09 11:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16 19:04 [Qemu-devel] [6344] graphical_console_init change (Stefano Stabellini) Anthony Liguori
2009-01-18 12:54 ` Shin-ichiro KAWASAKI
2009-01-18 14:37   ` Aurelien Jarno
2009-01-18 14:48   ` [PATCH] Adds null check for DisplayStatus (wasRe: " Shin-ichiro KAWASAKI
2009-01-19 11:39     ` Stefano Stabellini
2009-01-19 15:26       ` Shin-ichiro KAWASAKI
2009-01-19 15:31         ` Stefano Stabellini
2009-01-19 16:08           ` Anthony Liguori
2009-01-19 16:19             ` Stefano Stabellini
2009-01-19 19:07               ` Anthony Liguori
2009-01-20 10:53                 ` [Qemu-devel] [PATCH] Adds null check for DisplayStatus Stefano Stabellini
2009-01-20 15:56                   ` Gerd Hoffmann
2009-01-20 16:36                     ` Stefano Stabellini
2009-01-21 11:06                   ` [Qemu-devel] " Stefano Stabellini
2009-01-21 18:59                   ` [Qemu-devel] " Anthony Liguori
2009-01-19 16:34       ` [PATCH] Adds null check for DisplayStatus (wasRe: [Qemu-devel] [6344] graphical_console_init change (Stefano Stabellini) Anthony Liguori
2009-02-09 11:38 ` Riku Voipio [this message]
2009-02-09 11:52   ` Stefano Stabellini
2009-02-09 17:00   ` Aurelien Jarno

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=20090209113853.GA11874@kos.to \
    --to=riku.voipio@iki.fi \
    --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 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.