From: Brian Kress <kressb@moose.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Fix hardware accelerated video to video copy on Cirrus VGA
Date: Sat, 14 Feb 2009 23:50:43 -0500 [thread overview]
Message-ID: <49979F23.6010500@moose.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 547 bytes --]
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.
[-- Attachment #2: patch.cirrus_vga --]
[-- Type: text/plain, Size: 716 bytes --]
Signed-off-by: Brian Kressb <kressb@moose.net
Index: hw/cirrus_vga.c
===================================================================
--- hw/cirrus_vga.c (revision 6619)
+++ hw/cirrus_vga.c (working copy)
@@ -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;
next reply other threads:[~2009-02-15 4:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-15 4:50 Brian Kress [this message]
2009-02-15 5:23 ` [Qemu-devel] [PATCH] Fix hardware accelerated video to video copy on Cirrus VGA C.W. Betts
2009-02-15 5:23 ` C.W. Betts
2009-02-16 14:59 ` Anthony Liguori
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=49979F23.6010500@moose.net \
--to=kressb@moose.net \
--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.