From: Samuel Pitoiset Date: Thu, 15 Jun 2023 09:34:09 +0000 (+0200) Subject: radv: reserve space for shadowed regs X-Git-Tag: upstream/23.3.3~6830 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=795bf984c6bdbddb33dd00b7bf62c547a7855854;p=platform%2Fupstream%2Fmesa.git radv: reserve space for shadowed regs Tested on RDNA2, hopefully the space reservation is large enough for other chips as well. Fixes: 7893040f807f ("radv: Add stricter space checks.") Signed-off-by: Samuel Pitoiset Part-of: --- diff --git a/src/amd/vulkan/radv_cp_reg_shadowing.c b/src/amd/vulkan/radv_cp_reg_shadowing.c index 9f0aae8..c886f04 100644 --- a/src/amd/vulkan/radv_cp_reg_shadowing.c +++ b/src/amd/vulkan/radv_cp_reg_shadowing.c @@ -46,6 +46,8 @@ radv_create_shadow_regs_preamble(const struct radv_device *device, struct radv_q if (!cs) return VK_ERROR_OUT_OF_HOST_MEMORY; + radeon_check_space(ws, cs, 256); + /* allocate memory for queue_state->shadowed_regs where register states are saved */ result = ws->buffer_create(ws, SI_SHADOWED_REG_BUFFER_SIZE, 4096, RADEON_DOMAIN_VRAM, RADEON_FLAG_ZERO_VRAM | RADEON_FLAG_NO_INTERPROCESS_SHARING, RADV_BO_PRIORITY_SCRATCH, 0, @@ -132,6 +134,9 @@ radv_init_shadowed_regs_buffer_state(const struct radv_device *device, struct ra cs = ws->cs_create(ws, AMD_IP_GFX, false); if (!cs) return VK_ERROR_OUT_OF_HOST_MEMORY; + + radeon_check_space(ws, cs, 768); + radv_emit_shadow_regs_preamble(cs, device, &queue->state); ac_emulate_clear_state(info, cs, radv_set_context_reg_array);