anv: Add a cmd_buffer_execbuf helper
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 2 Nov 2016 17:33:54 +0000 (10:33 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 9 Nov 2016 19:30:55 +0000 (11:30 -0800)
This puts the actual execbuf2 call in anv_batch_chain.c along with the
other relocation stuff.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
src/intel/vulkan/anv_batch_chain.c
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_private.h

index 1e348cfb004b5ede51b04f2c8155534a4e3ac351..325da83324e659f095121c00079ce8d33bf06f07 100644 (file)
@@ -1202,3 +1202,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);
+}
index 6d8de90bf70c9c2a9e282fc45551f9e8336016a1..27402ceba52a22c96a42e1b8ca1b746448c4b16d 100644 (file)
@@ -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;
       }
index bc09208dec1854997b00b082fea89b113e8c9bee..7f4a27d86dc4040bc32dccd27e6cb0c46d5e108f 100644 (file)
@@ -1200,6 +1200,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);