From: Frank Binns Date: Thu, 13 Jul 2023 12:35:39 +0000 (+0100) Subject: pvr: skip setting up SPM consts buffer when no const shared regs are used X-Git-Tag: upstream/23.3.3~5647 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b470d931dc2da66a4d6d726891bf2e508025f99d;p=platform%2Fupstream%2Fmesa.git pvr: skip setting up SPM consts buffer when no const shared regs are used This is a temporary measure until the zeroed shaders are replaced with the real ones. This avoids a VK_ERROR_OUT_OF_DEVICE_MEMORY error due to a zero sized allocation. Signed-off-by: Frank Binns Reviewed-by: Karmjit Mahil Fixes: 1dfd5351249 ("pvr: Setup SPM background object") Part-of: --- diff --git a/src/imagination/vulkan/pvr_spm.c b/src/imagination/vulkan/pvr_spm.c index 92abaa4..e5654c4 100644 --- a/src/imagination/vulkan/pvr_spm.c +++ b/src/imagination/vulkan/pvr_spm.c @@ -981,6 +981,14 @@ pvr_spm_init_bgobj_state(struct pvr_device *device, consts_buffer_size = info->const_shared_regs * sizeof(uint32_t); + /* TODO: Remove this check, along with the pvr_finishme(), once the zeroed + * shaders are replaced by the real shaders. + */ + if (!consts_buffer_size) + return VK_SUCCESS; + + pvr_finishme("Remove consts buffer size check"); + result = pvr_bo_alloc(device, device->heaps.general_heap, consts_buffer_size,