fix mesa fb binding
[mesa.git] / src / mesa / drivers / dri / nouveau / nouveau_context.h
index ea28506b7422cc718d8c53cf91559cdc371ece6a..9a0be2cb2a57dee36d38c7611e31a899333b7bea 100644 (file)
@@ -40,10 +40,12 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "nouveau_state_cache.h"
 #include "nouveau_buffers.h"
 #include "nouveau_shader.h"
+#include "nouveau_sync.h"
 
 #include "xmlconfig.h"
 
 typedef struct nouveau_fifo_t{
+       int channel;
        u_int32_t* buffer;
        u_int32_t* mmio;
        u_int32_t put_base;
@@ -97,9 +99,22 @@ typedef struct nouveau_context {
        /* The read-only regs */
        volatile unsigned char* mmio;
 
+       /* The per-channel notifier block */
+       volatile void *notifier_block;
+
        /* Physical addresses of AGP/VRAM apertures */
        uint64_t vram_phys;
-       uint64_t agp_phys;
+       uint64_t vram_size;
+       uint64_t gart_phys;
+       uint64_t gart_size;
+
+       /* Channel synchronisation */
+       struct drm_nouveau_notifier_alloc *syncNotifier;
+
+       /* ARB_occlusion_query / EXT_timer_query */
+       GLuint            query_object_max;
+       GLboolean *       query_alloc;
+       struct drm_nouveau_notifier_alloc *queryNotifier;
 
        /* Additional hw-specific functions */
        nouveau_hw_func hw_func;
@@ -115,7 +130,10 @@ typedef struct nouveau_context {
        struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
        GLuint vertex_attr_count;
 
-       /* Depth/stencil clear state */
+       /* Color buffer clear value */
+       uint32_t clear_color_value;
+
+       /* Depth/stencil clear value */
        uint32_t clear_value;
 
        /* Light state */
@@ -135,7 +153,7 @@ typedef struct nouveau_context {
        GLuint numClipRects;
        drm_clip_rect_t *pClipRects;
        drm_clip_rect_t osClipRect;
-       GLuint drawX, drawY;
+       GLuint drawX, drawY, drawW, drawH;
 
        /* The rendering context information */
        GLenum current_primitive; /* the current primitive enum */
@@ -147,9 +165,10 @@ typedef struct nouveau_context {
        nouveauShader *current_fragprog;
        nouveauShader *current_vertprog;
        nouveauShader *passthrough_vp;
+       nouveauShader *passthrough_fp;
 
        nouveauScreenRec *screen;
-       drm_nouveau_sarea_t *sarea;
+       struct drm_nouveau_sarea *sarea;
 
        __DRIcontextPrivate  *driContext;    /* DRI context */
        __DRIscreenPrivate   *driScreen;     /* DRI screen */
@@ -163,15 +182,15 @@ typedef struct nouveau_context {
        /* Configuration cache */
        driOptionCache optionCache;
 
-        /* vblank stuff */
-        uint32_t vblank_flags;
-        uint32_t vblank_seq;
+       /* vblank stuff */
+       uint32_t vblank_flags;
+       uint32_t vblank_seq;
 
-        GLuint new_state;
-        GLuint new_render_state;
-        GLuint render_index;
-        GLmatrix viewport;
-        GLfloat depth_scale;
+       GLuint new_state;
+       GLuint new_render_state;
+       GLuint render_index;
+       GLmatrix viewport;
+       GLfloat depth_scale;
 
 }nouveauContextRec, *nouveauContextPtr;
 
@@ -209,5 +228,12 @@ extern void nouveauSwapBuffers(__DRIdrawablePrivate *dPriv);
 extern void nouveauCopySubBuffer(__DRIdrawablePrivate *dPriv,
                                 int x, int y, int w, int h);
 
+/* Debugging utils: */
+extern int NOUVEAU_DEBUG;
+
+#define DEBUG_SHADERS  0x00000001
+#define DEBUG_MEM      0x00000002
+#define DEBUG_BUFFEROBJ 0x00000004
+
 #endif /* __NOUVEAU_CONTEXT_H__ */