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 <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19656>
This commit is contained in:
@@ -53,6 +53,8 @@
|
||||
|
||||
extern simple_mtx_t table_lock;
|
||||
|
||||
#define SUBALLOC_SIZE (32 * 1024)
|
||||
|
||||
/*
|
||||
* Stupid/simple growable array implementation:
|
||||
*/
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user