From 6373845d985d65c00f7c62b793e67ae5106eabff Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Tue, 8 Mar 2016 16:01:47 +0100 Subject: [PATCH] winsys/amdgpu: enlarge buffer_indices_hashlist MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Enlarge the buffer hashlist to prevent large numbers of misses due to adding more buffers than can be cached in the hashlist. The game I tested had CS's with up to 1500 buffers and the overhead of amdgpu_lookup_buffer for various sizes was: 4096 1.97% (new value) 2048 4.37% 1024 6.92% 512 9.47% (old value) (percentage of CPU usage in render thread as determined by perf) The time spent in amdgpu_add_buffer self is ~4.2% in all cases and for 4096 the time needed to clear the hashlist is still < 0.10%, so I am not expecting significant regressions. Signed-off-by: Bas Nieuwenhuizen Signed-off-by: Marek Olšák --- src/gallium/winsys/amdgpu/drm/amdgpu_cs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h index 6ad3cddf7cb..a2fb44a4b0e 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h @@ -76,7 +76,7 @@ struct amdgpu_cs { uint8_t *flags; struct amdgpu_cs_buffer *buffers; - int buffer_indices_hashlist[512]; + int buffer_indices_hashlist[4096]; uint64_t used_vram; uint64_t used_gart; -- 2.30.2