From: Rob Clark Date: Thu, 16 Jan 2020 18:42:39 +0000 (-0800) Subject: freedreno/a6xx: limit scratch/debug markers to debug builds X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fba7e6f89600e1b2f41af5a42d91427be5468892;p=mesa.git freedreno/a6xx: limit scratch/debug markers to debug builds The overhead does seem to matter when you have a high enough # of draw calls that effect few bins/pixels, because these writes would happen unconditionally (ie. not part of a state-group). Possibly we could keep these if we moved them into a state-group so the register writes would be no-ops on bins with no geometry. OTOH I usually end up adding in a WFI when using them scratch reg values to track down a crash. (So add a WFI to mitigate the annoyance of needing to use a debug build to get scratch regs to locate the position of a crash/hang in the cmdstream.) Signed-off-by: Rob Clark Reviewed-by: Kristian H. Kristensen Part-of: --- diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_context.h b/src/gallium/drivers/freedreno/a6xx/fd6_context.h index 0d810d350e9..a7f786fac61 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_context.h +++ b/src/gallium/drivers/freedreno/a6xx/fd6_context.h @@ -143,8 +143,16 @@ emit_marker6(struct fd_ringbuffer *ring, int scratch_idx) { extern unsigned marker_cnt; unsigned reg = REG_A6XX_CP_SCRATCH_REG(scratch_idx); - OUT_PKT4(ring, reg, 1); - OUT_RING(ring, ++marker_cnt); +#ifdef DEBUG +# define __EMIT_MARKER 1 +#else +# define __EMIT_MARKER 0 +#endif + if (__EMIT_MARKER) { + OUT_WFI5(ring); + OUT_PKT4(ring, reg, 1); + OUT_RING(ring, ++marker_cnt); + } } #endif /* FD6_CONTEXT_H_ */