nvc0: force vertex data through FIFO if we need to convert it
[mesa.git] / src / gallium / drivers / nvc0 / nvc0_fence.h
1
2 #ifndef __NVC0_FENCE_H__
3 #define __NVC0_FENCE_H__
4
5 #include "util/u_inlines.h"
6 #include "util/u_double_list.h"
7
8 #define NVC0_FENCE_STATE_AVAILABLE 0
9 #define NVC0_FENCE_STATE_EMITTED 1
10 #define NVC0_FENCE_STATE_SIGNALLED 2
11
12 struct nvc0_mm_allocation;
13
14 struct nvc0_fence {
15 struct nvc0_fence *next;
16 struct nvc0_screen *screen;
17 int state;
18 int ref;
19 uint32_t sequence;
20 struct nvc0_mm_allocation *buffers;
21 };
22
23 void nvc0_fence_emit(struct nvc0_fence *);
24 void nvc0_fence_del(struct nvc0_fence *);
25
26 boolean nvc0_fence_wait(struct nvc0_fence *);
27 boolean nvc0_fence_signalled(struct nvc0_fence *);
28
29 static INLINE void
30 nvc0_fence_reference(struct nvc0_fence **ref, struct nvc0_fence *fence)
31 {
32 if (*ref) {
33 if (--(*ref)->ref == 0)
34 nvc0_fence_del(*ref);
35 }
36 if (fence)
37 ++fence->ref;
38
39 *ref = fence;
40 }
41
42 static INLINE struct nvc0_fence *
43 nvc0_fence(struct pipe_fence_handle *fence)
44 {
45 return (struct nvc0_fence *)fence;
46 }
47
48 #endif // __NVC0_FENCE_H__