Commit graph

177262 commits

Author SHA1 Message Date
Faith Ekstrand
27eb9af9d8 nvk: Require an environment variable for poorly tested hardware
We really only know that Turing and Ampere work right now.  Maxwell has
recieved some testing but still can't survive a CTS run.  Other hardware
is even less well tested.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Karol Herbst
a4367f2e3c nouveau: fix max_warps_per_mp_for_sm for builds with asserts disabled
Fixes: 1b756be2bca ("nvk: properly calculate SLM region by taking per arch limits into account")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Karol Herbst
61c0d86831 nvk: properly calculate SLM region by taking per arch limits into account
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Karol Herbst
4b66a0a70c nvk: replace mp with tpc
The tls space is calculate per TPC, but nouveau also doesn't report the MP
count to us, but the TPC count instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Karol Herbst
a5129fb03f nvk: fix num_gprs for Volta+
Fixes OOR_REG errors being thrown

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
c6a8851902 nvk: Implement VK_EXT_physical_device_drm
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
c68b4e4b3a nvk: Don't enumerate pre-Kepler GPUs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
f52add16fc nvk: Move the winsys device to nvk_device
Vulkan requires that different VkDevices be unable to affect each other.
To correctly provide this invariant, each VkDevice really needs its on
virtual address space.  This means opening a new nouveau_device per
nvk_device.  This may make device creation a tiny bit less efficient but
we can fix that with some sort of caching if we absolutely need to.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
be5d6c7cbe nvk: Add a ws_dev to nvk_device and use it
At the moment, this is just a convenient short-hand but we're about to
permanently move the nouveau_ws_device to nvk_device so it will be the
only way to access it soon.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
e2bdbc2151 nvk: Rename nvk_device::ctx to ws_ctx
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
088692d954 nvk: Use nv_device_info for class checks
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
1756e4601a nouveau: Move gart_size to nv_device_info
This is more complicated than the others since it is a calculated value.
For nv_device_info struct, we want the raw version that raw query from
the chip.  We move the calculation into nvk_create_drm_physical_device().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
372c884b4a nouveau: Move more stuff into nv_device_info
The device_id and is_integrated fields in nouveau_device can be dropped
entirely since they're redundant with nv_device_info::device_id and
nv_device_info::type.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
8e85ea6f7a nvk: Set deviceType based on nv_device_info::type
The is_integrated bool is based on VRAM size which is a bit clunky and
not really what the Vulkan query means.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
56ccada087 nouveau: Stop using hex for SM numbers
There's no indication that NVIDIA considers this to be anything other
than a decimal number.  Much to the contrary, the number of 5s and 9s in
the SM number table implies they very much are base 10.  Given that
Lovelace is SM90, we'll likely be hitting 100 fairly soon at which point
this will stop fitting in a uint8_t.  Switch to decimal to compress it
down a bit.

Also, rename the field to SM which beter matches the NVIDIA docs and
ensures that there are no users of this which are likely to be confused.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
9846c4e13e nouveau: Put PCI info in a pci substruct in nv_device_info
We separate out device_id because even non-PCI devices have one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
b232e42532 nvk: Only advertise EXT_pci_bus_info on discrete GPUs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
e722d0ff0b nvk: Drop nvk_physical_device::instance
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
221e024386 nvk: Use canonical variable names in nvk_sampler.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
75fc6260e8 nvk: Use canonical variable names in nvk_bo_sync.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
2be4acce25 nvk: Use canonical variable names in nvk_shader.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
6170e1c8d9 nvk: Use canonical variable names in nvk_physical_device.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Dave Airlie
0d9155c9f8 nvk: handle alignments in device memory
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
f0a165799c nvk: Add an addr field to nvk_image_plane
Nothing actually needs the pointer to the memory object so it's better
to not even include it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Dave Airlie
ad37394dfe nvk: init image fields for requirements
Fixes a crash in dEQP-VK.memory.requirements.create_info.*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
0498eeba32 nvk: Add a buffer alignment helper
This consolodates buffer alignment calculations into one place,
including physical device queries, buffer creation, and buffer memory
requirements queries.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
6a0cc93bd4 nvk: Reformat nvk_buffer.c
Mostly, using dev instead of device and re-flow the arguments to
nvk_GetDeviceBufferMemoryRequirements().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Karol Herbst
5fb3298a95 nouveau/winsys: fix SM value for Ada
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Emma Anholt
9ffbd53bb7 nvk: Add support for probing as a platform device.
The driver now comes up on gk20a (Jetson TK1).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Emma Anholt
880663c25d nvk: Clean up redundant vendor checking for physical device creation.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Emma Anholt
826486339b nvk: Quiet a compiler warning.
Looks like it's always set to me, but 🤷

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Emma Anholt
0410054459 nouveau/winsys: Fix an undefined use in the error path.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Dave Airlie
820c03ebee nvk/query: fix push buffer size for copy pool results.
the immediate takes two slots, so bump this by one,
fixes a crash in zink KHR-GL45.transform_feedback.query_vertex_interleaved_test

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
4fe57b2d7a nvk: Enable external memory extensions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
113b9b00e7 nvk: Support dma-buf export
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
0399999dec nvk: Support dma-buf import
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
c370260a8f nouveau/winsys: Add dma-buf import support
This requires a lock and a buffer cache on the nouveau_ws_device.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
10ffe8e709 nvk: Require dedicated allocations for external images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
7f0c06e130 nvk: Dedicated allocations override internal
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
702326d013 nvk: Add external memory queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
3d247f447e nvk: Add device and driver UUIDs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
cccc044f51 nvk: Use abbreviated names in nvk_device_memory.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
14d35c7048 nvk: Use NVIDIA_VENDOR_ID in pdev try_create()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
George Ouzounoudis
ccfbd94891 nvk: Enable descriptor indexing
These values follow the already existing per-stage and descriptor set
limits.  If we change these to be similar to the reported values of the
proprietary driver, care must be taken as Turing has bigger limits for
uniform buffers than older generations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
George Ouzounoudis
edb58c6660 nvk: Add nir non-uniform optimization pass
The hardware supports non-uniform access natively so we do not need to
lower most non-uniform access in the shader. Just lower the ubo access
as it should probably be faster when we uniformly load from real hw
ubos in the future.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
George Ouzounoudis
0dd15199a1 nvk: Handle cases of descriptor bindings with variable counts
We need to compute the allocated descriptor buffer size at descriptor allocation
time. So we need to split to a pre-computed size for all the other bindings
except the one with the variable count.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
George Ouzounoudis
6a74b3e311 nvk: Support VkDescriptorSetVariableDescriptorCountLayoutSupport
On cases with variable descriptor counts we need to calculate the
maximum supported variable count while taking into account the other existing
descriptors and their alignments in the set.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
81bec8b63b nvk: Use the max descriptor alignemtn in GetDescriptorSetLayoutSupport
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Benjamin Lee
354fe8fda0 nvk: Fix segfault when opening DRI device file returns error
Previously, ver was unitialized on this path, causing UB on the
`if (ver)` branch after the out_err label.

Signed-off-by: Benjamin Lee <benjamin@computer.surgery>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Dave Airlie
3572f5cd7e nvk: add support for D32_SFLOAT_S8_UINT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00