[Mesa-dev] [PATCH 36/51] i965: Move a few intel_batchbuffer functions to brw_batch

Chris Wilson chris at chris-wilson.co.uk
Tue Jan 10 21:23:59 UTC 2017


In preparation for the next patch, just transplant some functions
between header files.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 src/mesa/drivers/dri/i965/brw_batch.h         | 17 +++++++++++++++++
 src/mesa/drivers/dri/i965/intel_batchbuffer.h | 18 ------------------
 2 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_batch.h b/src/mesa/drivers/dri/i965/brw_batch.h
index 6fe80bcb90..3899f18f83 100644
--- a/src/mesa/drivers/dri/i965/brw_batch.h
+++ b/src/mesa/drivers/dri/i965/brw_batch.h
@@ -258,6 +258,23 @@ inline static void brw_batch_maybe_flush(struct brw_batch *batch)
       brw_batch_flush(batch, NULL);
 }
 
+void intel_batchbuffer_save_state(struct brw_batch *batch);
+void intel_batchbuffer_reset_to_saved(struct brw_batch *batch);
+void intel_batchbuffer_require_space(struct brw_batch *batch, GLuint sz,
+                                     enum brw_gpu_ring ring);
+
+void brw_batch_start_hook(struct brw_batch *batch);
+void brw_batch_finish_hook(struct brw_batch *batch);
+
+#define USED_BATCH(batch) ((uintptr_t)((batch)->map_next - (batch)->map))
+
+static inline unsigned
+intel_batchbuffer_space(struct brw_batch *batch)
+{
+   return (batch->state_batch_offset - batch->reserved_space)
+      - USED_BATCH(batch)*4;
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.h b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
index 508b32900f..b7c90df475 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.h
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.h
@@ -23,14 +23,6 @@ int intel_batchbuffer_init(struct brw_batch *batch, dri_bufmgr *bufmgr,
                             int gen, bool has_llc);
 void intel_batchbuffer_free(struct brw_batch *brw);
 
-void intel_batchbuffer_save_state(struct brw_batch *batch);
-void intel_batchbuffer_reset_to_saved(struct brw_batch *batch);
-void intel_batchbuffer_require_space(struct brw_batch *batch, GLuint sz,
-                                     enum brw_gpu_ring ring);
-
-void brw_batch_start_hook(struct brw_batch *batch);
-void brw_batch_finish_hook(struct brw_batch *batch);
-
 /* Unlike bmBufferData, this currently requires the buffer be mapped.
  * Consider it a convenience function wrapping multple
  * intel_buffer_dword() calls.
@@ -52,8 +44,6 @@ uint64_t intel_batchbuffer_reloc64(struct brw_batch *batch,
                                    uint32_t write_domain,
                                    uint32_t delta);
 
-#define USED_BATCH(batch) ((uintptr_t)((batch)->map_next - (batch)->map))
-
 static inline uint32_t float_as_int(float f)
 {
    union {
@@ -70,14 +60,6 @@ static inline uint32_t float_as_int(float f)
  * be passed as structs rather than dwords, but that's a little bit of
  * work...
  */
-static inline unsigned
-intel_batchbuffer_space(struct brw_batch *batch)
-{
-   return (batch->state_batch_offset - batch->reserved_space)
-      - USED_BATCH(batch)*4;
-}
-
-
 static inline void
 intel_batchbuffer_emit_dword(struct brw_batch *batch, GLuint dword)
 {
-- 
2.11.0



More information about the mesa-dev mailing list