[Mesa-dev] [PATCH 09/12] anv: Always set batch chain GTT address

Chris Wilson chris at chris-wilson.co.uk
Sun May 14 23:38:53 UTC 2017


A requirement for NORELOC is that the relocation entry exactly matches
the content of the buffer, and so we must set the value in the buffer on
adding the relocation.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 src/intel/vulkan/anv_batch_chain.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index 8edc2b521e..fe27038cd3 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -534,9 +534,12 @@ anv_batch_bo_list_clone(const struct list_head *list,
             prev_bbo->relocs.num_relocs--;
 
          const int reloc_size = cmd_buffer->device->info.gen < 8 ? 4 : 8;
+         uint64_t address;
          anv_reloc_list_add(&prev_bbo->relocs, &cmd_buffer->pool->alloc,
                             prev_bbo->length - reloc_size, &new_bbo->bo, 0,
-                            NULL);
+                            &address);
+         memcpy(prev_bbo->bo.map + prev_bbo->length - reloc_size,
+                &address, reloc_size);
       }
 
       prev_bbo = new_bbo;
-- 
2.11.0



More information about the mesa-dev mailing list