panfrost: Add checksum BOs to batch

So they don't get released before the last frame finishes rendering.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4944>
This commit is contained in:
Tomeu Vizoso 2020-05-04 09:01:19 +02:00 committed by Marge Bot
parent 4f17e9eef6
commit a4d41a1510
1 changed files with 14 additions and 2 deletions

View File

@ -580,6 +580,18 @@ panfrost_batch_add_bo(struct panfrost_batch *batch, struct panfrost_bo *bo,
panfrost_batch_update_bo_access(batch, bo, flags, old_flags != 0);
}
static void
panfrost_batch_add_resource_bos(struct panfrost_batch *batch,
struct panfrost_resource *rsrc,
uint32_t flags)
{
panfrost_batch_add_bo(batch, rsrc->bo, flags);
for (unsigned i = 0; i < MAX_MIP_LEVELS; i++)
if (rsrc->slices[i].checksum_bo)
panfrost_batch_add_bo(batch, rsrc->slices[i].checksum_bo, flags);
}
void panfrost_batch_add_fbo_bos(struct panfrost_batch *batch)
{
uint32_t flags = PAN_BO_ACCESS_SHARED | PAN_BO_ACCESS_WRITE |
@ -588,12 +600,12 @@ void panfrost_batch_add_fbo_bos(struct panfrost_batch *batch)
for (unsigned i = 0; i < batch->key.nr_cbufs; ++i) {
struct panfrost_resource *rsrc = pan_resource(batch->key.cbufs[i]->texture);
panfrost_batch_add_bo(batch, rsrc->bo, flags);
panfrost_batch_add_resource_bos(batch, rsrc, flags);
}
if (batch->key.zsbuf) {
struct panfrost_resource *rsrc = pan_resource(batch->key.zsbuf->texture);
panfrost_batch_add_bo(batch, rsrc->bo, flags);
panfrost_batch_add_resource_bos(batch, rsrc, flags);
}
}