panfrost: Drop batch from scoreboard routines
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5827>
This commit is contained in:
@@ -2200,9 +2200,9 @@ panfrost_emit_vertex_tiler_jobs(struct panfrost_batch *batch,
|
|||||||
if (wallpapering) {
|
if (wallpapering) {
|
||||||
/* Inject in reverse order, with "predicted" job indices.
|
/* Inject in reverse order, with "predicted" job indices.
|
||||||
* THIS IS A HACK XXX */
|
* THIS IS A HACK XXX */
|
||||||
panfrost_new_job(batch, JOB_TYPE_TILER, false,
|
panfrost_new_job(&batch->pool, &batch->scoreboard, JOB_TYPE_TILER, false,
|
||||||
batch->scoreboard.job_index + 2, tp, tp_size, true);
|
batch->scoreboard.job_index + 2, tp, tp_size, true);
|
||||||
panfrost_new_job(batch, JOB_TYPE_VERTEX, false, 0,
|
panfrost_new_job(&batch->pool, &batch->scoreboard, JOB_TYPE_VERTEX, false, 0,
|
||||||
vp, vp_size, true);
|
vp, vp_size, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2212,13 +2212,13 @@ panfrost_emit_vertex_tiler_jobs(struct panfrost_batch *batch,
|
|||||||
bool rasterizer_discard = ctx->rasterizer &&
|
bool rasterizer_discard = ctx->rasterizer &&
|
||||||
ctx->rasterizer->base.rasterizer_discard;
|
ctx->rasterizer->base.rasterizer_discard;
|
||||||
|
|
||||||
unsigned vertex = panfrost_new_job(batch, JOB_TYPE_VERTEX, false, 0,
|
unsigned vertex = panfrost_new_job(&batch->pool, &batch->scoreboard, JOB_TYPE_VERTEX, false, 0,
|
||||||
vp, vp_size, false);
|
vp, vp_size, false);
|
||||||
|
|
||||||
if (rasterizer_discard)
|
if (rasterizer_discard)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
panfrost_new_job(batch, JOB_TYPE_TILER, false, vertex, tp, tp_size,
|
panfrost_new_job(&batch->pool, &batch->scoreboard, JOB_TYPE_TILER, false, vertex, tp, tp_size,
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -132,7 +132,8 @@ panfrost_launch_grid(struct pipe_context *pipe,
|
|||||||
info->block[2],
|
info->block[2],
|
||||||
false);
|
false);
|
||||||
|
|
||||||
panfrost_new_job(batch, JOB_TYPE_COMPUTE, true, 0, &payload,
|
panfrost_new_job(&batch->pool, &batch->scoreboard,
|
||||||
|
JOB_TYPE_COMPUTE, true, 0, &payload,
|
||||||
sizeof(payload), false);
|
sizeof(payload), false);
|
||||||
panfrost_flush_all_batches(ctx, true);
|
panfrost_flush_all_batches(ctx, true);
|
||||||
}
|
}
|
||||||
|
@@ -1056,7 +1056,7 @@ panfrost_batch_submit(struct panfrost_batch *batch)
|
|||||||
mali_ptr polygon_list = panfrost_batch_get_polygon_list(batch,
|
mali_ptr polygon_list = panfrost_batch_get_polygon_list(batch,
|
||||||
MALI_TILER_MINIMUM_HEADER_SIZE);
|
MALI_TILER_MINIMUM_HEADER_SIZE);
|
||||||
|
|
||||||
panfrost_scoreboard_initialize_tiler(batch, polygon_list);
|
panfrost_scoreboard_initialize_tiler(&batch->pool, &batch->scoreboard, polygon_list);
|
||||||
|
|
||||||
ret = panfrost_batch_submit_jobs(batch);
|
ret = panfrost_batch_submit_jobs(batch);
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
#include "util/bitset.h"
|
#include "util/bitset.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Within a batch (panfrost_job), there are various types of Mali jobs:
|
* There are various types of Mali jobs:
|
||||||
*
|
*
|
||||||
* - WRITE_VALUE: generic write primitive, used to zero tiler field
|
* - WRITE_VALUE: generic write primitive, used to zero tiler field
|
||||||
* - VERTEX: runs a vertex shader
|
* - VERTEX: runs a vertex shader
|
||||||
@@ -108,15 +108,14 @@
|
|||||||
|
|
||||||
unsigned
|
unsigned
|
||||||
panfrost_new_job(
|
panfrost_new_job(
|
||||||
struct panfrost_batch *batch,
|
struct pan_pool *pool,
|
||||||
|
struct pan_scoreboard *scoreboard,
|
||||||
enum mali_job_type type,
|
enum mali_job_type type,
|
||||||
bool barrier,
|
bool barrier,
|
||||||
unsigned local_dep,
|
unsigned local_dep,
|
||||||
void *payload, size_t payload_size,
|
void *payload, size_t payload_size,
|
||||||
bool inject)
|
bool inject)
|
||||||
{
|
{
|
||||||
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
|
||||||
|
|
||||||
unsigned global_dep = 0;
|
unsigned global_dep = 0;
|
||||||
|
|
||||||
if (type == JOB_TYPE_TILER) {
|
if (type == JOB_TYPE_TILER) {
|
||||||
@@ -124,16 +123,16 @@ panfrost_new_job(
|
|||||||
* job must depend on the write value job, whose index we
|
* job must depend on the write value job, whose index we
|
||||||
* reserve now */
|
* reserve now */
|
||||||
|
|
||||||
if (batch->scoreboard.tiler_dep)
|
if (scoreboard->tiler_dep)
|
||||||
global_dep = batch->scoreboard.tiler_dep;
|
global_dep = scoreboard->tiler_dep;
|
||||||
else if (!(dev->quirks & IS_BIFROST)) {
|
else if (!(pool->dev->quirks & IS_BIFROST)) {
|
||||||
batch->scoreboard.write_value_index = ++batch->scoreboard.job_index;
|
scoreboard->write_value_index = ++scoreboard->job_index;
|
||||||
global_dep = batch->scoreboard.write_value_index;
|
global_dep = scoreboard->write_value_index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Assign the index */
|
/* Assign the index */
|
||||||
unsigned index = ++batch->scoreboard.job_index;
|
unsigned index = ++scoreboard->job_index;
|
||||||
|
|
||||||
struct mali_job_descriptor_header job = {
|
struct mali_job_descriptor_header job = {
|
||||||
.job_descriptor_size = 1,
|
.job_descriptor_size = 1,
|
||||||
@@ -145,27 +144,27 @@ panfrost_new_job(
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (inject)
|
if (inject)
|
||||||
job.next_job = batch->scoreboard.first_job;
|
job.next_job = scoreboard->first_job;
|
||||||
|
|
||||||
struct panfrost_transfer transfer = panfrost_pool_alloc(&batch->pool, sizeof(job) + payload_size);
|
struct panfrost_transfer transfer = panfrost_pool_alloc(pool, sizeof(job) + payload_size);
|
||||||
memcpy(transfer.cpu, &job, sizeof(job));
|
memcpy(transfer.cpu, &job, sizeof(job));
|
||||||
memcpy(transfer.cpu + sizeof(job), payload, payload_size);
|
memcpy(transfer.cpu + sizeof(job), payload, payload_size);
|
||||||
|
|
||||||
if (inject) {
|
if (inject) {
|
||||||
batch->scoreboard.first_job = transfer.gpu;
|
scoreboard->first_job = transfer.gpu;
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Form a chain */
|
/* Form a chain */
|
||||||
if (type == JOB_TYPE_TILER)
|
if (type == JOB_TYPE_TILER)
|
||||||
batch->scoreboard.tiler_dep = index;
|
scoreboard->tiler_dep = index;
|
||||||
|
|
||||||
if (batch->scoreboard.prev_job)
|
if (scoreboard->prev_job)
|
||||||
batch->scoreboard.prev_job->next_job = transfer.gpu;
|
scoreboard->prev_job->next_job = transfer.gpu;
|
||||||
else
|
else
|
||||||
batch->scoreboard.first_job = transfer.gpu;
|
scoreboard->first_job = transfer.gpu;
|
||||||
|
|
||||||
batch->scoreboard.prev_job = (struct mali_job_descriptor_header *) transfer.cpu;
|
scoreboard->prev_job = (struct mali_job_descriptor_header *) transfer.cpu;
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,12 +172,12 @@ panfrost_new_job(
|
|||||||
* this is called right before frame submission. */
|
* this is called right before frame submission. */
|
||||||
|
|
||||||
void
|
void
|
||||||
panfrost_scoreboard_initialize_tiler(struct panfrost_batch *batch, mali_ptr polygon_list)
|
panfrost_scoreboard_initialize_tiler(struct pan_pool *pool,
|
||||||
|
struct pan_scoreboard *scoreboard,
|
||||||
|
mali_ptr polygon_list)
|
||||||
{
|
{
|
||||||
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
|
|
||||||
|
|
||||||
/* Check if we even need tiling */
|
/* Check if we even need tiling */
|
||||||
if (dev->quirks & IS_BIFROST || !batch->scoreboard.tiler_dep)
|
if (pool->dev->quirks & IS_BIFROST || !scoreboard->tiler_dep)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Okay, we do. Let's generate it. We'll need the job's polygon list
|
/* Okay, we do. Let's generate it. We'll need the job's polygon list
|
||||||
@@ -186,9 +185,9 @@ panfrost_scoreboard_initialize_tiler(struct panfrost_batch *batch, mali_ptr poly
|
|||||||
|
|
||||||
struct mali_job_descriptor_header job = {
|
struct mali_job_descriptor_header job = {
|
||||||
.job_type = JOB_TYPE_WRITE_VALUE,
|
.job_type = JOB_TYPE_WRITE_VALUE,
|
||||||
.job_index = batch->scoreboard.write_value_index,
|
.job_index = scoreboard->write_value_index,
|
||||||
.job_descriptor_size = 1,
|
.job_descriptor_size = 1,
|
||||||
.next_job = batch->scoreboard.first_job
|
.next_job = scoreboard->first_job
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mali_payload_write_value payload = {
|
struct mali_payload_write_value payload = {
|
||||||
@@ -196,9 +195,9 @@ panfrost_scoreboard_initialize_tiler(struct panfrost_batch *batch, mali_ptr poly
|
|||||||
.value_descriptor = MALI_WRITE_VALUE_ZERO,
|
.value_descriptor = MALI_WRITE_VALUE_ZERO,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct panfrost_transfer transfer = panfrost_pool_alloc(&batch->pool, sizeof(job) + sizeof(payload));
|
struct panfrost_transfer transfer = panfrost_pool_alloc(pool, sizeof(job) + sizeof(payload));
|
||||||
memcpy(transfer.cpu, &job, sizeof(job));
|
memcpy(transfer.cpu, &job, sizeof(job));
|
||||||
memcpy(transfer.cpu + sizeof(job), &payload, sizeof(payload));
|
memcpy(transfer.cpu + sizeof(job), &payload, sizeof(payload));
|
||||||
|
|
||||||
batch->scoreboard.first_job = transfer.gpu;
|
scoreboard->first_job = transfer.gpu;
|
||||||
}
|
}
|
||||||
|
@@ -47,14 +47,17 @@ struct pan_scoreboard {
|
|||||||
|
|
||||||
unsigned
|
unsigned
|
||||||
panfrost_new_job(
|
panfrost_new_job(
|
||||||
struct panfrost_batch *batch,
|
struct pan_pool *pool,
|
||||||
|
struct pan_scoreboard *scoreboard,
|
||||||
enum mali_job_type type,
|
enum mali_job_type type,
|
||||||
bool barrier,
|
bool barrier,
|
||||||
unsigned local_dep,
|
unsigned local_dep,
|
||||||
void *payload, size_t payload_size,
|
void *payload, size_t payload_size,
|
||||||
bool inject);
|
bool inject);
|
||||||
|
|
||||||
void panfrost_scoreboard_initialize_tiler(struct panfrost_batch *batch,
|
void panfrost_scoreboard_initialize_tiler(
|
||||||
|
struct pan_pool *pool,
|
||||||
|
struct pan_scoreboard *scoreboard,
|
||||||
mali_ptr polygon_list);
|
mali_ptr polygon_list);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user