X-Git-Url: https://git.libre-soc.org/?p=mesa.git;a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fetnaviv%2Fetnaviv_resource.c;h=c7eedab74187cd3644b0d4b21d6b31ddd3ef434e;hp=ab40414fbe2cf76e35ec5899f65d82d53bcaee17;hb=f317ee1aff4365df5b8d183565eeee535ebc6576;hpb=c7cddc278767ef5acfd7bba35c66ebebef3b3396 diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c index ab40414fbe2..c7eedab7418 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_resource.c +++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c @@ -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;