panfrost: Add a cleanup_batch() method to panfrost_vtable

We have to do some cleanup on v10+. Let's add a new hook to allow
per-arch batch cleanup procedures.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
This commit is contained in:
Boris Brezillon
2023-10-04 10:49:40 +02:00
committed by Marge Bot
parent 5b53db5f60
commit e6a97a2b4a
4 changed files with 12 additions and 1 deletions
@@ -3777,6 +3777,7 @@ GENX(panfrost_cmdstream_screen_init)(struct panfrost_screen *screen)
screen->vtbl.context_init = JOBX(init_context);
screen->vtbl.context_cleanup = JOBX(cleanup_context);
screen->vtbl.init_batch = JOBX(init_batch);
screen->vtbl.cleanup_batch = JOBX(cleanup_batch);
screen->vtbl.submit_batch = submit_batch;
screen->vtbl.get_blend_shader = GENX(pan_blend_get_shader_locked);
screen->vtbl.get_compiler_options = GENX(pan_shader_get_compiler_options);
+6
View File
@@ -60,6 +60,12 @@ GENX(jm_cleanup_context)(struct panfrost_context *ctx)
}
void GENX(jm_init_batch)(struct panfrost_batch *batch);
static inline void
GENX(jm_cleanup_batch)(struct panfrost_batch *batch)
{
}
int GENX(jm_submit_batch)(struct panfrost_batch *batch);
void GENX(jm_preload_fb)(struct panfrost_batch *batch, struct pan_fb_info *fb);
+3
View File
@@ -113,6 +113,7 @@ static void
panfrost_batch_cleanup(struct panfrost_context *ctx,
struct panfrost_batch *batch)
{
struct panfrost_screen *screen = pan_screen(ctx->base.screen);
struct panfrost_device *dev = pan_device(ctx->base.screen);
assert(batch->seqnum);
@@ -120,6 +121,8 @@ panfrost_batch_cleanup(struct panfrost_context *ctx,
if (ctx->batch == batch)
ctx->batch = NULL;
screen->vtbl.cleanup_batch(batch);
unsigned batch_idx = panfrost_batch_idx(batch);
pan_bo_access *flags = util_dynarray_begin(&batch->bos);
+2 -1
View File
@@ -74,8 +74,9 @@ struct panfrost_vtable {
void (*context_init)(struct panfrost_context *ctx);
void (*context_cleanup)(struct panfrost_context *ctx);
/* Device-dependent initialization of a panfrost_batch */
/* Device-dependent initialization/cleanup of a panfrost_batch */
void (*init_batch)(struct panfrost_batch *batch);
void (*cleanup_batch)(struct panfrost_batch *batch);
/* Device-dependent submission of a panfrost_batch */
int (*submit_batch)(struct panfrost_batch *batch, struct pan_fb_info *fb);