From: Avi Kivity <avi@redhat.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Michael Tokarev <mjt@tls.msk.ru>, KVM list <kvm@vger.kernel.org>,
qemu-devel <qemu-devel@nongnu.org>,
Brian Kress <kressb@moose.net>
Subject: Re: Another SIGFPE in display code, now in cirrus
Date: Wed, 12 May 2010 19:07:14 +0300 [thread overview]
Message-ID: <4BEAD232.2040700@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1005121537370.11380@kaball-desktop>
On 05/12/2010 06:57 PM, Stefano Stabellini wrote:
> On Wed, 12 May 2010, Avi Kivity wrote:
>
>>> I suggest to start using the display pitch (with the proper sign)
>>> instead of cirrus_blt_srcpitch in cirrus_do_copy at least when
>>> cirrus_blt_srcpitch doesn't have a proper value.
>>>
>>>
>> Why switch from one bug to the other?
>>
>> It's perfectly possible to take into account both values. Of course
>> when abs(blt_pitch) != display pitch we can't use console_copy, but so what.
>>
>>
> I see: you want to support the case when abs(src_blt_pitch) != display_pitch,
> while I though it is some sort of error.
>
When blting withinh the screen, it is an error from the point of view of
writing a sane driver. My guess is that it's a bug in the NT driver.
It's not an error from the point of view of the hardware, or when blting
offscreen bitmaps (which can have different geomeries than the display).
> Considering that src_blt_pitch can even be 0 (as in the bug report), we
> would still need to calculate sx and sy using display_pitch instead, so
> the only place in which it would make a difference is when src_blt_pitch
> is passed as an argument to cirrus_rop.
>
cirrus_rop() and its arguments don't need to change. They're correctly
using the blt pitch.
My point is: x[xy] and d[xy] are only valid if both source and
destination overlap the display, and if both src_pitch and dst_pitch are
absequal to the display pitch. When they aren't valid, there's no point
in calculating them or using them in anything. The raster operation is
still valid though.
> I guess even a src blt pitch of 0 could be useful there, however in
> practice I think the only rop function that was written with this case in
> mind has:
>
> dstpitch -= bltwidth;
> srcpitch -= bltwidth;
>
> if (dstpitch< 0 || srcpitch< 0) {
> /* is 0 valid? srcpitch == 0 could be useful */
> return;
> }
>
> at the beginning and the others probably just don't deal with the case
> with possibly buggy consequences.
> Also the documentation I have states:
>
> 3CEh index 26h W(R/W): BLT Source Pitch (5426 +)
> bit 0-11 (5426-28) Number of bytes in a scanline at the source.
> 0-12 (5429 +) do
>
> if the source BLT is supposed to be the number of bytes in a scanline at
> the source, then 0 is not a correct value for it.
>
It's useful if you have a one-line horizontal pattern you want to
propagate all over.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@redhat.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Brian Kress <kressb@moose.net>, Michael Tokarev <mjt@tls.msk.ru>,
qemu-devel <qemu-devel@nongnu.org>,
KVM list <kvm@vger.kernel.org>
Subject: [Qemu-devel] Re: Another SIGFPE in display code, now in cirrus
Date: Wed, 12 May 2010 19:07:14 +0300 [thread overview]
Message-ID: <4BEAD232.2040700@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1005121537370.11380@kaball-desktop>
On 05/12/2010 06:57 PM, Stefano Stabellini wrote:
> On Wed, 12 May 2010, Avi Kivity wrote:
>
>>> I suggest to start using the display pitch (with the proper sign)
>>> instead of cirrus_blt_srcpitch in cirrus_do_copy at least when
>>> cirrus_blt_srcpitch doesn't have a proper value.
>>>
>>>
>> Why switch from one bug to the other?
>>
>> It's perfectly possible to take into account both values. Of course
>> when abs(blt_pitch) != display pitch we can't use console_copy, but so what.
>>
>>
> I see: you want to support the case when abs(src_blt_pitch) != display_pitch,
> while I though it is some sort of error.
>
When blting withinh the screen, it is an error from the point of view of
writing a sane driver. My guess is that it's a bug in the NT driver.
It's not an error from the point of view of the hardware, or when blting
offscreen bitmaps (which can have different geomeries than the display).
> Considering that src_blt_pitch can even be 0 (as in the bug report), we
> would still need to calculate sx and sy using display_pitch instead, so
> the only place in which it would make a difference is when src_blt_pitch
> is passed as an argument to cirrus_rop.
>
cirrus_rop() and its arguments don't need to change. They're correctly
using the blt pitch.
My point is: x[xy] and d[xy] are only valid if both source and
destination overlap the display, and if both src_pitch and dst_pitch are
absequal to the display pitch. When they aren't valid, there's no point
in calculating them or using them in anything. The raster operation is
still valid though.
> I guess even a src blt pitch of 0 could be useful there, however in
> practice I think the only rop function that was written with this case in
> mind has:
>
> dstpitch -= bltwidth;
> srcpitch -= bltwidth;
>
> if (dstpitch< 0 || srcpitch< 0) {
> /* is 0 valid? srcpitch == 0 could be useful */
> return;
> }
>
> at the beginning and the others probably just don't deal with the case
> with possibly buggy consequences.
> Also the documentation I have states:
>
> 3CEh index 26h W(R/W): BLT Source Pitch (5426 +)
> bit 0-11 (5426-28) Number of bytes in a scanline at the source.
> 0-12 (5429 +) do
>
> if the source BLT is supposed to be the number of bytes in a scanline at
> the source, then 0 is not a correct value for it.
>
It's useful if you have a one-line horizontal pattern you want to
propagate all over.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
next prev parent reply other threads:[~2010-05-12 16:07 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-06 20:07 Another SIGFPE in display code, now in cirrus Michael Tokarev
2010-05-07 7:54 ` Michael Tokarev
2010-05-10 7:41 ` Avi Kivity
2010-05-10 7:41 ` [Qemu-devel] " Avi Kivity
2010-05-10 8:15 ` Avi Kivity
2010-05-10 8:15 ` [Qemu-devel] " Avi Kivity
2010-05-12 12:20 ` Stefano Stabellini
2010-05-12 12:20 ` [Qemu-devel] " Stefano Stabellini
2010-05-12 12:36 ` Avi Kivity
2010-05-12 12:36 ` [Qemu-devel] " Avi Kivity
2010-05-12 13:45 ` Stefano Stabellini
2010-05-12 13:45 ` [Qemu-devel] " Stefano Stabellini
2010-05-12 14:27 ` Avi Kivity
2010-05-12 14:27 ` [Qemu-devel] " Avi Kivity
2010-05-12 15:57 ` Stefano Stabellini
2010-05-12 15:57 ` [Qemu-devel] " Stefano Stabellini
2010-05-12 16:07 ` Avi Kivity [this message]
2010-05-12 16:07 ` Avi Kivity
2010-05-12 16:55 ` Stefano Stabellini
2010-05-12 16:55 ` [Qemu-devel] " Stefano Stabellini
2010-05-12 16:57 ` Avi Kivity
2010-05-12 16:57 ` [Qemu-devel] " Avi Kivity
2010-05-12 17:07 ` Jamie Lokier
2010-05-12 17:07 ` Jamie Lokier
2010-05-12 18:11 ` Stefano Stabellini
2010-05-12 18:11 ` Stefano Stabellini
2010-05-12 19:12 ` Michael Tokarev
2010-05-12 19:12 ` Michael Tokarev
2010-05-13 6:49 ` Avi Kivity
2010-05-13 6:49 ` Avi Kivity
2010-05-13 13:48 ` Stefano Stabellini
2010-05-13 13:48 ` Stefano Stabellini
2010-05-13 14:13 ` Michael Tokarev
2010-05-13 14:13 ` Michael Tokarev
2010-05-13 18:03 ` Stefano Stabellini
2010-05-13 18:03 ` Stefano Stabellini
2010-05-13 16:04 ` Jamie Lokier
2010-05-13 16:04 ` Jamie Lokier
2010-05-28 20:51 ` Michael Tokarev
2010-05-28 20:51 ` Michael Tokarev
2010-05-30 8:24 ` Avi Kivity
2010-05-30 8:24 ` Avi Kivity
2010-05-13 7:36 ` Paolo Bonzini
2010-05-13 7:36 ` [Qemu-devel] " Paolo Bonzini
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=4BEAD232.2040700@redhat.com \
--to=avi@redhat.com \
--cc=kressb@moose.net \
--cc=kvm@vger.kernel.org \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@eu.citrix.com \
/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.