i965: Make intel_bachbuffer_reloc() take a batchbuffer argument
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 2 Jan 2017 15:14:33 +0000 (16:14 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Wed, 4 Jan 2017 07:14:04 +0000 (08:14 +0100)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/genX_blorp_exec.c
src/mesa/drivers/dri/i965/intel_batchbuffer.c
src/mesa/drivers/dri/i965/intel_batchbuffer.h

index edcd89640980237802aabeb8d230eac8f96b66be..40a2499e08f158233c43a4044e0a55a7af51a1d7 100644 (file)
@@ -55,12 +55,12 @@ blorp_emit_reloc(struct blorp_batch *batch,
 
    uint32_t offset = (char *)location - (char *)brw->batch.map;
    if (brw->gen >= 8) {
-      return intel_batchbuffer_reloc64(brw, address.buffer, offset,
+      return intel_batchbuffer_reloc64(&brw->batch, address.buffer, offset,
                                        address.read_domains,
                                        address.write_domain,
                                        address.offset + delta);
    } else {
-      return intel_batchbuffer_reloc(brw, address.buffer, offset,
+      return intel_batchbuffer_reloc(&brw->batch, address.buffer, offset,
                                      address.read_domains,
                                      address.write_domain,
                                      address.offset + delta);
index 65c27731cd2f03a2a59c759fe6c4dddd3fd2244d..1c7bb2c966c5b78e4c45dc2a8f85926ef9b7179e 100644 (file)
@@ -432,14 +432,14 @@ _intel_batchbuffer_flush(struct brw_context *brw,
 /*  This is the only way buffers get added to the validate list.
  */
 uint32_t
-intel_batchbuffer_reloc(struct brw_context *brw,
+intel_batchbuffer_reloc(struct intel_batchbuffer *batch,
                         drm_intel_bo *buffer, uint32_t offset,
                         uint32_t read_domains, uint32_t write_domain,
                         uint32_t delta)
 {
    int ret;
 
-   ret = drm_intel_bo_emit_reloc(brw->batch.bo, offset,
+   ret = drm_intel_bo_emit_reloc(batch->bo, offset,
                                 buffer, delta,
                                 read_domains, write_domain);
    assert(ret == 0);
@@ -453,12 +453,12 @@ intel_batchbuffer_reloc(struct brw_context *brw,
 }
 
 uint64_t
-intel_batchbuffer_reloc64(struct brw_context *brw,
+intel_batchbuffer_reloc64(struct intel_batchbuffer *batch,
                           drm_intel_bo *buffer, uint32_t offset,
                           uint32_t read_domains, uint32_t write_domain,
                           uint32_t delta)
 {
-   int ret = drm_intel_bo_emit_reloc(brw->batch.bo, offset,
+   int ret = drm_intel_bo_emit_reloc(batch->bo, offset,
                                      buffer, delta,
                                      read_domains, write_domain);
    assert(ret == 0);
index fbb51582ee0fb2a4308e6d1c883978e97c0190ea..c4573ec57b839b92583170fa5dfbd5b57a5a65e6 100644 (file)
@@ -62,13 +62,13 @@ void intel_batchbuffer_data(struct brw_context *brw,
                             const void *data, GLuint bytes,
                             enum brw_gpu_ring ring);
 
-uint32_t intel_batchbuffer_reloc(struct brw_context *brw,
+uint32_t intel_batchbuffer_reloc(struct intel_batchbuffer *batch,
                                  drm_intel_bo *buffer,
                                  uint32_t offset,
                                  uint32_t read_domains,
                                  uint32_t write_domain,
                                  uint32_t delta);
-uint64_t intel_batchbuffer_reloc64(struct brw_context *brw,
+uint64_t intel_batchbuffer_reloc64(struct intel_batchbuffer *batch,
                                    drm_intel_bo *buffer,
                                    uint32_t offset,
                                    uint32_t read_domains,
@@ -159,18 +159,18 @@ intel_batchbuffer_advance(struct brw_context *brw)
 #define OUT_BATCH(d) *__map++ = (d)
 #define OUT_BATCH_F(f) OUT_BATCH(float_as_int((f)))
 
-#define OUT_RELOC(buf, read_domains, write_domain, delta) do { \
-   uint32_t __offset = (__map - brw->batch.map) * 4;           \
-   OUT_BATCH(intel_batchbuffer_reloc(brw, (buf), __offset,     \
-                                     (read_domains),           \
-                                     (write_domain),           \
-                                     (delta)));                \
+#define OUT_RELOC(buf, read_domains, write_domain, delta) do {    \
+   uint32_t __offset = (__map - brw->batch.map) * 4;              \
+   OUT_BATCH(intel_batchbuffer_reloc(&brw->batch, (buf), __offset, \
+                                     (read_domains),              \
+                                     (write_domain),              \
+                                     (delta)));                   \
 } while (0)
 
 /* Handle 48-bit address relocations for Gen8+ */
 #define OUT_RELOC64(buf, read_domains, write_domain, delta) do {      \
    uint32_t __offset = (__map - brw->batch.map) * 4;                  \
-   uint64_t reloc64 = intel_batchbuffer_reloc64(brw, (buf), __offset, \
+   uint64_t reloc64 = intel_batchbuffer_reloc64(&brw->batch, (buf), __offset, \
                                                 (read_domains),       \
                                                 (write_domain),       \
                                                 (delta));             \