panfrost: Use vtable for fragment descriptor functions
Arch dependent and not directly from Gallium. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11745>
This commit is contained in:
parent
d4e3f4858c
commit
035434658e
|
@ -2349,8 +2349,8 @@ panfrost_emit_vertex_tiler_jobs(struct panfrost_batch *batch,
|
|||
vertex, 0, tiler_job, false);
|
||||
}
|
||||
|
||||
void
|
||||
panfrost_emit_tls(struct panfrost_batch *batch)
|
||||
static void
|
||||
emit_tls(struct panfrost_batch *batch)
|
||||
{
|
||||
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
||||
|
||||
|
@ -2376,9 +2376,8 @@ panfrost_emit_tls(struct panfrost_batch *batch)
|
|||
pan_emit_tls(dev, &tls, batch->tls.cpu);
|
||||
}
|
||||
|
||||
void
|
||||
panfrost_emit_fbd(struct panfrost_batch *batch,
|
||||
const struct pan_fb_info *fb)
|
||||
static void
|
||||
emit_fbd(struct panfrost_batch *batch, const struct pan_fb_info *fb)
|
||||
{
|
||||
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
||||
struct panfrost_bo *tls_bo =
|
||||
|
@ -2415,9 +2414,8 @@ panfrost_initialize_surface(struct panfrost_batch *batch,
|
|||
/* Generate a fragment job. This should be called once per frame. (According to
|
||||
* presentations, this is supposed to correspond to eglSwapBuffers) */
|
||||
|
||||
mali_ptr
|
||||
panfrost_emit_fragment_job(struct panfrost_batch *batch,
|
||||
const struct pan_fb_info *pfb)
|
||||
static mali_ptr
|
||||
emit_fragment_job(struct panfrost_batch *batch, const struct pan_fb_info *pfb)
|
||||
{
|
||||
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
||||
|
||||
|
@ -3652,6 +3650,9 @@ void
|
|||
panfrost_cmdstream_screen_init(struct panfrost_screen *screen)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -782,7 +782,9 @@ panfrost_batch_submit_jobs(struct panfrost_batch *batch,
|
|||
const struct pan_fb_info *fb,
|
||||
uint32_t in_sync, uint32_t out_sync)
|
||||
{
|
||||
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
||||
struct pipe_screen *pscreen = batch->ctx->base.screen;
|
||||
struct panfrost_screen *screen = pan_screen(pscreen);
|
||||
struct panfrost_device *dev = pan_device(pscreen);
|
||||
bool has_draws = batch->scoreboard.first_job;
|
||||
bool has_tiler = batch->scoreboard.first_tiler;
|
||||
bool has_frag = has_tiler || batch->clear;
|
||||
|
@ -811,7 +813,7 @@ panfrost_batch_submit_jobs(struct panfrost_batch *batch,
|
|||
* *only* clears, since otherwise the tiler structures will be
|
||||
* uninitialized leading to faults (or state leaks) */
|
||||
|
||||
mali_ptr fragjob = panfrost_emit_fragment_job(batch, fb);
|
||||
mali_ptr fragjob = screen->vtbl.emit_fragment_job(batch, fb);
|
||||
ret = panfrost_batch_submit_ioctl(batch, fragjob,
|
||||
PANFROST_JD_REQ_FS, 0,
|
||||
out_sync);
|
||||
|
@ -849,7 +851,9 @@ static void
|
|||
panfrost_batch_submit(struct panfrost_batch *batch,
|
||||
uint32_t in_sync, uint32_t out_sync)
|
||||
{
|
||||
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
||||
struct pipe_screen *pscreen = batch->ctx->base.screen;
|
||||
struct panfrost_screen *screen = pan_screen(pscreen);
|
||||
struct panfrost_device *dev = pan_device(pscreen);
|
||||
int ret;
|
||||
|
||||
/* Nothing to do! */
|
||||
|
@ -875,11 +879,11 @@ panfrost_batch_submit(struct panfrost_batch *batch,
|
|||
/* Now that all draws are in, we can finally prepare the
|
||||
* FBD for the batch (if there is one). */
|
||||
|
||||
panfrost_emit_tls(batch);
|
||||
screen->vtbl.emit_tls(batch);
|
||||
panfrost_emit_tile_map(batch, &fb);
|
||||
|
||||
if (batch->scoreboard.first_tiler || batch->clear)
|
||||
panfrost_emit_fbd(batch, &fb);
|
||||
screen->vtbl.emit_fbd(batch, &fb);
|
||||
|
||||
ret = panfrost_batch_submit_jobs(batch, &fb, in_sync, out_sync);
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ struct panfrost_batch;
|
|||
struct panfrost_context;
|
||||
struct panfrost_resource;
|
||||
struct panfrost_shader_state;
|
||||
struct pan_fb_info;
|
||||
|
||||
/* Virtual table of per-generation (GenXML) functions */
|
||||
|
||||
|
@ -53,6 +54,15 @@ struct panfrost_vtable {
|
|||
void (*prepare_rsd)(struct panfrost_device *,
|
||||
struct panfrost_shader_state *,
|
||||
struct panfrost_pool *, bool);
|
||||
|
||||
/* Emits a thread local storage descriptor */
|
||||
void (*emit_tls)(struct panfrost_batch *);
|
||||
|
||||
/* Emits a framebuffer descriptor */
|
||||
void (*emit_fbd)(struct panfrost_batch *, const struct pan_fb_info *);
|
||||
|
||||
/* Emits a fragment job */
|
||||
mali_ptr (*emit_fragment_job)(struct panfrost_batch *, const struct pan_fb_info *);
|
||||
};
|
||||
|
||||
struct panfrost_screen {
|
||||
|
|
Loading…
Reference in New Issue