From: Alyssa Rosenzweig Date: Fri, 13 Dec 2019 19:12:48 +0000 (-0500) Subject: panfrost: Don't double-create scratchpad X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0eb84eb7023432e20a151d5742e7168faefdafde;p=mesa.git panfrost: Don't double-create scratchpad Signed-off-by: Alyssa Rosenzweig Fixes: 4f7fddbd716 ("panfrost: Pass size to panfrost_batch_get_scratchpad") Tested-by: Marge Bot Part-of: --- 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 *