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>
(cherry picked from commit 3b78f17532)
This commit is contained in:
Kenneth Graunke 2021-11-15 19:14:01 -08:00 committed by Eric Engestrom
parent 1b90272e16
commit 00638cea40
2 changed files with 10 additions and 13 deletions

View file

@ -2830,7 +2830,7 @@
"description": "iris: Tidy code in iris_use_pinned_bo a bit",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "b21e916a6280f9aee5353c0dd4c6bcebb947496d"
},

View file

@ -356,20 +356,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