From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KUXKC-0005ne-5z for qemu-devel@nongnu.org; Sat, 16 Aug 2008 21:44:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KUXKB-0005nE-EP for qemu-devel@nongnu.org; Sat, 16 Aug 2008 21:44:55 -0400 Received: from [199.232.76.173] (port=60805 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KUXKB-0005nA-7A for qemu-devel@nongnu.org; Sat, 16 Aug 2008 21:44:55 -0400 Received: from savannah.gnu.org ([199.232.41.3]:46581 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 1KUXKB-0002HI-GD for qemu-devel@nongnu.org; Sat, 16 Aug 2008 21:44:55 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KUXKA-0005Jw-AI for qemu-devel@nongnu.org; Sun, 17 Aug 2008 01:44:54 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KUXKA-0005Jr-2q for qemu-devel@nongnu.org; Sun, 17 Aug 2008 01:44:54 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Sun, 17 Aug 2008 01:44:54 +0000 Subject: [Qemu-devel] [5016] Fix g364fb video emulation 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: 5016 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5016 Author: aurel32 Date: 2008-08-17 01:44:53 +0000 (Sun, 17 Aug 2008) Log Message: ----------- Fix g364fb video emulation (Herv?\195?\169 Poussineau) Modified Paths: -------------- trunk/hw/g364fb.c trunk/hw/g364fb_template.h Modified: trunk/hw/g364fb.c =================================================================== --- trunk/hw/g364fb.c 2008-08-17 01:44:40 UTC (rev 5015) +++ trunk/hw/g364fb.c 2008-08-17 01:44:53 UTC (rev 5016) @@ -36,7 +36,6 @@ QEMUConsole *console; int graphic_mode; uint32_t scr_width, scr_height; /* in pixels */ - uint32_t last_scr_width, last_scr_height; /* in pixels */ } G364State; /* @@ -73,9 +72,6 @@ static void g364fb_draw_graphic(G364State *s, int full_update) { - if (s->scr_width == 0 || s->scr_height == 0) - return; - switch (s->ds->depth) { case 8: g364fb_draw_graphic8(s, full_update); @@ -94,7 +90,7 @@ return; } - dpy_update(s->ds, 0, 0, s->last_scr_width, s->last_scr_height); + dpy_update(s->ds, 0, 0, s->scr_width, s->scr_height); } static void g364fb_draw_blank(G364State *s, int full_update) @@ -104,17 +100,15 @@ if (!full_update) return; - if (s->last_scr_width <= 0 || s->last_scr_height <= 0) - return; - w = s->last_scr_width * ((s->ds->depth + 7) >> 3); + w = s->scr_width * ((s->ds->depth + 7) >> 3); d = s->ds->data; - for(i = 0; i < s->last_scr_height; i++) { + for(i = 0; i < s->scr_height; i++) { memset(d, 0, w); d += s->ds->linesize; } - dpy_update(s->ds, 0, 0, - s->last_scr_width, s->last_scr_height); + + dpy_update(s->ds, 0, 0, s->scr_width, s->scr_height); } #define GMODE_GRAPH 0 @@ -125,6 +119,9 @@ G364State *s = opaque; int full_update, graphic_mode; + if (s->scr_width == 0 || s->scr_height == 0) + return; + if (s->ctla & CTLA_FORCE_BLANK) graphic_mode = GMODE_BLANK; else @@ -134,6 +131,10 @@ s->graphic_mode = graphic_mode; full_update = 1; } + if (s->scr_width != s->ds->width || s->scr_height != s->ds->height) { + qemu_console_resize(s->console, s->scr_width, s->scr_height); + full_update = 1; + } switch(graphic_mode) { case GMODE_GRAPH: g364fb_draw_graphic(s, full_update); @@ -158,7 +159,6 @@ memset(s->palette, 0, sizeof(s->palette)); s->scr_width = s->scr_height = 0; - s->last_scr_width = s->last_scr_height = 0; memset(s->vram_buffer, 0, s->vram_size); s->graphic_mode = -1; /* force full update */ } @@ -266,8 +266,6 @@ #endif break; } - if (s->scr_width && s->scr_height) - qemu_console_resize(s->console, s->scr_width, s->scr_height); } s->graphic_mode = -1; /* force full update */ } Modified: trunk/hw/g364fb_template.h =================================================================== --- trunk/hw/g364fb_template.h 2008-08-17 01:44:40 UTC (rev 5015) +++ trunk/hw/g364fb_template.h 2008-08-17 01:44:53 UTC (rev 5016) @@ -27,11 +27,11 @@ uint8_t *data_display, *dd; data_buffer = s->vram_buffer; - w_display = s->last_scr_width * PIXEL_WIDTH / 8; + w_display = s->scr_width * PIXEL_WIDTH / 8; data_display = s->ds->data; - for(i = 0; i < s->last_scr_height; i++) { + for(i = 0; i < s->scr_height; i++) { dd = data_display; - for (j = 0; j < s->last_scr_width; j++, dd += PIXEL_WIDTH / 8, data_buffer++) { + for (j = 0; j < s->scr_width; j++, dd += PIXEL_WIDTH / 8, data_buffer++) { uint8_t index = *data_buffer; *((glue(glue(uint, PIXEL_WIDTH), _t) *)dd) = glue(rgb_to_pixel, BPP)( s->palette[index][0],