Commit graph

181332 commits

Author SHA1 Message Date
Erico Nunes
898700ca64 v3dv: Rework to remove drm authentication for wsi
For Wayland wsi allocations, v3dv used the wl_drm protocol, which is now
being phased out in favor of dmabuf feedback.
wl_drm is used to figure out the display device (in v3dv assumed to be
vc4) and then to authenticate with the Wayland compositor in order to
allocate scanout-able buffers (in this case, dumb buffers) directly at
the display device.
Recent commit 88c03ddd34 changed the behavior of the wsi code, and
wl_drm is now passing the render device instead, which broke Wayland
wsi.
It turns out that the authentication code is not really needed and since
we would like to remove wl_drm usage and the master device is assumed to
be vc4 anyway, we can just remove some unneeded device-specific wsi code
and get Vulkan Wayland wsi back to work.

Fixes: 88c03ddd34 ("egl/drm: get compatible render-only device fd for kms-only device")

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26200>
2023-11-19 17:00:49 +00:00
Janne Grunau
2091515a70 gallium: Do not create pipe-loader version scripts for disabled drivers
They are not going to be used without shared library to build.

Fixes: 667de678a0 ("gallium: Fix undefined symbols in version scripts")
Signed-off-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26273>
2023-11-19 09:34:59 +01:00
Janne Grunau
b2da38413f gallium: Fix i915 pipe-loader build
'i915' was missing from the list of drivers for the 'driver_descriptor'
descriptor symbol. Rather than maintaining a second list of drivers add
the 'driver_descriptor' symbol for all drivers except swrast.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10171
Fixes: 667de678a0 ("gallium: Fix undefined symbols in version scripts")
Signed-off-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26273>
2023-11-19 09:22:43 +01:00
Matt Turner
f05688aa32 util: Provide DRM_DEVICE_GET_PCI_REVISION definition
This allows src/intel/dev/intel_device_info.c to build with libdrm
stubbed out.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26265>
2023-11-18 17:01:24 +00:00
Matt Turner
5022a26b50 util: Include stdint.h in libdrm.h
drmGetDevices2()'s first parameter is a uint32_t.

Fixes: e05abb1345 ("util: Add a simple no-op libdrm shim")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26265>
2023-11-18 17:01:24 +00:00
Timur Kristóf
d487d9d05b radv: Use SDMA version instead of gfx_level where possible.
The SDMA IP is independent from the GFX IP, so it is technically
wrong to program it based on the GFX level.

This patch changes the RADV SDMA code to use SDMA IP versions
where possible.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26110>
2023-11-18 17:11:18 +01:00
Timur Kristóf
24022d5680 radv: Use GPU info for determining SDMA metadata support.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26110>
2023-11-18 17:11:15 +01:00
Timur Kristóf
fd3cdf28ac ac: Add sdma_version enum and use it for SDMA features.
The SDMA IP is independent from the GFX IP, so it is technically
wrong to program it based on the GFX level.

This patch adds a new enum for SDMA IP version and uses that
to determine functionality such as compression and sparse
support.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26110>
2023-11-18 17:11:11 +01:00
Timur Kristóf
d09ad16fd4 ac: Remove CIK prefix from SDMA opcodes.
The vast majority of AMD GPUs (except the very first GCN) have
the same SDMA packet format, so let's just call it SDMA instead
of CIK_SDMA.

(And leave the oldest GPUs with SI_SDMA as they are now.)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26110>
2023-11-18 17:11:00 +01:00
Timur Kristóf
6413b860c4 ac: Rename SDMA max copy size macros to reflect SDMA version.
This naming is more accurate and closer to the HW.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26110>
2023-11-18 17:10:56 +01:00
Janne Grunau
be9953ac2c gallium: Avoid empty version scripts in pipe-loader
Meson produces version scripts with an empty global node for disabled
drivers. This is reported as syntax error by the linker.
The root cause of the problem is that the version scripts are
accumulated in the out of foreach `pipe_loader_link_args` variable
although they should be only used once for their driver specific loader
library.
Fixes build errors when some of the drivers are disabled like on arm64
which disables i915 due to missing dependencies.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10166
Fixes: 667de678a0 ("gallium: Fix undefined symbols in version scripts")
Signed-off-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26268>
2023-11-18 13:05:48 +00:00
Simon Ser
0f978c3441 egl: ensure a render node is passed to _eglFindDevice()
_eglFindDevice() will fail if it's not provided a render node:
the EGLDevice list only contains one entry per render node, plus
the special software device. Passing a primary node for a
display-only device will not work.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10142
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Tested-by: Iago Toral Quiroga <itoral@igalia.com>
Tested-by: Alejandro Piñeiro <apinheiro@igalia.com>
Fixes: 2be404f557 ("egl: error out if we can't find an EGLDevice in _eglFindDevice()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26205>
2023-11-18 13:19:53 +01:00
Simon Ser
9b70096f5e egl: move dri2_setup_device() after dri2_setup_extensions()
dri2_setup_device() will depend on the extensions being set up in
the next commit.

None of the code in-between depends on disp->Device AFAIU.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Tested-by: Iago Toral Quiroga <itoral@igalia.com>
Tested-by: Alejandro Piñeiro <apinheiro@igalia.com>
Backport-to: 23.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26205>
2023-11-18 13:19:05 +01:00
Simon Ser
b4ec0b51ce egl: extract EGLDevice setup in dedicated function
Extract the logic responsible for populating disp->Device via
_eglFindDevice(). This isn't much for now but will grow in a
following commit.

No functional changes.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Tested-by: Iago Toral Quiroga <itoral@igalia.com>
Tested-by: Alejandro Piñeiro <apinheiro@igalia.com>
Backport-to: 23.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26205>
2023-11-18 13:19:04 +01:00
Shuicheng Lin
dddab9fa77 intel/xe: Correct DRM_XE_EXEC_QUEUE_SET_PROPERTY's ioctl
DRM_XE_EXEC_QUEUE_SET_PROPERTY is the offset,
while DRM_IOCTL_XE_EXEC_QUEUE_SET_PROPERTY is the real number.

Signed-off-by: Shuicheng Lin <shuicheng.lin@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/26253>
2023-11-18 10:17:45 +00:00
Mary Guillemard
275afe73f7 nvk: Implement VK_KHR_fragment_shader_barycentric
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9619

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26224>
2023-11-18 02:46:47 +00:00
Mary Guillemard
7fb91f22d5 nak: Add more bits discovered in SPH
This adds barycentric related bits and various others.

We still need to figure out the bits between 640..672, 800..1024 and checks
some "reserved" bits. (especially around the GS passthrough bit)

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26224>
2023-11-18 02:46:47 +00:00
Mary Guillemard
60544cae07 nir: Add a ldtram_nv intrinsic
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26224>
2023-11-18 02:46:47 +00:00
Faith Ekstrand
62006c2f96 nvk: Advertise the rest of the subgroup ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26264>
2023-11-18 01:09:33 +00:00
Faith Ekstrand
1bc865ca8a nak: Implement quad ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26264>
2023-11-18 01:09:33 +00:00
Faith Ekstrand
cca40086c6 nak: Lower scan/reduce in NIR
We can probably do slightly better than this if we take advantage of the
predicate destination in SHFL but not by much.  All of the insanity is
still required (nvidia basically emits this), we just might be able to
save ourslves a few comparison ops.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26264>
2023-11-18 01:09:33 +00:00
Faith Ekstrand
11bcce9461 nak: Use c == 0x0 for shuffle_up
The bounds check on SHFL.UP is from below, so we actually want
maxLane == 0.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26264>
2023-11-18 01:09:33 +00:00
Faith Ekstrand
8c79d616bd nak: Add builder helpers for a few ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26264>
2023-11-18 01:09:33 +00:00
Faith Ekstrand
c874db9381 nak: Add the predicate destination to OpShfl
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26264>
2023-11-18 01:09:33 +00:00
Faith Ekstrand
3cc389f3da nvk: Set the right API version in the ICD json files
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26264>
2023-11-18 01:09:33 +00:00
Eric Engestrom
f011410c1c egl/dri2: increase NUM_ATTRIBS to fit all the attributes
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26234>
2023-11-17 22:54:28 +00:00
Ganesh Belgur Ramachandra
4dd287308f radeonsi: "get_blitter_vs" shader in nir
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25782>
2023-11-17 22:19:39 +00:00
Ganesh Belgur Ramachandra
4a3cebaffc radeonsi: "create_fmask_expand_cs" shader in nir
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25782>
2023-11-17 22:19:39 +00:00
Ganesh Belgur Ramachandra
6584088cd5 radeonsi: "create_dma_compute" shader in nir
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25782>
2023-11-17 22:19:39 +00:00
Juston Li
d54c140eb6 venus: disable unsupported ExtendedDynamicState3Features
Fixes: 49e5b583 ("venus: enable VK_EXT_extended_dynamic_state3")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26261>
2023-11-17 22:00:27 +00:00
Ian Romanick
52ee4cf229 nir/builder: Teach nir_pack_bits and nir_unpack_bits about 32_4x8
Also teach it how to pack and unpack 32-bits to or from 32-bits.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24741>
2023-11-17 21:00:59 +00:00
Ian Romanick
25743209c4 nir/lower_packing: Add lowering for nir_op_unpack_32_4x8
Nothing should currently hit this path.

The next commit adds code to nir_pack_bits and nir_unpack_bits that can
lead to this path being hit.

v2: Change nir_u2uN(..., 8) to nir_u2u8(...). Suggested by Alyssa.

v3: Don't generate nir_extract_u8 if the driver has set
lower_extract_byte. These instructions were causing some problems for
dozen.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> [v2]
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> [v2]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24741>
2023-11-17 21:00:59 +00:00
Ian Romanick
7a1a9fb287 nir/lower_packing: Don't generate nir_pack_32_4x8_split on drivers that can't handle it
It should not be possible for this to happen now as the nir_pack_32_4x8
instruction that is being lowered shouldn't exist. A later commit will
change this.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24741>
2023-11-17 21:00:59 +00:00
Anthony Roberts
a76cb87602 glsl: Use unsigned instead of enum type in ir_variable_data
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26254>
2023-11-17 20:08:49 +00:00
Jesse Natalie
cb019ff926 d3d12: GL4.6
This enables pipeline stats and SO overflow queries

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26210>
2023-11-17 19:19:11 +00:00
Jesse Natalie
b0ba671446 d3d12: Enable some 4.6 extensions that were already implemented
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26210>
2023-11-17 19:19:11 +00:00
Jesse Natalie
eac2ce6e3b d3d12: Fixes for QBO shaders
Output offset for resolves was wrong, and we can't use a double for the
timestamp multiplier, because doubles might be emulated, and that emulation
is only handled by shaders that go through the GL frontend.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26210>
2023-11-17 19:19:11 +00:00
Jesse Natalie
df4fc66649 nir: Add a flag to opt_if to prevent fighting with splitting 64bit phis
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26210>
2023-11-17 19:19:11 +00:00
Andrew Gazizov
bafc27583c venus: Make sure that guest allocated blobs from hostmem are mappable
For guest-based blob allocations from hostmem (Host visible memory),
to make sure that virtio-gpu driver will send to the host the address
(offset in the region) of the allocated blob using RESOURCE_MAP_BLOB
command a flag VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT must be set.

Otherwise, if the upper layers didn't set it, host can't import memory
and guest allocation from Host visible memory region makes no sense.

Signed-off-by: Andrew D. Gazizov <andrew.gazizov@opensynergy.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26130>
2023-11-17 18:24:20 +00:00
Andrew Gazizov
8929889563 venus: Tighten the conditions for guest_vram device memory alloc
In addition to the platform requirement (use_guest_vram), device memory
allocations from dedicated heap (guest_vram) are necessary only when:

1. VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT is set and it indicates that
memory is host visible and assumed to be accessed by CPU (vkMapMemory).
2. One of external memory handle types is set, that indicates memory
can be exported with external handle.

In other cases it's not necessary to create virtgpu_bo object in the
guest and enough just perform vkAllocateMemory on host side without
memory import from dedicated heap.

Reported-by: Yiwei Zhang <zzyiwei@chromium.org>
Signed-off-by: Andrew D. Gazizov <andrew.gazizov@opensynergy.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26130>
2023-11-17 18:24:20 +00:00
Andrew Gazizov
816f66cdfd venus: Use vk_object_id as blob_id for guest_vram device memory alloc
blob_id == 0 does not refer to an existing VkDeviceMemory and implies
a shmem allocation. So for guest_vram device memory allocations, 0 is
not a valid blob id and must be greater than 0.

Therefore, set vk_object_id as blob_id for guest_vram device memory
allocations. Considering that vk_object_id made from valid pointer, it
will be always greater than 0.

Signed-off-by: Andrew D. Gazizov <andrew.gazizov@opensynergy.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26130>
2023-11-17 18:24:20 +00:00
Paulo Zanoni
c853e259ab anv+zink/ci: document new sparse failures
Now that we have sparse resources on Anv these tests are finally
running, but they're failing. We'll eventually fix them, but let's not
make Zink gatekeep the entirety of sparse resource on Anv.

v2: KHR-GL46.sparse_buffer_tests.BufferStorageTest was initially
reported as Crash by Mesa CI. On my second run in Mesa CI it gave me a
Timeout. On my machine it passes but takes about 4 minutes to finish,
so skip it entirely.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:29 +00:00
Paulo Zanoni
563678f310 anv/sparse: don't support YCBCR 2x1 compressed formats
Regarding supporting these formats, the spec says:

  "A sparse image created using VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
   supports all non-compressed color formats with power-of-two element
   size that non-sparse usage supports. Additional formats may also be
   supported and can be queried via
   vkGetPhysicalDeviceSparseImageFormatProperties.
   VK_IMAGE_TILING_LINEAR tiling is not supported."

Regarding the formats themselves, the spec says:
  "VK_FORMAT_B8G8R8G8_422_UNORM specifies a four-component, 32-bit
   format containing a pair of G components, an R component, and a B
   component, collectively encoding a 2×1 rectangle of unsigned
   normalized RGB texel data. One G value is present at each i
   coordinate, with the B and R values shared across both G values and
   thus recorded at half the horizontal resolution of the image. This
   format has an 8-bit B component in byte 0, an 8-bit G component for
   the even i coordinate in byte 1, an 8-bit R component in byte 2,
   and an 8-bit G component for the odd i coordinate in byte 3. This
   format only supports images with a width that is a multiple of two.
   For the purposes of the constraints on copy extents, this format is
   treated as a compressed format with a 2×1 compressed texel block."

Since these formats are to be considered compressed 2x1 blocks and we
don't necessarily have to support non-compressed formats that
non-sparse support, we can claim them as not supported with sparse.

In addition to all of that, if you look at isl_gfx125_filter_tiling()
you'll see that we don't even support Tile64 for these formats, so
sparse residency (i.e., non-opaque image binds) doesn't really make
sense for them yet.

The Vulkan spec defines 4 other YCBCR "2x1 compressed" formats like
the ones we have in this commit, but we don't support them even
without sparse, so there's no reason to check them here.

A recent change in VK-GL-CTS made tests that use these formats go from
unsupported to failures:
  7ecc7716a983 ("Do not use and check for STORAGE image support, when
  it is not used in the test")

This commit "fixes" the following VK-GL-CTS failures (by making them
return NotSupported):
  dEQP-VK.sparse_resources.image_block_shapes.2d.b8g8r8g8_422_unorm.samples_1
  dEQP-VK.sparse_resources.image_block_shapes.2d.g8b8g8r8_422_unorm.samples_1
  dEQP-VK.sparse_resources.image_block_shapes.2d_array.b8g8r8g8_422_unorm.samples_1
  dEQP-VK.sparse_resources.image_block_shapes.2d_array.g8b8g8r8_422_unorm.samples_1

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:29 +00:00
Paulo Zanoni
a0559768db anv: enable sparse by default on i915.ko
On i915.ko we don't have the vm_bind ioctl, so sparse requires TR-TT.
Unfortunately, on gfx < 20 TR-TT is not compatible with non-render
queues, so we have to disable those when sparse is enabled. Notice
that although we don't have TR-TT for non-render queues on gfx >= 20,
vm_bind is the default, and it doesn't have this restriction.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:29 +00:00
Paulo Zanoni
fda5163f34 anv/trtt: properly handle the lifetime of TR-TT batch BOs
We need to wait for the batches to complete before we return the BOs
to the pool. We were previously doing this completely synchronously,
which made the code unnecessarily wait. Now we have a timeline syncobj
that signals completion of the previous BOs, so sometimes we check
where we are in the timeline and then return the BOs that we know are
unused.

This, in addition to the previous patch that made us wait for the
other syncobjs through the execbuf ioctl instead of through the CPU,
makes TR-TT batches at least an order of magnitude faster. Still, I
don't think we'll notice any changes in games's FPS as they don't bind
sparse resources that often.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:29 +00:00
Paulo Zanoni
0f21836272 anv/trtt: add support for queue->sync to the TR-TT batches
At this moment this patch won't buy us anything since we're already
being completely synchronous, but the next patch is going to change
this and so queue->sync will start making sense.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:29 +00:00
Paulo Zanoni
1534ee46b8 anv/trtt: add struct anv_trtt_batch_bo and pass it around
For now it just wraps the bo and size, so there's really no value to
having it. In the next commit we'll add more elements to the struct.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:29 +00:00
Paulo Zanoni
18bd00c024 anv/trtt: don't wait/signal syncobjs using the CPU anymore
Pass them as part of the TR-TT batch. This is what a lot of the
previous commits were building up to.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
f2206a0eb1 anv/xe: allow passing extra syncs to xe_exec_process_syncs()
We're going to use this in two different patches.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
4b435d6983 anv/i915: extract setup_execbuf_fence_params()
I'm about to add a 3rd caller for it.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00