From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K2zPv-0005Ke-KO for qemu-devel@nongnu.org; Sun, 01 Jun 2008 22:04:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K2zPu-0005KC-Tb for qemu-devel@nongnu.org; Sun, 01 Jun 2008 22:04:59 -0400 Received: from [199.232.76.173] (port=37184 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2zPu-0005K9-Qf for qemu-devel@nongnu.org; Sun, 01 Jun 2008 22:04:58 -0400 Received: from savannah.gnu.org ([199.232.41.3]:58685 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K2zPu-0002Ph-E8 for qemu-devel@nongnu.org; Sun, 01 Jun 2008 22:04:58 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1K2zPt-0006Ia-MK for qemu-devel@nongnu.org; Mon, 02 Jun 2008 02:04:57 +0000 Received: from balrog by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1K2zPt-0006IP-FQ for qemu-devel@nongnu.org; Mon, 02 Jun 2008 02:04:57 +0000 MIME-Version: 1.0 Errors-To: balrog Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Andrzej Zaborowski Message-Id: Date: Mon, 02 Jun 2008 02:04:57 +0000 Subject: [Qemu-devel] [4646] MusicPal: Restore display size after invalidation (Jan Kiszka). 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 Revision: 4646 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4646 Author: balrog Date: 2008-06-02 02:04:56 +0000 (Mon, 02 Jun 2008) Log Message: ----------- MusicPal: Restore display size after invalidation (Jan Kiszka). 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 Modified Paths: -------------- trunk/hw/musicpal.c Modified: trunk/hw/musicpal.c =================================================================== --- trunk/hw/musicpal.c 2008-06-02 01:48:27 UTC (rev 4645) +++ trunk/hw/musicpal.c 2008-06-02 02:04:56 UTC (rev 4646) @@ -759,6 +759,7 @@ int page_off; DisplayState *ds; uint8_t video_ram[128*64/8]; + int invalidate; } musicpal_lcd_state; static uint32_t lcd_brightness; @@ -817,6 +818,11 @@ musicpal_lcd_state *s = opaque; int x, y, col; + if (s->invalidate && (s->ds->width != 128*3 || s->ds->height != 64*3)) { + dpy_resize(s->ds, 128*3, 64*3); + s->invalidate = 0; + } + switch (s->ds->depth) { case 0: return; @@ -843,6 +849,13 @@ dpy_update(s->ds, 0, 0, 128*3, 64*3); } +static void lcd_invalidate(void *opaque) +{ + musicpal_lcd_state *s = opaque; + + s->invalidate = 1; +} + static uint32_t musicpal_lcd_read(void *opaque, target_phys_addr_t offset) { musicpal_lcd_state *s = opaque; @@ -919,12 +932,12 @@ return; s->base = base; s->ds = ds; + s->invalidate = 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 */