diff options
author | José Fonseca <[email protected]> | 2007-11-15 17:07:50 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2007-11-15 17:07:50 +0000 |
commit | 90dd0cb822f2fe14258c786e5c37da69472b7d17 (patch) | |
tree | 709a0073a8e5cd66442199d4bd529a4097573cba /src/mesa/pipe/i915simple | |
parent | 193c85ec7a1aec44eebc67c6224fb6ecbb4607a5 (diff) |
Include fences in the i915simple winsys interface.
Diffstat (limited to 'src/mesa/pipe/i915simple')
-rw-r--r-- | src/mesa/pipe/i915simple/i915_batch.h | 10 | ||||
-rw-r--r-- | src/mesa/pipe/i915simple/i915_context.h | 3 | ||||
-rw-r--r-- | src/mesa/pipe/i915simple/i915_flush.c | 3 | ||||
-rw-r--r-- | src/mesa/pipe/i915simple/i915_winsys.h | 18 |
4 files changed, 26 insertions, 8 deletions
diff --git a/src/mesa/pipe/i915simple/i915_batch.h b/src/mesa/pipe/i915simple/i915_batch.h index fb88cd6db0d..99b03c37db1 100644 --- a/src/mesa/pipe/i915simple/i915_batch.h +++ b/src/mesa/pipe/i915simple/i915_batch.h @@ -44,11 +44,11 @@ #define ADVANCE_BATCH() -#define FLUSH_BATCH() do { \ - if (0) i915_dump_batchbuffer( i915 ); \ - i915->winsys->batch_flush( i915->winsys ); \ - i915->batch_start = NULL; \ - i915->hardware_dirty = ~0; \ +#define FLUSH_BATCH() do { \ + if (0) i915_dump_batchbuffer( i915 ); \ + i915->last_fence = i915->winsys->batch_flush( i915->winsys ); \ + i915->batch_start = NULL; \ + i915->hardware_dirty = ~0; \ } while (0) #endif diff --git a/src/mesa/pipe/i915simple/i915_context.h b/src/mesa/pipe/i915simple/i915_context.h index ee430ebc902..488682f852e 100644 --- a/src/mesa/pipe/i915simple/i915_context.h +++ b/src/mesa/pipe/i915simple/i915_context.h @@ -80,6 +80,7 @@ +struct pipe_fence; struct i915_cache_context; /* Use to calculate differences between state emitted to hardware and @@ -184,6 +185,8 @@ struct i915_context unsigned dirty; unsigned *batch_start; + + struct pipe_fence *last_fence; /** Vertex buffer */ struct pipe_buffer_handle *vbo; diff --git a/src/mesa/pipe/i915simple/i915_flush.c b/src/mesa/pipe/i915simple/i915_flush.c index 3c2069b8273..1044cb1bdbd 100644 --- a/src/mesa/pipe/i915simple/i915_flush.c +++ b/src/mesa/pipe/i915simple/i915_flush.c @@ -69,7 +69,8 @@ static void i915_flush( struct pipe_context *pipe, FLUSH_BATCH(); if (flags & PIPE_FLUSH_WAIT) { - i915->winsys->batch_finish(i915->winsys); + if( i915->last_fence ) + i915->winsys->fence_wait(i915->winsys, i915->last_fence); } } diff --git a/src/mesa/pipe/i915simple/i915_winsys.h b/src/mesa/pipe/i915simple/i915_winsys.h index 2c0f335d346..03457c1d61c 100644 --- a/src/mesa/pipe/i915simple/i915_winsys.h +++ b/src/mesa/pipe/i915simple/i915_winsys.h @@ -52,6 +52,7 @@ struct pipe_buffer_handle; struct pipe_winsys; +struct pipe_fence; /** @@ -97,8 +98,21 @@ struct i915_winsys { unsigned access_flags, unsigned delta ); - void (*batch_flush)( struct i915_winsys *sws ); - void (*batch_finish)( struct i915_winsys *sws ); + struct pipe_fence *(*batch_flush)( struct i915_winsys *sws ); + + + /* Fence + */ + void (*fence_reference)( struct i915_winsys *sws, + struct pipe_fence **dst_fence, + struct pipe_fence *src_fence ); + + int (*fence_is_signalled)( struct i915_winsys *sws, + struct pipe_fence *fence ); + + int (*fence_wait)( struct i915_winsys *sws, + struct pipe_fence *fence ); + }; #define I915_BUFFER_ACCESS_WRITE 0x1 |