Mesa (master): i915g: Make batchbuffer flush function not be inline

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Sun Jul 4 12:38:38 UTC 2010


Module: Mesa
Branch: master
Commit: 57fc2ad7a165bd969de5d1943e325db52f702eb8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=57fc2ad7a165bd969de5d1943e325db52f702eb8

Author: Jakob Bornecrantz <wallbraker at gmail.com>
Date:   Sat Jul  3 15:25:17 2010 +0100

i915g: Make batchbuffer flush function not be inline

---

 src/gallium/drivers/i915/i915_batch.h       |   14 ++++++++++----
 src/gallium/drivers/i915/i915_batchbuffer.h |    9 ++-------
 src/gallium/drivers/i915/i915_flush.c       |   20 ++++++++++++++++----
 3 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_batch.h b/src/gallium/drivers/i915/i915_batch.h
index f008669..c411b84 100644
--- a/src/gallium/drivers/i915/i915_batch.h
+++ b/src/gallium/drivers/i915/i915_batch.h
@@ -30,6 +30,7 @@
 
 #include "i915_batchbuffer.h"
 
+
 #define BEGIN_BATCH(dwords, relocs) \
    (i915_winsys_batchbuffer_check(i915->batch, dwords, relocs))
 
@@ -39,9 +40,14 @@
 #define OUT_RELOC(buf, usage, offset) \
    i915_winsys_batchbuffer_reloc(i915->batch, buf, usage, offset)
 
-#define FLUSH_BATCH(fence) do {                 \
-   i915_winsys_batchbuffer_flush(i915->batch, fence); \
-   i915->hardware_dirty = ~0;                   \
-} while (0)
+#define FLUSH_BATCH(fence) \
+   i915_flush(i915, fence)
+
+
+/************************************************************************
+ * i915_flush.c
+ */
+void i915_flush(struct i915_context *i915, struct pipe_fence_handle **fence);
+
 
 #endif
diff --git a/src/gallium/drivers/i915/i915_batchbuffer.h b/src/gallium/drivers/i915/i915_batchbuffer.h
index 27ccaa6..c1cd314 100644
--- a/src/gallium/drivers/i915/i915_batchbuffer.h
+++ b/src/gallium/drivers/i915/i915_batchbuffer.h
@@ -30,6 +30,8 @@
 
 #include "i915_winsys.h"
 
+struct i915_context;
+
 static INLINE boolean
 i915_winsys_batchbuffer_check(struct i915_winsys_batchbuffer *batch,
                               size_t dwords,
@@ -77,11 +79,4 @@ i915_winsys_batchbuffer_reloc(struct i915_winsys_batchbuffer *batch,
    return batch->iws->batchbuffer_reloc(batch, buffer, usage, offset);
 }
 
-static INLINE void
-i915_winsys_batchbuffer_flush(struct i915_winsys_batchbuffer *batch,
-                              struct pipe_fence_handle **fence)
-{
-   batch->iws->batchbuffer_flush(batch, fence);
-}
-
 #endif
diff --git a/src/gallium/drivers/i915/i915_flush.c b/src/gallium/drivers/i915/i915_flush.c
index 482d28e..a2c70b1 100644
--- a/src/gallium/drivers/i915/i915_flush.c
+++ b/src/gallium/drivers/i915/i915_flush.c
@@ -38,9 +38,9 @@
 #include "i915_debug.h"
 
 
-static void i915_flush( struct pipe_context *pipe,
-                        unsigned flags,
-                        struct pipe_fence_handle **fence )
+static void i915_flush_pipe( struct pipe_context *pipe,
+                             unsigned flags,
+                             struct pipe_fence_handle **fence )
 {
    struct i915_context *i915 = i915_context(pipe);
 
@@ -81,5 +81,17 @@ static void i915_flush( struct pipe_context *pipe,
 
 void i915_init_flush_functions( struct i915_context *i915 )
 {
-   i915->base.flush = i915_flush;
+   i915->base.flush = i915_flush_pipe;
+}
+
+/**
+ * Here we handle all the notifications that needs to go out on a flush.
+ * XXX might move above function to i915_pipe_flush.c and leave this here.
+ */
+void i915_flush(struct i915_context *i915, struct pipe_fence_handle **fence)
+{
+   struct i915_winsys_batchbuffer *batch = i915->batch;
+
+   batch->iws->batchbuffer_flush(batch, fence);
+   i915->hardware_dirty = ~0;
 }




More information about the mesa-commit mailing list