diff options
author | Jakob Bornecrantz <[email protected]> | 2010-04-17 15:17:33 +0100 |
---|---|---|
committer | Jakob Bornecrantz <[email protected]> | 2010-04-17 21:13:23 +0100 |
commit | 44bafca1a0b1e9bf06e05a3ec982e0feab5ada47 (patch) | |
tree | 2b1c11f7acb9a39c3e17ffe14784a8d968db530a /src/gallium/winsys/i915/sw/i915_sw_fence.c | |
parent | 3e3d6864da093a99bad282e78945a1b1c4503ca4 (diff) |
i915g: Add a software only debuging winsys
Diffstat (limited to 'src/gallium/winsys/i915/sw/i915_sw_fence.c')
-rw-r--r-- | src/gallium/winsys/i915/sw/i915_sw_fence.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/gallium/winsys/i915/sw/i915_sw_fence.c b/src/gallium/winsys/i915/sw/i915_sw_fence.c new file mode 100644 index 00000000000..4b61b2a5e30 --- /dev/null +++ b/src/gallium/winsys/i915/sw/i915_sw_fence.c @@ -0,0 +1,58 @@ + +#include "i915_sw_winsys.h" +#include "util/u_memory.h" +#include "util/u_atomic.h" +#include "util/u_inlines.h" + +struct i915_sw_fence +{ + struct pipe_reference reference; +}; + +struct pipe_fence_handle * +i915_sw_fence_create() +{ + struct i915_sw_fence *fence = CALLOC_STRUCT(i915_sw_fence); + + pipe_reference_init(&fence->reference, 1); + + return (struct pipe_fence_handle *)fence; +} + +static void +i915_sw_fence_reference(struct i915_winsys *iws, + struct pipe_fence_handle **ptr, + struct pipe_fence_handle *fence) +{ + struct i915_sw_fence *old = (struct i915_sw_fence *)*ptr; + struct i915_sw_fence *f = (struct i915_sw_fence *)fence; + + if (pipe_reference(&((struct i915_sw_fence *)(*ptr))->reference, &f->reference)) { + FREE(old); + } + *ptr = fence; +} + +static int +i915_sw_fence_signalled(struct i915_winsys *iws, + struct pipe_fence_handle *fence) +{ + assert(0); + + return 0; +} + +static int +i915_sw_fence_finish(struct i915_winsys *iws, + struct pipe_fence_handle *fence) +{ + return 0; +} + +void +i915_sw_winsys_init_fence_functions(struct i915_sw_winsys *isws) +{ + isws->base.fence_reference = i915_sw_fence_reference; + isws->base.fence_signalled = i915_sw_fence_signalled; + isws->base.fence_finish = i915_sw_fence_finish; +} |