fix GL_LINE_LOOP with drivers using own render pipeline stage (#12410, #13527)
[mesa.git] / src / mesa / drivers / dri / mga / mgacontext.h
index 97ea04256d1cb0056786c4b307481860cc4deaf4..2681976fc2b946e336b45910e9ed4424fbf3b041 100644 (file)
 #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 "texmem.h"
 #include "macros.h"
@@ -62,6 +63,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 +149,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 +240,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 +258,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
     */
@@ -278,12 +275,12 @@ struct mga_context_t {
    int drawX, drawY;           /* origin of drawable in draw buffer */
    int lastX, lastY;           /* detect DSTORG bug */
    GLuint numClipRects;                /* cliprects for the draw buffer */
-   XF86DRIClipRectPtr pClipRects;
-   XF86DRIClipRectRec draw_rect;
-   XF86DRIClipRectRec scissor_rect;
+   drm_clip_rect_t *pClipRects;
+   drm_clip_rect_t draw_rect;
+   drm_clip_rect_t scissor_rect;
    int scissor;
 
-   XF86DRIClipRectRec tmp_boxes[2][MGA_NR_SAREA_CLIPRECTS];
+   drm_clip_rect_t tmp_boxes[2][MGA_NR_SAREA_CLIPRECTS];
 
 
    /* Texture aging and DMA based aging.
@@ -295,22 +292,15 @@ struct mga_context_t {
 
    /* Mirrors of some DRI state.
     */
-   drmContext hHWContext;
-   drmLock *driHwLock;
+   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;
-
    __DRIscreenPrivate *driScreen;
    struct mga_screen_private_s *mgaScreen;
-   MGASAREAPrivPtr sarea;
+   drm_mga_sarea_t *sarea;
 
    /* Configuration cache
     */