Commit graph

181642 commits

Author SHA1 Message Date
Benjamin Lee
4b8a8b2a28 nak: use carry register file for IADD2
This allows detecting dependencies between IADD.X and IADD.CC, which is
necessary for SM50 sched and DCE.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
9d6c487a75 nak: move iadd64 construction to a builder method
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
6323cae9f9 nak: add carry register file
There is only one carry-register, so representing it as a register file
is a little weird, but it makes calculating instruction deps simpler.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
1ae43d2606 nak/sm50: Stop using ALUSrc for IADD2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
998c470f58 nak/sm50: Add better helpers for encoding sources with modifiers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
43160df14e nak/sm50: rewrite encode_iadd2 to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
e5d70d303f nak: Drop the SM50 encoding of BREV
We should add an OpBfe instead of this mess.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
a1af8129a6 nak/sm50: Rewrite the encoding for OpMov
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
0adb7c52f8 nak: Implement FS input interpolation on SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
bdf0c300e1 nak/sm50: Rewrite the encoding for OpIMnMx
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
20176035f6 nak: Rewrite the SM50 encoding of OpF2I
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
426b27ef04 nak/sm50: Wire up tex ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
bb41f2815f nak/nv50: Rewrite the encoding of OpShf
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
08ac17789b nak: Rework nvfuzz for SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
899c58606d nak: Only split texture destinations on Volta+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
c57bf36c0a nak: Add SM50 encodings for ALD and AST
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
08cab9a57e nak: add ATOM{G,S} encoding for SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
cd7ac4b0c5 nak: implement ST* and LD* on SM50
LDG was previously encoded, but the opcode and field offsets were incorrect.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Benjamin Lee
8a82f426a2 nak: add IADD instruction for SM50
For now, we're just using this in place of IAdd3x for 64-bit adds. IADD3
with carry flags is supported on SM50, but it works completely
differently from SM75. Longer-term we'll probably want to emit this in
all of the places that we're currently using IADD3.

Also need to hook the carry register up to calc_deps, but for now I'm
just using NAK_DEBUG=serial.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Benjamin Lee
588cfcaec7 nak: Legalize a bunch of instructions for SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
bbd2de34c5 nak: Rework the SM50 encoding of isetp
Drop the ALU stuff and hand-encode it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
e404877a02 nak: Use OpLop2 and OpPSetP pre-SM70
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
36e80caac9 nak: Rename LogicOp to LogicOp3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
93b6c43725 nak: Rewrite SM50 encode_fadd to not use encode_alu
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
4ab2d5c4ff nak: Rework set_src_imm20 in nak_encode_sm50
Rename it to set_src_i20 and fix the assert to allow negative signed
values.  Also, add a new set_src_f20 helper with the correct semantics
for float immediates.  Finally, get rid of some bogus shifting in the
ALU code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
a80ce982d4 nak: Initial WIP SM50 backend
Only encode some instructions.

some TODO:
- SM50 specific legalizer
- Cleaner ALU encoding (there is multiple form of encoding depending of
  the instruction)

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Benjamin Lee
9af7639e4b nak: make sm available in builders
This is needed for the 'sel' builder method, which should emit different
instrs on SM50 versus SM75.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
40127e881f nak: Split legalize into per-SM functions
We still have common code to handle the multiple vector source case
because that's required for RA correctness but everything else is
pretty much per-SM.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Juan A. Suarez Romero
d0ae58f413 ci: do not mount already mounted directories
In some cases we are using an initramfs image that pre-mounts some of
the directories, so let's skip them in the next stage.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26552>
2023-12-07 00:05:25 +00:00
Juan A. Suarez Romero
f97e065c4f ci/baremetal: make BM_BOOTCONFIG optional
In some cases we can have the config.txt boot file already available in
the tftp folder.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26552>
2023-12-07 00:05:25 +00:00
Jesse Natalie
d157cd7442 microsoft/clc: One more image lowering fix
Bindings are not necessarily globally unique, and even the location
where we were trying to read the binding value out of is a union, so
we could be trying to compare binding values against data for other
arg types.

Instead, use the arg metadata offset, which is globally unique and
outside of the union.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26555>
2023-12-06 23:46:42 +00:00
Faith Ekstrand
03ae261183 nvk: Advertise KHR_shader_integer_dot_product
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26533>
2023-12-06 23:15:33 +00:00
Faith Ekstrand
eb633b4978 nak: Wire up DP4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26533>
2023-12-06 23:15:33 +00:00
Faith Ekstrand
fcf31d9c25 nak: Rework printing of int/float types and rounding modes
Make the . part of the enum's print like for other things.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26533>
2023-12-06 23:15:33 +00:00
Faith Ekstrand
adafcacf15 microsoft: Stop claiming dot_4x8_sat support
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26533>
2023-12-06 23:15:33 +00:00
Faith Ekstrand
d2ffcb6092 nir: Lower [su]dot_4x8_[ui]add_sat to [su]dot_4x8_[ui]add
Since nir_opt_algebraic runs on its own results, if the driver doesn't
have [su]dot_4x8_[ui]add then the [su]dot_4x8_[ui]add lowering rules
will kick in and lower that to what we had originally.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26533>
2023-12-06 23:15:33 +00:00
Faith Ekstrand
09fc5e1c4d nir: Split has_[su]dot_4x8 bits into regular and _sat versions
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26533>
2023-12-06 23:15:33 +00:00
Faith Ekstrand
fde43e44e9 ci: Also rustfmt binaries
The standard name for an executable is main.rs.  Also fix the rusticl
docs while we're at it.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26546>
2023-12-06 22:41:47 +00:00
Faith Ekstrand
03f1b99f50 nak: Restructure for better module separation
With this commit, NAK now takes on a more Cargo-like structure with
things split better into crates:

 - bitview/
    - lib.rs // Formerly bitview.rs
 - nak/
    - lib.rs // Only pulls stuff into the module
    - api.rs // Formerly nak.rs
    - ...
 - nvfuzz/
    - main.rs // Formerly nvfuzz.rs

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26546>
2023-12-06 22:41:47 +00:00
Faith Ekstrand
97cd55d065 nak: rustfmt
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26546>
2023-12-06 22:41:47 +00:00
José Roberto de Souza
5560835fbe anv: Avoid unnecessary intel_flush calls
Batch bos are always allocated with ANV_BO_ALLOC_HOST_CACHED_COHERENT
so there is no need to do cflush calls.
But if we ever decide to change that anv_bo_needs_host_cache_flush()
will make sure cflush is called.

Outside of batch bos, this patch is also removing the
intel_flush_range() call from anv_QueuePresentKHR because
device->debug_frame_desc is offset of workaround_bo that is also
allocated as ANV_BO_ALLOC_HOST_COHERENT.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26457>
2023-12-06 22:18:26 +00:00
José Roberto de Souza
9aea879342 anv: Promote bos to host_cached+host_coherent in platforms with LLC
In platforms with LLC we can promote all bos to cached+coherent
without any performance penality.
On the up side CPU reads can hit cache this way.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26457>
2023-12-06 22:18:26 +00:00
José Roberto de Souza
a65e982b44 anv: Split ANV_BO_ALLOC_HOST_CACHED_COHERENT into two actual flags
As suggested by Lionel, here adding ANV_BO_ALLOC_HOST_COHERENT
and with that ANV_BO_ALLOC_HOST_CACHED_COHERENT is now defined by
(ANV_BO_ALLOC_HOST_COHERENT | ANV_BO_ALLOC_HOST_CACHED).

In some callers of anv_device_alloc_bo() was necessary to add
ANV_BO_ALLOC_HOST_COHERENT as no other flag was set and that
was the default behavior up to now.

A change that could look not related is the removal of the
intel_flush_range() in anv_device_init_trivial_batch(), that was done
because trivial_batch_bo is HOST_COHERENT so no flush is necessary.
And it did not made sense to make it ANV_BO_ALLOC_HOST_CACHED_COHERENT
as it was never read in CPU.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26457>
2023-12-06 22:18:26 +00:00
José Roberto de Souza
0eac6298f2 anv: Fix handling of host_cached_coherent bos in gen9 lp in older kernels
Kernel versions without DRM_I915_QUERY_MEMORY_REGIONS support will
take a different code path in i915_gem_create() that lacks the
i915_gem_set_caching() call to make cached bos in gen9 lp 1 way
coherent.

Fixes: fc0acf6d90 ("anv: Move i915 specific gem_set_caching to backend")
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26457>
2023-12-06 22:18:26 +00:00
Sil Vilerino
d0c3556011 meson: Add all, all_free (default) options for video-codecs option.
- Adds new 'all' value to the video-codecs option
- Adds 'all_free' value to video-codecs and sets
   it as default value for non patent-encumbered
   codecs, restoring the behavior for these codecs
   before existing as options in commit 7b22dd8bfd

Fixes: 7b22dd8bfd ("meson: add vp9 and av1 codec support options")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26320>
2023-12-06 21:49:27 +00:00
Samuel Pitoiset
e126e82c79 zink/ci: stop running zink-radv-navi31-valve sequentially
Skipping the tests that OOM seems to fix this.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26544>
2023-12-06 20:31:24 +00:00
Samuel Pitoiset
bec2928cc2 zink/ci: update list of failures for NAVI31
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26544>
2023-12-06 20:31:24 +00:00
Samuel Pitoiset
f6dc3429e6 zink/ci: skip more tests that run OOM on NAVI31
These have been skipped recently, but not for NAVI31 for some reasons.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26544>
2023-12-06 20:31:24 +00:00
José Roberto de Souza
969af605fe intel/isl: Set mocs.blitter_dst/src for MTL
This fields are required to be set because those are used by
XY_FAST_COLOR_BLT instruction.
Right now it is not set causing applications to abort because
DestinationMOCS is required to be non-zero.

This fixes at least piglit@ext_external_objects-vk-image-display on MTL.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26502>
2023-12-06 20:09:04 +00:00
Lionel Landwerlin
4ff1b0f751 anv/video: only report matching memory types for protected sessions
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 794b0496e9 ("anv: enable protected memory")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26519>
2023-12-06 19:17:17 +00:00