summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvc0/nvc0_fence.h
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-12-09 15:01:37 +0100
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-12-09 15:01:37 +0100
commit3ef1616b63507db01f54efa882a9cf28839cfdf3 (patch)
tree8950b3c215ca3e7d7e511d6b8afa701131ec8218 /src/gallium/drivers/nvc0/nvc0_fence.h
parent0d1a2bd0fb356fdb74a9aed1c34276dc9e97b4c6 (diff)
nvc0: buffer suballocation with a primitive slab allocator
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_fence.h')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_fence.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_fence.h b/src/gallium/drivers/nvc0/nvc0_fence.h
index 513ac07c1a..7b31f28808 100644
--- a/src/gallium/drivers/nvc0/nvc0_fence.h
+++ b/src/gallium/drivers/nvc0/nvc0_fence.h
@@ -3,24 +3,21 @@
#define __NVC0_FENCE_H__
#include "util/u_inlines.h"
+#include "util/u_double_list.h"
-struct nvc0_fence_trigger {
- void (*func)(void *);
- void *arg;
- struct nvc0_fence_trigger *next;
-};
-
+#define NVC0_FENCE_STATE_AVAILABLE 0
#define NVC0_FENCE_STATE_EMITTED 1
#define NVC0_FENCE_STATE_SIGNALLED 2
-/* reference first, so pipe_reference works directly */
+struct nvc0_mm_allocation;
+
struct nvc0_fence {
- struct pipe_reference reference;
struct nvc0_fence *next;
struct nvc0_screen *screen;
int state;
+ int ref;
uint32_t sequence;
- struct nvc0_fence_trigger trigger;
+ struct nvc0_mm_allocation *buffers;
};
void nvc0_fence_emit(struct nvc0_fence *);
@@ -31,10 +28,20 @@ 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);
+ if (*ref) {
+ if (--(*ref)->ref == 0)
+ nvc0_fence_del(*ref);
+ }
+ if (fence)
+ ++fence->ref;
*ref = fence;
}
+static INLINE struct nvc0_fence *
+nvc0_fence(struct pipe_fence_handle *fence)
+{
+ return (struct nvc0_fence *)fence;
+}
+
#endif // __NVC0_FENCE_H__