aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorTomeu Vizoso <[email protected]>2020-05-04 09:01:19 +0200
committerMarge Bot <[email protected]>2020-05-07 17:16:52 +0000
commita4d41a151095f73b4b8a7ba06bf06adc7cedebd8 (patch)
tree16f2fc087be6ee12c6fefc81c1b3bc47e1bf1cf7 /src/gallium
parent4f17e9eef6f9f8a2986264b3da5157542983a1da (diff)
panfrost: Add checksum BOs to batch
So they don't get released before the last frame finishes rendering. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4944>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/panfrost/pan_job.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index 461d29aeaa0..5b02701392a 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -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);
}
}