winsys/radeon: fix the scratch buffer on gfx6-7

I'm sure this was broken.

Fixes: 1bf39b1f9d - ac,radeonsi: rework how scratch_waves is used and move it to ac_gpu_info.c

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23221>
This commit is contained in:
Marek Olšák
2023-05-24 17:30:43 -04:00
committed by Marge Bot
parent fe03351bee
commit 474f9fbe86
@@ -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);