From: Marcelo Tosatti <mtosatti@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] regression introduced by cirrus_vga.c commit r6622?
Date: Fri, 20 Feb 2009 12:23:06 -0300 [thread overview]
Message-ID: <20090220152306.GA4450@amt.cnet> (raw)
Installation of CentOS5 and FC8 crash with kvm-userspace, since commit
6622:
------------------------------------------------------------------------
r6622 | aliguori | 2009-02-16 11:59:35 -0300 (Mon, 16 Feb 2009) | 14
lines
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>
Index: hw/cirrus_vga.c
===================================================================
--- hw/cirrus_vga.c (revision 6621)
+++ hw/cirrus_vga.c (revision 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;
(gdb) bt
#0 0x0000000000435b99 in vga_draw_line24_32 (s1=<value optimized out>,
d=0x7f3d90d59000 "",
s=0x7f3db190baf7
"��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������"...,
width=<value optimized out>)
at
/root/git/kvm-autotest/client/tests/kvm_runtest/root/src/kvmuser/qemu/hw/vga_template.h:484
#1 0x0000000000439427 in vga_draw_graphic (full_update=0)
at
/root/git/kvm-autotest/client/tests/kvm_runtest/root/src/kvmuser/qemu/hw/vga.c:1760
#2 vga_update_display (opaque=<value optimized out>)
at
/root/git/kvm-autotest/client/tests/kvm_runtest/root/src/kvmuser/qemu/hw/vga.c:1856
#3 0x000000000045d5ba in cirrus_do_copy ()
at
/root/git/kvm-autotest/client/tests/kvm_runtest/root/src/kvmuser/qemu/hw/cirrus_vga.c:767
#4 cirrus_bitblt_videotovideo_copy ()
at
/root/git/kvm-autotest/client/tests/kvm_runtest/root/src/kvmuser/qemu/hw/cirrus_vga.c:796
#5 cirrus_bitblt_videotovideo ()
at
/root/git/kvm-autotest/client/tests/kvm_runtest/root/src/kvmuser/qemu/hw/cirrus_vga.c:918
#6 cirrus_bitblt_start (s=0x275b240)
at
/root/git/kvm-autotest/client/tests/kvm_runtest/root/src/kvmuser/qemu/hw/cirrus_vga.c:1059
#7 0x000000000045d7dd in cirrus_write_bitblt ()
at
/root/git/kvm-autotest/client/tests/kvm_runtest/root/src/kvmuser/qemu/hw/cirrus_vga.c:1080
#8 cirrus_hook_write_gr (s=0x275b240, reg_index=2429917328,
reg_value=227)
at
/root/git/kvm-autotest/client/tests/kvm_runtest/root/src/kvmuser/qemu/hw/cirrus_vga.c:1585
#9 0x000000000045f226 in cirrus_mmio_writel (opaque=0x7f3db190baf7,
addr=139902399647744, val=4294967042)
at
/root/git/kvm-autotest/client/tests/kvm_runtest/root/src/kvmuser/qemu/hw/cirrus_vga.c:3055
#10 0x00000000004bbdb9 in cpu_physical_memory_rw (addr=4060086592,
buf=0x7f3d90d56028 <Address 0x7f3d90d56028 out of bounds>, len=4,
is_write=1)
at
/root/git/kvm-autotest/client/tests/kvm_runtest/root/src/kvmuser/qemu/exec.c:2993
#11 0x0000000000519948 in kvm_mmio_write (opaque=<value optimized out>,
addr=139902948784887, data=0x7f3d90d59000 "", len=15591907)
at
/root/git/kvm-autotest/client/tests/kvm_runtest/root/src/kvmuser/qemu/qemu-kvm.c:708
#12 0x00000000005464da in handle_mmio (kvm=0x247d010,
kvm_run=0x7f3d90d56000)
at libkvm.c:822
reply other threads:[~2009-02-20 15:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20090220152306.GA4450@amt.cnet \
--to=mtosatti@redhat.com \
--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 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).