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 <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3435>
This commit is contained in:
Rob Clark 2020-01-16 10:42:39 -08:00
parent 5d7381c645
commit fba7e6f896
1 changed files with 10 additions and 2 deletions

View File

@ -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_ */