Commit graph

184774 commits

Author SHA1 Message Date
Boris Brezillon
30d6dfb861 panvk: Pass PAN_BO_SHAREABLE when relevant
Check VkExportMemoryAllocateInfo to know if we might export the BO
object at some point.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:27 +00:00
Boris Brezillon
aa6176ee1e panfrost: Introduce a PAN_BO_SHAREABLE flag
This flag reflects the ability to share a BO. This lets the kmod
backend optimize the case where the BO stays private to a specific
VM.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:27 +00:00
Boris Brezillon
5089a758df panfrost: Back panfrost_bo with pan_kmod_bo object
We keep the existing implementation unchanged but use pan_kmod for
all interactions with the kernel driver.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:27 +00:00
Boris Brezillon
7a9c471009 panfrost: Add a VM to panfrost_device
The current code assumes the logical device comes with a VM, so let's
explicitly create this default VM so we can map BOs with the kmod API.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:26 +00:00
Boris Brezillon
91fe8a0d28 panfrost: Back panfrost_device with pan_kmod_dev object
Back panfrost_device with pan_kmod_dev object and query all props using
the pan_kmod_dev_query_props().

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:26 +00:00
Boris Brezillon
70bcdbee6c panfrost: Avoid direct accesses to some panfrost_bo fields
We are about to delegate some BO-related operations to the pan_kmod
layer, but before we can do that, we need to hide panfrost_bo
internals so we can redirect such accesses to pan_kmod.

Provide panfrost_bo_{size,handle}() accessors and start using them.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:26 +00:00
Boris Brezillon
d47e01a3c3 panfrost: Avoid direct accesses to some panfrost_device fields
We are about to delegate some device-related operations to the pan_kmod
layer, but before we can do that, we need to hide panfrost_device
internals so we can redirect such accesses to pan_kmod.

Provide a few panfrost_device_xxx() accessors and start using them.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:26 +00:00
Boris Brezillon
93178999f6 pan/kmod: Add a backend for the panfrost kernel driver
Just a few implementation details that are worth mentioning:

- Panfrost doesn't support explicit VM management. This means
  panfrost_kmod_vm_create() must always be created with
  PAN_KMOD_VM_FLAG_AUTO_VA and panfrost_kmod_vm_bind(op=map) must
  always be passed PAN_KMOD_VM_MAP_AUTO_VA. The actual VA is assigned
  at BO creation time, and returned through
  drm_panfrost_create_bo.offset, or can be queried through
  DRM_IOCTL_PANFROST_GET_BO_OFFSET for imported BOs.

- Evictability is hooked up to DRM_IOCTL_PANFROST_MADVISE.

- BO wait is natively supported through DRM_IOCTL_PANFROST_WAIT_BO.

The rest is just a straightforward translation between the kmod API and
the existing panfrost ioctls.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:26 +00:00
Boris Brezillon
d95ec56f8c panfrost: Abstract kernel driver operations
We have generic BO management and device management layers that
directly call kernel driver-specific ioctls. The introduction of
Panthor (the new kernel driver supporting CSF hardware) forces us to
abstract some low-level operations. This could be done directly in
pan_{bo,device,props}.{c,h}, but having the abstraction clearly defined
and separated from the rest of the code makes for a cleaner
implementation.

This is also a good way to get a low-level KMD abstraction that
we can use without pulling all sort of gallium-related details in,
which will be important for some refactoring we plan to do in panvk.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:26 +00:00
Samuel Pitoiset
768c737273 radv: remove some declared but unused functions/macros
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26682>
2023-12-15 08:40:24 +00:00
Samuel Pitoiset
2f79ed1831 radv: stop asserting some image create info fields
Vulkan Validation Layers already check that and these assertions never
caught anything.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26682>
2023-12-15 08:40:23 +00:00
Colin Marc
a26119e124 vulkan video: correctly set SPS VUI bits
According to the spec section E.1 flags such as overscan_info_present_flag are
independent of aspect_ratio_info_present_flag.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26669>
2023-12-15 07:13:13 +00:00
Tapani Pälli
07f8db02ff iris: cleanup, use intel_needs_workaround instead of is_dg2
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26666>
2023-12-15 06:13:41 +00:00
Tapani Pälli
2f25679b3f anv: cleanup, use intel_needs_workaround instead of is_dg2
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26666>
2023-12-15 06:13:41 +00:00
Tapani Pälli
012b6fbe63 drirc: setup anv_assume_full_subgroups=16 for UnrealEngine5.1
We set max subgroup size as 16 for 'UnrealEngine5.1', this improves a
customer benchmark by 50% on A750.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26385>
2023-12-15 05:28:51 +00:00
Tapani Pälli
7ff8f79a88 anv/hasvk/drirc: change anv_assume_full_subgroups to have subgroup size
Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26385>
2023-12-15 05:28:51 +00:00
Faith Ekstrand
1cf1b9d741 nir: Scalarize bounds checked loads and stores
Fixes: 39da1deb49 ("nir/lower_io: Add a bounds-checked 64-bit global address format")
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26526>
2023-12-15 03:53:54 +00:00
Caio Oliveira
81e3b28f78 compiler: Remove C++ static member pointers to builtin types
When we moved the bulk of glsl_type to C, these globals were
kept to avoid changes to compiler/glsl code in the MR.  Now that
landed, change the code to use the actual bultins directly.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26658>
2023-12-15 03:09:19 +00:00
Caio Oliveira
bfc953add7 intel/compiler: Use C helpers to access builtin types
Remove usage of C++ static members as they are going to be removed.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26658>
2023-12-15 03:09:19 +00:00
Caio Oliveira
90e364edb0 compiler/types: Add a few more helpers to get builtin types
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26658>
2023-12-15 03:09:19 +00:00
Faith Ekstrand
22b99f15b9 nvk: Use ENUM_PACKED for enums instead of PACKED
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:59 +00:00
Faith Ekstrand
45f320e97f nvk: Enable cbufs
Just in case this breaks and blows up the universe, we'll add a NO_CBUFS
debug flag as a back-door.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:59 +00:00
Faith Ekstrand
d41fe63d99 nvk: Add debug flags to the physical device
These should probably go on the instance but everything is tangled up
too badly right now.  This at least moves them to some place where we
have them without a nouveau_ws_device.  It's fine to do this because
debug flags are an environment variable and won't change across a run.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:59 +00:00
Faith Ekstrand
ee29a8d1cd nvk: Upload cbufs based on the cbuf_map
For draw, this requires that we use a macro to read descriptors out of
the descriptor buffer because we may not have that information easily
available on the CPU.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
e6cd4b177a nvk: Don't flush descriptors in BeginConditionalRendering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
869f5fc680 nvk: Set MME_DATA_FIFO_CONFIG on device init
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
951d96a1a2 nvk: Rework push_indirect to take an address
The only reason we took a buffer bevore was to support the old kernel
API.  We can simplify the function now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
af3e7ba105 nvk: Stash descriptor set sizes
To save space in the root descriptor table, we put these in the CPU-only
descriptor structure instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
107a09e7dd nvk: Add a cbuf_bind_map to nvk_shader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
bdec097bb8 nvk/nir: Lower UBO loads to load_ubo when we have a cbuf
This will make it go through the cbuf path in NAK.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
f1c909edd5 nvk/nir: Add cbuf analysis to nvi_nir_lower_descriptors()
This builds a list of the 15 most commonly used UBOs or descriptor
buffers and places them in a new nvk_cbuf_map data structure.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
952e06672f nak/sm50: Add legalization and encoding for OpLdc
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
2199eea31b nak/sm50: Fix legalization of OpIAdd
Most of them specified bits 20..40 which is wrong because it's actually
19 bits with the sign bit off in bit 56 for some reason.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
e697280ebf nak/sm50: Fix immediate encodings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
eabd8cd470 nak: Handle negative cbuf offset immediates
This can happen with indirect UBO pulls because we just try go find an
iadd in NIR and one side may be negative.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
7bfb7a2b81 nak: Rework the dependency pass
This breaks the dependency pass in two.  The first pass builds a
dependency graph, including first-wait information for each barrier.
The second applies uses the newly constructed dependencies to place
barriers.  This fixes at least two known bugs:

 1. We were placing redundant write barriers.  In the case where we did
    a load, for example, we would add read barriers for the address and
    write barriers for the result.  In the fairly common case where the
    result is used before someone tries to overwrite the address, we
    don't actually need both barriers because a wait on the result
    implies a wait on the sources.

 2. There were a bunch of WaR cases which weren't being handled
    correctly.  In particular, when a variable-latency instruction read
    a register and then a fixed fixed-latency instruction read it, the
    fixed-latency read would replace the variable latency read.  When we
    then wrote that value with a fixed-latency instruction, we wouldn't
    see the hazard.  This commit fixes it by replacing the single last
    use per reg with a Vec of uses in the case of reads.

This fixes all known 1.1 memory model fails.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
8006f271d4 nak: Add a delay of 2 cycles for barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Sil Vilerino
0739927080 d3d12: Remove D3D12_SDK_VERSION checks after bumping directx-headers dependency to v611
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26556>
2023-12-14 20:06:53 -05:00
Sil Vilerino
90b49f16f7 d3d12: Bump directx-headers dependency to v611.0 for latest video codecs and features
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26556>
2023-12-14 20:06:52 -05:00
Jesse Natalie
2ea04ef69b vulkan/wsi: Convert bit tests to bool with != 0
Otherwise the bool result could be some value other than 0 or 1.

Fixes: d7938de8 ("vulkan/wsi: don't support present with queues where blit is unsupported")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26706>
2023-12-15 00:39:10 +00:00
Jesse Natalie
19175e474b microsoft: Whitespace change to trigger CI
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26706>
2023-12-15 00:39:10 +00:00
Jordan Petridis
62c797f5f3 Revert "ci: take microsoft farm offline"
Infrastructure issues [1] have been solved, sort of! Let's give
it a go again!

This reverts commit 0957b01a06.

[1]: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/37270

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26706>
2023-12-15 00:39:10 +00:00
GKraats
4fe9a6053a i915G: show correct number of needed ALU instructions at errmess
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26340>
2023-12-14 23:24:32 +00:00
Daniel Stone
752b23547a panfrost/ci: Skip broken image copy tests
Any kind of image copy with a conversion (between channel
size/order/content, or between tiling mode) seems liable to failure.
Since this seems like a general problem, just skip the entire battery of
tests until it can be systematically fixed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26449>
2023-12-14 22:53:40 +00:00
Daniel Stone
f51d99def6 panfrost/ci: Add environment variable to suppress warnings
Without it, our test log fills up with warnings that crawling index
buffers from the CPU isn't valid. We know that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26449>
2023-12-14 22:53:39 +00:00
Daniel Stone
ac613b9e44 panfrost/ci: Remove Vulkan expectations from G57
panvk doesn't yet support G57.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26449>
2023-12-14 22:53:39 +00:00
Thomas H.P. Andersen
487837c0bf docs: update features.txt for nvk
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26676>
2023-12-14 22:41:37 +00:00
Eric Engestrom
871ea3bb88 radv/ci: add flake
Failed in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52773139

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26704>
2023-12-14 22:13:45 +00:00
Eric Engestrom
64c2a0489d docs: drop : in title
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26702>
2023-12-14 22:07:08 +00:00
Eric Engestrom
b557362b3a ci: run every test when changing the build
Changing meson options, checks or dependencies can affect drivers, so
they should be tested.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26625>
2023-12-14 20:58:16 +00:00