radeonsi/compute: Clamp COMPUTE_TMPRING_SIZE.WAVES to: num_cu * 32
authorTom Stellard <thomas.stellard@amd.com>
Fri, 5 Dec 2014 23:59:11 +0000 (23:59 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Mon, 8 Dec 2014 22:20:50 +0000 (17:20 -0500)
This is the maximum value allowed for this field.

src/gallium/drivers/radeonsi/si_compute.c

index 6ddb47896c530648e1b37c0424cf960b74694e46..bf935dcfee7aa82543582c60705158afba7a0a4c 100644 (file)
@@ -371,6 +371,9 @@ static void si_launch_grid(
                | S_00B85C_SH1_CU_EN(0xffff /* Default value */))
                ;
 
+       num_waves_for_scratch =
+               MIN2(num_waves_for_scratch,
+                    32 * sctx->screen->b.info.max_compute_units);
        si_pm4_set_reg(pm4, R_00B860_COMPUTE_TMPRING_SIZE,
                /* The maximum value for WAVES is 32 * num CU.
                 * If you program this value incorrectly, the GPU will hang if