From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38554 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIdoj-0007FX-28 for qemu-devel@nongnu.org; Sun, 30 May 2010 04:24:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OIdoh-0000cX-MZ for qemu-devel@nongnu.org; Sun, 30 May 2010 04:24:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31810) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIdoh-0000cJ-G8 for qemu-devel@nongnu.org; Sun, 30 May 2010 04:24:19 -0400 Message-ID: <4C0220A6.4050803@redhat.com> Date: Sun, 30 May 2010 11:24:06 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: Another SIGFPE in display code, now in cirrus References: <4BE32178.2090103@msgid.tls.msk.ru> <4BE7B8C1.9060807@redhat.com> <4BE7C0A5.3090909@redhat.com> <4BEAA0CC.4090906@redhat.com> <4BEABABC.6080305@redhat.com> <4BEAD232.2040700@redhat.com> <20100512170702.GE19314@shareable.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: Brian Kress , Michael Tokarev , qemu-devel , KVM list On 05/12/2010 09:11 PM, Stefano Stabellini wrote: > On Wed, 12 May 2010, Jamie Lokier wrote: > >> Stefano Stabellini wrote: >> >>> On Wed, 12 May 2010, Avi Kivity wrote: >>> >>>> It's useful if you have a one-line horizontal pattern you want to >>>> propagate all over. >>>> >>> >>> It might be useful all right, but it is not entirely clear what the >>> hardware should do in this situation from the documentation we have, and >>> certainly the current state of the cirrus emulation code doesn't help. >>> >> It's quite a reasonable thing for hardware to do, even if not documented. >> It would be surprising if the hardware didn't copy the one-line pattern. >> > > All right then, you convinced me :) > > This is my proposed solution, however it is untested with Windows NT. > > > Signed-off-by: Stefano Stabellini > > --- > > > > diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c > index 9f61a01..a7f0d3c 100644 > --- a/hw/cirrus_vga.c > +++ b/hw/cirrus_vga.c > @@ -676,15 +676,17 @@ static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h) > int sx, sy; > int dx, dy; > int width, height; > + uint32_t start_addr, line_offset, line_compare; > int depth; > int notify = 0; > > depth = s->vga.get_bpp(&s->vga) / 8; > s->vga.get_resolution(&s->vga,&width,&height); > + s->vga.get_offsets(&s->vga,&line_offset,&start_addr,&line_compare); > > /* extra x, y */ > - sx = (src % ABS(s->cirrus_blt_srcpitch)) / depth; > - sy = (src / ABS(s->cirrus_blt_srcpitch)); > + sx = (src % line_offset) / depth; > + sy = (src / line_offset); > dx = (dst % ABS(s->cirrus_blt_dstpitch)) / depth; > dy = (dst / ABS(s->cirrus_blt_dstpitch)); > dx/dy also need to be calculated according to line_offset. I think the rules are: if src_byte_range in screen and dst_byte_range in screen and srcpitch == dstpitch == line_offset: can use qemu_console_copy elif dst_byte_range overlaps screen: if dstpitch == line_offset: invalidate rectangle else: invalidate full screen -- error compiling committee.c: too many arguments to function