2 #ifndef __NOUVEAU_FENCE_H__
3 #define __NOUVEAU_FENCE_H__
5 #include "util/u_inlines.h"
8 #define NOUVEAU_FENCE_STATE_AVAILABLE 0
9 #define NOUVEAU_FENCE_STATE_EMITTING 1
10 #define NOUVEAU_FENCE_STATE_EMITTED 2
11 #define NOUVEAU_FENCE_STATE_FLUSHED 3
12 #define NOUVEAU_FENCE_STATE_SIGNALLED 4
14 struct nouveau_fence_work
{
15 struct list_head list
;
20 struct nouveau_fence
{
21 struct nouveau_fence
*next
;
22 struct nouveau_screen
*screen
;
26 struct list_head work
;
29 void nouveau_fence_emit(struct nouveau_fence
*);
30 void nouveau_fence_del(struct nouveau_fence
*);
32 boolean
nouveau_fence_new(struct nouveau_screen
*, struct nouveau_fence
**,
34 boolean
nouveau_fence_work(struct nouveau_fence
*, void (*)(void *), void *);
35 void nouveau_fence_update(struct nouveau_screen
*, boolean flushed
);
36 void nouveau_fence_next(struct nouveau_screen
*);
37 boolean
nouveau_fence_wait(struct nouveau_fence
*);
38 boolean
nouveau_fence_signalled(struct nouveau_fence
*);
41 nouveau_fence_ref(struct nouveau_fence
*fence
, struct nouveau_fence
**ref
)
47 if (--(*ref
)->ref
== 0)
48 nouveau_fence_del(*ref
);
54 static INLINE
struct nouveau_fence
*
55 nouveau_fence(struct pipe_fence_handle
*fence
)
57 return (struct nouveau_fence
*)fence
;
60 #endif // __NOUVEAU_FENCE_H__