Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5564 | serge | 1 | |
2 | #define __NOUVEAU_FENCE_H__ |
||
3 | |||
4 | |||
5 | #include "util/list.h" |
||
6 | |||
7 | |||
8 | #define NOUVEAU_FENCE_STATE_EMITTING 1 |
||
9 | #define NOUVEAU_FENCE_STATE_EMITTED 2 |
||
10 | #define NOUVEAU_FENCE_STATE_FLUSHED 3 |
||
11 | #define NOUVEAU_FENCE_STATE_SIGNALLED 4 |
||
12 | |||
13 | |||
14 | struct list_head list; |
||
15 | void (*func)(void *); |
||
16 | void *data; |
||
17 | }; |
||
18 | |||
19 | |||
20 | struct nouveau_fence *next; |
||
21 | struct nouveau_screen *screen; |
||
22 | int state; |
||
23 | int ref; |
||
24 | uint32_t sequence; |
||
25 | struct list_head work; |
||
26 | }; |
||
27 | |||
28 | |||
29 | void nouveau_fence_del(struct nouveau_fence *); |
||
30 | |||
31 | |||
32 | boolean emit); |
||
33 | boolean nouveau_fence_work(struct nouveau_fence *, void (*)(void *), void *); |
||
34 | void nouveau_fence_update(struct nouveau_screen *, boolean flushed); |
||
35 | void nouveau_fence_next(struct nouveau_screen *); |
||
36 | boolean nouveau_fence_wait(struct nouveau_fence *); |
||
37 | boolean nouveau_fence_signalled(struct nouveau_fence *); |
||
38 | |||
39 | |||
40 | nouveau_fence_ref(struct nouveau_fence *fence, struct nouveau_fence **ref) |
||
41 | { |
||
42 | if (fence) |
||
43 | ++fence->ref; |
||
44 | |||
45 | |||
46 | if (--(*ref)->ref == 0) |
||
47 | nouveau_fence_del(*ref); |
||
48 | } |
||
49 | |||
50 | |||
51 | } |
||
52 | |||
53 | |||
54 | nouveau_fence(struct pipe_fence_handle *fence) |
||
55 | { |
||
56 | return (struct nouveau_fence *)fence; |
||
57 | } |
||
58 | |||
59 | |||
60 |