From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JtsOz-0004xI-86 for qemu-devel@nongnu.org; Wed, 07 May 2008 18:46:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JtsOx-0004wA-VO for qemu-devel@nongnu.org; Wed, 07 May 2008 18:46:20 -0400 Received: from [199.232.76.173] (port=38668 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JtsOx-0004vx-Hb for qemu-devel@nongnu.org; Wed, 07 May 2008 18:46:19 -0400 Received: from mx1.redhat.com ([66.187.233.31]:37932) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JtsOw-0001i0-UV for qemu-devel@nongnu.org; Wed, 07 May 2008 18:46:19 -0400 Date: Wed, 7 May 2008 19:49:23 -0300 From: Marcelo Tosatti Message-ID: <20080507224923.GA28197@dmt> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] cirrusfb: proper "Attribute Controller Toggle Readback" register behaviour Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alan Pevec , Anthony Liguori Cc: qemu-devel@nongnu.org The cirrusfb Linux driver uses the toggle readback register to determine whether to flip 0xC30 to data/address mode. Without proper implementation the VGA mode will be erroneously set to blank resulting in crashes when starting BITBLT. 3d4h index 24h (R): Attribute Controller Toggle Readback Register bit 7 If set the Attribute Controller will next access a data register, if clear it'll access the index register Signed-off-by: Marcelo Tosatti diff --git a/qemu/hw/cirrus_vga.c b/qemu/hw/cirrus_vga.c index e14ec35..5baac2f 100644 --- a/qemu/hw/cirrus_vga.c +++ b/qemu/hw/cirrus_vga.c @@ -1606,13 +1606,15 @@ cirrus_hook_read_cr(CirrusVGAState * s, unsigned reg_index, int *reg_value) case 0x17: // Standard VGA case 0x18: // Standard VGA return CIRRUS_HOOK_NOT_HANDLED; + case 0x24: // Attribute Controller Toggle Readback (R) + *reg_value = (s->ar_flip_flop << 7); + break; case 0x19: // Interlace End case 0x1a: // Miscellaneous Control case 0x1b: // Extended Display Control case 0x1c: // Sync Adjust and Genlock case 0x1d: // Overlay Extended Control case 0x22: // Graphics Data Latches Readback (R) - case 0x24: // Attribute Controller Toggle Readback (R) case 0x25: // Part Status case 0x27: // Part ID (R) *reg_value = s->cr[reg_index];