panfrost: Stop using the scoreboard to check the presence of draws/compute

Now that we count draws and compute jobs, we can change some of the
tests to be HW-agnostic, so they can be re-used when we introduce
support for CSF hardware.

Anything that's related to job submission keeps using the scoreboard
information, because this code will stay JM-specific.

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 14:31:58 +01:00
committed by Marge Bot
parent 9b2e78b003
commit d3b7b8c807
4 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -4580,7 +4580,7 @@ batch_get_polygon_list(struct panfrost_batch *batch)
struct panfrost_device *dev = pan_device(batch->ctx->base.screen);
if (!batch->tiler_ctx.midgard.polygon_list) {
bool has_draws = batch->scoreboard.first_tiler != NULL;
bool has_draws = batch->draw_count > 0;
unsigned size = panfrost_tiler_get_polygon_list_size(
dev, batch->key.width, batch->key.height,
batch->tiler_ctx.vertex_count);
+1 -1
View File
@@ -70,7 +70,7 @@ panfrost_clear(struct pipe_context *pipe, unsigned buffers,
struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
/* At the start of the batch, we can clear for free */
if (!batch->scoreboard.first_job) {
if (batch->draw_count == 0) {
panfrost_batch_clear(batch, buffers, color, depth, stencil);
return;
}
+3 -4
View File
@@ -229,7 +229,7 @@ panfrost_get_fresh_batch_for_fbo(struct panfrost_context *ctx,
/* We only need to submit and get a fresh batch if there is no
* draw/clear queued. Otherwise we may reuse the batch. */
if (batch->scoreboard.first_job) {
if (batch->draw_count + batch->compute_count > 0) {
perf_debug_ctx(ctx, "Flushing the current FBO due to: %s", reason);
panfrost_batch_submit(ctx, batch);
batch = panfrost_get_batch(ctx, &ctx->pipe_framebuffer);
@@ -777,14 +777,13 @@ panfrost_batch_submit(struct panfrost_context *ctx,
{
struct pipe_screen *pscreen = ctx->base.screen;
struct panfrost_screen *screen = pan_screen(pscreen);
bool has_frag = panfrost_has_fragment_job(batch);
int ret;
/* Nothing to do! */
if (!batch->scoreboard.first_job && !batch->clear)
if (!has_frag && batch->compute_count == 0)
goto out;
bool has_frag = panfrost_has_fragment_job(batch);
if (batch->key.zsbuf && has_frag) {
struct pipe_surface *surf = batch->key.zsbuf;
struct panfrost_resource *z_rsrc = pan_resource(surf->texture);
+1 -1
View File
@@ -267,7 +267,7 @@ bool panfrost_batch_skip_rasterization(struct panfrost_batch *batch);
static inline bool
panfrost_has_fragment_job(struct panfrost_batch *batch)
{
return batch->scoreboard.first_tiler || batch->clear;
return batch->draw_count > 0 || batch->clear;
}
#endif