From: aliguori <aliguori> 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 <kre...@moose.net> Signed-off-by: Anthony Liguori <aligu...@us.ibm.com> diff --git a/qemu/hw/cirrus_vga.c b/qemu/hw/cirrus_vga.c index 2666642..866954d 100644 --- a/qemu/hw/cirrus_vga.c +++ b/qemu/hw/cirrus_vga.c @@ -731,10 +731,10 @@ static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h) 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; -- To unsubscribe from this list: send the line "unsubscribe kvm-commits" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html