From 1bb0cd66828a20ba56089d15d122e60f66d28f54 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 9 Nov 2022 15:47:25 -0800 Subject: [PATCH] freedreno/drm: Use same-sized "chunks" for growable rings Using the same size that we suballoc from for suballoc'd streaming and long-lived stateobjs should help improve bo cache usage, by making more of the backing BOs the same size and interchangable. Signed-off-by: Rob Clark Part-of: --- src/freedreno/drm/freedreno_priv.h | 2 ++ src/freedreno/drm/freedreno_ringbuffer.h | 3 --- src/freedreno/drm/freedreno_ringbuffer_sp.c | 6 +----- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/freedreno/drm/freedreno_priv.h b/src/freedreno/drm/freedreno_priv.h index ae137fc..a5184dc 100644 --- a/src/freedreno/drm/freedreno_priv.h +++ b/src/freedreno/drm/freedreno_priv.h @@ -53,6 +53,8 @@ extern simple_mtx_t table_lock; +#define SUBALLOC_SIZE (32 * 1024) + /* * Stupid/simple growable array implementation: */ diff --git a/src/freedreno/drm/freedreno_ringbuffer.h b/src/freedreno/drm/freedreno_ringbuffer.h index 0576834..5b45234 100644 --- a/src/freedreno/drm/freedreno_ringbuffer.h +++ b/src/freedreno/drm/freedreno_ringbuffer.h @@ -183,9 +183,6 @@ 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 0x0fffff */ - ring->size = MIN2(ring->size << 1, 0x0fffff); - ring->funcs->grow(ring, ring->size); } diff --git a/src/freedreno/drm/freedreno_ringbuffer_sp.c b/src/freedreno/drm/freedreno_ringbuffer_sp.c index 7df4b39..35fb699 100644 --- a/src/freedreno/drm/freedreno_ringbuffer_sp.c +++ b/src/freedreno/drm/freedreno_ringbuffer_sp.c @@ -39,10 +39,6 @@ * (but still builds a bos table) */ -#define INIT_SIZE 0x1000 - -#define SUBALLOC_SIZE (32 * 1024) - /* In the pipe->flush() path, we don't have a util_queue_fence we can wait on, * instead use a condition-variable. Note that pipe->flush() is not expected * to be a common/hot path. @@ -147,7 +143,7 @@ fd_submit_sp_new_ringbuffer(struct fd_submit *submit, uint32_t size, fd_submit_suballoc_ring_bo(submit, fd_ring, size); } else { if (flags & FD_RINGBUFFER_GROWABLE) - size = INIT_SIZE; + size = SUBALLOC_SIZE; fd_ring->offset = 0; fd_ring->ring_bo = fd_bo_new_ring(submit->pipe->dev, size); -- 2.7.4