From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JzAjL-0003Ra-7K for qemu-devel@nongnu.org; Thu, 22 May 2008 09:21:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JzAjJ-0003Ql-Cu for qemu-devel@nongnu.org; Thu, 22 May 2008 09:21:14 -0400 Received: from [199.232.76.173] (port=43275 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JzAjJ-0003Qd-6Y for qemu-devel@nongnu.org; Thu, 22 May 2008 09:21:13 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:57532) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JzAjI-0002ey-MC for qemu-devel@nongnu.org; Thu, 22 May 2008 09:21:13 -0400 Received: from smtp06.web.de (fmsmtp06.dlan.cinetic.de [172.20.5.172]) by fmmailgate02.web.de (Postfix) with ESMTP id 3E02EDDCD1E8 for ; Thu, 22 May 2008 15:21:12 +0200 (CEST) Received: from [88.64.5.207] (helo=[192.168.1.198]) by smtp06.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.109 #226) id 1JzAjI-0001lq-00 for qemu-devel@nongnu.org; Thu, 22 May 2008 15:21:12 +0200 Message-ID: <48357347.1000305@web.de> Date: Thu, 22 May 2008 15:21:11 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@web.de Subject: [Qemu-devel] [PATCH] MusicPal: Restore display size after invalidation Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Make sure that the MusicPal display is set to the correct size again after some other console may have used a different size. Signed-off-by: Jan Kiszka --- hw/musicpal.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) Index: b/hw/musicpal.c =================================================================== --- a/hw/musicpal.c +++ b/hw/musicpal.c @@ -759,6 +759,7 @@ typedef struct musicpal_lcd_state { int page_off; DisplayState *ds; uint8_t video_ram[128*64/8]; + int resize; } musicpal_lcd_state; static uint32_t lcd_brightness; @@ -817,6 +818,11 @@ static void lcd_refresh(void *opaque) musicpal_lcd_state *s = opaque; int x, y, col; + if (s->resize) { + dpy_resize(s->ds, 128*3, 64*3); + s->resize = 0; + } + switch (s->ds->depth) { case 0: return; @@ -843,6 +849,13 @@ static void lcd_refresh(void *opaque) dpy_update(s->ds, 0, 0, 128*3, 64*3); } +static void lcd_invalidate(void *opaque) +{ + musicpal_lcd_state *s = opaque; + + s->resize = 1; +} + static uint32_t musicpal_lcd_read(void *opaque, target_phys_addr_t offset) { musicpal_lcd_state *s = opaque; @@ -919,12 +932,12 @@ static void musicpal_lcd_init(DisplaySta return; s->base = base; s->ds = ds; + s->resize = 1; iomemtype = cpu_register_io_memory(0, musicpal_lcd_readfn, musicpal_lcd_writefn, s); cpu_register_physical_memory(base, MP_LCD_SIZE, iomemtype); - graphic_console_init(ds, lcd_refresh, NULL, NULL, NULL, s); - dpy_resize(ds, 128*3, 64*3); + graphic_console_init(ds, lcd_refresh, lcd_invalidate, NULL, NULL, s); } /* PIC register offsets */