All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Alan Pevec <apevec@redhat.com>, Anthony Liguori <aliguori@us.ibm.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] cirrusfb: proper "Attribute Controller Toggle Readback" register behaviour
Date: Wed, 7 May 2008 19:49:23 -0300	[thread overview]
Message-ID: <20080507224923.GA28197@dmt> (raw)


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 <mtosatti@redhat.com>


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];

             reply	other threads:[~2008-05-07 22:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-07 22:49 Marcelo Tosatti [this message]
2008-05-08 11:09 ` [Qemu-devel] Re: cirrusfb: proper "Attribute Controller Toggle Readback" register behaviour Alan Pevec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080507224923.GA28197@dmt \
    --to=mtosatti@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=apevec@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.