qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [6622] Fix hardware accelerated video to video copy on Cirrus VGA ( Brian Kress)
@ 2009-02-16 14:59 Anthony Liguori
  0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2009-02-16 14:59 UTC (permalink / raw)
  To: qemu-devel

Revision: 6622
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6622
Author:   aliguori
Date:     2009-02-16 14:59:35 +0000 (Mon, 16 Feb 2009)

Log Message:
-----------
Fix hardware accelerated video to video copy on Cirrus VGA (Brian Kress)

cirrus_do_copy() in hw/cirrus_vga.c seems to make some incorrect assumptions
about video memory layout.  It tries to convert addresses to coordinates
assuming that one row of data is (width * depth) bytes long.  The correct way
seems to be to use the pitch fields in the CirrusVGAState structure instead.

Without this patch, I get lots of screen corruption when I try to drag a window
under X as it's passing the wrong coordinates to the display surface for the
copy.  With this patch I can drag a window with no screen corruption.

Signed-off-by: Brian Kress <kressb@moose.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Modified Paths:
--------------
    trunk/hw/cirrus_vga.c

Modified: trunk/hw/cirrus_vga.c
===================================================================
--- trunk/hw/cirrus_vga.c	2009-02-16 14:59:30 UTC (rev 6621)
+++ trunk/hw/cirrus_vga.c	2009-02-16 14:59:35 UTC (rev 6622)
@@ -730,10 +730,10 @@
     s->get_resolution((VGAState *)s, &width, &height);
 
     /* extra x, y */
-    sx = (src % (width * depth)) / depth;
-    sy = (src / (width * depth));
-    dx = (dst % (width *depth)) / depth;
-    dy = (dst / (width * depth));
+    sx = (src % ABS(s->cirrus_blt_srcpitch)) / depth;
+    sy = (src / ABS(s->cirrus_blt_srcpitch));
+    dx = (dst % ABS(s->cirrus_blt_dstpitch)) / depth;
+    dy = (dst / ABS(s->cirrus_blt_dstpitch));
 
     /* normalize width */
     w /= depth;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-16 14:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-16 14:59 [Qemu-devel] [6622] Fix hardware accelerated video to video copy on Cirrus VGA ( Brian Kress) Anthony Liguori

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).