asahi: skip set if tested

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616>
This commit is contained in:
Alyssa Rosenzweig 2024-01-21 11:53:56 -04:00 committed by Marge Bot
parent 7eac18b1bc
commit 46c70b72ca

View file

@ -981,12 +981,13 @@ agx_batch_add_bo(struct agx_batch *batch, struct agx_bo *bo)
batch->bo_list.word_count = word_count;
}
if (BITSET_TEST(batch->bo_list.set, bo->handle))
return;
/* The batch holds a single reference to each BO in the batch, released when
* the batch finishes execution.
*/
if (!BITSET_TEST(batch->bo_list.set, bo->handle))
agx_bo_reference(bo);
agx_bo_reference(bo);
BITSET_SET(batch->bo_list.set, bo->handle);
}