qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] cirrusfb: proper "Attribute Controller Toggle Readback" register behaviour
@ 2008-05-07 22:49 Marcelo Tosatti
  2008-05-08 11:09 ` [Qemu-devel] " Alan Pevec
  0 siblings, 1 reply; 2+ messages in thread
From: Marcelo Tosatti @ 2008-05-07 22:49 UTC (permalink / raw)
  To: Alan Pevec, Anthony Liguori; +Cc: qemu-devel


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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Qemu-devel] Re: cirrusfb: proper "Attribute Controller Toggle Readback" register behaviour
  2008-05-07 22:49 [Qemu-devel] cirrusfb: proper "Attribute Controller Toggle Readback" register behaviour Marcelo Tosatti
@ 2008-05-08 11:09 ` Alan Pevec
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Pevec @ 2008-05-08 11:09 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Anthony Liguori, qemu-devel

Thanks Marcelo,
here is the koji scratch build of F9 kvm RPM with your patch included:
http://koji.fedoraproject.org/koji/taskinfo?taskID=600393

This fixes vnc console blanking after cirrusfb kmod is loaded.
But we still have already reported edge-case:
after cirrusfb is loaded, vbetool post or vbetool vgamode produces:

Program received signal SIGFPE, Arithmetic exception.

[Switching to Thread 0x964a3b90 (LWP 3608)]

0x080987e4 in cirrus_bitblt_start (s=0xa7811e4)

    at /usr/src/debug/kvm-65/qemu/hw/cirrus_vga.c:715

715	    sx = (src % (width * depth)) / depth;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-08 11:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-07 22:49 [Qemu-devel] cirrusfb: proper "Attribute Controller Toggle Readback" register behaviour Marcelo Tosatti
2008-05-08 11:09 ` [Qemu-devel] " Alan Pevec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).