Commit Graph

191906 Commits

Author SHA1 Message Date
Christian Gmeiner
e019517d6e nak: Set has_imad32 conditionally
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30099>
2024-07-12 05:54:46 +00:00
Faith Ekstrand
b209fedebe nak/sm50: Fix immediates for IMnMx
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
faeb715535 nak/sm50: Re-order all the ops
This puts them in the same order as nak/ir.rs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
970b3e0e71 nak: Add a legalize() method to ShaderModel
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
e039b7e1ac nak/sm50: Move legalization into SM50Op
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
59f1ad581e nak/sm50: Move instruction encoding into a trait
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
99c4b90f3c nak/sm70: Move legalization into SM70Op
This puts the legalize routine and the encoder right next to each other
in the code, making it much easier to verify that legalize() enforces
all of the constraints reqauired by encode().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
f20b1c50b4 nak/legalize: Handle RA instructions up-front
This pulls them out of the per-SM flow.  They're also all no-ops to
legalize since they don't take vectors and are handled directly by RA.
This also means these instructions are now getting properly handled on
Maxwell where we previously trusted in the (probably broken) maxwell
legalizing code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
9d8d928a59 nak/legalize: Handle OpBreak and OpBSSy specially
This lets us stop passing liveness information into the per-op
legalization code.  Long-term, I want to add a more general core
concept of destinations which are also reads but I haven't gotten
around to that yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
d9a9bb651c nak/legalize: Move a bunch of helpers to a trait
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
1b9b6a9529 nak/sm70: Re-organize the code a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
20e1160f3f nak/sm70: Move instruction encoding into a trait
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
57667aeac8 nak: Move instruction encoding into ShaderModel
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
d4db2f43de nak: Move Instr::can_be_uniform() into ShaderModel
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
6ddb2b291d nak: Move RegFile::num_regs() into ShaderModel
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
74ac40da2d nak/ra: Move the NAK_DEBUG=spill logic into RA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
e6b8da5427 nak: Plumb a ShaderModel trait through everywhere
Instead of scattering number checks everywhere, this lets us actually
start splitting code paths.  This commit just adds the shader model
trait.  Later commits will add more methods.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
69bea2b49f nak/sm50: Get rid of the hand-rolled align_up/down() helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
0f7ff6fbdc nak: Move encode_sm* to to sm*.rs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:31 +00:00
Faith Ekstrand
d82a5d0f59 nak/sph: Stop storing the shader model in ShaderProgramHeader
It's only needed for one Kepler+ check which is unlikely to ever be
relevant for NAK.  Also, that should probably be based on the SPH
version or something, not an arbitrary shader model.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30141>
2024-07-11 22:28:30 +00:00
Caio Oliveira
c2d1e10315 intel/brw: Don't print extra newlines in assembler
Handle '\n' when inside the MSGDESC start condition,
otherwise the lexer would apply its default rule (write
to stdout).

Without that, newlines were "leaking" to the output when
parsing a multiple line "MsgDesc". E.g. given the file
example.asm below

```
send(8)  nullUD  g126UD  nullUD  0x02000000  0x00000000
    thread_spawner MsgDesc:  mlen 1 ex_mlen 0 rlen 0
    { align1 WE_all 1Q @1 EOT };
```

the assembler would produce one extra newline

```
$ brw_asm -t hex -g tgl example.asm

31 01 03 80 04 00 00 00 0c 7e 00 70 00 00 00 00
```

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30100>
2024-07-11 21:07:54 +00:00
Alyssa Rosenzweig
b8dcbfbd39 zink: print pipeline stats for compute shader-db
this is useful for evaluating compute shaders with zink. the open shader-db
doesn't have any compute shaders in it, but shader-db runner is capable of
compute and we need to handle it. (Rob's shaderdb definitely has some compute
shaders in it, at least.)

this gets us pipeline stats printing on zink+nvk for a simple compute shader I wrote when working on common NIR stuff:

b.shader_test - type: compute, Code Size: 752, Number of GPRs: 19, SLM Size: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30135>
2024-07-11 20:37:38 +00:00
Alyssa Rosenzweig
8c597c0861 zink: move print_pipeline_stats
we need it higher up in the file for the next patch. nfc.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30135>
2024-07-11 20:37:38 +00:00
Louis-Francis Ratté-Boulianne
2b8eaf3bd6 panfrost: add PAN_AFRC_RATE env var to force a compression rate
Valid values are "default" and integers from 1 to 12 (bpc).

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28813>
2024-07-11 19:02:50 +00:00
Louis-Francis Ratté-Boulianne
2ff543f3b8 panfrost: add support for fixed-rate compression
Add support for the gallium interface to retrieve supported bitrates
and modifiers and creation of a compressed resource.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28813>
2024-07-11 19:02:50 +00:00
Louis-Francis Ratté-Boulianne
6665840929 panfrost: add translation between modifier and compression rates
Add some util methods to be able to translate from an AFRC modifier
to the associated compression bitrate (bits-per-components) and
vice-versa. Also add a method to query all the supported compression
bitrate for a format.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28813>
2024-07-11 19:02:50 +00:00
Louis-Francis Ratté-Boulianne
894657a5ed panfrost: add support for AFRC modifiers
Add support for all three block sizes (16, 24 and 32) and two
paging tiles layout (rotation or scan optimized). The size of the
resource is aligned to the paging tile width and height.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28813>
2024-07-11 19:02:50 +00:00
Louis-Francis Ratté-Boulianne
450c853f8b panfrost: add support for AFRC render targets
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28813>
2024-07-11 19:02:50 +00:00
Louis-Francis Ratté-Boulianne
df226c237e panfrost: add support for AFRC textures
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28813>
2024-07-11 19:02:50 +00:00
Louis-Francis Ratté-Boulianne
87aad0a5e4 panfrost: encode component order as an inverted swizzle (v10)
v10 restricts component orders when AFRC is in use, so we use the
same solution as for AFBC on v7.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28813>
2024-07-11 19:02:50 +00:00
Louis-Francis Ratté-Boulianne
2dae926850 panfrost: add utils for AFRC fixed-rate support
There are mainly two parameters to control the fixed-rate
compression:

 - Block size: the size (16, 24 or 32 bytes) that will take a
               coding unit (format dependent).
 - AFRC format: the pixel format and paging tile layout

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28813>
2024-07-11 19:02:50 +00:00
Louis-Francis Ratté-Boulianne
fb95e8ada0 panfrost: add device querying for AFRC support
As of now, only Mali-G310 supports ARM fixed-rate compression but
it should be advertised in bit 25 of TEXTURE_FEATURES_0

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28813>
2024-07-11 19:02:50 +00:00
Louis-Francis Ratté-Boulianne
a7b489f7be panfrost: Add AFRC overlay in v10 xml specification
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28813>
2024-07-11 19:02:50 +00:00
David Rosca
6cc32c609b radeonsi/vcn: Add low latency encode support
This feature should be enabled for use cases when the lowest encoding
latency is desired, such as real-time game streaming.
Disabled by default due to increased power usage.

There is no libva interface currently that could be used for this, so
for now it can only be enabled by setting AMD_DEBUG=lowlatencyenc
environment variable.

See: https://gitlab.freedesktop.org/drm/amd/-/issues/3336

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30039>
2024-07-11 18:33:41 +00:00
David Rosca
c06b944398 radeonsi: Add debug option to enable low latency encode
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30039>
2024-07-11 18:33:41 +00:00
Caio Oliveira
e63b0571bc intel/brw: Account for reg_unit() in assembler
Use reg_unit() to match the internal representation in brw_reg.
Fixes the assembler tool when targetting Xe2.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30060>
2024-07-11 16:38:54 +00:00
Caio Oliveira
6cdd56e7ed intel/brw: Use brw_inst_set_group() to set QtrCtrl and NibCtrl
The function handles the Xe2 case where NibCtrl is gone.  Also add
error messages for invalid input when assembling for Xe2, e.g. "2N".

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30060>
2024-07-11 16:38:54 +00:00
Caio Oliveira
c3c65e8821 intel/brw: Don't set acc_wr_control for Xe2
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30060>
2024-07-11 16:38:54 +00:00
David Rosca
3a6513d7c4 radeonsi/vcn: Limit size to target size in AV1 decode
Avoids page faults when trying to decode into small target buffer.
This currently happens due to ffmpeg bug when decoding AV1-TEST-VECTORS/av1-1-b8-03-sizeup.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30072>
2024-07-11 13:33:04 +00:00
Karol Herbst
d36b1e30a2 rusticl: require PIPE_CAP_IMAGE_STORE_FORMATTED for image support.
Luckily we don't need PIPE_CAP_IMAGE_LOAD_FORMATTED as this will only be
relevant for read_write image support.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30104>
2024-07-11 12:14:57 +00:00
Karol Herbst
382b88cbc4 rusticl/device: fix advertizement of 3d write images support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30104>
2024-07-11 12:14:57 +00:00
Karol Herbst
06cecdc420 rusticl/device: turn image_3d_write_supported into a cap
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30104>
2024-07-11 12:14:57 +00:00
Karol Herbst
386632e2a3 rusticl/device: fix image_3d_write_supported for embedded
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30104>
2024-07-11 12:14:57 +00:00
Karol Herbst
5cc37b9025 rusticl/spirv: support more caps
Fixes: 22171d16f8 ("mesa: Use the new spirv_capabilities struct")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30104>
2024-07-11 12:14:57 +00:00
Karol Herbst
48050d9f45 v3d: support unnormalized coords
Useful for OpenCL and maybe other things.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30104>
2024-07-11 12:14:57 +00:00
Kenneth Graunke
837c441acb intel/nir: Don't needlessly split u2f16 for nir_type_uint32
Commit f695a9fed2 moved the 64-bit float <-> 16-bit float conversion
splitting into a core NIR pass, so the code remaining here is only
needed for 64-bit integer types.

Presumably in an attempt to remove the float handling, it replaced
simple bit_size == 64 checks with this expression:

   (full_type & (nir_type_int64 | nir_type_uint64))

I believe that the intended expression was:

   (full_type == nir_type_int64 || full_type == nir_type_uint64)

Unfortunately, the former is incorrect.  Any integer or unsigned
NIR type would trigger the former expression.  For example:

   nir_type_uint32 & (nir_type_int64 | nir_type_uint64) => nir_type_uint

This meant that we were splitting e.g. u2f16 on 32-bit unsigned types
into u2f32 and f2f16, when we can easily natively handle that case.

To fix this, we go back to simple bit_size == 64 checks.  This pass is
already run after nir_lower_fp16_casts which will split the float case,
so we will never see it here.

fossil-db on Alchemist shows a -1.14% reduction in affected shaders for
google-meet-clvk shaders.  In another ChromeOS workload, it improves
performance by around 8% on Meteorlake.

Thanks to Sushma Venkatesh Reddy for finding this performance issue!

Fixes: f695a9fed2 ("intel/compiler: use nir_lower_fp16_casts")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30091>
2024-07-11 02:37:05 -07:00
Sergi Blanch Torne
5873b3ac14 ci: run_n_monitor, sort by name when listing jobs
The job loops, w/o and explicit sort, are sorted by the job id. As they produce
logs, humans could feel an improvement by sorting by name.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29444>
2024-07-11 08:28:31 +00:00
Sergi Blanch Torne
12c1bdc31d ci: run_n_monitor, listing job names with a padding
Formatting the output lines with a padding in the job name fields may help
the readability of the information when one tries to follow the progress of
a specific job.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29444>
2024-07-11 08:28:31 +00:00
Sergi Blanch Torne
d80d35ceff ci: run_n_monitor, pretty duration with padding
When printing time durations, the smaller units can always have the same
number of digits. Helps to have aligned fields when printing.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29444>
2024-07-11 08:28:31 +00:00
Sergi Blanch Torne
45f19b3631 ci: run_n_monitor, arguments review and unicode
Coding style homogenous for all the methods in the file. Document
unicode symbols used.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29444>
2024-07-11 08:28:31 +00:00