panfrost: Move context initalization to the vtable
Now there's only a single genx entrypoint. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11851>
This commit is contained in:
committed by
Marge Bot
parent
366de834aa
commit
d0e6db100c
@@ -3699,24 +3699,8 @@ preload(struct panfrost_batch *batch, struct pan_fb_info *fb)
|
||||
pan_is_bifrost(dev) ? batch->tiler_ctx.bifrost : 0);
|
||||
}
|
||||
|
||||
void
|
||||
panfrost_cmdstream_screen_init(struct panfrost_screen *screen)
|
||||
{
|
||||
struct panfrost_device *dev = &screen->dev;
|
||||
|
||||
screen->vtbl.prepare_rsd = prepare_rsd;
|
||||
screen->vtbl.emit_tls = emit_tls;
|
||||
screen->vtbl.emit_fbd = emit_fbd;
|
||||
screen->vtbl.emit_fragment_job = emit_fragment_job;
|
||||
screen->vtbl.screen_destroy = screen_destroy;
|
||||
screen->vtbl.preload = preload;
|
||||
|
||||
pan_blitter_init(dev, &screen->blitter.bin_pool.base,
|
||||
&screen->blitter.desc_pool.base);
|
||||
}
|
||||
|
||||
void
|
||||
panfrost_cmdstream_context_init(struct pipe_context *pipe)
|
||||
static void
|
||||
context_init(struct pipe_context *pipe)
|
||||
{
|
||||
pipe->draw_vbo = panfrost_draw_vbo;
|
||||
pipe->launch_grid = panfrost_launch_grid;
|
||||
@@ -3730,3 +3714,22 @@ panfrost_cmdstream_context_init(struct pipe_context *pipe)
|
||||
|
||||
pipe->get_sample_position = panfrost_get_sample_position;
|
||||
}
|
||||
|
||||
void
|
||||
panfrost_cmdstream_screen_init(struct panfrost_screen *screen)
|
||||
{
|
||||
struct panfrost_device *dev = &screen->dev;
|
||||
|
||||
screen->vtbl.prepare_rsd = prepare_rsd;
|
||||
screen->vtbl.emit_tls = emit_tls;
|
||||
screen->vtbl.emit_fbd = emit_fbd;
|
||||
screen->vtbl.emit_fragment_job = emit_fragment_job;
|
||||
screen->vtbl.screen_destroy = screen_destroy;
|
||||
screen->vtbl.preload = preload;
|
||||
screen->vtbl.context_init = context_init;
|
||||
|
||||
pan_blitter_init(dev, &screen->blitter.bin_pool.base,
|
||||
&screen->blitter.desc_pool.base);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1100,7 +1100,8 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
|
||||
|
||||
gallium->set_blend_color = panfrost_set_blend_color;
|
||||
|
||||
panfrost_cmdstream_context_init(gallium);
|
||||
pan_screen(screen)->vtbl.context_init(gallium);
|
||||
|
||||
panfrost_resource_context_init(gallium);
|
||||
panfrost_compute_context_init(gallium);
|
||||
|
||||
|
||||
@@ -436,7 +436,4 @@ panfrost_clean_state_3d(struct panfrost_context *ctx)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
panfrost_cmdstream_context_init(struct pipe_context *pipe);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -70,6 +70,9 @@ struct panfrost_vtable {
|
||||
|
||||
/* Preload framebuffer */
|
||||
void (*preload)(struct panfrost_batch *, struct pan_fb_info *);
|
||||
|
||||
/* Initialize a Gallium context */
|
||||
void (*context_init)(struct pipe_context *pipe);
|
||||
};
|
||||
|
||||
struct panfrost_screen {
|
||||
|
||||
Reference in New Issue
Block a user