mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
iris: Make a resource_is_busy() helper
This checks both "is it busy" and "do we have work queued up for it"?
This commit is contained in:
parent
5ad0c88dbe
commit
768b17a7ad
1 changed files with 13 additions and 4 deletions
|
|
@ -878,6 +878,18 @@ iris_resource_get_handle(struct pipe_screen *pscreen,
|
|||
return false;
|
||||
}
|
||||
|
||||
static bool
|
||||
resource_is_busy(struct iris_context *ice,
|
||||
struct iris_resource *res)
|
||||
{
|
||||
bool busy = iris_bo_busy(res->bo);
|
||||
|
||||
for (int i = 0; i < IRIS_BATCH_COUNT; i++)
|
||||
busy |= iris_batch_references(&ice->batches[i], res->bo);
|
||||
|
||||
return busy;
|
||||
}
|
||||
|
||||
static void
|
||||
iris_invalidate_resource(struct pipe_context *ctx,
|
||||
struct pipe_resource *resource)
|
||||
|
|
@ -1331,10 +1343,7 @@ iris_transfer_map(struct pipe_context *ctx,
|
|||
}
|
||||
|
||||
if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED)) {
|
||||
map_would_stall = iris_bo_busy(res->bo);
|
||||
|
||||
for (int i = 0; i < IRIS_BATCH_COUNT; i++)
|
||||
map_would_stall |= iris_batch_references(&ice->batches[i], res->bo);
|
||||
map_would_stall = resource_is_busy(ice, res);
|
||||
|
||||
if (map_would_stall && (usage & PIPE_TRANSFER_DONTBLOCK) &&
|
||||
(usage & PIPE_TRANSFER_MAP_DIRECTLY))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue