diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-31 14:08:59 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-01 16:23:02 -0700 |
commit | 4b93152c29356382acfefaf66a466faca516cec0 (patch) | |
tree | c2f6033afbae9192933a87ac2629148166b2fe24 | |
parent | cd1be4605c21807c07eff48e983c6c7fb0ad410d (diff) |
panfrost: Flesh out launch_grid stub
It's still incomplette, but we're able to hook into launch_grid to
create a stub COMPUTE job.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r-- | src/gallium/drivers/panfrost/pan_compute.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/gallium/drivers/panfrost/pan_compute.c b/src/gallium/drivers/panfrost/pan_compute.c index 5ef26f3e35d..61b3085cac0 100644 --- a/src/gallium/drivers/panfrost/pan_compute.c +++ b/src/gallium/drivers/panfrost/pan_compute.c @@ -51,15 +51,34 @@ panfrost_delete_compute_state(struct pipe_context *pipe, void *cso) free(cso); } +/* Launch grid is the compute equivalent of draw_vbo, so in this routine, we + * construct the COMPUTE job and some of its payload. + */ + static void panfrost_launch_grid(struct pipe_context *pipe, const struct pipe_grid_info *info) { - printf("Launch grid %dx%dx%d ... %dx%dx%d\n", - info->block[0], info->block[1], info->block[2], - info->grid[0], info->grid[1], info->grid[2]); + struct panfrost_context *ctx = pan_context(pipe); - /* Stub */ + struct mali_job_descriptor_header job = { + .job_type = JOB_TYPE_COMPUTE, + .job_descriptor_size = 1, + .job_barrier = 1 + }; + + /* TODO: Stub */ + struct midgard_payload_vertex_tiler *payload = &ctx->payloads[PIPE_SHADER_COMPUTE]; + + struct panfrost_transfer transfer = panfrost_allocate_transient(ctx, sizeof(job) + sizeof(*payload)); + memcpy(transfer.cpu, &job, sizeof(job)); + memcpy(transfer.cpu + sizeof(job), payload, sizeof(*payload)); + + /* TODO: Do we want a special compute-only batch? */ + struct panfrost_job *batch = panfrost_get_job_for_fbo(ctx); + + /* Queue the job */ + panfrost_scoreboard_queue_compute_job(batch, transfer); } void |