i965: Rename batch->exec_objects to validation_list

Within i965, we have many different objects and confusingly when
submitting an execbuf we have lists of both our internal objects and a
list of the kernel's drm_i915_gem_exec_object with very similar names.
Rename the kernel's validation list to avoid the collison as it is only
used for interfacing with the kernel and so a peripheral use of
"object".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Chris Wilson 2017-07-20 17:29:19 +01:00 committed by Kenneth Graunke
parent 8696c3e997
commit 0e6ad379dd
2 changed files with 14 additions and 12 deletions

View file

@ -458,11 +458,13 @@ struct intel_batchbuffer {
struct drm_i915_gem_relocation_entry *relocs;
int reloc_count;
int reloc_array_size;
/** The validation list */
struct drm_i915_gem_exec_object2 *exec_objects;
struct drm_i915_gem_exec_object2 *validation_list;
struct brw_bo **exec_bos;
int exec_count;
int exec_array_size;
/** The amount of aperture space (in bytes) used by all exec_bos */
int aperture_space;

View file

@ -78,8 +78,8 @@ intel_batchbuffer_init(struct intel_batchbuffer *batch,
batch->exec_array_size = 100;
batch->exec_bos =
malloc(batch->exec_array_size * sizeof(batch->exec_bos[0]));
batch->exec_objects =
malloc(batch->exec_array_size * sizeof(batch->exec_objects[0]));
batch->validation_list =
malloc(batch->exec_array_size * sizeof(batch->validation_list[0]));
if (INTEL_DEBUG & DEBUG_BATCH) {
batch->state_batch_sizes =
@ -162,7 +162,7 @@ intel_batchbuffer_free(struct intel_batchbuffer *batch)
}
free(batch->relocs);
free(batch->exec_bos);
free(batch->exec_objects);
free(batch->validation_list);
brw_bo_unreference(batch->last_bo);
brw_bo_unreference(batch->bo);
@ -532,13 +532,13 @@ add_exec_bo(struct intel_batchbuffer *batch, struct brw_bo *bo)
batch->exec_bos =
realloc(batch->exec_bos,
batch->exec_array_size * sizeof(batch->exec_bos[0]));
batch->exec_objects =
realloc(batch->exec_objects,
batch->exec_array_size * sizeof(batch->exec_objects[0]));
batch->validation_list =
realloc(batch->validation_list,
batch->exec_array_size * sizeof(batch->validation_list[0]));
}
struct drm_i915_gem_exec_object2 *validation_entry =
&batch->exec_objects[batch->exec_count];
&batch->validation_list[batch->exec_count];
validation_entry->handle = bo->gem_handle;
if (bo == batch->bo) {
validation_entry->relocation_count = batch->reloc_count;
@ -568,7 +568,7 @@ execbuffer(int fd,
int flags)
{
struct drm_i915_gem_execbuffer2 execbuf = {
.buffers_ptr = (uintptr_t) batch->exec_objects,
.buffers_ptr = (uintptr_t) batch->validation_list,
.buffer_count = batch->exec_count,
.batch_start_offset = 0,
.batch_len = used,
@ -599,10 +599,10 @@ execbuffer(int fd,
bo->idle = false;
/* Update brw_bo::offset64 */
if (batch->exec_objects[i].offset != bo->offset64) {
if (batch->validation_list[i].offset != bo->offset64) {
DBG("BO %d migrated: 0x%" PRIx64 " -> 0x%llx\n",
bo->gem_handle, bo->offset64, batch->exec_objects[i].offset);
bo->offset64 = batch->exec_objects[i].offset;
bo->gem_handle, bo->offset64, batch->validation_list[i].offset);
bo->offset64 = batch->validation_list[i].offset;
}
}