Commit Graph

188335 Commits

Author SHA1 Message Date
Lucas Fryzek
0507988f41 lavapipe: EXT_image_drm_format_modifier
Co-authored-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:21 +00:00
Mike Blumenkrantz
d6cb3c5793 lavapipe: handle drm image imports
this creates the unbacked image with the metadata expected for use
with imports, then applies the import offset when binding memory

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:21 +00:00
Lucas Fryzek
bd4f69a0fe lavapipe: check drm modifier info during image create
not doing anything except validation

Co-authored-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:21 +00:00
Mike Blumenkrantz
97331d1ed4 lavapipe: handle drm image format queries
only LINEAR is supported, so this is easy

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:21 +00:00
Lucas Fryzek
a4290558df lavapipe: include drm_fourcc.h
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:21 +00:00
Mike Blumenkrantz
18c345d840 lavapipe: rework mem handle type assert to handle dmabuf
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:21 +00:00
Mike Blumenkrantz
6df7cf4cfc lavapipe: EXT_queue_family_foreign
no-op for us

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:21 +00:00
Lucas Fryzek
b3d3239fc1 llvmpipe: make it possible to import and bind unbacked resources
this reworks the existing import to just set some metadata and then
apply the memory region during bind with the assumption that something
else is doing the import

Also adjust ci failures for llvmpipe to represent multiplanar surfaces as
not supported

Co-authored-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:21 +00:00
Mike Blumenkrantz
bfd8c12406 winsys: add more stride members to winsys_handle
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:21 +00:00
Mike Blumenkrantz
3727457884 winsys: add WINSYS_HANDLE_TYPE_UNBACKED
for use with lavapipe imports

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:21 +00:00
Lucas Fryzek
07f25aa785 lavapipe: EXT_external_memory_dma_buf
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:21 +00:00
Lucas Fryzek
c1657de63c lavapipe: support VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT
Co-authored-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:20 +00:00
Mike Blumenkrantz
eb64f56b59 lavapipe: add a function for asserting external memory handle types
easier to expand upon

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:20 +00:00
Lucas Fryzek
ce3851d469 llvmpipe: conditionally export PIPE_CAP_DMABUF
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:20 +00:00
Lucas Fryzek
715b29d032 drisw: reuse kopper image extension vtable if modifiers/dmabuf is supported
this is handier than copying the same vtable again

Co-authored-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:20 +00:00
Lucas Fryzek
d74ea2c117 llvmpipe: Implement dmabuf handling
For export this is handled through the use of the udmabuf driver to
allocate a dmabuf we can control from userspace. For import this is
handled through mmap-ing a dmabuf handle. Please note that you can
only mmap a dmabuf handle if its linear and the dmabuf handle was
created with matching read and write permissions.

Co-authored-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:20 +00:00
Lucas Fryzek
7e5c5d313b gallium: Add dmabuf arg to memory fd allocation API
Modify the memory fd allocation API to provide an argument to specify
if the allocating fd should be a dmabuf.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:20 +00:00
Mike Blumenkrantz
e4ae665f93 winsys/drisw: implement dmabuf handling
this comes in two variants:
* util/memfd stuff with a header for metadata
* raw fd passing

for imports, both have to be tried since the import might be from a hw
device, but only the latter needs to be handled in winsys here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:20 +00:00
Mike Blumenkrantz
17abe3ecbd winsys/drisw: implement displaytarget_create_mapped
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:20 +00:00
Mike Blumenkrantz
73d75971ab winsys/null: implement displaytarget_create_mapped
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:20 +00:00
Mike Blumenkrantz
23206844eb sw_winsys: add displaytarget_create_mapped
this is for creating displaytargets from already-imported fds

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:20 +00:00
Mike Blumenkrantz
6e43fbdb11 drisw: reorder image extensions
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:20 +00:00
Lucas Fryzek
2b4e56ca27 llvmpipe: explicitly reject (most) yuv formats
use gallium fallbacks here

Co-authored-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-05 16:05:20 +00:00
Gert Wollny
0f97c2ec51 ntv: simplify increasing the number of dest componnets for sparse tex
store_def doesn't use the number of components, so we can drop the
checks for is_shador and simpliy increment the number of components.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28502>
2024-04-05 15:28:12 +00:00
Gert Wollny
0aa6c4437c ntv: pass def->index to store_def
The full definition is not needed, only the index.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28502>
2024-04-05 15:28:12 +00:00
Gert Wollny
f73dc77cc7 ntv: remove store_ssa_def
move the code to store_def and drop store_ssa_def.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28502>
2024-04-05 15:28:12 +00:00
Gert Wollny
5415abe396 ntv: remove store_def_raw
it was only forwarding to store_ssa_def

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28502>
2024-04-05 15:28:12 +00:00
José Roberto de Souza
77c004f7ca anv: Create protected engine context when i915 supports vm control
When has_vm_control is supported it takes a different code path and
creates one context per engine and in this code path we were not
setting the protected context flag.

The lack of this is not causing any test to fail in our CI but it is
better do what we are supposed to do.

Fixes: fd40134487 ("anv: allow protected GEM context creation")
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28299>
2024-04-05 15:00:24 +00:00
Timur Kristóf
f0a354a7a5 radv: Don't set driver locations for last pre-rasterization stage.
They were already unused, just don't set them.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28553>
2024-04-05 15:25:32 +02:00
Timur Kristóf
0dbf6e7582 radv: Don't set driver locations for FS outputs.
They were already unused, just don't set them.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28553>
2024-04-05 15:25:24 +02:00
Timur Kristóf
450c8f159b radv: Don't set driver locations for mesh shaders.
They were already unused, just don't set them.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28553>
2024-04-05 15:25:15 +02:00
Timur Kristóf
a554e44eae radv: Use NIR IO semantics for VS input location mapping.
The IO semantics already contain all the information needed
for VS inputs, so there is no need use driver locations.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28553>
2024-04-05 15:24:43 +02:00
Timur Kristóf
124202469f ac/nir/ngg: Rename confusing driver_location variable in mesh shader lowering.
Mesh shader lowering never used the actual driver location
because it uses custom mapping for the I/O variables, but
it had some variables with this name, which is confusing.
Rename them to mapped_location.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28553>
2024-04-05 15:24:37 +02:00
Timur Kristóf
580baaf1e1 ac/nir/ngg: Use IO semantics for determining instance rate inputs.
This used the driver location by accident, which is wrong.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28553>
2024-04-05 15:24:14 +02:00
Timur Kristóf
11ced35e0a ac/nir/ngg: Don't create dummy output variable for primitive ID.
This was needed by RADV in the past, but not anymore.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28553>
2024-04-05 15:23:28 +02:00
Samuel Pitoiset
14ba56718f radv: make sure the heap budget is less than or equal to the heap size
Reported by Hans-Kristian.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28575>
2024-04-05 12:43:09 +00:00
Samuel Pitoiset
a29fda1ba0 radv: move radv_printf_data to radv_printf.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28592>
2024-04-05 12:18:38 +00:00
Samuel Pitoiset
9223b80086 radv: remove old comment in radv_cs.c
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28592>
2024-04-05 12:18:38 +00:00
Samuel Pitoiset
6428270408 radv: move radv_queue_family_to_ring() to radv_queue.c
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28592>
2024-04-05 12:18:38 +00:00
Samuel Pitoiset
6e4f26827c radv: move radv_get_user_sgpr() to radv_shader.c
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28592>
2024-04-05 12:18:38 +00:00
Samuel Pitoiset
80683c220b radv: make radv_get_vgt_index_size() static
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28592>
2024-04-05 12:18:38 +00:00
Rhys Perry
be8b8722f9 radv: memset radv_pipeline_cache_object data
This silences Valgrind warnings.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28549>
2024-04-05 11:56:25 +00:00
Rhys Perry
c3c138b10f radv: optimize msad_4x8 to mqsad_4x8
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26251>
2024-04-05 11:01:39 +00:00
Rhys Perry
e5976bebed amd: set has_shfr32=true
This appears in some FSR3 shaders and will be used for the MQSAD
optimization.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26251>
2024-04-05 11:01:39 +00:00
Rhys Perry
35f9318cee ac/llvm: implement mqsad_4x8 and shfr
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26251>
2024-04-05 11:01:39 +00:00
Rhys Perry
6b301eae36 aco: implement mqsad_4x8 and shfr
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26251>
2024-04-05 11:01:39 +00:00
Rhys Perry
08903bbe89 nir: add mqsad_4x8, shfr and nir_opt_mqsad
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26251>
2024-04-05 11:01:39 +00:00
Georg Lehmann
be93e38152 aco/vn: remove instruction hash templates
This reuses the instruction data size helper used for creating instruction.
It also removes the hashing of the aco::spans used for operands and definitions,
which was redundant with hash finalization.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28527>
2024-04-05 10:23:16 +00:00
Lionel Landwerlin
ea84b36592 anv: fix incorrect blorp dynamic state heap usage
Found with valgrind :

==253563== Invalid free() / delete / delete[] / realloc()
==253563==    at 0x6EEBB88: anv_state_pool_free (anv_allocator.c:962)
==253563==    by 0x6EFB563: anv_device_finish_blorp (anv_blorp.c:143)
==253563==    by 0x6F204F8: anv_DestroyDevice (anv_device.c:4063)
==253563==    by 0x6DE1CD7: loader_layer_destroy_device (loader.c:4387)
==253563==    by 0x6DF1D5E: vkDestroyDevice (trampoline.c:1025)
==253563==    by 0x407C54: vk::refdetails::Deleter<vk::VkDevice_s*>::operator()(vk::VkDevice_s*) const (vkRef.hpp:131)
==253563==    by 0x42C016: vk::refdetails::RefBase<vk::VkDevice_s*>::reset() (vkRef.hpp:303)
==253563==    by 0x40B385: vk::refdetails::RefBase<vk::VkDevice_s*>::~RefBase() (vkRef.hpp:296)
==253563==    by 0x40A95D: vk::refdetails::Unique<vk::VkDevice_s*>::~Unique() (vkRef.hpp:376)
==253563==    by 0x402501: vkt::DefaultDevice::~DefaultDevice() (vktTestCase.cpp:658)
==253563==    by 0x444807: de::DefaultDeleter<vkt::DefaultDevice>::operator()(vkt::DefaultDevice*) const (deDefs.hpp:112)
==253563==    by 0x43922D: de::details::UniqueBase<vkt::DefaultDevice, de::DefaultDeleter<vkt::DefaultDevice> >::reset() (deUniquePtr.hpp:90)
==253563==  Address 0xd3df000 is 0 bytes inside a block of size 272 client-defined
==253563==    at 0x6EEBA0B: anv_state_pool_alloc (anv_allocator.c:940)
==253563==    by 0x6EFA610: anv_state_pool_emit_data (anv_private.h:852)
==253563==    by 0x6EFB206: upload_dynamic_state (anv_blorp.c:106)
==253563==    by 0x6FC8C31: blorp_init_dynamic_states (blorp_genX_exec_brw.h:2211)
==253563==    by 0x6FCD02D: gfx9_blorp_init_dynamic_states (genX_blorp_exec.c:507)
==253563==    by 0x6EFB47E: anv_device_init_blorp (anv_blorp.c:129)
==253563==    by 0x6F1FBBA: anv_CreateDevice (anv_device.c:3908)
==253563==    by 0x840B669: vk_tramp_CreateDevice (vk_dispatch_trampolines.c:78)
==253563==    by 0x6DE663A: terminator_CreateDevice (loader.c:5836)
==253563==    by 0x6DE3E39: loader_create_device_chain (loader.c:4940)
==253563==    by 0x6DE1AC5: loader_layer_create_device (loader.c:4320)
==253563==    by 0x6DF1CBF: vkCreateDevice (trampoline.c:1005)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: fe1baa6481 ("anv: reduce blorp dynamic state emissions")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28578>
2024-04-05 09:50:41 +00:00
Corentin Noël
0624130933 zink: Remove ctx from zink_gfx_program
It is already available in the base structure.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28567>
2024-04-05 08:01:01 +00:00