From fa0e1f478ba1529a5167acad75a72460a39b11e5 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Mon, 18 Sep 2023 10:55:45 +0200 Subject: [PATCH 47/64] panfrost: Use JOBX() for the ->context_{init,cleanup} hooks Those are job-backend specific, so no need to provide a common entry point, we can directly use JOBX() and have empty implementations for the JM backend. --- src/gallium/drivers/panfrost/pan_cmdstream.c | 34 ++++++++------------ 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 749c98f75e7..73e0fc96d23 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -4996,7 +4996,7 @@ panfrost_sampler_view_destroy(struct pipe_context *pctx, #if PAN_USE_CSF static void -panfrost_csf_init_context(struct panfrost_context *ctx) +csf_init_context(struct panfrost_context *ctx) { struct panfrost_device *dev = pan_device(ctx->base.screen); struct drm_panthor_queue_create qc[] = {{ @@ -5060,7 +5060,7 @@ panfrost_csf_init_context(struct panfrost_context *ctx) } static void -panfrost_csf_cleanup_context(struct panfrost_context *ctx) +csf_cleanup_context(struct panfrost_context *ctx) { struct panfrost_device *dev = pan_device(ctx->base.screen); struct drm_panthor_tiler_heap_destroy thd = { @@ -5081,6 +5081,16 @@ panfrost_csf_cleanup_context(struct panfrost_context *ctx) panfrost_bo_unreference(ctx->heap.desc_bo); } +#else +static void +jm_init_context(struct panfrost_context *ctx) +{ +} + +static void +jm_cleanup_context(struct panfrost_context *ctx) +{ +} #endif static void @@ -5100,22 +5110,6 @@ context_populate_vtbl(struct pipe_context *pipe) pipe->get_sample_position = u_default_get_sample_position; } -static void -context_init(struct panfrost_context *ctx) -{ -#if PAN_USE_CSF - panfrost_csf_init_context(ctx); -#endif -} - -static void -context_cleanup(struct panfrost_context *ctx) -{ -#if PAN_USE_CSF - panfrost_csf_cleanup_context(ctx); -#endif -} - #if PAN_ARCH <= 5 /* Returns the polygon list's GPU address if available, or otherwise allocates @@ -5188,8 +5182,8 @@ GENX(panfrost_cmdstream_screen_init)(struct panfrost_screen *screen) screen->vtbl.screen_destroy = screen_destroy; screen->vtbl.preload = preload; screen->vtbl.context_populate_vtbl = context_populate_vtbl; - screen->vtbl.context_init = context_init; - screen->vtbl.context_cleanup = context_cleanup; + screen->vtbl.context_init = JOBX(init_context); + screen->vtbl.context_cleanup = JOBX(cleanup_context); screen->vtbl.init_batch = init_batch; screen->vtbl.get_blend_shader = GENX(pan_blend_get_shader_locked); screen->vtbl.init_polygon_list = init_polygon_list; -- 2.42.0