mesa/src/intel
Kenneth Graunke 5c88488a64 intel/eu: Fix XeHP register region validation for hstride == 0
Recently, we started using <1;1,0> register regions for consecutive
channels, rather than the <8;8,1> we've traditionally used, as the
<1;1,0> encoding can be compacted on XeHP.  Since then, one of the
EU validator rules has been flagging tons of instructions as errors:

   mov(16)   g114<1>F   g112<1,1,0>UD   { align1 1H I@2 compacted };
   ERROR: Register Regioning patterns where register data bit locations are changed between source and destination are not supported except for broadcast of a scalar.

Our code for this restriction checked three things:

   #1: vstride != width * hstride ||
   #2: src_stride != dst_stride ||
   #3: subreg != dst_subreg

Destination regions are always linear (no replicated values, nor
any overlapping components), as they only have hstride.  Rule #1 is
requiring that the source region be linear as well.  Rules #2-3 are
straightforward: the subregister must match (for the first channel to
line up), and the source/destination strides must match (for any
subsequent channels to line up).

Unfortunately, rules #1-2 weren't working when horizontal stride was 0.
In that case, regions are linear if width == 1, and the stride between
consecutive channels is given by vertical stride instead.

So we adjust our src_stride calculation from

   src_stride = hstride * type_size;

to:

   src_stride = (hstride ? hstride : vstride) * type_size;

and adjust rule #1 to allow hstride == 0 as long as width == 1.

While here, we also update the text of the rule to match the latest
documentation, which apparently clarifies that it's the location of
the LSB of the channel which matters.

Fixes: 3f50dde8b3 ("intel/eu: Teach EU validator about FP/DP pipeline regioning restrictions.")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17624>
2022-07-28 21:31:45 +00:00
..
blorp intel/blorp: Set uses_sample_shading for MSAA blit shaders 2022-07-13 20:28:42 +00:00
ci intel/fs: Use nir_lower_single_sampled 2022-07-13 20:28:42 +00:00
common intel: protect against empty invalidate ranges 2022-07-13 01:33:27 +00:00
compiler intel/eu: Fix XeHP register region validation for hstride == 0 2022-07-28 21:31:45 +00:00
dev intel/dev: Determine the amount of free vram using small BAR uapi 2022-07-26 20:34:02 +00:00
ds u_trace/anv/iris: drop cs argument for recording traces 2022-05-19 19:04:28 +00:00
genxml intel: fix typos found by codespell 2022-06-27 10:20:55 +00:00
isl isl: add new helper for format component compatibility 2022-07-11 14:57:26 +00:00
nullhw-layer vulkan: drop empty vulkan_wsi_args 2022-04-27 11:51:26 +00:00
perf intel: fix typos found by codespell 2022-06-27 10:20:55 +00:00
tools intel/compiler: Introduce a new brw_isa_info structure 2022-06-30 23:46:35 +00:00
vulkan util/list: rename LIST_ENTRY() to list_entry() 2022-07-28 10:10:44 +00:00
meson.build anv: add perfetto source 2022-01-14 20:17:44 +00:00