提交 d85d0d38 编写于 作者: A aliguori

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: NBrian Kress <kressb@moose.net>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6622 c046a42c-6fe2-441c-8c8c-71466251a162
上级 753b4053
...@@ -730,10 +730,10 @@ static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h) ...@@ -730,10 +730,10 @@ static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
s->get_resolution((VGAState *)s, &width, &height); s->get_resolution((VGAState *)s, &width, &height);
/* extra x, y */ /* extra x, y */
sx = (src % (width * depth)) / depth; sx = (src % ABS(s->cirrus_blt_srcpitch)) / depth;
sy = (src / (width * depth)); sy = (src / ABS(s->cirrus_blt_srcpitch));
dx = (dst % (width *depth)) / depth; dx = (dst % ABS(s->cirrus_blt_dstpitch)) / depth;
dy = (dst / (width * depth)); dy = (dst / ABS(s->cirrus_blt_dstpitch));
/* normalize width */ /* normalize width */
w /= depth; w /= depth;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册