panfrost: Store the fragment job descriptor address in the batch

In preparation of v10 support, where the fragment job is not passed
as a descriptor, but issued directly on the command stream, we make
->emit_fragment_job() a void method, and store the fragment job
descriptor in the batch.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
This commit is contained in:
Boris Brezillon 2023-11-14 17:14:21 +01:00 committed by Marge Bot
parent d3b7b8c807
commit a4f037bd6d
4 changed files with 10 additions and 8 deletions

View file

@ -2637,7 +2637,7 @@ panfrost_initialize_surface(struct panfrost_batch *batch,
/* Generate a fragment job. This should be called once per frame. (Usually,
* this corresponds to eglSwapBuffers or one of glFlush, glFinish)
*/
static mali_ptr
static void
emit_fragment_job(struct panfrost_batch *batch, const struct pan_fb_info *pfb)
{
/* Mark the affected buffers as initialized, since we're writing to it.
@ -2674,8 +2674,7 @@ emit_fragment_job(struct panfrost_batch *batch, const struct pan_fb_info *pfb)
pan_pool_alloc_desc(&batch->pool.base, FRAGMENT_JOB);
GENX(pan_emit_fragment_job)(pfb, batch->framebuffer.gpu, transfer.cpu);
return transfer.gpu;
batch->frag_job = transfer.gpu;
}
#define DEFINE_CASE(c) \

View file

@ -740,9 +740,9 @@ panfrost_batch_submit_jobs(struct panfrost_batch *batch,
}
if (has_frag) {
mali_ptr fragjob = screen->vtbl.emit_fragment_job(batch, fb);
ret = panfrost_batch_submit_ioctl(batch, fragjob, PANFROST_JD_REQ_FS, 0,
out_sync);
screen->vtbl.emit_fragment_job(batch, fb);
ret = panfrost_batch_submit_ioctl(batch, batch->frag_job,
PANFROST_JD_REQ_FS, 0, out_sync);
if (ret)
goto done;
}

View file

@ -142,6 +142,9 @@ struct panfrost_batch {
/* Job scoreboarding state */
struct pan_scoreboard scoreboard;
/* Fragment job GPU address */
mali_ptr frag_job;
/* Scratchpad BO bound to the batch, or NULL if none bound yet */
struct panfrost_bo *scratchpad;

View file

@ -71,8 +71,8 @@ struct panfrost_vtable {
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 *);
void (*emit_fragment_job)(struct panfrost_batch *,
const struct pan_fb_info *);
/* General destructor */
void (*screen_destroy)(struct pipe_screen *);