Friedrich Vock
db564a40b3
radv: Use max_se instead of num_se where appropriate
...
Scratch allocation needs to happen using max_se, otherwise there can be
hangs.
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29202 >
2024-05-22 10:35:01 +00:00
Samuel Pitoiset
074f3cfe73
radv: use new common helpers for building buffer descriptor
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29268 >
2024-05-22 08:31:39 +00:00
Samuel Pitoiset
f0200a54d9
radv: add a helper to configure ring buffer descriptors
...
Instead of duplicating everything which is annoying for bringup when
some fields are updated.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29234 >
2024-05-17 06:21:35 +00:00
Samuel Pitoiset
f0d4212847
radv: stop using radv_physical_device for radeon helpers
...
It will be easier to share helpers between RadeonSI and RADV.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29192 >
2024-05-15 11:34:35 +00:00
Marek Olšák
2adc66e586
amd: add initial common code for gfx12
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29007 >
2024-05-11 22:14:05 -04:00
Marek Olšák
58a5de5c34
amd: add gfx12 register definitions into the register header generator
...
The generator renamed some definitions to resolve conflicts.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29007 >
2024-05-11 22:14:05 -04:00
Konstantin
2b2f67aa2b
radv: Use a struct for the trace_bo layout
...
Now we can use the members on the CPU side and offsetof on the GPU side
instead of magic offsets.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28838 >
2024-04-25 10:20:03 +00:00
Samuel Pitoiset
87fde606cf
radv: use SPDX-License-Identifier
...
Only files under src/amd/vulkan/** are concerned.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28599 >
2024-04-08 07:17:31 +00:00
Samuel Pitoiset
6428270408
radv: move radv_queue_family_to_ring() to radv_queue.c
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28592 >
2024-04-05 12:18:38 +00:00
Samuel Pitoiset
69b911bc53
radv: remove radv_private.h
...
This file was a giant mess and I'm very happy to remove it entirely.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28568 >
2024-04-04 21:57:46 +00:00
Samuel Pitoiset
cc1526eeac
radv: replace radv_is_aligned() by util_is_aligned()
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28568 >
2024-04-04 21:57:46 +00:00
Samuel Pitoiset
0388df3d08
radv: replace RADV_FROM_HANDLE by VK_FROM_HANDLE
...
It was exactly the same thing.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28568 >
2024-04-04 21:57:45 +00:00
Samuel Pitoiset
7ea12d6ace
radv: move radv_emit_{compute,graphics}() to radv_queue.c
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551 >
2024-04-04 16:35:16 +00:00
Samuel Pitoiset
58cd24a636
radv: move radv_queue_ring() to radv_queue.c
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551 >
2024-04-04 16:35:15 +00:00
Samuel Pitoiset
9a7afbfa13
radv: add radv_printf.h
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551 >
2024-04-04 16:35:15 +00:00
Samuel Pitoiset
d1adbf0e53
radv: add radv_cp_reg_shadowing.h
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551 >
2024-04-04 16:35:15 +00:00
Samuel Pitoiset
195383a5ec
radv: add radv_rmv.h
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551 >
2024-04-04 16:35:15 +00:00
Samuel Pitoiset
0fb19b8331
radv: add radv_queue.h
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526 >
2024-04-03 13:32:54 +00:00
Samuel Pitoiset
83841b0b78
radv: add radv_device_memory.h
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28526 >
2024-04-03 13:32:53 +00:00
Samuel Pitoiset
db736ebf53
radv: implement VK_EXT_device_address_binding_report
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28373 >
2024-04-03 08:48:36 +00:00
Samuel Pitoiset
d7141bbf79
radv: add radv_image.h
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28510 >
2024-04-02 21:04:53 +00:00
Samuel Pitoiset
c925f03712
radv: add radv_buffer.h
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28510 >
2024-04-02 21:04:53 +00:00
Samuel Pitoiset
29bae070d1
radv: remove radv_queue::device
...
Get the logical device object using the base object.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500 >
2024-04-01 16:35:09 +00:00
Samuel Pitoiset
896c9cf486
radv: remove radv_device::physical_device
...
Get the logical device object using the base object.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500 >
2024-04-01 16:35:09 +00:00
Samuel Pitoiset
310597cab6
radv: rename radv_physical_device::rad_info to info
...
The extra rad_ prefix isn't necessary and it's longer to type.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500 >
2024-04-01 16:35:09 +00:00
Samuel Pitoiset
2686cd59df
radv: rename radeon_info variables to gpu_info everywhere
...
Sometimes we might have other info struct, so renaming to gpu_info
removes the confusion.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500 >
2024-04-01 16:35:09 +00:00
Samuel Pitoiset
ce1c32e358
radv: rename radv_physical_device variables to pdev everywhere
...
Shorter and more consistent.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500 >
2024-04-01 16:35:09 +00:00
Samuel Pitoiset
6440abce3b
radv: add radv_bo_virtual_bind() helper
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28367 >
2024-03-27 08:54:34 +01:00
Samuel Pitoiset
e715cf30dc
radv/rmv: log allocated/destroyed BOs in radv_buffer_{create,destroy}()
...
This will likely log more things because a bunch of them were missing.
This will also allow us to implement
VK_EXT_device_address_binding_report more easily.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28367 >
2024-03-27 08:54:34 +01:00
Samuel Pitoiset
36f6a5b8ff
radv: add radv_bo_{create,destroy}() helpers
...
This will allow us to easily log all BOs both for RMV and
VK_EXT_device_address_binding_report.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28367 >
2024-03-27 08:54:23 +01:00
Samuel Pitoiset
b7d21220e8
radv/rmv: fix logging sparse residency
...
The offset should be the sparse image/buffer offset.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28367 >
2024-03-27 08:52:50 +01:00
Samuel Pitoiset
13ad10bd26
radv/rmv: fix logging of per-queue destroyed BOs
...
They should be logged before actually destroyed.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28367 >
2024-03-27 08:52:50 +01:00
Konstantin Seurer
a6b93c50d0
radv/printf: Use fprintf instead of printf
...
For using other destinations than stdout.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28228 >
2024-03-19 19:05:25 +00:00
Bas Nieuwenhuizen
7e029735e6
radv: Implement reserving the VA range on unmap.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27689 >
2024-03-01 15:07:09 +00:00
Bas Nieuwenhuizen
cccbe1527c
radv/winsys: Use radv_buffer_map wrapper.
...
So we can have 1 function ptr and then have a version with default
args.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27689 >
2024-03-01 15:07:09 +00:00
Bas Nieuwenhuizen
f7e8fdf35d
radv: Add winsys argument to buffer map/unmap.
...
To use later.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27689 >
2024-03-01 15:07:09 +00:00
Samuel Pitoiset
c253a76f5d
radv: handle indirect pipeline binds with scratch and DGC
...
vkCmdUpdatePipelineIndirectBufferNV() can be called on any queue
supporting transfer operations and it's not required to call it on the
same queue as DGC execute. This is very annoying if the compute shader
has scratch because it needs to be configured per queue.
The solution is to gather the maximum possible scratch size used by
indirect compute pipelines and use that to configure scratch.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27495 >
2024-03-01 06:59:59 +00:00
Chia-I Wu
dd84a575c0
radv: hide the sparse queue when radv_legacy_sparse_binding
...
This change is unnecessary but should be harmless. We will have other
reasons to hide the sparse queue so do it here for
radv_legacy_sparse_binding as well.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27838 >
2024-02-29 20:20:37 +00:00
Dave Airlie
47c725b53e
radv: don't submit 0 length on UVD either.
...
The kernel checks for UVD msgs and if there aren't any gets upset,
so don't submit 0 length on UVD rings either to avoid that.
Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27186 >
2024-02-05 08:14:26 +00:00
Samuel Pitoiset
7a20946579
radv: add a helper to know if device fault detection is enabled
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27293 >
2024-01-31 08:41:54 +01:00
Konstantin Seurer
a9c057d5a3
radv: Implement NIR debug printf
...
Adds radv_build_printf which can print nir_defs. The arguments are written
to a buffer and printed after the submit.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25753 >
2024-01-20 16:11:55 +01:00
Joshua Ashton
f62bdde703
radv: Remove check_status
...
Following discussion on kernel mailing list[1], we are not gaining
anything from this right now, and it does not handle soft recovery.
We will hear about the context loss and rationale when we vkQueueSubmit
next.
We can come back to this if there is ever a Vulkan extension for
figuring out innocent vs guilty like GL_EXT_robustness.
This does mean however that we return VK_SUCCESS for cancelled semaphore
and fence waits, but this is legal per the Vulkan spec:
"Commands that wait indefinitely for device execution (namely
vkDeviceWaitIdle, vkQueueWaitIdle, vkWaitForFences with a maximum
timeout, and vkGetQueryPoolResults with the VK_QUERY_RESULT_WAIT_BIT
bit set in flags) must return in finite time even in the case of a lost
device, and return either VK_SUCCESS or VK_ERROR_DEVICE_LOST."
"If device loss occurs (see Lost Device) before the timeout has expired,
vkWaitSemaphores must return in finite time with either VK_SUCCESS or
VK_ERROR_DEVICE_LOST."
[1]: https://lists.freedesktop.org/archives/amd-gfx/2024-January/103337.html
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27091 >
2024-01-19 07:52:01 +00:00
Joshua Ashton
b24a4b8949
radv: Mark device loss if QueueSubmit failed immediately
...
Otherwise we rely on check_status alone, and that's going away.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27091 >
2024-01-19 07:52:01 +00:00
Dave Airlie
f33683e4da
radv: don't submit empty command buffers on encoder ring.
...
the vcn enc/unified rings don't do nop packets, and hang with 0 sized
cmd buffers. This just stops submitting 0 sized cmd buffers to the hw.
Fixes hangs with dEQP-VK.video.decode.h264_i on navi3x
Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25932 >
2024-01-18 13:33:25 +10:00
Samuel Pitoiset
6febec12e4
radv: correctly return VK_ERROR_OUT_OF_DEVICE_MEMORY when mapping a BO fails
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27039 >
2024-01-15 09:41:55 +00:00
Samuel Pitoiset
58d2a78dba
radv: move dri options to radv_instance::drirc
...
To make it clearer that such an option is a per-application option.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26946 >
2024-01-10 10:07:40 +00:00
Samuel Pitoiset
395dee0d89
radv: drop si_ prefix from all functions
...
Most of these functions were copied from RadeonSI but they should be
prefixed with radv_ instead.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26854 >
2024-01-04 08:40:37 +00:00
Tatsuyuki Ishi
b2e8095d6d
radv: Add workaround to allow sparse binding on gfx queues.
...
For working around improper usage of sparse in DOOM Eternal.
When fully explicit sync sparse binding is implemented, this path will
remain implicit sync to also deal with the improper semaphore usage.
radv_queue_submit_bind_sparse_memory will likely get a bool parameter to
control explicit / implicit sync in that case.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26464 >
2023-12-07 11:40:38 +00:00
Bas Nieuwenhuizen
748b7f80ef
radv: Move sparse binding into a dedicated queue.
...
1) This better reflects the reality that we only have one timeline
of sparse binding changes.
2) Allows making it a threaded queue from the start in prep of
explicit sync stuff.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16935 >
2023-11-29 17:37:37 +00:00
Mike Blumenkrantz
c4283e32e3
radv: correctly return oom from the device when failing to create a cs
...
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25927 >
2023-10-27 15:29:32 +00:00