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

Mark Huijgen mark.sf.net
Wed Feb 14 05:21:54 PST 2007


Benno Schulenberg wrote:
> Mark Huijgen wrote:
>> Then I looked at the code in viaInitXAA(ScreenPtr pScreen) and
>> disabled this part (commented out)
>> xaaptr->SetClippingRectangle = viaSetClippingRectangle;
>> xaaptr->DisableClipping = viaDisableClipping;
>> xaaptr->ClippingFlags
> 
> Then it would be interesting to know with what values 
> viaSetClippingRectangle is called when the glitch occurs.

(EE) VIA(0): viaSetClippingRectangle (0,22) (1023x41)
(EE) VIA(0): viaDisableClipping
(EE) VIA(0): viaSetClippingRectangle (0,22) (1023x41)


with (0,22) being x1,y1 and (1023,41) being x2,y2, looks good I think?
All requests should be clipped within this box.

Now in case of the via driver the following fills are emitted that cause 
the glitch:
(EE) VIA(0): VIASubsequentSolidFillRect x-2 y18 w19 h1
(EE) VIA(0): VIASubsequentSolidFillRect x-2 y19 w19 h1
(EE) VIA(0): VIASubsequentSolidFillRect x-2 y20 w19 h1
(EE) VIA(0): VIASubsequentSolidFillRect x-2 y21 w19 h1
(EE) VIA(0): VIASubsequentSolidFillRect x-2 y22 w19 h1
.......And so on till y=42:
(EE) VIA(0): VIASubsequentSolidFillRect x-2 y42 w19 h1
(EE) VIA(0): viaDisableClipping

In case of the intel driver (without a hardware SetClippingRectangle 
function (so XAA will do software clipping?)) the following fills are 
emitted to draw the same box that glitches on the via driver:
(WW) I810(0): I830SubsequentFillRectSolid 0,22 17x1
(WW) I810(0): I830SubsequentFillRectSolid 0,23 17x1
.......And so on till y=41:
(WW) I810(0): I830SubsequentFillRectSolid 0,41 17x1

In case of the via driver the first 4 fills will be clipped entirely 
(fall out of the y range) by the hardware clipping. I think in case of 
the intel driver this is done by software XAA, since the Fills arent 
emitted at all. Same goes with the last fill y=42, also out of y range, 
on intel fill for y=42 isn't emitted at all.

But now for x coordinates, it seems that for intel the software XAA 
clipping will clip x values too. The via clipping function only works on 
y's and does not clip in the x range.

Isn't the driver also supposed to clip x also when it supports
xaaptr->SetClippingRectangle function? Cant check with the intel driver, 
because they don't provide the XAA hardware cliping functions.
Taken from the XAA.HOWTO in the xorg source tree:
------------------------
2.9 Clipping
XAA supports hardware clipping rectangles.  To use clipping
in this way it is expected that the graphics accelerator can
clip primitives with verticies anywhere in the 16 bit signed
coordinate system.

void SetClippingRectangle ( ScrnInfoPtr pScrn,
                 int left, int top, int right, int bottom)

void DisableClipping (ScrnInfoPtr pScrn)

     When SetClippingRectangle is called, all hardware rendering
     following it should be clipped to the rectangle specified
     until DisableClipping is called.

     The ClippingFlags field indicates which operations this sort
     of Set/Disable pairing can be used with.  Any of the following
     flags may be OR'd together.

     HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND
     HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY
     HARDWARE_CLIP_MONO_8x8_FILL
     HARDWARE_CLIP_COLOR_8x8_FILL
     HARDWARE_CLIP_SOLID_FILL
     HARDWARE_CLIP_DASHED_LINE
     HARDWARE_CLIP_SOLID_LINE

------------------------

So either this documentation is incomplete/incorrect or the clipping 
function in the via driver should also support clipping x values.

> 
> 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?
> 
>> Anyway I dont know what the via chip does and what it does not
>> support in hardware, but it seems negative x's for solid fill
>> isnt one of the things it supports.
> 
> Nor does, probably, the intel chip.  When in the intel driver you 
> artificially create a negative x value in SubsequentSolidFillRect, 
> does it glitch too?  Or does it get properly clipped?

To test this I added the following code at the start of the i830 solid 
fill function:
if(x==0){
     x=-2;
     w+=2;
}
But no glitches occur anywhere. There doesnt seem to be a clipping 
function present in the code for I830SubsequentSolidFillRect. They only 
throw commands in their ringbuffer. But who knows what the intel chip 
will do with negative values, maybe it does automatically clip to the 
screen resolution?

Mark




More information about the Openchrome-users mailing list