On Monday 01 Jul 2002 5:19 pm, Keith Whitwell scribed numinously:"
> > I'm running without PageFlipping, and don't see any SwapBuffers ioctls
> > in my debug output, so that rules that out.
> >
> > I got suspicious of the clear ioctl before and put a wait-for-idle
> > (full blown host-wait) call in after each clear. That didn't fix it
> > either, so I don't think it's the clear.
> >
> > It's always radeon_cp_cmdbuf, and it never, ever locks up when nrect <
> > 2, and usually nrect >=3 (I think I might have seen a lockup with nrect
> > == 2 but it's harder to provoke). emit_clip_rect() therefore seemed
> > like the safest place to put the wait. In the common case where
> > nrect==1 it gets called once only for the whole buffer, and most of the
> > time it should be a no-op.
>
> The other dumb thing we're doing here is using those registers for 3d
> cliprects *at all* -- the radeon has 3 (three!) dedicated 3d scissor
> rects that are intended for this task -- we should simply change the code
> to use them, fix the lockup & get a 3x speedup in clipping situations...

I found those defined in the DRM header file and in the SDK from ATI, but no 
documentation on them at all; the register reference is silent on them and 
lists no registers with their offsets.

Looking around there got me thinking, and attached is a *much* better fix 
for the problem than I previously posted; no waiting around for things to 
go idle at all. I've verified that this fixes all the lockups I've been 
able to provoke. This emits the type 3 SET_SCISSORS CCE command packet 
rather than two consecutive type 0 register-write command packets.
Given that this fixes it without a wait, I theorise that either it's more of 
a conflict over the host interface than over the 2D/3D engines, or the 
microengine knows something about the SET_SCISSORS command packet that it 
doesn't know about two consecutive register writes (which latter seems more 
likely, else why bother to provide the command?)



-- 
Tim Smith ([EMAIL PROTECTED])
"Reactions to his invention were immediate and far-reaching: the normally
phlegmatic British were aroused into a state of frenzied apathy...."
Index: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drv.h
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drv.h,v
retrieving revision 1.16
diff -u -3 -p -r1.16 radeon_drv.h
--- xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drv.h	18 Jun 2002 22:40:26 -0000	1.16
+++ xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drv.h	1 Jul 2002 19:07:40 -0000
@@ -477,6 +477,7 @@ extern int radeon_cp_flip( struct inode 
 #	define RADEON_CNTL_HOSTDATA_BLT		0x00009400
 #	define RADEON_CNTL_PAINT_MULTI		0x00009A00
 #	define RADEON_CNTL_BITBLT_MULTI		0x00009B00
+#       define RADEON_CCE_SET_SCISSORS          0xC0001E00
 
 #define RADEON_CP_PACKET_MASK		0xC0000000
 #define RADEON_CP_PACKET_COUNT_MASK	0x3fff0000
Index: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_state.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_state.c,v
retrieving revision 1.17
diff -u -3 -p -r1.17 radeon_state.c
--- xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_state.c	27 Jun 2002 17:56:39 -0000	1.17
+++ xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_state.c	1 Jul 2002 19:07:41 -0000
@@ -48,13 +48,11 @@ static inline void radeon_emit_clip_rect
 	DRM_DEBUG( "   box:  x1=%d y1=%d  x2=%d y2=%d\n",
 		   box->x1, box->y1, box->x2, box->y2 );
 
-	BEGIN_RING( 4 );
-	OUT_RING( CP_PACKET0( RADEON_RE_TOP_LEFT, 0 ) );
-	OUT_RING( (box->y1 << 16) | box->x1 );
-	OUT_RING( CP_PACKET0( RADEON_RE_WIDTH_HEIGHT, 0 ) );
-/*	OUT_RING( ((box->y2 - 1) << 16) | (box->x2 - 1) );*/
-	OUT_RING( (box->y2 << 16) | box->x2 );
-	ADVANCE_RING();
+        BEGIN_RING( 3 );
+        OUT_RING( CP_PACKET3( RADEON_CCE_SET_SCISSORS, 1 ));
+        OUT_RING( (box->y1 << 16) | box->x1 );
+        OUT_RING( (box->y2 << 16) | box->x2 );
+        ADVANCE_RING();
 }
 
 /* Emit 1.1 state

Reply via email to