iris: use add_bo_to_batch() when adding batch->bo

Again, we don't need all the dependency checking, seqno incrementing
and duplicate tracking for batch->bo. Just use the unchecked version.

This commit is not particularly significant since it really just saves
us a check in the iris_use_pinned_bo() hot path, but since we already
have the helper function, why not?

v2:
 - (turns out the answer to "why not?" is because the patch had a bug)
 - Call ensure_exec_obj_space() since batch batch chaining can happen
   and doesn't guarantee pre-reserved space (Ken).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12194>
This commit is contained in:
Paulo Zanoni
2021-08-02 13:41:46 -07:00
parent 155a7a9b0f
commit 03d17461f3

View File

@@ -296,6 +296,7 @@ iris_use_pinned_bo(struct iris_batch *batch,
bool writable, enum iris_domain access)
{
assert(bo->kflags & EXEC_OBJECT_PINNED);
assert(bo != batch->bo);
/* Never mark the workaround BO with EXEC_OBJECT_WRITE. We don't care
* about the order of any writes to that buffer, and marking it writable
@@ -322,8 +323,7 @@ iris_use_pinned_bo(struct iris_batch *batch,
return;
}
if (bo != batch->bo &&
(!batch->measure || bo != batch->measure->bo)) {
if (!batch->measure || bo != batch->measure->bo) {
/* This is the first time our batch has seen this BO. Before we use it,
* we may need to flush and synchronize with other batches.
*/
@@ -372,7 +372,8 @@ create_batch(struct iris_batch *batch)
batch->map = iris_bo_map(NULL, batch->bo, MAP_READ | MAP_WRITE);
batch->map_next = batch->map;
iris_use_pinned_bo(batch, batch->bo, false, IRIS_DOMAIN_NONE);
ensure_exec_obj_space(batch, 1);
add_bo_to_batch(batch, batch->bo, false);
}
static void