i965: fix bugs in projective texture coordinates
[mesa.git] / src / gallium / winsys / drm / nouveau / dri / nouveau_context.h
1 #ifndef __NOUVEAU_CONTEXT_DRI_H__
2 #define __NOUVEAU_CONTEXT_DRI_H__
3
4 #include <dri_util.h>
5 #include <xmlconfig.h>
6
7 #include "nouveau/nouveau_winsys.h"
8
9 #define NOUVEAU_ERR(fmt, args...) debug_printf("%s: "fmt, __func__, ##args)
10
11 struct nouveau_framebuffer {
12 struct st_framebuffer *stfb;
13 };
14
15 struct nouveau_context {
16 struct st_context *st;
17
18 /* DRI stuff */
19 __DRIscreenPrivate *dri_screen;
20 __DRIdrawablePrivate *dri_drawable;
21 unsigned int last_stamp;
22 driOptionCache dri_option_cache;
23 drm_context_t drm_context;
24 drmLock drm_lock;
25 int locked;
26 };
27
28 extern GLboolean nouveau_context_create(const __GLcontextModes *,
29 __DRIcontextPrivate *, void *);
30 extern void nouveau_context_destroy(__DRIcontextPrivate *);
31 extern GLboolean nouveau_context_bind(__DRIcontextPrivate *,
32 __DRIdrawablePrivate *draw,
33 __DRIdrawablePrivate *read);
34 extern GLboolean nouveau_context_unbind(__DRIcontextPrivate *);
35
36 extern void nouveau_contended_lock(struct nouveau_context *nv);
37 extern void LOCK_HARDWARE(struct nouveau_context *nv);
38 extern void UNLOCK_HARDWARE(struct nouveau_context *nv);
39
40 #ifdef DEBUG
41 extern int __nouveau_debug;
42
43 #define DEBUG_BO (1 << 0)
44
45 #define DBG(flag, ...) do { \
46 if (__nouveau_debug & (DEBUG_##flag)) \
47 NOUVEAU_ERR(__VA_ARGS__); \
48 } while(0)
49 #else
50 #define DBG(flag, ...)
51 #endif
52
53 #endif