From e3bedd984e62a1aadc478f4741a33cc7d43a49b4 Mon Sep 17 00:00:00 2001 From: Matt Coster Date: Tue, 8 Aug 2023 09:28:03 +0100 Subject: [PATCH] pvr: Zero tail of cs buffers after linking when dumping cs Dumps already force buffers to zero before they get written to, this keeps up the pattern of making the contents easier to grok. Signed-off-by: Matt Coster Reviewed-by: Luigi Santivetti Part-of: --- src/imagination/vulkan/pvr_csb.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/imagination/vulkan/pvr_csb.c b/src/imagination/vulkan/pvr_csb.c index e831f568e39..d4975e16258 100644 --- a/src/imagination/vulkan/pvr_csb.c +++ b/src/imagination/vulkan/pvr_csb.c @@ -261,9 +261,11 @@ static bool pvr_csb_buffer_extend(struct pvr_csb *csb) /* if this is not the first BO in csb */ if (csb->pvr_bo) { + bool zero_after_move = PVR_IS_DEBUG_SET(DUMP_CONTROL_STREAM); + void *new_buffer = pvr_bo->bo->map; + current_state_update_size = (uint8_t *)csb->next - (uint8_t *)csb->relocation_mark; - void *new_buffer = pvr_bo->bo->map; assert(csb->relocation_mark != NULL); assert(csb->next >= csb->relocation_mark); @@ -273,10 +275,12 @@ static bool pvr_csb_buffer_extend(struct pvr_csb *csb) #if defined(DEBUG) assert(csb->relocation_mark_status == PVR_CSB_RELOCATION_MARK_SET); csb->relocation_mark_status = PVR_CSB_RELOCATION_MARK_SET_AND_CONSUMED; - - memset(csb->relocation_mark, 0, current_state_update_size); + zero_after_move = true; #endif + if (zero_after_move) + memset(csb->relocation_mark, 0, current_state_update_size); + csb->next = csb->relocation_mark; csb->end += stream_link_space;