summaryrefslogtreecommitdiff
path: root/src/mesa/pipe
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2007-11-15 17:07:50 +0000
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2007-11-15 17:07:50 +0000
commit90dd0cb822f2fe14258c786e5c37da69472b7d17 (patch)
tree709a0073a8e5cd66442199d4bd529a4097573cba /src/mesa/pipe
parent193c85ec7a1aec44eebc67c6224fb6ecbb4607a5 (diff)
Include fences in the i915simple winsys interface.
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r--src/mesa/pipe/i915simple/i915_batch.h10
-rw-r--r--src/mesa/pipe/i915simple/i915_context.h3
-rw-r--r--src/mesa/pipe/i915simple/i915_flush.c3
-rw-r--r--src/mesa/pipe/i915simple/i915_winsys.h18
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 fb88cd6db0..99b03c37db 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 ee430ebc90..488682f852 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 3c2069b827..1044cb1bdb 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 2c0f335d34..03457c1d61 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