gallium/draw: initial code to properly support llvm in the draw module
[mesa.git] / src / mesa / drivers / dri / mga / mgacontext.h
index f2ef14a8ab7de183bb4351850aa1124318e9ce87..414156593143fbc9522e1b0c4f00c909157ebafe 100644 (file)
@@ -1,4 +1,3 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgacontext.h,v 1.7 2002/12/16 16:18:52 dawes Exp $*/
 /*
  * Copyright 2000-2001 VA Linux Systems, Inc.
  * All Rights Reserved.
 #ifndef MGALIB_INC
 #define MGALIB_INC
 
-#include <inttypes.h>
+#include <stdint.h>
+#include "drm.h"
+#include "mga_drm.h"
 #include "dri_util.h"
-#include "mtypes.h"
 #include "xf86drm.h"
-#include "mm.h"
-#include "mga_sarea.h"
-#include "colormac.h"
+#include "main/mtypes.h"
+#include "main/mm.h"
+#include "main/colormac.h"
+#include "main/macros.h"
 #include "texmem.h"
-#include "macros.h"
 #include "xmlconfig.h"
 
 #define MGA_SET_FIELD(reg,mask,val)  reg = ((reg) & (mask)) | ((val) & ~(mask))
@@ -62,6 +62,7 @@
 #define MGA_FALLBACK_STENCIL        0x20
 #define MGA_FALLBACK_DEPTH          0x40
 #define MGA_FALLBACK_BORDER_MODE    0x80
+#define MGA_FALLBACK_DISABLE        0x100
 
 
 /* Use the templated vertex formats:
@@ -147,7 +148,7 @@ typedef struct mga_texture_object_s
    int                texelBytes;
    GLuint             age;
 
-   mga_texture_regs_t setup;
+   drm_mga_texture_regs_t setup;
 
    /* If one texture dimension wraps with GL_CLAMP and the other with
     * GL_CLAMP_TO_EDGE, we have to fallback to software.  We would also have
@@ -238,7 +239,7 @@ struct mga_context_t {
    GLuint        NewGLState; 
    GLuint        dirty;
 
-   mga_context_regs_t setup;
+   drm_mga_context_regs_t setup;
 
    GLuint        ClearColor;
    GLuint        ClearDepth;
@@ -256,18 +257,13 @@ struct mga_context_t {
    drmBufPtr  vertex_dma_buffer;
    drmBufPtr  iload_buffer;
 
-   /* VBI
-    */
-   GLuint vbl_seq;
-   GLuint vblank_flags;
-
    int64_t swap_ust;
    int64_t swap_missed_ust;
 
    GLuint swap_count;
    GLuint swap_missed_count;
 
-   PFNGLXGETUSTPROC get_ust;
+   uint32_t last_frame_fence;
 
    /* Drawable, cliprect and scissor information
     */
@@ -295,22 +291,15 @@ struct mga_context_t {
 
    /* Mirrors of some DRI state.
     */
-   drmContext hHWContext;
+   drm_context_t hHWContext;
    drm_hw_lock_t *driHwLock;
    int driFd;
-   __DRIdrawablePrivate *driDrawable;
-   __DRIdrawablePrivate *driReadable;
-
-   /**
-    * Drawable used by Mesa for software fallbacks for reading and
-    * writing.  It is set by Mesa's \c SetBuffer callback, and will always be
-    * either \c mga_context_t::driDrawable or \c mga_context_t::driReadable.
-    */
-   __DRIdrawablePrivate *mesa_drawable;
+   __DRIdrawable *driDrawable;
+   __DRIdrawable *driReadable;
 
-   __DRIscreenPrivate *driScreen;
+   __DRIscreen *driScreen;
    struct mga_screen_private_s *mgaScreen;
-   MGASAREAPrivPtr sarea;
+   drm_mga_sarea_t *sarea;
 
    /* Configuration cache
     */
@@ -339,9 +328,9 @@ extern int MGA_DEBUG;
 #define DEBUG_VERBOSE_TEXTURE   0x08
 #define DEBUG_VERBOSE_FALLBACK 0x10
 
-static __inline__ GLuint mgaPackColor(GLuint cpp,
-                                     GLubyte r, GLubyte g,
-                                     GLubyte b, GLubyte a)
+static INLINE GLuint mgaPackColor(GLuint cpp,
+                                  GLubyte r, GLubyte g,
+                                  GLubyte b, GLubyte a)
 {
    switch (cpp) {
    case 2: