pan/blitter: Let pan_preload_fb() callers queue the jobs to the job chain
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29450>
This commit is contained in:
committed by
Marge Bot
parent
629b9258df
commit
8293376f7c
@@ -462,8 +462,7 @@ GENX(csf_preload_fb)(struct panfrost_batch *batch, struct pan_fb_info *fb)
|
||||
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
||||
|
||||
GENX(pan_preload_fb)
|
||||
(&dev->blitter, &batch->pool.base, NULL, fb, batch->tls.gpu,
|
||||
batch->tiler_ctx.bifrost, NULL);
|
||||
(&dev->blitter, &batch->pool.base, fb, 0, batch->tls.gpu, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -236,10 +236,17 @@ void
|
||||
GENX(jm_preload_fb)(struct panfrost_batch *batch, struct pan_fb_info *fb)
|
||||
{
|
||||
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
||||
struct panfrost_ptr preload_jobs[2];
|
||||
|
||||
GENX(pan_preload_fb)
|
||||
(&dev->blitter, &batch->pool.base, &batch->jm.jobs.vtc_jc, fb,
|
||||
batch->tls.gpu, PAN_ARCH >= 6 ? batch->tiler_ctx.bifrost : 0, NULL);
|
||||
unsigned preload_job_count = GENX(pan_preload_fb)(
|
||||
&dev->blitter, &batch->pool.base, fb, 0, batch->tls.gpu, preload_jobs);
|
||||
|
||||
assert(PAN_ARCH < 6 || !preload_job_count);
|
||||
|
||||
for (unsigned j = 0; j < preload_job_count; j++) {
|
||||
pan_jc_add_job(&batch->jm.jobs.vtc_jc, MALI_JOB_TYPE_TILER, false, false,
|
||||
0, 0, &preload_jobs[j], true);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -1370,7 +1370,7 @@ pan_preload_emit_pre_frame_dcd(struct pan_blitter_cache *cache,
|
||||
}
|
||||
#else
|
||||
static struct panfrost_ptr
|
||||
pan_preload_emit_tiler_job(struct pan_blitter_cache *cache, struct pan_pool *desc_pool, struct pan_jc *jc,
|
||||
pan_preload_emit_tiler_job(struct pan_blitter_cache *cache, struct pan_pool *desc_pool,
|
||||
struct pan_fb_info *fb, bool zs, mali_ptr coords,
|
||||
mali_ptr tsd)
|
||||
{
|
||||
@@ -1392,30 +1392,29 @@ pan_preload_emit_tiler_job(struct pan_blitter_cache *cache, struct pan_pool *des
|
||||
void *invoc = pan_section_ptr(job.cpu, TILER_JOB, INVOCATION);
|
||||
panfrost_pack_work_groups_compute(invoc, 1, 4, 1, 1, 1, 1, true, false);
|
||||
|
||||
pan_jc_add_job(jc, MALI_JOB_TYPE_TILER, false, false, 0, 0, &job, true);
|
||||
return job;
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct panfrost_ptr
|
||||
pan_preload_fb_part(struct pan_blitter_cache *cache, struct pan_pool *pool,
|
||||
struct pan_jc *jc, struct pan_fb_info *fb, bool zs,
|
||||
mali_ptr coords, mali_ptr tsd, mali_ptr tiler)
|
||||
struct pan_fb_info *fb, bool zs, mali_ptr coords,
|
||||
mali_ptr tsd)
|
||||
{
|
||||
struct panfrost_ptr job = {0};
|
||||
|
||||
#if PAN_ARCH >= 6
|
||||
pan_preload_emit_pre_frame_dcd(cache, pool, fb, zs, coords, tsd);
|
||||
#else
|
||||
job = pan_preload_emit_tiler_job(cache, pool, jc, fb, zs, coords, tsd);
|
||||
job = pan_preload_emit_tiler_job(cache, pool, fb, zs, coords, tsd);
|
||||
#endif
|
||||
return job;
|
||||
}
|
||||
|
||||
unsigned
|
||||
GENX(pan_preload_fb)(struct pan_blitter_cache *cache, struct pan_pool *pool,
|
||||
struct pan_jc *jc, struct pan_fb_info *fb, mali_ptr tsd,
|
||||
mali_ptr tiler, struct panfrost_ptr *jobs)
|
||||
struct pan_fb_info *fb, unsigned layer_idx, mali_ptr tsd,
|
||||
struct panfrost_ptr *jobs)
|
||||
{
|
||||
bool preload_zs = pan_preload_needed(fb, true);
|
||||
bool preload_rts = pan_preload_needed(fb, false);
|
||||
@@ -1425,8 +1424,10 @@ GENX(pan_preload_fb)(struct pan_blitter_cache *cache, struct pan_pool *pool,
|
||||
return 0;
|
||||
|
||||
float rect[] = {
|
||||
0.0, 0.0, 0.0, 1.0, fb->width, 0.0, 0.0, 1.0,
|
||||
0.0, fb->height, 0.0, 1.0, fb->width, fb->height, 0.0, 1.0,
|
||||
0.0, 0.0, layer_idx, 1.0,
|
||||
fb->width, 0.0, layer_idx, 1.0,
|
||||
0.0, fb->height, layer_idx, 1.0,
|
||||
fb->width, fb->height, layer_idx, 1.0,
|
||||
};
|
||||
|
||||
coords = pan_pool_upload_aligned(pool, rect, sizeof(rect), 64);
|
||||
@@ -1434,14 +1435,14 @@ GENX(pan_preload_fb)(struct pan_blitter_cache *cache, struct pan_pool *pool,
|
||||
unsigned njobs = 0;
|
||||
if (preload_zs) {
|
||||
struct panfrost_ptr job =
|
||||
pan_preload_fb_part(cache, pool, jc, fb, true, coords, tsd, tiler);
|
||||
pan_preload_fb_part(cache, pool, fb, true, coords, tsd);
|
||||
if (jobs && job.cpu)
|
||||
jobs[njobs++] = job;
|
||||
}
|
||||
|
||||
if (preload_rts) {
|
||||
struct panfrost_ptr job =
|
||||
pan_preload_fb_part(cache, pool, jc, fb, false, coords, tsd, tiler);
|
||||
pan_preload_fb_part(cache, pool, fb, false, coords, tsd);
|
||||
if (jobs && job.cpu)
|
||||
jobs[njobs++] = job;
|
||||
}
|
||||
|
||||
@@ -122,9 +122,9 @@ void GENX(pan_blitter_cache_init)(struct pan_blitter_cache *cache,
|
||||
void GENX(pan_blitter_cache_cleanup)(struct pan_blitter_cache *cache);
|
||||
|
||||
unsigned GENX(pan_preload_fb)(struct pan_blitter_cache *cache,
|
||||
struct pan_pool *desc_pool, struct pan_jc *jc,
|
||||
struct pan_fb_info *fb, mali_ptr tsd,
|
||||
mali_ptr tiler, struct panfrost_ptr *jobs);
|
||||
struct pan_pool *desc_pool,
|
||||
struct pan_fb_info *fb, unsigned layer_idx,
|
||||
mali_ptr tsd, struct panfrost_ptr *jobs);
|
||||
|
||||
void GENX(pan_blit_ctx_init)(struct pan_blitter_cache *cache,
|
||||
const struct pan_blit_info *info,
|
||||
|
||||
@@ -120,10 +120,9 @@ panvk_per_arch(cmd_close_batch)(struct panvk_cmd_buffer *cmdbuf)
|
||||
list_addtail(&batch->node, &cmdbuf->batches);
|
||||
|
||||
if (batch->jc.first_tiler) {
|
||||
ASSERTED unsigned num_preload_jobs =
|
||||
GENX(pan_preload_fb)(&dev->meta.blitter.cache, &cmdbuf->desc_pool.base,
|
||||
&batch->jc, &cmdbuf->state.gfx.render.fb.info,
|
||||
batch->tls.gpu, batch->tiler.ctx_desc.gpu, NULL);
|
||||
ASSERTED unsigned num_preload_jobs = GENX(pan_preload_fb)(
|
||||
&dev->meta.blitter.cache, &cmdbuf->desc_pool.base,
|
||||
&cmdbuf->state.gfx.render.fb.info, 0, batch->tls.gpu, NULL);
|
||||
|
||||
assert(num_preload_jobs == 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user