Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
vulkan/meta: Add key types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Properly implement robustBufferAccess
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Add lowering for load_global_constant_bounded
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: drop nvk_nir.h
Instead, move the definition of nvk_nir_lower_descriptors to
nvk_shader.h.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Thomas H.P. Andersen [Sat, 17 Sep 2022 09:22:45 +0000 (11:22 +0200)]
nvk: use common pipeline layout code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Thomas H.P. Andersen [Sat, 17 Sep 2022 09:21:20 +0000 (11:21 +0200)]
nvk: use common descriptor set layout code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Bring back push sync and dumping
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Also store the push BO map in nvk_queue_state
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Add an nvk_queue_submit wrapper
Instead of having the common queue code call into drm_nouveau code
directly, add a wrapper layer. This gives us a place to put things like
command buffer dumping. Importantly, we move calling
`vk_queue_set_error()` to this layer because it may abort if the
`VK_ABORT_ON_DEVICE_LOST` is set and we may want to dump before that
happens.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Embed a nv_device_info in nvk_physical_device
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Reference descriptor set layouts in the sets themselves
We need descriptor set layouts for vkUpdateDescriptorSets() but they
have different lifetimes. This is the entire reason for doing reference
counting at all but we haven't actually set up the descriptor set code
to take references yet.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Implement VK_KHR_push_descriptor
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Fix up whitespace in nvk_descriptor_set.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Use vk_object_zalloc/free for descriptor pools/sets
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Re-indent vk_instance.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nouveau: Drop nouveau_ws_push
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nouveau: Use DRM interfaces directly in MME tests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Remove remaining references to nouveau_push.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Implement vkCmdExecuteCommands()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Use nvk_cmd_bo for push bufs
This allows us to recycle them. It also makes implementing secondary
command buffers tractable.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Allocate upload buffers from the command pool
Instead of the growing BO thing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Add an nvk_cmd_buffer_ref_bo helper
We only need this for internal stuff that isn't tracked any other way.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Add an nvk_cmd_buffer_push helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Rework side-band data upload
Instead of doing magic alignments, it now takes an explicit alignment
parameter. Also, we now have a version of the helper which does the
memcpy. This should encourage users to avoid reading reading upload
maps in case they're ever write-combine in the future.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Constant buffer alignment is actually 64B
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Fully populate QMDs before uploading
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: memcpy root descriptors for compute instead of doing a DMA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Return VkResult from nvk_cmd_buffer_upload_alloc
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Add BO recycling to the command pool
Command BOs (nvk_cmd_bo) are automatically mapped recyclable BOs to use
for upload and push buffers.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Use cmd instead of cmd_buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Break nvk_cmd_pool into its own file
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Use queue_submit_simple for zero_vram
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Use submit_simple for draw state init
We also move it to being a queue function. This architecturally makes
more sense even if it seems a bit redundant at first. Worst case, we
initialize multiple times but this guarantees that we're initialized by
the time we try to submit something. It also doesn't matter now because
we only have the one queue.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Initialize the queue later in device setup
We basically want it at the end but before we set up meta.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Add an nvk_queue_submit_simple helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Use a regular BO for the queue state push
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Use a regular BO for the empty push
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Submit pushbufs directly
By getting rid of the winsys stuff we can batch everything into a single
ioctl which should be a bit more efficient. It also simplifies BO
reference handling because we no longer need any of the save/restore
nonsense because we're the ones building the BO list, not the pushbuf
code. This should be a lot more robust.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Move queue_sumbit to nvk_queue_drm_nouveau.c
We're about to start doing nouveau DRM specific stuff in here so let's
move it to a nouveau DRM specific file.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Always allocate empty_push
We always allocate it on queue_submit anyway so we may as well allocate
it up-front.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Use bo_new_mapped for the zero page
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nouveau: Add a nouveau_ws_bo_new_mapped helper
Error handling for allocating a bo and immediately mapping it is a pain.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Use nv_push directly for graphics pipelines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nouveau: Move push dumping to nv_push.c
Because we need access to classes, we also add a basic device info
struct. We'll expand on this a bit later.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nouveau: Move push validate to nv_push.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nouveau/parser: Take a FILE* in DUMP_*_MTHD_DATA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nouveau: Move nv_push and helpers to their own header
We put this in nvidia-headers to separate it from the pushbuf stuff.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nouveau: Rename the fields of vk_push
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nouveau: Add an nv_push struct
This encapsulates the minimum we need for the push macros/functions.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:58 +0000 (20:11 -0600)]
nvk: Use p for the nouveau_ws_push_buffer in zero_vram
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nvk: Implement vkCmdDraw[Indexed]Indirect()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nvk: Use MME for vkCmdDraw[Indexed]()
This lets us move the instance loop to the MME and stop emitting state
per-instance.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nouveau/mme: Add helper macros for setting fields
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nvk: Use MME for clears
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nvk: Add MME infrastructure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nouveau/mme: Add unit tests for the Turing+ MME simulator
These verify that its behavior is the same as the hardware. Very useful
for reverse engineering.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nouveau/mme: Make the winsys headers C++ safe
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nouveau/mme: Add an isaspec-based dumper
This actually dumps everything, unlike the pretty printer which tries to
dump something readable and may ignore bits of instructions if it thinks
they're no-ops. Useful for debugging the pretty printer.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nouveau/mme: Add a tiny simulator for the Turing+ MME
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nouveau/mme: Add a builder for the Turing+ MME
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nouveau/mme: Add an assembler and disassembler for the Turring+ MME
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nouveau/mme: Add isaspec XML for the Turing+ MME
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nouveau/mme: Add basic structures for the Turing+ MME
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nouveau/parser: Add more arrays
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nouveau/push: Fix a void pointer arithmetic bug
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nil: Don't claim texture support for 2-bit SNORM
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nvk: Increase the graphics pipeline push space
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nvk: Use VK_IMAGE_USAGE_*_ATTACHMENT_BIT for image clears
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nvk: Drop a TODO
Dynamic buffer bindings work fine
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nvk: Use f for extension features
It's shorter and more ergonamic and the driver is still small so we can
pick a reasonable convention before things get out-of-hand.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Emma Anholt [Sun, 11 Sep 2022 05:24:18 +0000 (22:24 -0700)]
nvk: Fix unused result warnings in pushbuf resets.
We know we aren't hitting the resize paths here, so errors can't be
thrown.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Emma Anholt [Sun, 11 Sep 2022 05:22:12 +0000 (22:22 -0700)]
nvk: Fix uninitialized result usage in NVK_DEBUG_ZERO_MEMORY.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Emma Anholt [Sun, 11 Sep 2022 05:19:57 +0000 (22:19 -0700)]
nvk: Avoid strict aliasing warning in the pushbuffer encoding.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Karol Herbst [Sat, 10 Sep 2022 20:44:03 +0000 (22:44 +0200)]
nvk: fix zero page refing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nouveau/parser: Put the dump helpers in C files
This should make the build faster since we don't have to compile those
giant functions with giant switch statements constantly.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nouveau/parser: Use more idiomatic python
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nouveau/parser: Convert to mako
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Karol Herbst [Thu, 8 Sep 2022 23:31:42 +0000 (01:31 +0200)]
nvk: alloc a zero page and use it for vertex runouts
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nvk: Initialize fixed draw/default state once
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nvk: Start every command buffer with a nop
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:57 +0000 (20:11 -0600)]
nvk: Split nvk_queue into its own file
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Thomas H.P. Andersen [Wed, 7 Sep 2022 21:05:13 +0000 (23:05 +0200)]
nvk: fix mem leaks
device would leak in various situations.
Separate out lables were needed in the earlier
versions of this function but now we can just
use a single label
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Thomas H.P. Andersen [Wed, 7 Sep 2022 21:01:40 +0000 (23:01 +0200)]
nvk: delete commented code
nvk_CmdClearColorImage first lived in nvk_cmd_copy,
then moved to nvk_cmd_meta, and finally in nvk_cmd_clear
I seems that this was left behind in one of the moves
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Thomas H.P. Andersen [Wed, 7 Sep 2022 20:58:51 +0000 (22:58 +0200)]
nvk: fix implicit-fallthrough warnings with clang
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Thomas H.P. Andersen [Sun, 4 Sep 2022 22:11:20 +0000 (00:11 +0200)]
nvk: use common physical device enumeration
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Karol Herbst [Sun, 4 Sep 2022 18:31:57 +0000 (20:31 +0200)]
nvk: fix OOB read inside nvk_get_va_format
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:56 +0000 (20:11 -0600)]
nvk: Update to the new command buffer infrastructure
We leave nvk_command_pool because we'll want to use it for recycling
individual pushbufs. Drop reset_on_submit becuse there was never really
that much point in that micro-optimization and it isn't thread-safe
anyway if we recycle things in the pool.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Karol Herbst [Sat, 20 Aug 2022 18:28:40 +0000 (20:28 +0200)]
nouveau/ws: push chaining
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Karol Herbst [Sat, 20 Aug 2022 17:49:12 +0000 (19:49 +0200)]
nouveau/ws: rework refing push buffer bos
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Karol Herbst [Sat, 20 Aug 2022 16:54:32 +0000 (18:54 +0200)]
nouveau/ws: bound check nouveau_ws_push_append
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:56 +0000 (20:11 -0600)]
nvk: Add some asserts for nv50 compiler image restrictions
These just ensure that we assert instead of doing something that the
nv50 compiler is likely to screw up.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:56 +0000 (20:11 -0600)]
nvk: Zero unused descriptors
When a descriptor gets freed because a buffer/image veiw or sampler is
deleted, zero out the descriptor memory. This prevents the descriptor
from being used later and faulting on possibly non-existant memory.
While we're here, clean up the function a bit.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:56 +0000 (20:11 -0600)]
nvk: Implement descriptor table growing
Now that command buffers are no longer referencing descriptor table BOs
directly and we're not handing out maps, we can support growing.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:56 +0000 (20:11 -0600)]
nvk: Rework nvk_descriptor_table_add/remove
The new api returns a VkResult for more accurate error checking. More
importantly, it also does copies the descriptor data into the table
instead of returning a map. This means the users of the descriptor
table will never see a map and we can make sure that the copy happens
under the lock in case we have to grow. Since each descriptor is only
32 bytes, this isn't going to be a perf problem.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:56 +0000 (20:11 -0600)]
nvk/sampler: Free descriptor table entries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:56 +0000 (20:11 -0600)]
nvk: Invalidate texture header and sampler caches each submit
It's possible descriptors have been added or removed. We could track
it, but there's really no point. Per-submit shouldn't be terrible.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:56 +0000 (20:11 -0600)]
nvk: Rework TLS/SLM and image/sampler table handling
When Dave originally added SLM, he did so with a preamble pushbuf which
sets up the SLM area prior to executing any actual command buffers.
This has the advantage that the SLM BO is never directly referenced in
any command buffer and we can swap it out even after command buffers
have been built. When I added image/sampler tables, I sort-of went
along with it but then did something different for 3D.
Thanks to buffer reference counting, we can employ a fairly simple
locking scheme. Each of the globals: images, samplers, and TSL has a
lock which gets taken whenever the table is modified. When we go to do
a submit, we take each lock and take a queue-local reference to the BO
and grab a copy of its size parameter under the lock. If anything has
changed, we update the queue-local preamble pushbuf. Because the queue
also holds a reference, we can safely proceed to submit command buffers
which reference those global BOs without the individual global locks
taken. If SLM or one of the descriptor tables resizes while we're
mid-submit, our reference to the BO will remain valid until either the
destruction of the queue or the next submit.
The one small bit of threaded cleverness (one always has to be careful
with that) is that the SLM size can be checked without taking the lock
because the SLM size only ever increases.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:56 +0000 (20:11 -0600)]
nvk: Drop most buffer tracking
If it's backed by an nvk_device_memory, we don't need to track it since
we always add all of those to every submit so that bindless works.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:56 +0000 (20:11 -0600)]
nvk/dispatch: Rename push to p
I took to using this convention in nvk_cmd_draw.c because it's shorter.
Let's use it other places too.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Faith Ekstrand [Tue, 31 Jan 2023 02:11:56 +0000 (20:11 -0600)]
nvk/blit: Rename push to p
I took to using this convention in nvk_cmd_draw.c because it's shorter.
Let's use it other places too.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>