etnaviv: move buffer range tracking into the PIPE_MAP_WRITE clause
Move the valid buffer range tracking next to all the other things we do on write mapping. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24164>
This commit is contained in:
@@ -167,6 +167,10 @@ etna_transfer_unmap(struct pipe_context *pctx, struct pipe_transfer *ptrans)
|
||||
FREE(trans->staging);
|
||||
}
|
||||
|
||||
if (ptrans->resource->target == PIPE_BUFFER)
|
||||
util_range_add(&rsc->base, &rsc->valid_buffer_range,
|
||||
ptrans->box.x, ptrans->box.x + ptrans->box.width);
|
||||
|
||||
etna_resource_level_ts_mark_invalid(res_level);
|
||||
etna_resource_level_mark_changed(res_level);
|
||||
|
||||
@@ -186,14 +190,6 @@ etna_transfer_unmap(struct pipe_context *pctx, struct pipe_transfer *ptrans)
|
||||
if (!trans->rsc && !(ptrans->usage & PIPE_MAP_UNSYNCHRONIZED))
|
||||
etna_bo_cpu_fini(rsc->bo);
|
||||
|
||||
if ((ptrans->resource->target == PIPE_BUFFER) &&
|
||||
(ptrans->usage & PIPE_MAP_WRITE)) {
|
||||
util_range_add(&rsc->base,
|
||||
&rsc->valid_buffer_range,
|
||||
ptrans->box.x,
|
||||
ptrans->box.x + ptrans->box.width);
|
||||
}
|
||||
|
||||
pipe_resource_reference(&trans->rsc, NULL);
|
||||
pipe_resource_reference(&ptrans->resource, NULL);
|
||||
slab_free(&ctx->transfer_pool, trans);
|
||||
|
||||
Reference in New Issue
Block a user