panfrost: Support debugging JM context priorities with env vars

Allow users to set an environment variable to influence JM context slot
priorities.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Ashley Smith <ashley.smith@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37075>
This commit is contained in:
Boris Brezillon
2025-08-29 00:06:46 +01:00
committed by Marge Bot
parent e9aedfe508
commit 4a84acff8a

View File

@@ -974,6 +974,13 @@ panfrost_fence_server_sync(struct pipe_context *pctx,
close(fd);
}
static const struct debug_named_value panfrost_prio_options[] = {
{"low", PIPE_CONTEXT_LOW_PRIORITY, "low prio"},
{"high", PIPE_CONTEXT_HIGH_PRIORITY, "high prio"},
{"rt", PIPE_CONTEXT_REALTIME_PRIORITY, "real-time prio"},
DEBUG_NAMED_VALUE_END
};
struct pipe_context *
panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
{
@@ -982,6 +989,15 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
if (!ctx)
return NULL;
unsigned prio =
debug_get_flags_option("PAN_MESA_PRIO", panfrost_prio_options, 0);
if (prio) {
flags &= (PIPE_CONTEXT_LOW_PRIORITY | PIPE_CONTEXT_HIGH_PRIORITY |
PIPE_CONTEXT_REALTIME_PRIORITY);
flags |= prio;
}
ctx->flags = flags;
struct pipe_context *gallium = (struct pipe_context *)ctx;