iris: Tidy code in iris_use_pinned_bo a bit

Now that we aren't short-circuiting most of the code, we should probably
reorganize it a little bit.  Tagged with fixes just so we pull all the
refactors together as one group.

Fixes: b21e916a62 ("iris: Combine iris_use_pinned_bo and add_exec_bo")
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13808>
This commit is contained in:
Kenneth Graunke
2021-11-15 19:14:01 -08:00
parent 6e90984934
commit 3b78f17532

View File

@@ -360,20 +360,17 @@ iris_use_pinned_bo(struct iris_batch *batch,
int existing_index = find_exec_index(batch, bo);
if (existing_index != -1) {
if (existing_index == -1) {
flush_for_cross_batch_dependencies(batch, bo, writable);
ensure_exec_obj_space(batch, 1);
add_bo_to_batch(batch, bo, writable);
} else if (writable && !BITSET_TEST(batch->bos_written, existing_index)) {
flush_for_cross_batch_dependencies(batch, bo, writable);
/* The BO is already in the list; mark it writable */
if (writable && !BITSET_TEST(batch->bos_written, existing_index)) {
BITSET_SET(batch->bos_written, existing_index);
flush_for_cross_batch_dependencies(batch, bo, writable);
}
return;
BITSET_SET(batch->bos_written, existing_index);
}
flush_for_cross_batch_dependencies(batch, bo, writable);
ensure_exec_obj_space(batch, 1);
add_bo_to_batch(batch, bo, writable);
}
static void