i965: Always set tiling for depth buffer on sandybridge
[mesa.git] / src / mesa / drivers / dri / tdfx / tdfx_context.h
index 7d18e77c4df4bf32338319d345bc8eb81d968cfe..29b0876f9f93f383826415c346a07be3c92aaf82 100644 (file)
@@ -23,7 +23,6 @@
  * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.h,v 1.5 2002/02/24 21:51:10 dawes Exp $ */
 
 /*
  * New fixes:
@@ -45,7 +44,7 @@
 #ifdef XFree86Server
 #include "GL/xf86glx.h"
 #else
-#include "glheader.h"
+#include "main/glheader.h"
 #endif
 #if defined(__linux__)
 #include <signal.h>
 #include "drm.h"
 #include "drm_sarea.h"
 #include "tdfx_glide.h"
+#include "xmlconfig.h"
 
-#include "clip.h"
-#include "context.h"
-#include "macros.h"
-#include "matrix.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/clip.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/matrix.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
 
 #include "tdfx_screen.h"
 
 #define TDFX_FALLBACK_COLORMASK                0x0100
 #define TDFX_FALLBACK_BLEND            0x0200
 #define TDFX_FALLBACK_LINE_STIPPLE     0x0400
+#define TDFX_FALLBACK_DISABLE          0x0800
 
 /* Different Glide vertex layouts
  */
@@ -891,9 +892,19 @@ struct tdfx_context {
    char rendererString[100];
 
    /* stuff added for DRI */
-   __DRIscreenPrivate *driScreen;
-   __DRIcontextPrivate *driContext;
-   __DRIdrawablePrivate *driDrawable;
+   __DRIscreen *driScreen;
+   __DRIcontext *driContext;
+
+   /**
+    * DRI drawable bound to this context for drawing.
+    */
+   __DRIdrawable       *driDrawable;
+
+   /**
+    * DRI drawable bound to this context for reading.
+    */
+   __DRIdrawable       *driReadable;
+
    drm_context_t hHWContext;
    drm_hw_lock_t *driHwLock;
    int driFd;
@@ -917,27 +928,30 @@ struct tdfx_context {
 
    tdfxStats stats;
 
-   GLboolean debugFallbacks;
+   /* Configuration cache
+    */
+   driOptionCache optionCache;
 };
 
 #define TDFX_CONTEXT(ctx)      ((tdfxContextPtr)((ctx)->DriverCtx))
 
 
 extern GLboolean
-tdfxCreateContext( const __GLcontextModes *mesaVis,
-                   __DRIcontextPrivate *driContextPriv,
+tdfxCreateContext( gl_api api,
+                  const __GLcontextModes *mesaVis,
+                   __DRIcontext *driContextPriv,
                    void *sharedContextPrivate );
 
 extern void
-tdfxDestroyContext( __DRIcontextPrivate *driContextPriv );
+tdfxDestroyContext( __DRIcontext *driContextPriv );
 
 extern GLboolean
-tdfxUnbindContext( __DRIcontextPrivate *driContextPriv );
+tdfxUnbindContext( __DRIcontext *driContextPriv );
 
 extern GLboolean
-tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv,
-                 __DRIdrawablePrivate *driDrawPriv,
-                 __DRIdrawablePrivate *driReadPriv );
+tdfxMakeCurrent( __DRIcontext *driContextPriv,
+                 __DRIdrawable *driDrawPriv,
+                 __DRIdrawable *driReadPriv );
 
 extern GLboolean
 tdfxInitGlide( tdfxContextPtr tmesa );
@@ -970,9 +984,9 @@ FX_grColorMaskv_NoLock(GLcontext *ctx, const GLboolean rgba[4]);
 #define TDFXPACKCOLOR4444( r, g, b, a )                                           \
    ((((a) & 0xf0) << 8) | (((b) & 0xf0) << 4) | ((g) & 0xf0) | ((r) >> 4))
 
-static __inline__ GrColor_t tdfxPackColor( GLuint cpp,
-                                          GLubyte r, GLubyte g,
-                                          GLubyte b, GLubyte a )
+static INLINE GrColor_t tdfxPackColor( GLuint cpp,
+                                       GLubyte r, GLubyte g,
+                                       GLubyte b, GLubyte a )
 {
    switch ( cpp ) {
    case 2:
@@ -984,7 +998,7 @@ static __inline__ GrColor_t tdfxPackColor( GLuint cpp,
   }
 }
 
-#define DO_DEBUG               0
+#define DO_DEBUG               1
 #if DO_DEBUG
 extern int TDFX_DEBUG;
 #else
@@ -993,11 +1007,8 @@ extern int TDFX_DEBUG;
 
 #define DEBUG_ALWAYS_SYNC      0x01
 #define DEBUG_VERBOSE_API      0x02
-#define DEBUG_VERBOSE_MSG      0x04
-#define DEBUG_VERBOSE_LRU      0x08
-#define DEBUG_VERBOSE_DRI      0x10
-#define DEBUG_VERBOSE_IOCTL    0x20
-#define DEBUG_VERBOSE_2D       0x40
+#define DEBUG_VERBOSE_DRI      0x04
+#define DEBUG_VERBOSE_FALL     0x08
 
 /* conf */
 #define FX_COMPRESS_S3TC_AS_FXT1_HACK 1