[Openchrome-users] XAA SolidFillRect problem with negative x value
Thomas Hellström
thomas
Thu Feb 15 14:01:06 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?
>
>
No, but xaa given the flags Unichrome hands it assumes that the driver
can cope with
negative X values.
>
>
>>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.
>
>
But I was primarily referring to the x values in the solid and copy helpers.
This line, for example
OUT_RING_H1(VIA_REG_DSTPOS, (y << 16) | x);
will not work with negative x-es as they will clobber the y bits.
/Thomas
>Benno
>
>
>------------------------------------------------------------------------
>
>diff -ur open-svn/unichrome/via_accel.c open-new/unichrome/via_accel.c
>--- open-svn/unichrome/via_accel.c 2007-02-10 16:13:24.000000000 +0100
>+++ open-new/unichrome/via_accel.c 2007-02-15 22:35:55.000000000 +0100
>@@ -388,10 +388,14 @@
> VIAPtr pVia = VIAPTR(pScrn);
> ViaTwodContext *tdc = &pVia->td;
>
>+ if ((x1 < 0) || (y1 < 0) || (x2 < 0) || (y2 < 0))
>+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Please report: Negative "
>+ "clipping: (x1=%i,y1=%i) (x2=%i,y2=%i)", x1, y1, x2, y2);
>+
> tdc->clipping = TRUE;
>- tdc->clipX1 = x1;
>+ tdc->clipX1 = x1 & 0xFFFF;
> tdc->clipY1 = y1;
>- tdc->clipX2 = x2;
>+ tdc->clipX2 = x2 & 0xFFFF;
> tdc->clipY2 = y2;
> }
>
>@@ -619,6 +623,10 @@
>
> RING_VARS;
>
>+ if ((x < 0) || (y < 0) || (w < 0) || (h < 0))
>+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Please report: Negative "
>+ "rectangle: (x=%i,y=%i) w=%i, h=%i)", x, y, w, h);
>+
> if (!w || !h)
> return;
>
>
>
More information about the Openchrome-users
mailing list