On Mon, 2005-04-04 at 22:44 +0200, Claudio Ciccani wrote:
> I have committed a new driver for Radeon R200 based chipsets.

Here's a patch that adds support for FBIO_WAITFORVSYNC to the
crtc1WaitVSync() method.

-- 
Torgeir Veimo <[EMAIL PROTECTED]>
Index: gfxdrivers/r200/r200_crtc1.c
===================================================================
RCS file: /cvs/directfb/DirectFB/gfxdrivers/r200/r200_crtc1.c,v
retrieving revision 1.2
diff -u -r1.2 r200_crtc1.c
--- gfxdrivers/r200/r200_crtc1.c	7 Apr 2005 13:10:45 -0000	1.2
+++ gfxdrivers/r200/r200_crtc1.c	24 Apr 2005 19:11:21 -0000
@@ -45,6 +45,10 @@
 
 #include <fbdev/fbdev.h>
 
+#ifndef FBIO_WAITFORVSYNC
+#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
+#endif
+
 #include <misc/conf.h>
 
 #include "r200.h"
@@ -116,20 +120,30 @@
      R200DriverData *rdrv = (R200DriverData*) driver_data;
      volatile __u8  *mmio = rdrv->mmio_base; 
      int             i;
+     static const int zero = 0;
      
      if (dfb_config->pollvsync_none)
           return DFB_OK;
+
+#ifdef FBIO_WAITFORVSYNC
+     FBDev *dfb_fbdev = dfb_system_data();
+     if ( ioctl( dfb_fbdev->fd, FBIO_WAITFORVSYNC, &zero ) ) {
+#endif
+          /* fallback method if ioctl fails */
+
           
-     r200_out32( mmio, GEN_INT_STATUS, VSYNC_INT_AK );
+          r200_out32( mmio, GEN_INT_STATUS, VSYNC_INT_AK );
      
-     for (i = 0; i < 2000000; i++) {
-          struct timespec t = { 0, 0 };     
+          for (i = 0; i < 2000000; i++) {
+               struct timespec t = { 0, 0 };     
           
-          if (r200_in32( mmio, GEN_INT_STATUS ) & VSYNC_INT)
-               break;
-          nanosleep( &t, NULL );
+               if (r200_in32( mmio, GEN_INT_STATUS ) & VSYNC_INT)
+                    break;
+               nanosleep( &t, NULL );
+          }
+#ifdef FBIO_WAITFORVSYNC
      }
-
+#endif
      return DFB_OK;
 }
 
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to