From 8d0c76b143bb02d2800ebfdc4548189f9c15b6f6 Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Mon, 31 May 2021 11:41:22 +0300 Subject: [PATCH] freedreno: reduce the upper bound of IB size by one Going beyond 0x100000 results in hangs, however I found that the last 0x100000 packet just doesn't get executed. Thus the real limit is 0x0FFFFF. At least this is true for a6xx. This could be tested by appending nops to the cmdstream and placing e.g. CP_INTERRUPT at the end, at any position other than being 0x100000 packet it results in a hang. Signed-off-by: Danylo Piliaiev Part-of: --- src/freedreno/drm/freedreno_ringbuffer.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/freedreno/drm/freedreno_ringbuffer.h b/src/freedreno/drm/freedreno_ringbuffer.h index 8e6b3e90110..cf47a76e7e6 100644 --- a/src/freedreno/drm/freedreno_ringbuffer.h +++ b/src/freedreno/drm/freedreno_ringbuffer.h @@ -173,9 +173,8 @@ fd_ringbuffer_grow(struct fd_ringbuffer *ring, uint32_t ndwords) { assert(ring->funcs->grow); /* unsupported on kgsl */ - /* there is an upper bound on IB size, which appears to be 0x100000 */ - if (ring->size < 0x100000) - ring->size *= 2; + /* there is an upper bound on IB size, which appears to be 0x0fffff */ + ring->size = MIN2(ring->size << 1, 0x0fffff); ring->funcs->grow(ring, ring->size); }