Commit Graph

179917 Commits

Author SHA1 Message Date
Eric Engestrom
be18be9deb Revert "ci: backport two mesh/task query fixes for VKCTS"
This reverts commit dcc4e1b4d7.

The hashes added there are incorrect, and fixing them regresses a bunch
of drivers, so let's just revert for now, and the next commit fixes the
bug that allowed incorrect backports to go in undetected.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26013>
2023-11-04 12:44:36 +00:00
Karol Herbst
655cbf203d docs/features: mark rusticl gl_sharing as done
It seems at the moment only iris and radeonsi expose other drivers aren't
fulfilling all prerequisites.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26044>
2023-11-04 10:30:56 +01:00
Rob Clark
d67d501af4 tu/drm/virtio: Switch to vdrm helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24733>
2023-11-04 03:00:04 +00:00
Rob Clark
0e3584df44 freedreno/drm/virtio: Switch to vdrm helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24733>
2023-11-04 03:00:04 +00:00
Rob Clark
06e57e3231 virtio: Add vdrm native-context helper
Add a helper to de-duplicate some of the virtgpu native-context support
between turnip and freedreno.  This should make things easier for other
drivers adding virtgpu support.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> # virtio-intel
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24733>
2023-11-04 03:00:04 +00:00
Rob Clark
53ccb421a2 freedreno/drm: Simplify backend mmap impl
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24733>
2023-11-04 03:00:04 +00:00
Lucas Fryzek
6f467fc6a3 freedreno/drm: Add more APIs to per backend API
Add bo_map, bo_from_dmabuf, and bo_close_handle to the per backend
APIs for freedreno/drm. These changes are required to implement
a KGSL backend as part of freedreno/drm.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24733>
2023-11-04 03:00:04 +00:00
Rob Clark
b90244776a virtio/drm: Split out common virtgpu drm structs
Since these all ended up the same with (not yet merged) intel and amd
implementation of drm native context, split these out so they can be
shared.  This will also make it easier to extract out a shared helper
that can be re-used across native-context drivers.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> # virtio-intel
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24733>
2023-11-04 03:00:04 +00:00
Juan A. Suarez Romero
9bdee8cd39 vc4/ci: comment why piglit is disabled
We disabled piglit testsuite some time ago because it is causing GPU
hangs from time to time, and we didn't find out yet what are the tests
causing such issue.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26021>
2023-11-04 02:41:21 +00:00
Paulo Zanoni
c2db19f496 anv: setup the TR-TT vma heap
"16TB ought to be enough for anybody."
      - Probably some Intel graphics hardware engineer

TR-TT addresses are fixed regardless of the platform's gtt_size.
Unconditionally reserve this space for it: our total 48bit address
space is 256tb and TR-TT takes 16tb out of it (1/16th).

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/26036>
2023-11-04 02:06:53 +00:00
Paulo Zanoni
0a120edfb8 anv/sparse: extract anv_sparse_bind()
This function will be able to transparently handle sparse binding
regardless of the backend: vm_bind ioctls or TR-TT. For now we only
support the vm_bind ioctls, but soon we'll have anv_sparse_bind_trtt()
as an option.

It is important to notice that even backends that support the vm_bind
ioctl may choose to do Sparse binding via TR-TT, that's why we're
adding the indirection at this specific point.

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/26036>
2023-11-04 02:06:53 +00:00
Paulo Zanoni
544c5c006c intel/genxml: add the Gen12+ TR-TT registers
These are the registers we're going to use for now.

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/26036>
2023-11-04 02:06:52 +00:00
Paulo Zanoni
1af1426542 anv/sparse: also print bind->address at dump_anv_vm_bind
This helped tracking down xe.ko bug #746.

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/26036>
2023-11-04 02:06:52 +00:00
Paulo Zanoni
b94d7dbe66 anv/sparse: join multiple NULL binds when possible
When it's a NULL bind we always set the bo_offset (aka memory offset)
to zero, so we have to avoid the "bind.offset == prev.offset + size"
check.

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/26036>
2023-11-04 02:06:52 +00:00
Paulo Zanoni
2fc0bbe814 anv/sparse: join multiple bind operations when possible
If the next bind is just an extension of the previous one, join both
in the same bind operation. Due to how mip levels are laid in memory,
this can only happen for mip level 0.

As of today xe.ko doesn't try to join contiguous operations for us.
Due to how rebinds happen each additional rebind operation may end up
resulting in many extra things done, so these simple checks end up
saving us a lot of cycles the Kernel would otherwise waste. This will
be true even after we issue all binds in a single ioctl.

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/26036>
2023-11-04 02:06:52 +00:00
Paulo Zanoni
2883c6ddaa anv: alloc client visible addresses at the bottom of vma_hi
Kill vma_cva and just toggle heap->alloc_high instead. This way,
client visible addresses will remain isolated in their own little
corner, except we have one less vma to deal with.

For TR-TT we'll need a special vma, and if we don't use the trick
above we'll need yet another trtt_cva_vma, increasing complexity even
more.

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/26036>
2023-11-04 02:06:52 +00:00
Paulo Zanoni
e1b50074fe anv: don't forget to destroy device->vma_mutex
This actually doesn't fix any bugs or leaks, because according to the
man page:

  "In the LinuxThreads implementation, no resources are associated
   with mutex objects, thus pthread_mutex_destroy actually does
   nothing except checking that the mutex is unlocked.

still, it's better to have it than not to have it, especially since
other implementations may do something.

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/26036>
2023-11-04 02:06:52 +00:00
Karol Herbst
0a072bb31c rusticl/context: fix importing gl cube maps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:43 +00:00
Karol Herbst
06a2258b4b radeonsi: hack for importing 3D textures
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:43 +00:00
Karol Herbst
56f934103d radeonsi: support importing arbitrary resources
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:43 +00:00
Antonio Gomes
7e031078dd rusticl: Advertise cl_khr_gl_sharing extension
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
59287a1223 rusticl: Flush objects just before importing them
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
1c3dde7ba6 rusticl: Add support for cube maps
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
2645003bdc rusticl: Create CL mem objects from GL
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
0bafe8be2c rusticl/format: Add conversion table for GL->CL
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
57dfc013a6 rusticl: Add functions to create CL ctxs from GL, and also to query them
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
425d7acd4a rusticl/device: Enable gl_sharing only if create_fence_fd is implemented
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
7bb131964b rusticl/device: Function to check for gl interop support
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
c4c58aa26f rusticl: Add xplat helpers to dynamic link interop functions
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
1396dc1c38 mesa/st, dri2, wgl, glx: Modify flush_objects interop func to export a fence_fd
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
663cef26d0 mesa/st: Add new data to mesa_glinterop
* Version 3 of mesa_glinterop_device_info
* Export device uuid
* Version 2 of mesa_glinterop_export_out
* Export texture sizes
* Export whandle.modifier
* Export whandle.stride
* Add PIPE_HANDLE_USAGE_EXPLICIT_FLUSH in interop_export_objects

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
d52f35fa1a iris: Fixups in resource_get_handle and resource_from_handle
* Add support for PIPE_BUFFER in resource_from_handle.
* Flush batches after reallocate_resource_inplace:
  If we're dealing with a PIPE_BUFFER, iris_flush_resource doesn't
  flush the batch and we export the resource with pending commands.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
df0623e51a rusticl, meson: Add gl/egl/glx bindings
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
bcd7538d03 rusticl, meson: Move libc functions to their own crate
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Yonggang Luo
84db4d5698 micosoft: decouple microsoft vulkan driver and compiler from gallium
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24440>
2023-11-04 00:02:59 +00:00
Yonggang Luo
8bcb996a88 micosoft: define enum dxil_tex_wrap to avoid the usage of enum pipe_tex_wrap
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24440>
2023-11-04 00:02:59 +00:00
Yonggang Luo
a36ad49e0e microsoft/clc: Use 128 instead of PIPE_MAX_SHADER_SAMPLER_VIEWS
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24440>
2023-11-04 00:02:59 +00:00
Yonggang Luo
1181c2509d microsoft/clc: Using sampler_id instead PIPE_MAX_SHADER_SAMPLER_VIEWS for dxil_lower_sample_to_txf_for_integer_tex
Because sampler_id is the real number of samples.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24440>
2023-11-04 00:02:59 +00:00
Jesse Natalie
e51acb65ac dzn: Fix memory type sorting
For a dGPU, we should have:
1. RAM
2. RAM + write-combined CPU access
3. RAM + cached CPU access
4. VRAM

Eventually there'll be VRAM + write-combined CPU access after 4, using "GPU upload heaps"

For an iGPU, we should have:
1. RAM (declared as device-local)
2. RAM + write-combined CPU access (declared as device-local)
3. RAM + cached CPU access (declared as device-local)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26037>
2023-11-03 23:33:02 +00:00
Dave Airlie
c8e39683da vulkan/video: add h265 header encoders.
Vulkan video has parameter overrides, where the	driver can override the
driver provided	parameters with	an encoded bitstream where it has made
changes.

This is	the support code to encode the bitstream headers for h265
from parameters	(vps/sps/pps).

Acked-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:37 +00:00
Dave Airlie
d46162981a vulkan/video: add h264 headers encode
Vulkan video has parameter overrides, where the driver can override the
driver provided parameters with an encoded bitstream where it has made
changes.

This is the support code to encode the bitstream headers for h264
from parameters (sps/pps).

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:37 +00:00
Dave Airlie
8243145f02 vulkan/video: add a h265 level translator.
This just converts the protocol level to the spec level encoding.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:37 +00:00
Dave Airlie
5542b51aff vulkan/video: add h264 level idc convertor utility
This converts vulkan level to the bitstream encoding.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:37 +00:00
Dave Airlie
1782ab4d8b util: add a bitstream encoder for video stream headers.
This is based on the d3d12 code, and is mostly a rewrite in C,
these are just some helpers to use for writing h264 and h265
headers for vulkan encode.

Acked-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
72f52329cd vulkan/video: add a nal_unit lookup for hevc
This is needed to by drivers to get a nal unit type
for the picture type.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
fee258de27 vulkan/video: add h264 nal enum
This will be used later for header encoding.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
8dd97080d8 vulkan/video: add h265 encode support
This just adds the session and parameter handling for h265 encode.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
5cb46f1ce7 vulkan/video: add support for h264 encode to common code
This adds support for the h264 encode session and parameter storage.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
b84c58d727 vulkan: update video headers
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
José Expósito
8a635e516e zink: Fix crash on zink_create_screen error path
The `zink_internal_create_screen()` function can fail before
`screen->loader_lib` and/or `screen->instance` are initialized.
The `zink_destroy_screen()` doesn't check those cases and crashes.

The error was found by Fedora's CI. The back trace is available at [1].

[1] https://bodhi.fedoraproject.org/updates/FEDORA-2023-c39f82c465

Fixes: 0c2045553f ("zink: use screen destructor for creation fails")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26029>
2023-11-03 22:37:43 +00:00