panfrost: do not open-code panfrost_has_fragment_job()

panfrost_batch_submit() already has an has_fragment_job() at the
beginning of the function. Store the result in a local has_frag variable
and replace the open-coded test by an 'if (has_frag)'.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
This commit is contained in:
Erik Faye-Lund
2023-08-23 13:22:29 +02:00
committed by Marge Bot
parent f9bab3566b
commit 9a53cca85a

View File

@@ -789,7 +789,9 @@ panfrost_batch_submit(struct panfrost_context *ctx,
if (!batch->scoreboard.first_job && !batch->clear)
goto out;
if (batch->key.zsbuf && panfrost_has_fragment_job(batch)) {
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);
@@ -823,7 +825,7 @@ panfrost_batch_submit(struct panfrost_context *ctx,
screen->vtbl.emit_tls(batch);
panfrost_emit_tile_map(batch, &fb);
if (batch->scoreboard.first_tiler || batch->clear)
if (has_frag)
screen->vtbl.emit_fbd(batch, &fb);
ret = panfrost_batch_submit_jobs(batch, &fb, 0, ctx->syncobj);