[Mesa-dev] [PATCH v3 2/8] anv: Add a cmd_buffer_execbuf helper

Jason Ekstrand jason at jlekstrand.net
Wed Nov 2 20:58:37 UTC 2016


This puts the actual execbuf2 call in anv_batch_chain.c along with the
other relocation stuff.
---
 src/intel/vulkan/anv_batch_chain.c | 8 ++++++++
 src/intel/vulkan/anv_device.c      | 3 +--
 src/intel/vulkan/anv_private.h     | 2 ++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index dfa9abf..529fe7e 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -1131,3 +1131,11 @@ anv_cmd_buffer_prepare_execbuf(struct anv_cmd_buffer *cmd_buffer)
    if (!cmd_buffer->execbuf2.need_reloc)
       cmd_buffer->execbuf2.execbuf.flags |= I915_EXEC_NO_RELOC;
 }
+
+VkResult
+anv_cmd_buffer_execbuf(struct anv_device *device,
+                       struct anv_cmd_buffer *cmd_buffer)
+{
+   return anv_device_execbuf(device, &cmd_buffer->execbuf2.execbuf,
+                             cmd_buffer->execbuf2.bos);
+}
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 6d8de90..27402ce 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -1103,8 +1103,7 @@ VkResult anv_QueueSubmit(
                          pSubmits[i].pCommandBuffers[j]);
          assert(cmd_buffer->level == VK_COMMAND_BUFFER_LEVEL_PRIMARY);
 
-         result = anv_device_execbuf(device, &cmd_buffer->execbuf2.execbuf,
-                                     cmd_buffer->execbuf2.bos);
+         result = anv_cmd_buffer_execbuf(device, cmd_buffer);
          if (result != VK_SUCCESS)
             return result;
       }
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 83b9328..2265346 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -1195,6 +1195,8 @@ void anv_cmd_buffer_end_batch_buffer(struct anv_cmd_buffer *cmd_buffer);
 void anv_cmd_buffer_add_secondary(struct anv_cmd_buffer *primary,
                                   struct anv_cmd_buffer *secondary);
 void anv_cmd_buffer_prepare_execbuf(struct anv_cmd_buffer *cmd_buffer);
+VkResult anv_cmd_buffer_execbuf(struct anv_device *device,
+                                struct anv_cmd_buffer *cmd_buffer);
 
 VkResult anv_cmd_buffer_reset(struct anv_cmd_buffer *cmd_buffer);
 
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list