From 474f9fbe86d63cbdab9d6a7d5e32f873eec4b439 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 24 May 2023 17:30:43 -0400 Subject: [PATCH] winsys/radeon: fix the scratch buffer on gfx6-7 I'm sure this was broken. Fixes: 1bf39b1f9d115d69 - ac,radeonsi: rework how scratch_waves is used and move it to ac_gpu_info.c Reviewed-by: Dave Airlie Part-of: --- src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c index 9f2d444..543af4c 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c @@ -566,6 +566,13 @@ static bool do_winsys_init(struct radeon_drm_winsys *ws) ws->info.spi_cu_en = 0xffff; ws->info.never_stop_sq_perf_counters = false; + /* The maximum number of scratch waves. The number is only a function of the number of CUs. + * It should be large enough to hold at least 1 threadgroup. Use the minimum per-SA CU count. + */ + const unsigned max_waves_per_tg = 1024 / 64; /* LLVM only supports 1024 threads per block */ + ws->info.max_scratch_waves = MAX2(32 * ws->info.min_good_cu_per_sa * ws->info.max_sa_per_se * + ws->info.num_se, max_waves_per_tg); + ws->check_vm = strstr(debug_get_option("R600_DEBUG", ""), "check_vm") != NULL || strstr(debug_get_option("AMD_DEBUG", ""), "check_vm") != NULL; ws->noop_cs = debug_get_bool_option("RADEON_NOOP", false); -- 2.7.4