[Openchrome-users] Driver hangs X after a few movies have been played

Barry Scott barry.scott
Mon May 22 06:44:48 PDT 2006


I used xine on XFree86 4.6.0 and the current  OpenChrome from SVN to play
a 8 second MPEG2 followed by 15seconds of video capture from TV card 
Composite.
After a couple of minutes. I also tried with a patch we developed for 
the old UniChrome
code from october 2005 and the driver still hangs X.

I'm using FC4 with lastest DRM from cvs.

The root cause of this problem used to be that the driver did not wait 
for the HQV hardware
to be HQV_IDLE before changing registers. That will put the CLE266 into 
a bad state
that you do not recover from.

Here is my patch against svn for reference.

Barry

Index: unichrome/via_swov.c
===================================================================
--- unichrome/via_swov.c        (revision 186)
+++ unichrome/via_swov.c        (working copy)
@@ -1162,6 +1162,42 @@
        DBG_DD(ErrorF("ViaSwovSurfaceDestroy: VideoStatus =0x%08lx\n",
                pVia->VideoStatus));

+#if 1
+        {
+#define ONELAN_LOOP_REPORT_INTERVAL 100000
+
+        /* wait till the HQV is idle */
+        DBG_DD(ErrorF("VIAVidDestroySurface : start : HQV_CONTROL read 
0x%8.8lx \n", VIDInD( HQV_CONTROL ) ));
+
+        if( VIDInD(HQV_CONTROL) & HQV_ENABLE )
+        {
+
+            int count = 0;
+            /* while not IDLE */
+            while( (VIDInD(HQV_CONTROL) & HQV_IDLE) == 0
+            /* or FLIP STATUS needs an ack */
+            || (VIDInD(HQV_CONTROL) & HQV_FLIP_STATUS) != 0 )
+            {
+                if( (VIDInD(HQV_CONTROL) & HQV_FLIP_STATUS) != 0 )
+                {
+                    DBG_DD(ErrorF("VIAVidDestroySurface : clear flip 
status : H QV_CONTROL read 0x%8.8lx count %d\n", VIDInD( HQV_CONTROL ), 
count ));
+                    VIDOutD(HQV_CONTROL, VIDInD(HQV_CONTROL));
+                }
+
+                if( (count % ONELAN_LOOP_REPORT_INTERVAL) == 
(ONELAN_LOOP_REPOR T_INTERVAL-1) )
+                {
+                    ErrorF("VIAVidDestroySurface : looping : 
HQV_CONTROL read 0 x%8.8lx count=%d\n", VIDInD( HQV_CONTROL ), count );
+                }
+                count++;
+            }
+            DBG_DD(ErrorF("VIAVidDestroySurface :  wait HQV_IDLE done : 
HQV_CON TROL read 0x%8.8lx count=%d\n", VIDInD( HQV_CONTROL ), count ));
+            DBG_DD(ErrorF("VIAVidDestroySurface :  disable : 
HQV_CONTROL write 0x%8.8lx\n", VIDInD( HQV_CONTROL )&~HQV_ENABLE ));
+            VIDOutD( HQV_CONTROL, VIDInD( HQV_CONTROL )&~HQV_ENABLE );
+            DBG_DD(ErrorF("VIAVidDestroySurface :  disable done : 
HQV_CONTROL r ead 0x%8.8lx\n", VIDInD( HQV_CONTROL ) ));
+        }
+        }
+#endif
+
        switch (pPriv->FourCC) {
        case FOURCC_YUY2:
        case FOURCC_RV16:




More information about the Openchrome-users mailing list