platform/upstream/mesa.git
14 months agonvk: Implement timestamp queries
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Implement timestamp queries

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk: Add a query pool object
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Add a query pool object

Also, while we're here, add a skeliton for vkGetQueryPoolResult().  It
doesn't do anything yet because we haven't implemented any qeury types,
but all the helpers, etc. we need are there.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonouveau/parser: Parse all fields in each method
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nouveau/parser: Parse all fields in each method

When converting to mako, the break got moved to the wrong spot and we
were only parsing the first method.  Now we parse them all.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk/wsi: Use the common present implementation
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk/wsi: Use the common present implementation

This enables WSI for NVK.  Currently, it always gets the blit path and
renders correctly on X11 and corrupts on Wayland.  The problem is that
we don't yet support linear images so wayland gets tiled and is wrong.
The thing that saves us for X11 is the lack of VK_EXT_pci_bus_info.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk/wsi: Style fixes
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk/wsi: Style fixes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk: Reset semaphore syncs on wait
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Reset semaphore syncs on wait

Vulkan semaphores are spec'd to auto-reset on wait but we currently
assert on signal that the state is RESET. Without this, semaphores used
more than once assert which isn't what we want.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk: Style fixes in nvk_physical_device.c
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Style fixes in nvk_physical_device.c

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk: support exporting buffers
Karol Herbst [Fri, 10 Jun 2022 17:37:17 +0000 (19:37 +0200)]
nvk: support exporting buffers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk: Rework whitespace in nvk_device_memory.c
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Rework whitespace in nvk_device_memory.c

Trying to keep things consistent...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk: Allocate shaders from a heap
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Allocate shaders from a heap

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk: Add a shader heap to nvk_device
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Add a shader heap to nvk_device

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk: Return a VkResult from nvk_shader_upload()
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Return a VkResult from nvk_shader_upload()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk: Add a heap data structure
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Add a heap data structure

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk: Rework nvk_queue_submit_simple()
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Rework nvk_queue_submit_simple()

This is a few changes rolled into one:

 1. Add a sync flag to force a stall before returning
 2. Re-order dw and push_dw_count to put the count first
 3. Take an array of extra BOs instead of just one

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agoutil/vma: Allow initializing zero-size heaps
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
util/vma: Allow initializing zero-size heaps

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk: WFI in pipeline barriers
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: WFI in pipeline barriers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk: Use meta for doing blits with the 3D hardware
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Use meta for doing blits with the 3D hardware

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk/meta: Save/restore descriptor set 0
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk/meta: Save/restore descriptor set 0

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonvk: Support load_layer_id
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Support load_layer_id

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agovulkan/meta: Implement vkCmdBlitImage()
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
vulkan/meta: Implement vkCmdBlitImage()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agovulkan/meta: Fixes for clear
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
vulkan/meta: Fixes for clear

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agovulkan/meta: Add a create_sampler helper
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
vulkan/meta: Add a create_sampler helper

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agovulkan/meta: Add a helper for image view types
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
vulkan/meta: Add a helper for image view types

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agovulkan/meta: Add key types
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>

14 months agonvk: Properly implement robustBufferAccess
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>

14 months agonvk: Add lowering for load_global_constant_bounded
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>

14 months agonvk: drop nvk_nir.h
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>

14 months agonvk: use common pipeline layout code
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>

14 months agonvk: use common descriptor set layout code
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>

14 months agonvk: Bring back push sync and dumping
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>

14 months agonvk: Also store the push BO map in nvk_queue_state
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>

14 months agonvk: Add an nvk_queue_submit wrapper
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>

14 months agonvk: Embed a nv_device_info in nvk_physical_device
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>

14 months agonvk: Reference descriptor set layouts in the sets themselves
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>

14 months agonvk: Implement VK_KHR_push_descriptor
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>

14 months agonvk: Fix up whitespace in nvk_descriptor_set.c
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>

14 months agonvk: Use vk_object_zalloc/free for descriptor pools/sets
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>

14 months agonvk: Re-indent vk_instance.c
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>

14 months agonouveau: Drop nouveau_ws_push
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>

14 months agonouveau: Use DRM interfaces directly in MME tests
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>

14 months agonvk: Remove remaining references to nouveau_push.h
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>

14 months agonvk: Implement vkCmdExecuteCommands()
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>

14 months agonvk: Use nvk_cmd_bo for push bufs
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>

14 months agonvk: Allocate upload buffers from the command pool
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>

14 months agonvk: Add an nvk_cmd_buffer_ref_bo helper
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>

14 months agonvk: Add an nvk_cmd_buffer_push helper
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>

14 months agonvk: Rework side-band data upload
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>

14 months agonvk: Constant buffer alignment is actually 64B
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>

14 months agonvk: Fully populate QMDs before uploading
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>

14 months agonvk: memcpy root descriptors for compute instead of doing a DMA
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>

14 months agonvk: Return VkResult from nvk_cmd_buffer_upload_alloc
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>

14 months agonvk: Add BO recycling to the command pool
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>

14 months agonvk: Use cmd instead of cmd_buffer
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>

14 months agonvk: Break nvk_cmd_pool into its own file
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>

14 months agonvk: Use queue_submit_simple for zero_vram
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>

14 months agonvk: Use submit_simple for draw state init
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>

14 months agonvk: Initialize the queue later in device setup
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>

14 months agonvk: Add an nvk_queue_submit_simple helper
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>

14 months agonvk: Use a regular BO for the queue state push
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>

14 months agonvk: Use a regular BO for the empty push
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>

14 months agonvk: Submit pushbufs directly
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>

14 months agonvk: Move queue_sumbit to nvk_queue_drm_nouveau.c
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>

14 months agonvk: Always allocate empty_push
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>

14 months agonvk: Use bo_new_mapped for the zero page
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>

14 months agonouveau: Add a nouveau_ws_bo_new_mapped helper
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>

14 months agonvk: Use nv_push directly for graphics pipelines
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>

14 months agonouveau: Move push dumping to nv_push.c
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>

14 months agonouveau: Move push validate to nv_push.c
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>

14 months agonouveau/parser: Take a FILE* in DUMP_*_MTHD_DATA
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>

14 months agonouveau: Move nv_push and helpers to their own header
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>

14 months agonouveau: Rename the fields of vk_push
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>

14 months agonouveau: Add an nv_push struct
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>

14 months agonvk: Use p for the nouveau_ws_push_buffer in zero_vram
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>

14 months agonvk: Implement vkCmdDraw[Indexed]Indirect()
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>

14 months agonvk: Use MME for vkCmdDraw[Indexed]()
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>

14 months agonouveau/mme: Add helper macros for setting fields
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>

14 months agonvk: Use MME for clears
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>

14 months agonvk: Add MME infrastructure
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>

14 months agonouveau/mme: Add unit tests for the Turing+ MME simulator
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>

14 months agonouveau/mme: Make the winsys headers C++ safe
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>

14 months agonouveau/mme: Add an isaspec-based dumper
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>

14 months agonouveau/mme: Add a tiny simulator for the Turing+ MME
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>

14 months agonouveau/mme: Add a builder for the Turing+ MME
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>

14 months agonouveau/mme: Add an assembler and disassembler for the Turring+ MME
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>

14 months agonouveau/mme: Add isaspec XML for the Turing+ MME
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>

14 months agonouveau/mme: Add basic structures for the Turing+ MME
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>

14 months agonouveau/parser: Add more arrays
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>

14 months agonouveau/push: Fix a void pointer arithmetic bug
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>

14 months agonil: Don't claim texture support for 2-bit SNORM
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>

14 months agonvk: Increase the graphics pipeline push space
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>

14 months agonvk: Use VK_IMAGE_USAGE_*_ATTACHMENT_BIT for image clears
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>

14 months agonvk: Drop a TODO
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>

14 months agonvk: Use f for extension features
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>

14 months agonvk: Fix unused result warnings in pushbuf resets.
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>

14 months agonvk: Fix uninitialized result usage in NVK_DEBUG_ZERO_MEMORY.
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>

14 months agonvk: Avoid strict aliasing warning in the pushbuffer encoding.
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>

14 months agonvk: fix zero page refing
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>

14 months agonouveau/parser: Put the dump helpers in C files
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>

14 months agonouveau/parser: Use more idiomatic python
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>

14 months agonouveau/parser: Convert to mako
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>