Commit graph

172603 commits

Author SHA1 Message Date
duncan.hopkins
5fabb66f59 dri: guarded DRI code.
Added code guards that isolate DRM code paths so platformss that do not have DRM libraries can compile.
MacOS does not have vf86drm library and headers.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130>
2024-03-15 10:50:12 +00:00
duncan.hopkins
fcd0b4c94a util: Updated util/libdrm.h stubs with drmGetMagic()
Update adds in missing items that MacOS code needs to compile and run the DRI2 code.

New code is copied from the public repository: https://gitlab.freedesktop.org/mesa/drm/-/blob/main/xf86drm.h

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130>
2024-03-15 10:50:12 +00:00
duncan.hopkins
8ad4862126 gallium/dri: Added XCB dependency to frontends/dri/libdrm build. Fix header issues with xcb.h being used.
On systems where the xcb.h is not in the standard prefixed location,
meson needs to be told where to find it.
Adding the `dep_xcb` to the `libdri`build fixes this.

This issue happened on macOS when the brew package manager was not in the default location.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130>
2024-03-15 10:50:12 +00:00
duncan.hopkins
00e1562f5b gallium/dri: Switch xf86drm.h for util/libdrm.h to allow for the no-op shim to be used.
This patch allows MacOS to compile the dri[2] systems by switching from direct xf86drm.h to
the pre-existing util/libdrm.h.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130>
2024-03-15 10:50:12 +00:00
duncan.hopkins
1d9215f904 egl: Changed EGLNativeDisplayType size check to make sure it is big enough instead of exactly the same size.
MacOS uses a smaller EGLNativeDisplayType than 'void*', which is big enough for the storage.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130>
2024-03-15 10:50:12 +00:00
duncan.hopkins
4477139ec2 egl: Added DRI3 code guards.
MacOS does not have any DRI3 libraries, these code guards hide the code paths
the fail to compile without DRI3.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130>
2024-03-15 10:50:11 +00:00
duncan.hopkins
275fdf709d egl: MacOS platform guard around pthread_condattr_setclock()
This patch disabled the call to pthread_condattr_setclock on MacOS/Apple platforms.
This funciton is missing from the the Xcode pthread implemetation.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130>
2024-03-15 10:50:11 +00:00
duncan.hopkins
8387deff87 compiler/clc: fix compiler issue on MacOS with st_mtim[e] in stat.
MacOSs 'sys/stat.h' version of 'stat' doe snot have the 'st_mtim' that is used on other systems.
The change allows MacOS to use 'st_mtime' without affecting the behaviour on any other platform.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130>
2024-03-15 10:50:11 +00:00
Samuel Pitoiset
6146a1651a radv: emit VGT_GS_OUT_PRIM_TYPE as part of the dynamic primitive topology
With pipelines, the topology class is known at creation time but with
ESO this needs to be re-emitted when the topology change and not only
when graphics shaders are emitted.

This fixes spec@nv_primitive_restart@primitive-restart-* with Zink
when shader object is enabled.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28179>
2024-03-15 09:26:33 +00:00
Samuel Pitoiset
ccf894f29c radv: fix RADV_PERFTEST=dmashaders with ESO
Update the shader upload sequence when individual shaders are bound
to fix that.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28154>
2024-03-15 08:10:59 +00:00
Samuel Pitoiset
dd0b4f05ad radv: add helpers to bind the GS copy shader and the RT prolog
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28154>
2024-03-15 08:10:59 +00:00
Friedrich Vock
cc61409ea6 radv: Only enable SEs that the device reports
Matches PAL behavior.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28195>
2024-03-15 07:31:34 +00:00
Caio Oliveira
bfdcddfda9 intel/tools: Make intel_stub_gpu work when using meson devenv
When `meson devenv` is used, the shim library that is meant to be
preloaded is not necessarily available at the installation dir.  So
when running in that mode both the script and the shim library will
be in the same (build) directory, so adjust the ld_preload to pick
that.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10798
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28134>
2024-03-15 03:25:46 +00:00
Jordan Justen
6922f421f4 intel/compiler: nib_ctrl no longer exists on Xe2+
Ref: cfb34dc695 ("intel/eu/validate: Validate that the ExecSize is a factor of chosen ChanOff")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28191>
2024-03-15 03:01:53 +00:00
Jordan Justen
72d289b8d1 intel/compiler/fs: Restore SIMD32 restriction for ray_queries on Xe2
In 96e0d979a7, the restriction was dropped because we don't compile a
SIMD8 program on Xe2. This change moves it to run_fs() so the
restriction will be added when compiling SIMD16 on Xe2.

Fixes: 96e0d979a7 ("intel/fs: Check fs_visitor instance before using it")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28191>
2024-03-15 03:01:53 +00:00
Marcin Ślusarz
2ad4d5f8dd intel/compiler/xe2: fix decoding of sampler simd mode
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28191>
2024-03-15 03:01:53 +00:00
Lionel Landwerlin
4df58ef503 intel/fs: bump max simd size of some messages for xe2
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28191>
2024-03-15 03:01:53 +00:00
Caio Oliveira
e5bc5bba7c anv: Enable VK_KHR_shader_maximal_reconvergence
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27278>
2024-03-15 02:10:21 +00:00
Yiwei Zhang
d56f65f7ca venus: ensure shmem is attached to renderer before use for guest vram
For guest vram, there's already roundtrip to protect device memory alloc
ordering. This change adds the same protection for shmem used in below
scenarios and optimize to wait for new shmem only.
- reply shmem
- indirect upload shmem
- cmd stream shmem

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28147>
2024-03-15 01:51:16 +00:00
Yiwei Zhang
72b124031b venus: minor naming cleanups
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28147>
2024-03-15 01:51:16 +00:00
Yiwei Zhang
362ba3f007 venus: roundtrip now belongs to ring
A roundtrip is to ensure a cmd via virtqueue happens on the renderer
side before a ring relies on it. Since venus is now with multi-ring, the
roundtrip submit and wait should belong to ring instead of instance, and
each ring owns its own roundtrip seqno to synchronize with virtqueue.

No behavior change.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28147>
2024-03-15 01:51:16 +00:00
Faith Ekstrand
160aa8ba48 nvk: Ignore rasterizationSamples when handling sampleShadingEnable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28192>
2024-03-15 01:31:55 +00:00
Timothy Arceri
20db9b77aa glsl: move invariant builtin validation to the nir linker
We don't attempt to recreate a nir implementation of the symbol table
instead here we simply use location to find the variables we need to
validate.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28142>
2024-03-15 00:01:34 +00:00
Yiwei Zhang
1bc25f4754 venus: optimize to further batch query records
Below is the common client pattern (app, angle, zink, etc):
- a few resets for queries to be used in this batch
  - optional, depending on EXT_host_query_reset
- a few queries
  - incremental
  - can cross query pool boundary

The HW drivers normally have faster shader path when there are too many
individual reset and copies. Without further resolving, this ends up
with linear overhead on the 2d engines. This change has largely
optimized that:
- angle: many copies => 1 copy (or 2)
- zink: many resets and copies => 1 reset and 1 copy (or 2)

and again...some more renamings around

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28112>
2024-03-14 23:40:44 +00:00
Yiwei Zhang
7c221e65a4 venus: add vn_queue_submission_get_resolved_query_records
This new split is for the getting the resolved query records, which is
to prepare for further query records resolving.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28112>
2024-03-14 23:40:44 +00:00
Yiwei Zhang
e868fc0b1e venus: refactor vn_queue_submission_add_query_feedback
Drop vn_combine_query_records_and_record_feedback to save the lines of
codes for args preparing. Also refactor to avoid the cmd stride trick,
but use indexing.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28112>
2024-03-14 23:40:44 +00:00
Yiwei Zhang
a6bc116f84 venus: rewrite qfb vn_feedback helpers
1. move record into alloc to simplify caller handling, which aligns
   with ffb and sfb as well
2. simplify locking to reduce lock overhead
3. remove unbalanced free from record helper
4. move reset to alloc

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28112>
2024-03-14 23:40:44 +00:00
Yiwei Zhang
aabb52979a venus: refactor query record recycle
Add a new free helper while renaming the alloc one as well. During query
record resolving, use a dropped list to store those records being reset.
This is to prepare for later further query record resolving.

This change also simplifies a query pool compare.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28112>
2024-03-14 23:40:44 +00:00
Yiwei Zhang
2a7085584e venus: simplify vn_cmd_reset and apply more code sharing
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28112>
2024-03-14 23:40:44 +00:00
Yiwei Zhang
5dbd88ad2a venus: drop vn_get_temp_cmd_ptr
It's more robust to base on original batch cmds instead of assuming
various constraints on copied cmds in the temp storage.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28112>
2024-03-14 23:40:44 +00:00
Yiwei Zhang
9e7797c8c1 venus: minor cmd count related refactors
This is to prepare for qfb refactor, so that we can distinguish the
current batch's cmd count and the appended new cmd count

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28112>
2024-03-14 23:40:44 +00:00
Yiwei Zhang
4bab7344a8 venus: massive qfb renamings
Summary:
- vn_feedback_query_batch => vn_cmd_query_record
- combined_batches => resolved_batches
- vn_feedback_query => vn_query_feedback

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28112>
2024-03-14 23:40:43 +00:00
Yiwei Zhang
25be8e721d venus: combine query record and reset
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28112>
2024-03-14 23:40:43 +00:00
Yiwei Zhang
71bf46fa5d venus: qfb to track cmd handle directly
since all usages are with vk handle

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28112>
2024-03-14 23:40:43 +00:00
Mike Blumenkrantz
e931ef4884 zink: iterate all the modes when doing separate shader fixups
otherwise this might only do the inputs without also handling outputs

Fixes: 0a12cedec9 ("zink: add a special separate shader i/o mode for legacy variables")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28185>
2024-03-14 23:17:02 +00:00
Faith Ekstrand
b68f2e747c zink: Rework sparse texture lowering
Instead of the previous fragile attempt to handle sparse_resident_and
by crawling deref chains, we now insert an is_sparse_resident_zink
intrinsic immediately after the tex or sparse_load intrinsic and define
Zink's sparse resident codes to always be 0/1.  Then sparse_resident_and
becomes iand and is_sparse_texels_resident becomes != 0 and everything
is well-defined and robust.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28123>
2024-03-14 22:37:51 +00:00
Corentin Noël
51593c6b34 dri/kopper: Assume a non-null drawable in flush_frontbuffer
It is expected that drawable is non-null here so don't add check for it.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28180>
2024-03-14 21:30:31 +00:00
Kenneth Graunke
484246ea0a iris: Eliminate prototype introduced in the previous patch
By moving iris_flush_resource() below.  This is done separately to
make the diff for the actual change in the previous patch easier to
follow.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13154>
2024-03-14 20:37:09 +00:00
Kenneth Graunke
fa24ff24dd iris: Remove suballocation in iris_flush_resource()
pipe->flush_resource() is called from eglCreateImageKHR in order to
prepare images to be shared.  It also has a valid context.  We can
just remove suballocation there, rather than doing it on the first
dri_image_query like radeonsi does.

This is much simpler and seems to work fine.

Suggested-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13154>
2024-03-14 20:37:09 +00:00
Sviatoslav Peleshko
a330ecc48a dri: Flush the context after flush_resource when creating shareable image
This makes sure that we'll be done with any pending preparations before
the actual export of the resource.

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13154>
2024-03-14 20:37:09 +00:00
Nanley Chery
27d35588f5 iris: Copy main ISL surf when reallocating in place
When reallocating a resource in place, we make sure to pass the
PIPE_BIND_SHARED flag for the new resource. On ACM, this generally
changes the allocation of the resource from tiled to linear. To pick up
the new layout of the resource, copy the new ISL surf.

This enables ACM to pass piglit's egl-ext_egl_image_storage
test.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10367
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13154>
2024-03-14 20:37:09 +00:00
Valentine Burley
98690db847 tu: Reorder device features
Sort device features by KHR, EXT, vendor and then alphabetically within that.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28095>
2024-03-14 19:13:23 +00:00
Valentine Burley
1726e03df4 tu: Advertise VK_KHR_vertex_attribute_divisor
This is a promotion from the EXT, except the new property
supportsNonZeroFirstInstance which should already be supported.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28095>
2024-03-14 19:13:23 +00:00
Valentine Burley
355dd782c5 tu: Implement VK_KHR_map_memory2
Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28080>
2024-03-14 18:50:19 +00:00
Corentin Noël
e7de9ab62a zink: Make sure to initialize all the fields of VkMemoryBarrier
Fixes several random validation errors as the value of dstAccessMask could be
anything.

Cc: mesa-stable
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28166>
2024-03-14 18:29:14 +00:00
Yonggang Luo
d2229304dc panfrost/meson: remove redundant gallium include from meson files
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24439>
2024-03-14 17:23:55 +00:00
Yonggang Luo
13ce0358b0 panfrost/shared: avoid use gallium helper in pan_minmax_cache.*
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24439>
2024-03-14 17:23:55 +00:00
Lionel Landwerlin
20df1d2b1f anv: ignore descriptor alignment for inline uniforms
For this particular case only it doesn't matter. Fixes some new CTS
tests with small inline uniform sizes.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28040>
2024-03-14 16:54:30 +00:00
Corentin Noël
812be09cd2 st_pbo/compute: Use the correct structure type when allocating a specialized key
Use pbo_spec_async_data instead of pbo_async_data.

Cc: mesa-stable
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28173>
2024-03-14 16:18:13 +00:00
José Roberto de Souza
27ab5fcf9f anv: Set VM control to true in Xe KMD
Xe KMD needs VMs to be created to work.
Setting this on Xe KMD code path allow us to simply a feature check
in init_queue_families().

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/28161>
2024-03-14 15:53:22 +00:00