diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index e9d472db759..9264477fd5e 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -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;