From 5b53db5f6097e5fc039beed9553939420cc84d1a Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Mon, 13 Nov 2023 15:39:50 +0100 Subject: [PATCH] panfrost: Add a panfrost_context_reinit() helper Will be needed for v10, so we can re-instantiate a context when an unrecoverable error is reported on a group or VM. Signed-off-by: Boris Brezillon Reviewed-by: Antonino Maniscalco Reviewed-by: Erik Faye-Lund Part-of: --- src/gallium/drivers/panfrost/pan_context.c | 7 +++++++ src/gallium/drivers/panfrost/pan_context.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 9bc1f018f05..e408d49a24d 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -986,3 +986,10 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags) return gallium; } + +void +panfrost_context_reinit(struct panfrost_context *ctx) +{ + pan_screen(ctx->base.screen)->vtbl.context_cleanup(ctx); + pan_screen(ctx->base.screen)->vtbl.context_init(ctx); +} diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index 407e3dd6afc..caf5e3534b0 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -523,4 +523,6 @@ void panfrost_track_image_access(struct panfrost_batch *batch, enum pipe_shader_type stage, struct pipe_image_view *image); +void panfrost_context_reinit(struct panfrost_context *ctx); + #endif