vk/cmd_buffer: Rename bo_count to exec2_bo_count
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 15 Jul 2015 23:48:13 +0000 (16:48 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 15 Jul 2015 23:56:29 +0000 (16:56 -0700)
src/vulkan/anv_cmd_buffer.c
src/vulkan/aub.c
src/vulkan/device.c
src/vulkan/private.h

index e6e60e141891323668ecca29b5dbec3580f8731e..8ccecd8f63b11f4f702bbd54217a970caed771df 100644 (file)
@@ -510,11 +510,11 @@ anv_cmd_buffer_add_bo(struct anv_cmd_buffer *cmd_buffer,
 {
    struct drm_i915_gem_exec_object2 *obj;
 
-   if (bo->index < cmd_buffer->bo_count &&
+   if (bo->index < cmd_buffer->exec2_bo_count &&
        cmd_buffer->exec2_bos[bo->index] == bo)
       return VK_SUCCESS;
 
-   if (cmd_buffer->bo_count >= cmd_buffer->exec2_array_length) {
+   if (cmd_buffer->exec2_bo_count >= cmd_buffer->exec2_array_length) {
       uint32_t new_len = cmd_buffer->exec2_objects ?
                          cmd_buffer->exec2_array_length * 2 : 64;
 
@@ -534,9 +534,9 @@ anv_cmd_buffer_add_bo(struct anv_cmd_buffer *cmd_buffer,
 
       if (cmd_buffer->exec2_objects) {
          memcpy(new_objects, cmd_buffer->exec2_objects,
-                cmd_buffer->bo_count * sizeof(*new_objects));
+                cmd_buffer->exec2_bo_count * sizeof(*new_objects));
          memcpy(new_bos, cmd_buffer->exec2_bos,
-                cmd_buffer->bo_count * sizeof(*new_bos));
+                cmd_buffer->exec2_bo_count * sizeof(*new_bos));
       }
 
       cmd_buffer->exec2_objects = new_objects;
@@ -544,9 +544,9 @@ anv_cmd_buffer_add_bo(struct anv_cmd_buffer *cmd_buffer,
       cmd_buffer->exec2_array_length = new_len;
    }
 
-   assert(cmd_buffer->bo_count < cmd_buffer->exec2_array_length);
+   assert(cmd_buffer->exec2_bo_count < cmd_buffer->exec2_array_length);
 
-   bo->index = cmd_buffer->bo_count++;
+   bo->index = cmd_buffer->exec2_bo_count++;
    obj = &cmd_buffer->exec2_objects[bo->index];
    cmd_buffer->exec2_bos[bo->index] = bo;
 
@@ -616,7 +616,7 @@ VkResult anv_EndCommandBuffer(
       cmd_buffer->surface_relocs.num_relocs - cmd_buffer->surface_batch_bo->first_reloc;
    cmd_buffer->surface_batch_bo->length = cmd_buffer->surface_next;
 
-   cmd_buffer->bo_count = 0;
+   cmd_buffer->exec2_bo_count = 0;
    cmd_buffer->need_reloc = false;
 
    /* Lock for access to bo->index. */
@@ -650,13 +650,13 @@ VkResult anv_EndCommandBuffer(
    anv_cmd_buffer_add_bo(cmd_buffer, &batch_bo->bo,
                          &batch->relocs.relocs[batch_bo->first_reloc],
                          batch_bo->num_relocs);
-   assert(batch_bo->bo.index == cmd_buffer->bo_count - 1);
+   assert(batch_bo->bo.index == cmd_buffer->exec2_bo_count - 1);
 
    anv_cmd_buffer_process_relocs(cmd_buffer, &cmd_buffer->surface_relocs);
    anv_cmd_buffer_process_relocs(cmd_buffer, &batch->relocs);
 
    cmd_buffer->execbuf.buffers_ptr = (uintptr_t) cmd_buffer->exec2_objects;
-   cmd_buffer->execbuf.buffer_count = cmd_buffer->bo_count;
+   cmd_buffer->execbuf.buffer_count = cmd_buffer->exec2_bo_count;
    cmd_buffer->execbuf.batch_start_offset = 0;
    cmd_buffer->execbuf.batch_len = batch->next - batch->start;
    cmd_buffer->execbuf.cliprects_ptr = 0;
index 42d4611eb6ea0bc30eb81a0af753fe65972235d5..c33defd48f5001e1cbbc6101faa135a85bad40d0 100644 (file)
@@ -248,9 +248,9 @@ anv_cmd_buffer_dump(struct anv_cmd_buffer *cmd_buffer)
    if (writer == NULL)
       return;
 
-   aub_bos = malloc(cmd_buffer->bo_count * sizeof(aub_bos[0]));
+   aub_bos = malloc(cmd_buffer->exec2_bo_count * sizeof(aub_bos[0]));
    offset = writer->offset;
-   for (uint32_t i = 0; i < cmd_buffer->bo_count; i++) {
+   for (uint32_t i = 0; i < cmd_buffer->exec2_bo_count; i++) {
       bo = cmd_buffer->exec2_bos[i];
       if (bo->map)
          aub_bos[i].map = bo->map;
@@ -282,9 +282,9 @@ anv_cmd_buffer_dump(struct anv_cmd_buffer *cmd_buffer)
                   bbo->num_relocs, aub_bos);
    }
 
-   for (uint32_t i = 0; i < cmd_buffer->bo_count; i++) {
+   for (uint32_t i = 0; i < cmd_buffer->exec2_bo_count; i++) {
       bo = cmd_buffer->exec2_bos[i];
-      if (i == cmd_buffer->bo_count - 1) {
+      if (i == cmd_buffer->exec2_bo_count - 1) {
          assert(bo == &first_bbo->bo);
          aub_write_trace_block(writer, AUB_TRACE_TYPE_BATCH,
                                aub_bos[i].relocated,
index c168219a40b2cf214ee0917666b8020049e4595d..052b725348eaef33fb8c33f7a8a11cfd6c9dbe82 100644 (file)
@@ -751,7 +751,7 @@ VkResult anv_QueueSubmit(
                return vk_error(VK_ERROR_UNKNOWN);
          }
 
-         for (uint32_t i = 0; i < cmd_buffer->bo_count; i++)
+         for (uint32_t i = 0; i < cmd_buffer->exec2_bo_count; i++)
             cmd_buffer->exec2_bos[i]->offset = cmd_buffer->exec2_objects[i].offset;
       } else {
          *(uint32_t *)queue->completed_serial.map = cmd_buffer->serial;
index cfc46ee8f60d8c2a241fde6c5dd2a0ac45ce022d..9c9190ab62a46e1bc55ca0dd6f0908b5ce94c48c 100644 (file)
@@ -697,12 +697,12 @@ struct anv_cmd_buffer {
 
    struct drm_i915_gem_execbuffer2              execbuf;
    struct drm_i915_gem_exec_object2 *           exec2_objects;
+   uint32_t                                     exec2_bo_count;
    struct anv_bo **                             exec2_bos;
    uint32_t                                     exec2_array_length;
    bool                                         need_reloc;
    uint32_t                                     serial;
 
-   uint32_t                                     bo_count;
    struct anv_batch                             batch;
    struct anv_batch_bo *                        last_batch_bo;
    struct anv_batch_bo *                        surface_batch_bo;