anv: multiply the scratch space by 4 on gen9-10 like iris and i965

My understanding is that there's no reason for the scratch space
allocation to be different between iris, i965 and anv. Let's make all
the functions behave the same.

I don't know if this fixes any specific gen9 bugs, it it might since
it increases the scratch space.

v2: Rebase.
v3: Rebase.
v4: Remove redundant gen 11 check (Jason).

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4006>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4006>
This commit is contained in:
Paulo Zanoni 2020-02-28 16:03:02 -08:00 committed by Marge Bot
parent aa78801f0a
commit 62f7197fb5
1 changed files with 16 additions and 2 deletions

View File

@ -1397,12 +1397,26 @@ anv_scratch_pool_alloc(struct anv_device *device, struct anv_scratch_pool *pool,
unsigned subslices = MAX2(device->physical->subslice_total, 1);
/* For, Gen11+, scratch space allocation is based on the number of threads
* in the base configuration. */
/* The documentation for 3DSTATE_PS "Scratch Space Base Pointer" says:
*
* "Scratch Space per slice is computed based on 4 sub-slices. SW
* must allocate scratch space enough so that each slice has 4
* slices allowed."
*
* According to the other driver team, this applies to compute shaders
* as well. This is not currently documented at all.
*
* This hack is no longer necessary on Gen11+.
*
* For, Gen11+, scratch space allocation is based on the number of threads
* in the base configuration.
*/
if (devinfo->gen >= 12)
subslices = devinfo->num_subslices[0];
else if (devinfo->gen == 11)
subslices = 8;
else if (devinfo->gen >= 9)
subslices = 4 * devinfo->num_slices;
unsigned scratch_ids_per_subslice;
if (devinfo->gen >= 12) {