panfrost: Don't double-create scratchpad

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: 4f7fddbd71 ("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>
This commit is contained in:
Alyssa Rosenzweig 2019-12-13 14:12:48 -05:00 committed by Marge Bot
parent 73bd9fe20c
commit 0eb84eb702

View file

@ -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 *