diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-12-13 14:12:48 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2019-12-16 23:32:07 +0000 |
commit | 0eb84eb7023432e20a151d5742e7168faefdafde (patch) | |
tree | 681607e82d6f5ac85a333ce67c0238ea4abe49d6 | |
parent | 73bd9fe20c4a4c34496d02ea888b3c1dcfdf1d4f (diff) |
panfrost: Don't double-create scratchpad
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Fixes: 4f7fddbd716 ("panfrost: Pass size to panfrost_batch_get_scratchpad")
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3119>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3119>
-rw-r--r-- | src/gallium/drivers/panfrost/pan_job.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 5722f4a1f31..b193ce6fa76 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -646,12 +646,18 @@ panfrost_batch_get_scratchpad(struct panfrost_batch *batch, thread_tls_alloc, core_count); - return panfrost_batch_create_bo(batch, size, + if (batch->scratchpad) { + assert(batch->scratchpad->size >= size); + } else { + batch->scratchpad = panfrost_batch_create_bo(batch, size, PAN_BO_INVISIBLE, PAN_BO_ACCESS_PRIVATE | PAN_BO_ACCESS_RW | PAN_BO_ACCESS_VERTEX_TILER | PAN_BO_ACCESS_FRAGMENT); + } + + return batch->scratchpad; } struct panfrost_bo * |