Commit graph

179609 commits

Author SHA1 Message Date
Mike Blumenkrantz
d2abb4f975 zink: make (some) vk allocation commands more robust against vram depletion
as has recently been exposed by ci, there are some cases where running
lots of tests simultaneously can temporarily result in depleted vram,
which torpedos everything

as this scenario is transient (vram will very soon become available again),
it makes more sense to add some retries at fixed intervals to try soldiering
onward instead of exploding and probably blocking a merge

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25938>
2023-10-27 17:33:31 +00:00
Mike Blumenkrantz
c4283e32e3 radv: correctly return oom from the device when failing to create a cs
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25927>
2023-10-27 15:29:32 +00:00
Mike Blumenkrantz
f8909e7d55 zink: add more locking for compute pipelines
if multiple contexts are accessing this all at once then this needs
more locking to avoid unsynchronized cache access

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25929>
2023-10-27 15:06:13 +00:00
Karol Herbst
9a3af6e1d8 rusticl/queue: Only take a weak ref to the last Event
This resolves a memory leak when the application drops its last reference
to the queue, but never waits explicitly.

The problem was, that the queue was refed by QueueState::last and that ref
only gets dropped on a blocking wait. This is problematic as non user
Event objects also hold a ref on the Queue they are created on, therefore
causing a cyclic ref relation.

In order to resolve it, just use a weak reference. A failure of upgrading
the Weak ref is not an issue as in this case we'd only wait on an already
destroyed or processed event. The worker thread already makes sure
everything stays in sync.

Fixes: 5b3ff7e3f3 ("rusticl/queue: overhaul of the queue+event handling")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25926>
2023-10-27 14:47:23 +00:00
Samuel Pitoiset
7ec2544a9b radv: dump the pipeline hash to the gpu hang report
It can be useful to verify that a specific pipeline causes a hang.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25908>
2023-10-27 12:10:51 +00:00
Alejandro Piñeiro
5cb00f7e77 broadcom/qpu: use back BITFIELD64_RANGE for ANYOPMASK
This is the original definition for ANYOPMASK, until we found that
clang raised a warning using the option shift-count-overflow, so we
used an alternative.

That warning was fixed with commit 6e2bb716b0, so let's restore
previous version.

Note that other good thing of that warning being fixed is that now we
can use without warning OP_RANGE with bit 63 (in the case that any
broadcom opcode used that bit)

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25776>
2023-10-27 11:45:09 +00:00
Karol Herbst
1c619b668d radv: fix buffers in vkGetDescriptorEXT with size not aligned to 4
The range alignment didn't happen through GetDescriptorEXT as it called
write_buffer_descriptor directly. So simply move the align
from write_buffer_descriptor_impl into write_buffer_descriptor.

Fixes: 46e0c77582 ("radv: implement VK_EXT_descriptor_buffer")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:55 +00:00
Karol Herbst
01b6ccccc6 zink: lower fisnormal as it requires the Kernel Cap
I didn't check if it's a valid vulkan SPIR-V opcode and turns out it isn't

Fixes: 82eed326f4 ("zink: support more nir opcodes")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:55 +00:00
Karol Herbst
e3a0df6468 zink: emit float controls
This is required by OpenCL who relies on flushing behavior to match the
runtimes advertized feature, but also later once rusticl does support
denorms, to flush them if applications whish to do so.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:55 +00:00
Karol Herbst
700a2dc648 zink: alias nir scratch memory by lowering to common bit_size
This aliases each access as required by OpenCL. It's up to the vulkan
driver to vectorize to wider loads/stores if possible.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:55 +00:00
Karol Herbst
ab065d9daa zink: support CLAMP_TO_BORDER with unnormalized coords
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:55 +00:00
Karol Herbst
abd8ef84ff rusticl/mem: properly set pipe_image_view::access
Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:55 +00:00
Karol Herbst
694001eef7 rusticl/device: restrict param_max_size further
It's kinda pointless to have it too big, it also causes weird shaders to
be generated and causes stack overflows in `nir_opt_gcm`.

Nothing needs big values here anyway.

Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:54 +00:00
Karol Herbst
9b6ac56d72 rusticl/device: restrict image_buffer_size
It's pointless to advertise more than CL_DEVICE_MAX_MEM_ALLOC_SIZE and
also the CTS tests against this.

Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:54 +00:00
Karol Herbst
d6a48ff402 vtn/opencl: always lower to libclc fmod
The nir/spirv variant is simply not precise enough and almost everybody
lowers it anyway.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:54 +00:00
Lionel Landwerlin
7cff4cc9c8 intel/fs: Xe2 fix for ExBSO on UGM
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
BSpec: 56890
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25506>
2023-10-27 10:58:12 +03:00
Juan A. Suarez Romero
b6fbc4e4dd v3d/ci: run V3D GL tests in 64-bits
The recommended OS flavour for RPI4 and onwards is 64 bits, and just
keep the 32 bits for RPI3 and below.

This makes all the V3D testing to be done with 64 bits.

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25904>
2023-10-27 06:33:04 +00:00
Yonggang Luo
ce5475366e compiler,vulkan,drm-shim: Remove unused include directories from meson.build
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24462>
2023-10-27 01:35:10 +00:00
Yonggang Luo
73b639ec5c nir: #include "util/macros.h" for BITFIELD64_MASK in nir.c
There is no neeed #include "main/menums.h" in nir.c,
as it's belongs to gallium code

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24462>
2023-10-27 01:35:10 +00:00
Mike Blumenkrantz
ee1039877c mesa/st/texture: match width+height for texture downloads of cube textures
some drivers require this

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Mike Blumenkrantz
df74ea7717 zink: unset explicit_xfb_buffer for non-xfb shaders
this catches duplicated xfb when generated geometry shaders are used

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Mike Blumenkrantz
87e3720b66 aux/u_transfer_helper: set rendertarget bind for msaa staging resource
this matches other resources created with staging blit-like mechanics

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Mike Blumenkrantz
694ebe8c72 zink: only emit xfb execution mode for last vertex stage
this is otherwise illegal

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Mike Blumenkrantz
e8b2680045 zink: clamp resolve extents to src/dst geometry
exceeding src/dst extents is illegal

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Mike Blumenkrantz
009d4a5fda zink: always set VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT for usermem
required by spec

backport-to: 23.3

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Mike Blumenkrantz
7035b5a8e8 zink: emit SpvCapabilitySampleRateShading with SampleId
required by spec

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Mike Blumenkrantz
f2fb2df6a3 ci: bump VVL to 1.3.269
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Guilherme Gallo
969ede4521 ci/bin: Refactor create_job_needs_dag
The function is getting too big, let's add comments, docstrings to the
most important function, new type hints and extract methods from it to
make it easier to read.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25858>
2023-10-27 00:36:48 +00:00
Guilherme Gallo
4e4743ec0a ci/bin: Do not forget to add early-stage dependencies
In Mesa MR pipelines, we have the sanity job. This job is not an
explicit need for any one job, because only jobs with `- needs: []`
ignores previous jobs. If no `needs` is specified, the job will wait
until all the jobs of earlier stages are finished before starting.

See additional details section at:
https://docs.gitlab.com/ee/ci/yaml/index.html#stage-post

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10032
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25858>
2023-10-27 00:36:48 +00:00
Guilherme Gallo
c7b67d8619 ci/bin: Use iid instead of SHA in gitlab_gql
We were using sha to fetch the pipeline from GraphQL, but that leads to
wrong results when MR and branch pipelines exist. For example,
using pipeline-url as the MR pipeline:
- https://gitlab.freedesktop.org/gallo/mesa/-/pipelines/1017182
This would lead into the branch pipeline:
- https://gitlab.freedesktop.org/gallo/mesa/-/pipelines/1013189

Also simplify the GQL query, it had lots of unused data.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25858>
2023-10-27 00:36:48 +00:00
Faith Ekstrand
49b3118302 nir/lower_bit_size: Use b2b for boolean subgroup ops
Without this, we replace vote_ieq(b) with vote_ieq(u2u32(b)) which is
wonky because we're doing a u2u on a 1-bit type. With this, we now
replace it with vote_ieq(b2b32(b)).  For other subgroup ops, we replace
things like *scan[op](b) with *scan[op](b2b32(b)).  For scan ops, this
assumes that b2b1(op(b1b32(x), b2b32(y))) = op(x, y) for all of the ops
iand, ior, and ixor.  This is true on all the back-ends I'm aware of.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Faith Ekstrand
5014759133 nir: Return b2b ops from nir_type_conversion_op()
Without this, nir_type_conversion_op(bool, bool32, RND) will return
u2u32 instead of b2b32 which is pretty unexpected behavior.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Faith Ekstrand
d5c310899a nir: Split nir_lower_subgroup_options::lower_vote_eq into two bits
On NVIDIA, we can do a vote_ieq on bool in one hardware op so we don't
want that lowered.  We do want to lower vote_feq and other vote_ieq,
though.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Faith Ekstrand
f10d768a88 nir/lower_bit_size: Use u_intN_min/max()
May as well clean it up while we're here.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Faith Ekstrand
5465e5b157 nir/lower_bit_size: Handle vote_feq/ieq separately
They're different enough from all the other subgroup ops so it's best to
handle them as their own case.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Faith Ekstrand
5979e74177 nir/lower_bit_size: Fix subgroup lowering for floats
Using u2u is always correct for integers, including signed integers,
because we're doing a down-cast.  It's wrong for floats, though.

Fixes: f95665cfeb ("nir/lower_bit_size: Add support for lowering subgroup ops")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Faith Ekstrand
16664b74a2 nir: Add a lower_read_first_invocation option to lower_subgroups
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Faith Ekstrand
3d027cca1e nir: Add a lower_first_invocation_to_ballot option to lower_subgroups
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Mike Blumenkrantz
d1d29d4f40 ci: skip zink vram test
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:26 +00:00
Mike Blumenkrantz
9a98d6714d zink: enable unsynchronized texture uploads using staging buffers
by not returning busy for non-HIC unsynchronized texture uploads,
the GL frontend will fall through to directly access the unsynchronized
cmdbuf

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:26 +00:00
Mike Blumenkrantz
846a5ea224 zink: add locking for batch refs
this is needed to handle unsynchronized access

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:26 +00:00
Mike Blumenkrantz
cd08b070a3 zink: add flag to restrict unsynchronized texture access
this is unset any time a texture is accessed and must be explicitly
re-set to preserve unsynchronized access

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:26 +00:00
Mike Blumenkrantz
8ee0d6dd71 zink: add a third cmdbuf for unsynchronized (not reordered) ops
this provides functionality for unsynchronized texture uploads without
HIC support by adding a cmdbuf which can only be accessed directly by
the frontend thread

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:26 +00:00
Mike Blumenkrantz
8d0eaf97db zink: rework cmdbuf submission to be more extensible
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:26 +00:00
Mike Blumenkrantz
7d0dbdeca2 zink: assert that transfer_dst is available before doing buf2img
the blitter path here was just wishful thinking anyway

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:25 +00:00
Mike Blumenkrantz
0b11b41fff zink: barrier_cmdbuf -> reordered_cmdbuf
this is more consistent with the current usage of the cmdbuf

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:25 +00:00
Mike Blumenkrantz
00206e01a4 zink: handle unsynchronized image maps from tc
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:25 +00:00
Mike Blumenkrantz
9cc06f817c tc: allow unsynchronized texture_subdata calls where possible
if a texture is provably idle, either by never having been used or
by exhaustively checking usage data, a texture subdata can occur
without any synchronization

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:25 +00:00
Mike Blumenkrantz
815ed12e3b tc: use strong refs for fb attachment tracking
this is necessary for unsynchronized texture upload tracking

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:25 +00:00
Mike Blumenkrantz
b385fa85db tc: add batch usage tagging to threaded_resource
this allows the tc recorder thread to tag resources to determine if
a resource has been previously seen by the current batch

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:25 +00:00