etnaviv: track resource sharing

Track if resources are shared outside of the screen, which means
changes to the resource must be visible to the external observers
after a flush and the resource might be manipulated by other
agents than the contexts from the screen.

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/25756>
This commit is contained in:
Lucas Stach 2023-10-16 20:03:39 +02:00 committed by Marge Bot
parent 22c4a5e127
commit 9ab9df3941
2 changed files with 4 additions and 0 deletions

View file

@ -678,6 +678,7 @@ etna_resource_from_handle(struct pipe_screen *pscreen,
rsc->layout = modifier_to_layout(modifier);
rsc->modifier = modifier;
rsc->shared = true;
if (usage & PIPE_HANDLE_USAGE_EXPLICIT_FLUSH)
rsc->explicit_flush = true;
@ -780,6 +781,7 @@ etna_resource_get_handle(struct pipe_screen *pscreen,
}
handle->modifier = etna_resource_modifier(rsc);
rsc->shared = true;
if (!(usage & PIPE_HANDLE_USAGE_EXPLICIT_FLUSH))
rsc->explicit_flush = false;

View file

@ -209,6 +209,8 @@ struct etna_resource {
struct pipe_resource *render;
/* frontend flushes resource via an explicit call to flush_resource */
bool explicit_flush;
/* resource is shared outside of the screen */
bool shared;
};
/* returns TRUE if a is newer than b */