panvk/jm: Automatically open a batch in dispatch_precomp()

cmd_clear_afbc_metadata() might be called before any other job, and it's
assuming dispatch_precomp() doesn't fail in that case. We could
explicitly open the batch in cmd_clear_afbc_metadata(), but checking for
cur_batch==NULL and opening a new batch seems to be okay too, and it
allows us to not special case for v7 in cmd_clear_afbc_metadata().

Fixes: c95f899305 ("panvk: add a meta command for transitioning image layout")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37158>
This commit is contained in:
Boris Brezillon 2025-09-03 14:04:53 +02:00 committed by Marge Bot
parent 023972827a
commit b2fabf1ffe

View file

@ -22,6 +22,11 @@ panvk_per_arch(dispatch_precomp)(struct panvk_precomp_ctx *ctx,
size_t data_size)
{
struct panvk_cmd_buffer *cmdbuf = ctx->cmdbuf;
/* Make sure we have a batch opened to queue our COMPUTE job to. */
if (!cmdbuf->cur_batch)
panvk_per_arch(cmd_open_batch)(cmdbuf);
struct panvk_batch *batch = cmdbuf->cur_batch;
struct panvk_device *dev = to_panvk_device(cmdbuf->vk.base.device);
const struct panvk_shader_variant *shader =