diff options
author | Christoph Bumiller <[email protected]> | 2010-11-12 15:17:40 +0100 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2010-11-12 15:17:40 +0100 |
commit | 4c2247538394a313e1e90bfcd07c1ab9c7d41281 (patch) | |
tree | edbf5d81cace64f63fd8361df4cf94b5b7ded43b /src/gallium/drivers/nvc0/nvc0_fence.h | |
parent | 93edd15178a4d3367ac3d2f9369603807de411d7 (diff) |
nvc0: import nvc0 gallium driver
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_fence.h')
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_fence.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_fence.h b/src/gallium/drivers/nvc0/nvc0_fence.h new file mode 100644 index 00000000000..513ac07c1a8 --- /dev/null +++ b/src/gallium/drivers/nvc0/nvc0_fence.h @@ -0,0 +1,40 @@ + +#ifndef __NVC0_FENCE_H__ +#define __NVC0_FENCE_H__ + +#include "util/u_inlines.h" + +struct nvc0_fence_trigger { + void (*func)(void *); + void *arg; + struct nvc0_fence_trigger *next; +}; + +#define NVC0_FENCE_STATE_EMITTED 1 +#define NVC0_FENCE_STATE_SIGNALLED 2 + +/* reference first, so pipe_reference works directly */ +struct nvc0_fence { + struct pipe_reference reference; + struct nvc0_fence *next; + struct nvc0_screen *screen; + int state; + uint32_t sequence; + struct nvc0_fence_trigger trigger; +}; + +void nvc0_fence_emit(struct nvc0_fence *); +void nvc0_fence_del(struct nvc0_fence *); + +boolean nvc0_fence_wait(struct nvc0_fence *); + +static INLINE void +nvc0_fence_reference(struct nvc0_fence **ref, struct nvc0_fence *fence) +{ + if (pipe_reference(&(*ref)->reference, &fence->reference)) + nvc0_fence_del(*ref); + + *ref = fence; +} + +#endif // __NVC0_FENCE_H__ |