From: Bas Nieuwenhuizen Date: Sat, 11 Mar 2023 17:43:45 +0000 (+0100) Subject: radv: Reserve space for updating DCC metadata. X-Git-Tag: upstream/23.3.3~10110 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b5bd0f1c061d6995b1499827e98dd6b7a0fdcd4;p=platform%2Fupstream%2Fmesa.git radv: Reserve space for updating DCC metadata. Fixes: 9ee67467c9e ("radv: predicate cmask eliminate when using DCC.") Part-of: --- diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index c1e9fb4..2888606 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -3169,6 +3169,9 @@ radv_update_dcc_metadata(struct radv_cmd_buffer *cmd_buffer, struct radv_image * assert(radv_dcc_enabled(image, range->baseMipLevel)); + ASSERTED unsigned cdw_max = + radeon_check_space(cmd_buffer->device->ws, cmd_buffer->cs, 4 + count); + radeon_emit(cmd_buffer->cs, PKT3(PKT3_WRITE_DATA, 2 + count, 0)); radeon_emit(cmd_buffer->cs, S_370_DST_SEL(V_370_MEM) | S_370_WR_CONFIRM(1) | S_370_ENGINE_SEL(V_370_PFP)); @@ -3179,6 +3182,8 @@ radv_update_dcc_metadata(struct radv_cmd_buffer *cmd_buffer, struct radv_image * radeon_emit(cmd_buffer->cs, pred_val); radeon_emit(cmd_buffer->cs, pred_val >> 32); } + + assert(cmd_buffer->cs->cdw <= cdw_max); } /**