From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LZ4wb-0007bn-HL for qemu-devel@nongnu.org; Mon, 16 Feb 2009 09:59:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LZ4wa-0007bK-Uj for qemu-devel@nongnu.org; Mon, 16 Feb 2009 09:59:36 -0500 Received: from [199.232.76.173] (port=39319 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LZ4wa-0007bD-Fm for qemu-devel@nongnu.org; Mon, 16 Feb 2009 09:59:36 -0500 Received: from savannah.gnu.org ([199.232.41.3]:46477 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LZ4wa-00025O-51 for qemu-devel@nongnu.org; Mon, 16 Feb 2009 09:59:36 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LZ4wZ-0004fD-Iq for qemu-devel@nongnu.org; Mon, 16 Feb 2009 14:59:35 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LZ4wZ-0004f9-BO for qemu-devel@nongnu.org; Mon, 16 Feb 2009 14:59:35 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Mon, 16 Feb 2009 14:59:35 +0000 Subject: [Qemu-devel] [6622] Fix hardware accelerated video to video copy on Cirrus VGA ( Brian Kress) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Signed-off-by: Anthony Liguori 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;