Merge commit 'origin/master' into gallium-0.2
[mesa.git] / src / mesa / drivers / dri / common / dri_util.h
index 8e1cdfc893fd71c77fa2df92495fe8f41b082b05..0feb57b3c6e6ac6d40e070f909e04a917ca2d200 100644 (file)
@@ -1,25 +1,3 @@
-/* $XFree86: xc/lib/GL/dri/dri_util.h,v 1.1 2002/02/22 21:32:52 dawes Exp $ */
-/**
- * \file dri_util.h
- * DRI utility functions definitions.
- *
- * This module acts as glue between GLX and the actual hardware driver.  A DRI
- * driver doesn't really \e have to use any of this - it's optional.  But, some
- * useful stuff is done here that otherwise would have to be duplicated in most
- * drivers.
- * 
- * Basically, these utility functions take care of some of the dirty details of
- * screen initialization, context creation, context binding, DRM setup, etc.
- *
- * These functions are compiled into each DRI driver so libGL.so knows nothing
- * about them.
- *
- * \sa dri_util.c.
- * 
- * \author Kevin E. Martin <kevin@precisioninsight.com>
- * \author Brian Paul <brian@precisioninsight.com>
- */
-
 /*
  * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
  * All Rights Reserved.
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
+/**
+ * \file dri_util.h
+ * DRI utility functions definitions.
+ *
+ * This module acts as glue between GLX and the actual hardware driver.  A DRI
+ * driver doesn't really \e have to use any of this - it's optional.  But, some
+ * useful stuff is done here that otherwise would have to be duplicated in most
+ * drivers.
+ * 
+ * Basically, these utility functions take care of some of the dirty details of
+ * screen initialization, context creation, context binding, DRM setup, etc.
+ *
+ * These functions are compiled into each DRI driver so libGL.so knows nothing
+ * about them.
+ *
+ * \sa dri_util.c.
+ * 
+ * \author Kevin E. Martin <kevin@precisioninsight.com>
+ * \author Brian Paul <brian@precisioninsight.com>
+ */
 
 #ifndef _DRI_UTIL_H_
 #define _DRI_UTIL_H_
 #include <drm.h>
 #include <drm_sarea.h>
 #include <xf86drm.h>
-#include <xf86mm.h>
+#include "main/glheader.h"
 #include "GL/internal/glcore.h"
 #include "GL/internal/dri_interface.h"
-#include "GL/internal/dri_sarea.h"
 
 #define GLX_BAD_CONTEXT                    5
 
@@ -204,16 +201,8 @@ struct __DriverAPIRec {
 
 
 
-    /* DRI2 Entry points */
+    /* DRI2 Entry point */
     const __DRIconfig **(*InitScreen2) (__DRIscreen * priv);
-    void (*HandleDrawableConfig)(__DRIdrawable *dPriv,
-                               __DRIcontext *pcp,
-                               __DRIDrawableConfigEvent *event);
-
-    void (*HandleBufferAttach)(__DRIdrawable *dPriv,
-                              __DRIcontext *pcp,
-                              __DRIBufferAttachEvent *ba);
-
 };
 
 extern const struct __DriverAPIRec driDriverAPI;
@@ -223,7 +212,7 @@ struct __DRIswapInfoRec {
     /** 
      * Number of swapBuffers operations that have been *completed*. 
      */
-    u_int64_t swap_count;
+    uint64_t swap_count;
 
     /**
      * Unadjusted system time of the last buffer swap.  This is the time
@@ -237,7 +226,7 @@ struct __DRIswapInfoRec {
      * swap, it has missed its deadline.  If swap_interval is 0, then the
      * swap deadline is 1 frame after the previous swap.
      */
-    u_int64_t swap_missed_count;
+    uint64_t swap_missed_count;
 
     /**
      * Amount of time used by the last swap that missed its deadline.  This
@@ -369,10 +358,6 @@ struct __DRIdrawableRec {
      * GLX_MESA_swap_control.
      */
     unsigned int swap_interval;
-    struct {
-       unsigned int tail;
-       unsigned int drawable_id;
-    } dri2;
 };
 
 /**
@@ -524,11 +509,7 @@ struct __DRIscreenRec {
        /* Flag to indicate that this is a DRI2 screen.  Many of the above
         * fields will not be valid or initializaed in that case. */
        int enabled;
-       drmBO sareaBO;
-       void *sarea;
-       __DRIEventBuffer *buffer;
-       __DRILock *lock;
-       __DRIloaderExtension *loader;
+       __DRIdri2LoaderExtension *loader;
     } dri2;
 
     /* The lock actually in use, old sarea or DRI2 */
@@ -542,9 +523,6 @@ __driUtilMessage(const char *f, ...);
 extern void
 __driUtilUpdateDrawableInfo(__DRIdrawable *pdp);
 
-extern int
-__driParseEvents(__DRIcontext *psp, __DRIdrawable *pdp);
-
 extern float
 driCalculateSwapUsage( __DRIdrawable *dPriv,
                       int64_t last_swap_ust, int64_t current_ust );