[Openchrome-users] FIX: Re: XAA SolidFillRect problem with negative x value

Mark Huijgen mark.sf.net
Fri Feb 16 00:52:02 PST 2007


Benno Schulenberg wrote:
> Thomas Hellstr?m wrote:
>> Benno Schulenberg wrote:
>>> If negative, then I'd think that it's at least also an
>>> application error, because, when fullscreen, how can it have a
>>> negative x?
>> It may also be a sign bug in the driver.
> 
> Hmm, I don't see how.  The negative x coordinates reported by Mark 
> are produced by OO Writer, aren't they?  The XAA routines are not 
> indirectly called by the driver itself, or are they?
Wether or not they are, the driver should do the cliping to the 
rectangle specified in viaSetClippingRectangle. If that accel function 
is disabled the clipping is done somewhere else and the glitch doesnt occur.

> 
>> I'm not sure whether the hardware can cope with negative x values
>> but if it can, they definitely need to be masked, since they only 
>> occupy 16 bits:
>>
>> x &= 0xFFFF;
> 
> Okay, see the proposed patch.  It also adds warnings when negative 
> clipping or rectangle values occur, as I'd like to know whether this 
> occurs more often or is entirely seldom.

The glitch is not fixed with this, the warnings only occured so far for 
the glitch I reported. Havent seen any other negative values.

But the idea for masking x made me look further into the code and into 
code of other drivers. In the matrox mga driver they also mask x in the 
clipping function, but also in another place: the SolidFill function. 
After applying this to the viaAccelSolidHelper function:

-    OUT_RING_H1(VIA_REG_DSTPOS, (y << 16) | x);
+    OUT_RING_H1(VIA_REG_DSTPOS, (y << 16) | (x & 0xFFFF));


The glitch is solved! Attached is a patch with both masks.
Since the other via driver from Luc has the same issue, should I report 
this to him too, or do you guys sync these kind of fixes?

Thanks for the help!
Mark Huijgen
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: negativexfix.patch
Url: http://wiki.openchrome.org/pipermail/openchrome-users/attachments/20070216/4b5dce0e/negativexfix.ksh



More information about the Openchrome-users mailing list