etnaviv: don't flush own context when updating resource use
The context is self synchronizing at the GPU side, as commands are
executed in order. We must not flush our own context when updating the
resource use, as that leads to excessive flushing on effectively every
draw call, causing huge CPU overhead.
Fixes: 64813541d5
(etnaviv: fix resource usage tracking across
different pipe_context's)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
This commit is contained in:
parent
c7cddc2787
commit
f317ee1aff
|
@ -666,9 +666,18 @@ etna_resource_used(struct etna_context *ctx, struct pipe_resource *prsc,
|
|||
struct etna_context *extctx = (struct etna_context *)entry->key;
|
||||
struct pipe_context *pctx = &extctx->base;
|
||||
|
||||
if (extctx == ctx)
|
||||
continue;
|
||||
|
||||
pctx->flush(pctx, NULL, 0);
|
||||
/* It's safe to clear the status here. If we need to flush it means
|
||||
* either another context had the resource in exclusive (write) use,
|
||||
* or we transition the resource to exclusive use in our context.
|
||||
* In both cases the new status accurately reflects the resource use
|
||||
* after the flush.
|
||||
*/
|
||||
rsc->status = 0;
|
||||
}
|
||||
rsc->status = 0;
|
||||
}
|
||||
|
||||
rsc->status |= status;
|
||||
|
|
Loading…
Reference in New Issue