dri: Add DRI entrypoints to create a context for a given API
[mesa.git] / src / mesa / drivers / dri / r128 / r128_context.h
index 4574f298bf85b66860a6d3418187bea49485489f..65ddb3bd23bcff540afb4a68c966f1d0d43d02bb 100644 (file)
@@ -1,4 +1,3 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_context.h,v 1.12 2002/12/16 16:18:52 dawes Exp $ */
 /**************************************************************************
 
 Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
@@ -36,13 +35,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #ifndef __R128_CONTEXT_H__
 #define __R128_CONTEXT_H__
 
-#ifdef GLX_DIRECT_RENDERING
-
 #include "dri_util.h"
 #include "drm.h"
 #include "r128_drm.h"
 
-#include "mtypes.h"
+#include "main/mtypes.h"
 #include "tnl/t_vertex.h"
 
 #include "r128_reg.h"
@@ -132,7 +129,7 @@ struct r128_context {
    char *verts;                        /* points to tnl->clipspace.vertex_buf */
    GLuint num_verts;
    int coloroffset, specoffset;
-   int tnl_state;      /* tnl->render_inputs for this _tnl_install_attrs */
+   DECLARE_RENDERINPUTS(tnl_state_bitset);     /* tnl->render_inputs for this _tnl_install_attrs */
 
    GLuint NewGLState;
    GLuint Fallback;
@@ -140,9 +137,9 @@ struct r128_context {
    GLfloat hw_viewport[16];
    GLfloat depth_scale;
 
-   u_int32_t ClearColor;                       /* Color used to clear color buffer */
-   u_int32_t ClearDepth;                       /* Value used to clear depth buffer */
-   u_int32_t ClearStencil;             /* Value used to clear stencil */
+   uint32_t ClearColor;                        /* Color used to clear color buffer */
+   uint32_t ClearDepth;                        /* Value used to clear depth buffer */
+   uint32_t ClearStencil;              /* Value used to clear stencil */
 
    /* Map GL texture units onto hardware
     */
@@ -179,11 +176,8 @@ struct r128_context {
     */
    GLuint doPageFlip;
 
-   /* Drawable, cliprect and scissor information
+   /* Cliprect and scissor information
     */
-   GLint drawOffset, drawPitch;
-   GLint readOffset, readPitch;
-
    GLuint numClipRects;                        /* Cliprects for the draw buffer */
    drm_clip_rect_t *pClipRects;
 
@@ -192,9 +186,9 @@ struct r128_context {
 
    /* Mirrors of some DRI state
     */
-   __DRIcontextPrivate *driContext;    /* DRI context */
-   __DRIscreenPrivate  *driScreen;     /* DRI screen */
-   __DRIdrawablePrivate        *driDrawable;   /* DRI drawable bound to this ctx */
+   __DRIcontext        *driContext;    /* DRI context */
+   __DRIscreen *driScreen;     /* DRI screen */
+   __DRIdrawable       *driDrawable;   /* DRI drawable bound to this ctx */
 
    unsigned int lastStamp;             /* mirror driDrawable->lastStamp */
 
@@ -215,11 +209,6 @@ struct r128_context {
    GLuint c_textureBytes;
    GLuint c_vertexBuffers;
 
-   /* VBI
-    */
-   GLuint vbl_seq;
-   GLuint vblank_flags;
-
    /* Configuration cache
     */
    driOptionCache optionCache;
@@ -235,17 +224,18 @@ struct r128_context {
                (rmesa->r128Screen->chipset == R128_CARD_TYPE_R128_MOBILITY)
 
 
-extern GLboolean r128CreateContext( const __GLcontextModes *glVisual,
-                                   __DRIcontextPrivate *driContextPriv,
+extern GLboolean r128CreateContext( gl_api api,
+                                   const __GLcontextModes *glVisual,
+                                   __DRIcontext *driContextPriv,
                                     void *sharedContextPrivate );
 
-extern void r128DestroyContext( __DRIcontextPrivate * );
+extern void r128DestroyContext( __DRIcontext * );
 
-extern GLboolean r128MakeCurrent( __DRIcontextPrivate *driContextPriv,
-                                  __DRIdrawablePrivate *driDrawPriv,
-                                  __DRIdrawablePrivate *driReadPriv );
+extern GLboolean r128MakeCurrent( __DRIcontext *driContextPriv,
+                                  __DRIdrawable *driDrawPriv,
+                                  __DRIdrawable *driReadPriv );
 
-extern GLboolean r128UnbindContext( __DRIcontextPrivate *driContextPriv );
+extern GLboolean r128UnbindContext( __DRIcontext *driContextPriv );
 
 /* ================================================================
  * Debugging:
@@ -268,5 +258,4 @@ extern int R128_DEBUG;
 #define DEBUG_VERBOSE_2D       0x40
 #define DEBUG_VERBOSE_FALL     0x80
 
-#endif
 #endif /* __R128_CONTEXT_H__ */