Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / libs / mesa / src / gallium / drivers / nouveau / nouveau_fence.h
blob680c75e99f962ec17862da79c44fba46ebc050f2
2 #ifndef __NOUVEAU_FENCE_H__
3 #define __NOUVEAU_FENCE_H__
5 #include "util/u_inlines.h"
6 #include "util/u_double_list.h"
8 #define NOUVEAU_FENCE_STATE_AVAILABLE 0
9 #define NOUVEAU_FENCE_STATE_EMITTED 1
10 #define NOUVEAU_FENCE_STATE_FLUSHED 2
11 #define NOUVEAU_FENCE_STATE_SIGNALLED 3
13 struct nouveau_fence_work {
14 struct list_head list;
15 void (*func)(void *);
16 void *data;
19 struct nouveau_fence {
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;
28 void nouveau_fence_emit(struct nouveau_fence *);
29 void nouveau_fence_del(struct nouveau_fence *);
31 boolean nouveau_fence_new(struct nouveau_screen *, struct nouveau_fence **,
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 *);
39 static INLINE void
40 nouveau_fence_ref(struct nouveau_fence *fence, struct nouveau_fence **ref)
42 if (fence)
43 ++fence->ref;
45 if (*ref) {
46 if (--(*ref)->ref == 0)
47 nouveau_fence_del(*ref);
50 *ref = fence;
53 static INLINE struct nouveau_fence *
54 nouveau_fence(struct pipe_fence_handle *fence)
56 return (struct nouveau_fence *)fence;
59 #endif // __NOUVEAU_FENCE_H__