From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNudG-0008DQ-KZ for qemu-devel@nongnu.org; Fri, 16 Jan 2009 14:45:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNudG-0008DE-0S for qemu-devel@nongnu.org; Fri, 16 Jan 2009 14:45:30 -0500 Received: from [199.232.76.173] (port=39550 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNudF-0008DB-QV for qemu-devel@nongnu.org; Fri, 16 Jan 2009 14:45:29 -0500 Received: from savannah.gnu.org ([199.232.41.3]:53489 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 1LNudF-0004XK-F8 for qemu-devel@nongnu.org; Fri, 16 Jan 2009 14:45:29 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LNudE-0004sj-QT for qemu-devel@nongnu.org; Fri, 16 Jan 2009 19:45:28 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LNudE-0004sf-K7 for qemu-devel@nongnu.org; Fri, 16 Jan 2009 19:45:28 +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: Fri, 16 Jan 2009 19:45:28 +0000 Subject: [Qemu-devel] [6349] Fix vga on PPC 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: 6349 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6349 Author: aurel32 Date: 2009-01-16 19:45:28 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Fix vga on PPC Fix crash introduced in revision 6336. (Stefano Stabellini) Revision Links: -------------- http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6336 Modified Paths: -------------- trunk/hw/vga.c Modified: trunk/hw/vga.c =================================================================== --- trunk/hw/vga.c 2009-01-16 19:45:19 UTC (rev 6348) +++ trunk/hw/vga.c 2009-01-16 19:45:28 UTC (rev 6349) @@ -1618,6 +1618,40 @@ s->double_scan = double_scan; } + depth = s->get_bpp(s); + if (s->line_offset != s->last_line_offset || + disp_width != s->last_width || + height != s->last_height || + s->last_depth != depth) { + if (depth == 16 || depth == 32) { + if (is_graphic_console()) { + qemu_free_displaysurface(s->ds->surface); + s->ds->surface = qemu_create_displaysurface_from(disp_width, height, depth, + s->line_offset, + s->vram_ptr + (s->start_addr * 4)); + dpy_resize(s->ds); + } else { + qemu_console_resize(s->ds, disp_width, height); + } + } else { + qemu_console_resize(s->ds, disp_width, height); + } + s->last_scr_width = disp_width; + s->last_scr_height = height; + s->last_width = disp_width; + s->last_height = height; + s->last_line_offset = s->line_offset; + s->last_depth = depth; + full_update = 1; + } else if (is_graphic_console() && is_buffer_shared(s->ds->surface) && + (full_update || s->ds->surface->data != s->vram_ptr + (s->start_addr * 4))) { + s->ds->surface->data = s->vram_ptr + (s->start_addr * 4); + dpy_setdata(s->ds); + } + + s->rgb_to_pixel = + rgb_to_pixel_dup_table[get_depth_index(s->ds)]; + if (shift_control == 0) { full_update |= update_palette16(s); if (s->sr[0x01] & 8) { @@ -1669,40 +1703,6 @@ } vga_draw_line = vga_draw_line_table[v * NB_DEPTHS + get_depth_index(s->ds)]; - depth = s->get_bpp(s); - if (s->line_offset != s->last_line_offset || - disp_width != s->last_width || - height != s->last_height || - s->last_depth != depth) { - if (depth == 16 || depth == 32) { - if (is_graphic_console()) { - qemu_free_displaysurface(s->ds->surface); - s->ds->surface = qemu_create_displaysurface_from(disp_width, height, depth, - s->line_offset, - s->vram_ptr + (s->start_addr * 4)); - dpy_resize(s->ds); - } else { - qemu_console_resize(s->ds, disp_width, height); - } - } else { - qemu_console_resize(s->ds, disp_width, height); - } - s->last_scr_width = disp_width; - s->last_scr_height = height; - s->last_width = disp_width; - s->last_height = height; - s->last_line_offset = s->line_offset; - s->last_depth = depth; - full_update = 1; - } else if (is_graphic_console() && is_buffer_shared(s->ds->surface) && - (full_update || s->ds->surface->data != s->vram_ptr + (s->start_addr * 4))) { - s->ds->surface->data = s->vram_ptr + (s->start_addr * 4); - dpy_setdata(s->ds); - } - - s->rgb_to_pixel = - rgb_to_pixel_dup_table[get_depth_index(s->ds)]; - if (!is_buffer_shared(s->ds->surface) && s->cursor_invalidate) s->cursor_invalidate(s);