nouveau: Add notifier support functions
[mesa.git] / src / mesa / drivers / dri / nouveau / nouveau_sync.h
1 #ifndef __NOUVEAU_SYNC_H__
2 #define __NOUVEAU_SYNC_H__
3
4 #include "nouveau_buffers.h"
5
6 #define NV_NOTIFY_TIME_0 0x00000000
7 #define NV_NOTIFY_TIME_1 0x00000004
8 #define NV_NOTIFY_RETURN_VALUE 0x00000008
9 #define NV_NOTIFY_STATE 0x0000000C
10 #define NV_NOTIFY_STATE_STATUS_MASK 0xFF000000
11 #define NV_NOTIFY_STATE_STATUS_SHIFT 24
12 #define NV_NOTIFY_STATE_STATUS_COMPLETED 0x00
13 #define NV_NOTIFY_STATE_STATUS_IN_PROCESS 0x01
14 #define NV_NOTIFY_STATE_ERROR_CODE_MASK 0x0000FFFF
15 #define NV_NOTIFY_STATE_ERROR_CODE_SHIFT 0
16
17 /* Methods that (hopefully) all objects have */
18 #define NV_NOP 0x00000100
19 #define NV_NOTIFY 0x00000104
20 #define NV_NOTIFY_STYLE_WRITE_ONLY 0
21
22 typedef struct nouveau_notifier_t {
23 GLuint handle;
24 nouveau_mem *mem;
25 } nouveau_notifier;
26
27 extern nouveau_notifier *nouveau_notifier_new(GLcontext *, GLuint handle);
28 extern void nouveau_notifier_destroy(GLcontext *, nouveau_notifier *);
29 extern void nouveau_notifier_reset(nouveau_notifier *);
30 extern GLboolean nouveau_notifier_wait_status(nouveau_notifier *r,
31 GLuint status, GLuint timeout);
32 extern void nouveau_notifier_wait_nop(GLcontext *ctx,
33 nouveau_notifier *, GLuint subc);
34
35 extern void nouveauSyncInitFuncs(GLcontext *ctx);
36 #endif