On Sat, Jul 13, 2002 at 08:12:26PM -0400, Leif Delgass wrote:
> On Sat, 13 Jul 2002, Leif Delgass wrote:
> 
> > On Sun, 14 Jul 2002, José Fonseca wrote:
> > 
> > > But the fact remains that the reads from GUI_STAT aren't reliable. I
> > > wonder if the chip creats some transient values...
> > 
> > I wonder if always reading FIFO_STAT before GUI_STAT would make a
> > difference.  The register reference says that the GUI_ACTIVE bit in
> > GUI_STAT would be set if the FIFO is not empty, but all the sample code I
> > recall looking at waits for idle by reading FIFO_STAT to make sure the
> > last 16 slots are not filled, and _then_ reads GUI_STAT.  It always seemed
> > like overkill, but maybe reading FIFO_STAT somehow updates GUI_STAT.
> 
> I looked at the idle function in the DDX, and it only reads FIFO_STAT for 
> chips earlier than the VTB.  It relies on the GUI_FIFO bits of GUI_STAT 
> for all Rage Pro chips and above, so it seems unlikely that reading 
> FIFO_STAT would make a difference.

Ok. Let's try the following then: call do_wait_for_idle when the engine
is given as idle on ring_tick. (This basically consists of checking
FIFO_STAT and then GUI_STAT again). 

If the chip generates transient "idles" during operation then this
should catch it (or at least it should be really unlikely to miss it). If 
the chip generates transient "busys" while in idle (which somehow seems more 
unlikely) then the error will happen again.

Felix, please try the patch attached. I'm also gonna see if I can
reproduce it (by the look of its webpages, TORCS seems a nice way to
spend sometime ;-). I'll also redo the other "extra safety check" that
was failing before on my system to see if it goes away too.

José Fonseca
Index: mach64_drv.h
===================================================================
RCS file: 
/cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Attic/mach64_drv.h,v
retrieving revision 1.1.6.3.2.26.2.3
diff -u -r1.1.6.3.2.26.2.3 mach64_drv.h
--- mach64_drv.h        10 Jul 2002 04:43:49 -0000      1.1.6.3.2.26.2.3
+++ mach64_drv.h        14 Jul 2002 18:47:07 -0000
@@ -523,6 +523,9 @@
                 */
                int gui_active = MACH64_READ(MACH64_GUI_STAT) & MACH64_GUI_ACTIVE;
                
+               if( !gui_active )
+                       mach64_do_wait_for_idle( dev_priv );
+               
                ring->head_addr = MACH64_READ(MACH64_BM_GUI_TABLE) & 0xfffffff0;
                
                if ( gui_active ) {

Reply via email to