vk/cmd_buffer: Rename emit_batch_buffer_end to end_batch_buffer
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 30 Jul 2015 04:22:10 +0000 (21:22 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 30 Jul 2015 15:24:02 +0000 (08:24 -0700)
This is more generic and doesn't imply that it emits MI_BATCH_BUFFER_END.
While we're at it, we'll move NOOP adding from bo_finish to
end_batch_buffer.

src/vulkan/anv_cmd_buffer.c
src/vulkan/anv_cmd_emit.c
src/vulkan/anv_private.h

index 2d46cc0c0ad81076fb76a01fe23ea7fdc1fc54fd..a0a67af676cc40a5153f98c70ceacea143f84d37 100644 (file)
@@ -249,10 +249,6 @@ anv_batch_bo_start(struct anv_batch_bo *bbo, struct anv_batch *batch,
 static void
 anv_batch_bo_finish(struct anv_batch_bo *bbo, struct anv_batch *batch)
 {
-   /* Round batch up to an even number of dwords. */
-   if ((batch->next - batch->start) & 4)
-      anv_batch_emit(batch, GEN8_MI_NOOP);
-
    assert(batch->start == bbo->bo.map);
    bbo->length = batch->next - batch->start;
    VG(VALGRIND_CHECK_MEM_IS_DEFINED(batch->start, bbo->length));
@@ -511,7 +507,7 @@ anv_cmd_buffer_reset_batch_bo_chain(struct anv_cmd_buffer *cmd_buffer)
 }
 
 void
-anv_cmd_buffer_emit_batch_buffer_end(struct anv_cmd_buffer *cmd_buffer)
+anv_cmd_buffer_end_batch_buffer(struct anv_cmd_buffer *cmd_buffer)
 {
    struct anv_batch_bo *batch_bo = anv_cmd_buffer_current_batch_bo(cmd_buffer);
    struct anv_batch_bo *surface_bbo =
@@ -519,6 +515,10 @@ anv_cmd_buffer_emit_batch_buffer_end(struct anv_cmd_buffer *cmd_buffer)
 
    anv_batch_emit(&cmd_buffer->batch, GEN8_MI_BATCH_BUFFER_END);
 
+   /* Round batch up to an even number of dwords. */
+   if ((cmd_buffer->batch.next - cmd_buffer->batch.start) & 4)
+      anv_batch_emit(&cmd_buffer->batch, GEN8_MI_NOOP);
+
    anv_batch_bo_finish(batch_bo, &cmd_buffer->batch);
 
    surface_bbo->length = cmd_buffer->surface_next;
index abe7275e2bde183cd86124197b7f13b1662c5174..93ffb8cf2c1a3f162fa9c608bcb9af5d88e24012 100644 (file)
@@ -182,7 +182,7 @@ VkResult anv_EndCommandBuffer(
    ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, cmdBuffer);
    struct anv_device *device = cmd_buffer->device;
 
-   anv_cmd_buffer_emit_batch_buffer_end(cmd_buffer);
+   anv_cmd_buffer_end_batch_buffer(cmd_buffer);
 
    /* The algorithm used to compute the validate list is not threadsafe as
     * it uses the bo->index field.  We have to lock the device around it.
index a3787229a74f8764717a74f75139ba0367d11b11..f3f50002568934939e9118937695b3397bb3f17b 100644 (file)
@@ -740,7 +740,7 @@ struct anv_cmd_buffer {
 VkResult anv_cmd_buffer_init_batch_bo_chain(struct anv_cmd_buffer *cmd_buffer);
 void anv_cmd_buffer_fini_batch_bo_chain(struct anv_cmd_buffer *cmd_buffer);
 void anv_cmd_buffer_reset_batch_bo_chain(struct anv_cmd_buffer *cmd_buffer);
-void anv_cmd_buffer_emit_batch_buffer_end(struct anv_cmd_buffer *cmd_buffer);
+void anv_cmd_buffer_end_batch_buffer(struct anv_cmd_buffer *cmd_buffer);
 void anv_cmd_buffer_prepare_execbuf(struct anv_cmd_buffer *cmd_buffer);
 
 struct anv_bo *