Commit 0921895137fc8c43f08cf1b2ddb6d6ae14438f12

Authored by aurel32
1 parent bd5ea513

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>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6577 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 6 additions and 5 deletions
hw/blizzard.c
... ... @@ -959,6 +959,10 @@ void *s1d13745_init(qemu_irq gpio_int)
959 959  
960 960 s->fb = qemu_malloc(0x180000);
961 961  
  962 + s->state = graphic_console_init(blizzard_update_display,
  963 + blizzard_invalidate_display,
  964 + blizzard_screen_dump, NULL, s);
  965 +
962 966 switch (ds_get_bits_per_pixel(s->state)) {
963 967 case 0:
964 968 s->line_fn_tab[0] = s->line_fn_tab[1] =
... ... @@ -991,9 +995,5 @@ void *s1d13745_init(qemu_irq gpio_int)
991 995  
992 996 blizzard_reset(s);
993 997  
994   - s->state = graphic_console_init(blizzard_update_display,
995   - blizzard_invalidate_display,
996   - blizzard_screen_dump, NULL, s);
997   -
998 998 return s;
999 999 }
... ...
hw/nseries.c
... ... @@ -1273,7 +1273,7 @@ static void n8x0_init(ram_addr_t ram_size, const char *boot_device,
1273 1273 struct n800_s *s = (struct n800_s *) qemu_mallocz(sizeof(*s));
1274 1274 int sdram_size = binfo->ram_size;
1275 1275 int onenandram_size = 0x00010000;
1276   - DisplayState *ds = get_displaystate();
  1276 + DisplayState *ds;
1277 1277  
1278 1278 if (ram_size < sdram_size + onenandram_size + OMAP242X_SRAM_SIZE) {
1279 1279 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,
1361 1361 /* FIXME: We shouldn't really be doing this here. The LCD controller
1362 1362 will set the size once configured, so this just sets an initial
1363 1363 size until the guest activates the display. */
  1364 + ds = get_displaystate();
1364 1365 ds->surface = qemu_resize_displaysurface(ds->surface, 800, 480, 32, 4 * 800);
1365 1366 dpy_resize(ds);
1366 1367 }
... ...