Merge commit 'origin/gallium-master-merge'
[mesa.git] / src / gallium / winsys / drm / nouveau / dri / nouveau_context_dri.h
1 #ifndef __NOUVEAU_CONTEXT_DRI_H__
2 #define __NOUVEAU_CONTEXT_DRI_H__
3
4 #include <dri_util.h>
5 #include <xmlconfig.h>
6 #include <nouveau/nouveau_winsys.h>
7 #include "../common/nouveau_context.h"
8
9 struct nouveau_framebuffer {
10 struct st_framebuffer *stfb;
11 };
12
13 struct nouveau_context_dri {
14 struct nouveau_context base;
15 struct st_context *st;
16
17 /* DRI stuff */
18 __DRIscreenPrivate *dri_screen;
19 __DRIdrawablePrivate *dri_drawable;
20 unsigned int last_stamp;
21 driOptionCache dri_option_cache;
22 drm_context_t drm_context;
23 drmLock drm_lock;
24 };
25
26 extern GLboolean nouveau_context_create(const __GLcontextModes *,
27 __DRIcontextPrivate *, void *);
28 extern void nouveau_context_destroy(__DRIcontextPrivate *);
29 extern GLboolean nouveau_context_bind(__DRIcontextPrivate *,
30 __DRIdrawablePrivate *draw,
31 __DRIdrawablePrivate *read);
32 extern GLboolean nouveau_context_unbind(__DRIcontextPrivate *);
33
34 #ifdef DEBUG
35 extern int __nouveau_debug;
36
37 #define DEBUG_BO (1 << 0)
38
39 #define DBG(flag, ...) do { \
40 if (__nouveau_debug & (DEBUG_##flag)) \
41 NOUVEAU_ERR(__VA_ARGS__); \
42 } while(0)
43 #else
44 #define DBG(flag, ...)
45 #endif
46
47 #endif