regression introduced by cirrus_vga.c commit r6622?
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.
cirrus_vga.c +4 -4
@@ -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