i965: Fix shared local memory size for Gen9+.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 9 Jun 2016 05:21:22 +0000 (22:21 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 12 Jun 2016 07:38:26 +0000 (00:38 -0700)
commit87d062a94080373995170f51063a9649c96c6dea
treea0057a7ebd072ec6104b83d17fb6ec7f396f60c7
parent3f48548a6f65fe90b97956c7be73268917c6f2f9
i965: Fix shared local memory size for Gen9+.

Skylake changes the representation of shared local memory size:

 Size   | 0 kB | 1 kB | 2 kB | 4 kB | 8 kB | 16 kB | 32 kB | 64 kB |
 -------------------------------------------------------------------
 Gen7-8 |    0 | none | none |    1 |    2 |     4 |     8 |    16 |
 -------------------------------------------------------------------
 Gen9+  |    0 |    1 |    2 |    3 |    4 |     5 |     6 |     7 |

The old formula would substantially underallocate the amount of space.
This fixes GPU hangs on Skylake when running with full thread counts.

v2: Fix the Vulkan driver too, use a helper function, and fix the table
    in the comments and commit message.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/intel/vulkan/gen7_cmd_buffer.c
src/intel/vulkan/gen8_cmd_buffer.c
src/mesa/drivers/dri/i965/brw_compiler.h
src/mesa/drivers/dri/i965/gen7_cs_state.c