Merge branch 'llvm-cliptest-viewport'
[mesa.git] / src / mesa / drivers / dri / r128 / r128_context.h
index 7477b95fadf69f785d77f3843d9cc3d8d6ef24d0..0a06c43878d515a2ce73fee5e47a4962634f868f 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"
@@ -77,12 +74,12 @@ typedef struct r128_context *r128ContextPtr;
 #define R128_FALLBACK_READ_BUFFER      0x0004
 #define R128_FALLBACK_STENCIL          0x0008
 #define R128_FALLBACK_RENDER_MODE      0x0010
-#define R128_FALLBACK_MULTIDRAW                0x0020
-#define R128_FALLBACK_LOGICOP          0x0040
-#define R128_FALLBACK_SEP_SPECULAR     0x0080
-#define R128_FALLBACK_BLEND_EQ         0x0100
-#define R128_FALLBACK_BLEND_FUNC       0x0200
-#define R128_FALLBACK_PROJTEX          0x0400
+#define R128_FALLBACK_LOGICOP          0x0020
+#define R128_FALLBACK_SEP_SPECULAR     0x0040
+#define R128_FALLBACK_BLEND_EQ         0x0080
+#define R128_FALLBACK_BLEND_FUNC       0x0100
+#define R128_FALLBACK_PROJTEX          0x0200
+#define R128_FALLBACK_DISABLE          0x0400
 
 
 /* Use the templated vertex format:
@@ -116,7 +113,7 @@ typedef void (*r128_point_func)( r128ContextPtr,
 
 
 struct r128_context {
-   GLcontext *glCtx;                   /* Mesa context */
+   struct gl_context *glCtx;                   /* Mesa context */
 
    /* Driver and hardware state management
     */
@@ -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;
@@ -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,22 +224,23 @@ 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 struct gl_config *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:
  */
-#define DO_DEBUG               0
+#define DO_DEBUG               1
 #define ENABLE_PERF_BOXES      0
 
 #if DO_DEBUG
@@ -266,6 +256,6 @@ extern int R128_DEBUG;
 #define DEBUG_VERBOSE_DRI      0x10
 #define DEBUG_VERBOSE_IOCTL    0x20
 #define DEBUG_VERBOSE_2D       0x40
+#define DEBUG_VERBOSE_FALL     0x80
 
-#endif
 #endif /* __R128_CONTEXT_H__ */