Commit Graph

184201 Commits

Author SHA1 Message Date
Antoine Coutant
445aacb421 clc: retrieve libclang path at runtime.
LLVM_LIB_DIR is a variable used for runtime compilations.
When cross compiling, LLVM_LIB_DIR must be set to the
libclang path on the target. So, this path should not
be retrieved during compilation but at runtime.

dladdr uses an address to search for a loaded library.
If a library is found, it returns information about it.
The path to the libclang library can therefore be
retrieved using one of its functions. This is useful
because we don't know the name of the libclang library
(libclang.so.X or libclang-cpp.so.X)

v2 (Karol): use clang::CompilerInvocation::CreateFromArgs for dladdr
v3 (Karol): follow symlinks to fix errors on debian

Fixes: e22491c832 ("clc: fetch clang resource dir at runtime")
Signed-off-by: Antoine Coutant <antoine.coutant@smile.fr>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by (v1): Jesse Natalie <jenatali@microsoft.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25568>
2024-01-31 12:23:49 +00:00
Karol Herbst
8efd11fce9 clc: force fPIC for every user when using shared LLVM
As we want to start using `dladdr`, this is needed to prevent `dladdr`
returning information of the wrong file.

Fixes tag as it's required by the actual fix.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Fixes: e22491c832 ("clc: fetch clang resource dir at runtime")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25568>
2024-01-31 12:23:49 +00:00
Karol Herbst
37a1346347 meson: remove opencl-external-clang-headers option and rely on shared-llvm
Setting opencl-external-clang-headers to enabled while using shared LLVM
was broken and this option was mostly used for windows to force static
inclusion of opencl base headers.

Simply relying on the shared-llvm option here is enough to get what we
want.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25568>
2024-01-31 12:23:49 +00:00
Eric Engestrom
501f78fdba util: check for setgid() as well in __normal_user()
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27378>
2024-01-31 11:42:56 +00:00
Eric Engestrom
afd4e633ee util: simplify logic in __normal_user()
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27378>
2024-01-31 11:42:55 +00:00
Iago Toral Quiroga
6c570f7a98 v3dv: allow subgroup operations in fragment shaders
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
2024-01-31 10:06:06 +00:00
Iago Toral Quiroga
e5bfce6f46 broadcom/compiler: support subgroup reduction operations from fragment shaders
In fragment shaders these instructions consider a lane active when
any lane in the same quad is active, which is not what we want, so
we need to include the current sample mask in the condition mask
used with these instructions to limit lane selection to those that
are really active.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
2024-01-31 10:06:06 +00:00
Iago Toral Quiroga
3544113ee2 brodcom/compiler: implement non-compute TSY barrier
The BARRIER_ID instruction is only available in compute
and tessellation, implement an equivalent barrier that we
can use from other stages.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
2024-01-31 10:06:06 +00:00
Iago Toral Quiroga
5b269814fc broadcom/compiler: be more careful with unifa in non-uniform control flow
If the lane from which the hardware writes the unifa address
is disabled, then we may end up with a bogus address and invalid
memory accesses from follow-up ldunifa.

Instead of always disabling unifa loads in non-uniform control
flow we can try to see if the address is prouced from a nir
register (which is the only case where we do conditional writes
under non-uniform control flow in ntq_store_def), and only
disable it in that case.

When enabling subgroups for graphics pipelines, this fixes a
GMP violation in the simulator with the following test
(which has non-uniform control flow writing unifa with lane 0
disabled, which is the lane from which the unifa takes the
address):
dEQP-VK.subgroups.ballot_broadcast.graphics.subgroupbroadcastfirst_int

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
2024-01-31 10:06:06 +00:00
Iago Toral Quiroga
31e8740808 v3dv: expose more subgroup features on V3D 7.x
The hardware included additional instructions to support more
subgroup features, so let's put them to use.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
2024-01-31 10:06:06 +00:00
Iago Toral Quiroga
93df9800e8 broadcom/compiler: support subgroup quad
These can all be implemented as specialized shuffles, so we
use the NIR lowering to do that.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
2024-01-31 10:06:06 +00:00
Iago Toral Quiroga
69d3b90839 broadcom/compiler: support subgroup vote
We don't rely in any lowerings for these (other than
scalarization). The only noteworthy aspect is that these
instructions, like ballot, use the condition mask to
filter out valid invocations that are inactive because of
control flow.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
2024-01-31 10:06:06 +00:00
Iago Toral Quiroga
3222fd71a1 broadcom/compiler: support subgroup shuffle
This maps to our native shuffle instruction. For shuffle relative
and shuffle xor, we rely on the nir lowering to lower this to
ALU and regular shuffle.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
2024-01-31 10:06:06 +00:00
Iago Toral Quiroga
29a5e3e615 broadcom/compiler: support subgroup ballot
This adds support in our compiler for the subgroup ballot
feature. To this end we start using the NIR lowering for
subgroups which can lowers some of these intrinsics into
things more amenable to our hardware and takes care of
scalarization.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
2024-01-31 10:06:06 +00:00
Iago Toral Quiroga
295f906517 broadcom/compiler: don't move subgroup reduction instructions above setmsf
These use the sample mask to decide about active lanes, so we need
to make sure we don't move them above a previous setmsf instruction.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
2024-01-31 10:06:06 +00:00
Iago Toral Quiroga
9bbfbc2089 broadcom/compiler: add new SFU instructions in V3D 7.x
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
2024-01-31 10:06:06 +00:00
Iago Toral Quiroga
7bdc8898b1 broadcom/compiler: fix incorrect flags update for subgroup elect
c->execute is 0 (not the block index) for lanes currently active
under non-uniform control flow.

Also this simplifies a bit the instructions we emit for flag
generation, both for uniform and non-uniform control flow.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
2024-01-31 10:06:06 +00:00
Iago Toral Quiroga
29d4924e5e broadcom/compiler: fix incorrect flags setup in non-uniform if path
If the ELSE block is cheap then we don't emit the branch instruction
but we still want to generate the flags, since these are setting
the flags for the THEN block too.

Fixes: e401add741 ("broadcom/compiler: skip jumps in non-uniform if/then when block cost is small")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27211>
2024-01-31 10:06:06 +00:00
Konstantin Seurer
13ca3d0eeb radv/sqtt: Set SeparateCompiled for monolithic RT pipelines
RGP can not handle how we implement "Unified" ray tracing pipelines and
only shows the prolog.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26697>
2024-01-31 10:24:24 +01:00
Konstantin Seurer
6d2926c54e radv: Skip unused acceleration structure build paths
If the whole batch doesn't use a path, we can skip binding the pipeline
and writing an user event.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26697>
2024-01-31 10:24:20 +01:00
Konstantin Seurer
93b1eec09b radv: Emit user events during acceleration structure builds
This way, we can see exactly which dispatches belong to acceleration
structure builds and which dispatches were caused by the app. We loose
the red coloring in RGP for this, but we get way more information.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26697>
2024-01-31 10:24:15 +01:00
Konstantin Seurer
22b719b445 radv: Make radv_write_user_event_marker non-static
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26697>
2024-01-31 10:24:11 +01:00
Konstantin Seurer
f43099ecf5 radv: Reduce the amount of radv_device_to_handle calls
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26697>
2024-01-31 10:24:06 +01:00
Konstantin Seurer
41e78330e7 radv/radix_sort: clang-format
The formatting was changed and those files were missed.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26697>
2024-01-31 10:23:51 +01:00
Hyunjun Ko
d0d2cf549b anv/video: fix out-of-bounds read
Since STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE is 19.

Fixes: 8d519eb5 ("anv: add initial video decode support for h265")
Closes: mesa/mesa#10529

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27373>
2024-01-31 08:24:22 +00:00
Samuel Pitoiset
31e29f7304 radv: enable deviceFaultVendorBinary if RADV_DEBUG=hang is set
Ideally, if deviceFaultVendorBinary is enabled by the app,
RADV_DEBUG=hang should be enabled behind the scene, but this isn't
possible right now because CTS always enables the feature.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27293>
2024-01-31 08:45:08 +01:00
Samuel Pitoiset
a778d5fd0d radv: export GPU hang reports through VK_EXT_device_fault
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27293>
2024-01-31 08:45:08 +01:00
Samuel Pitoiset
8c3d1c9140 radv: add support for keeping GPU hang reports in memory
To be exported through VK_EXT_device_fault when the feature is enabled
by app, otherwise it's saved on disk.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27293>
2024-01-31 08:45:08 +01:00
Samuel Pitoiset
c710cba0c7 radv: refactor dumping GPU hang reports by using chunks
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27293>
2024-01-31 08:41:54 +01:00
Samuel Pitoiset
7a20946579 radv: add a helper to know if device fault detection is enabled
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27293>
2024-01-31 08:41:54 +01:00
Zan Dobersek
f9c4e25483 freedreno: add fd_rd_output facilities for gzip-compressed RD dumps
Provide fd_rd_output facilities which enable constructing RD dumps that are
stored into gzip-compressed output. This matches the default behavior of
libwrap. Enabling and adjusting the behavior of functionality is done
through the FD_RD_DUMP environment variable.

Integration into Turnip's MSM backend is covered, replacing the previous
RD dump that was enabled through TU_DEBUG=rd. That debug option still
works and is the same as using FD_RD_DUMP=enable.

By default the dumps are created for each submission, using the provided
submit index. FD_RD_DUMP=combine enables gathering dumps for submissions
for the given logical device into a single file.

In the Turnip integration, FD_RD_DUMP=full will force dumping contents of
any buffer object. Additionally, with that option enabled any previous
submit will be waited on.

Specifying FD_RD_DUMP=trigger sets up a trigger file that can be used to
activate dumping manually. Writing zero or some non-integer value to the
file will disable dumping. Writing a positive integer value to it will
enable dumps for that many future submissions. Writing -1 to it will enable
dumps until disabled.

Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27230>
2024-01-31 07:59:30 +01:00
Mike Blumenkrantz
0a97d1ebfa zink: fix descriptor buffer unmaps on screen destroy
descriptor buffer uses mapped buffers. mapping/unmapping buffers
uses a ctx in the function params, but at this time there is no ctx.
since the ctx is not actually used for unmapping descriptor buffers,
this can instead use a special buffer unmap function to avoid invalid access

Fixes: b06f6e00fb ("zink: fix heap-use-after-free on batch_state with sub-allocated pipe_resources")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27344>
2024-01-31 04:08:20 +00:00
Mike Blumenkrantz
c900cca96c zink: always map descriptor buffers as COHERENT
this is already implied since the buffers must be BAR-allocated,
but it ensures the context isn't accessed during unmap

Fixes: b06f6e00fb ("zink: fix heap-use-after-free on batch_state with sub-allocated pipe_resources")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27344>
2024-01-31 04:08:20 +00:00
Bas Nieuwenhuizen
3f119a1fd8 util/disk_cache: Add marker on cache usage.
To be able to delete it later if it isn't used. Checking the mtime
on e.g. the index doesn't work if we always hit the cache so add
something that writes unconditionally.

Only once per day to avoid excessive writes.

(See https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22339)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27173>
2024-01-31 03:14:02 +00:00
Yiwei Zhang
5fbb00dbc7 venus: use obj handle instead of id in device memory report
Now the id is separately assigned in venus, while the test expects
handle.

Fixes: 7f9381782f ("venus: ensure object id is unique")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27285>
2024-01-31 02:58:57 +00:00
Felix DeGrood
8c87657fbd driconf: Fake vendorid for RDR2
Change force_vk_vendor=-1 for Red Dead Redemption 2 to avoid
pop up driver warning on launch. Warning only applies to Windows
driver.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27364>
2024-01-31 02:11:18 +00:00
Sil Vilerino
01a99f5d4d d3d12: d3d12_video_encoder_negotiate_current_h264_slices_configuration to use correct mode when intra-refresh is on
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27367>
2024-01-31 01:49:52 +00:00
Faith Ekstrand
45a6e1dc89 nak/nir: Stop lowering load_local_invocation_index
NAK_SV_COMBINED_TID is not gl_InvocationIndex. It's just gl_InvocationID
with the three components all crammed into one 32-bit value.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27365>
2024-01-31 01:23:23 +00:00
Faith Ekstrand
ac11cb0f72 nvk: Call lower_compute_system_values after zer_initialize_workgroup_memory
Fixes: 184bcfdc1c ("nvk: Implement VK_KHR_zero_initialize_workgroup_memory")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27365>
2024-01-31 01:23:23 +00:00
Yiwei Zhang
1718980e85 venus: force async pipeline create on threads creating descriptor pools
This works around some Unity engine behaivor with ANGLE-on-Venus, when
cmd pools are created on main thread once while the render thread only
does descriptor pool creation for set allocations during recording time.

This change also explicitly forces async pipeline create for threads
creating the device instead of implicitly via feedback cmd pool create.
This ensures intended behavior when feedback is disabled.

Fixes: d17ddcc847 ("venus: dispatch background shader tasks to secondary ring")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27347>
2024-01-30 23:50:47 +00:00
Martin Roukala (né Peres)
62797f036f zink/ci: update polaris10's expectations after piglit uprev
Fixes: 1c29869c20 ("Uprev Piglit to e9316bcd12544aaf7e753ce37fe50d64165d9598")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27357>
2024-01-30 23:32:00 +00:00
Martin Roukala (né Peres)
a0bf21e72f zink/ci: update navi31's expectations after piglit uprev
Fixes: 1c29869c20 ("Uprev Piglit to e9316bcd12544aaf7e753ce37fe50d64165d9598")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27357>
2024-01-30 23:32:00 +00:00
Martin Roukala (né Peres)
a6ea0f1762 radeonsi/ci: update vangogh's expectations after piglit uprev
Fixes: 1c29869c20 ("Uprev Piglit to e9316bcd12544aaf7e753ce37fe50d64165d9598")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27357>
2024-01-30 23:32:00 +00:00
Daniel Schürmann
faf3bb644d spirv: Update headers and grammar JSON
1.3.276.0

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27273>
2024-01-30 22:51:52 +00:00
Konstantin Seurer
e3c2dc2324 nir/print: Rename workgroup-size to workgroup_size
Every other field uses _ instead of -.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27318>
2024-01-30 21:19:40 +00:00
Konstantin Seurer
449e44d6d3 nir/print: Don't print shared_size twice
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27318>
2024-01-30 21:19:40 +00:00
Gert Wollny
0ab3b3c641 nir/builder: Fix compilation with gcc-13 when tsan is enabled
../src/compiler/nir/nir_builder.h: In function ‘nir_build_deref_follower’:
../src/compiler/nir/nir_builder.h:1607:1: error: control reaches end of non-void function [-Werror=return-type]
 1607 | }

Fixes: 4a4e175738
    nir: Support deref instructions in lower_var_copies

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27345>
2024-01-30 20:42:07 +00:00
Gert Wollny
80a1b91601 nir/lower_int64: Fix compilation with gcc-13 and tsan enabled
../src/compiler/nir/nir_lower_int64.c: In function ‘lower_int64_intrinsic’:
../src/compiler/nir/nir_lower_int64.c:1347:1: error: control reaches end of non-void function [-Werror=return-type]
1347 | }

Fixes: bf7a114246
   nir/lower_int64: Add lowering for some 64-bit subgroup ops

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27345>
2024-01-30 20:42:07 +00:00
Gert Wollny
ca47138fb1 radv: Fix compilation with gcc-13 and tsan enabled
../src/amd/vulkan/radv_sampler.c: In function ‘radv_tex_wrap’:
../src/amd/vulkan/radv_sampler.c:50:1: error: control reaches end of non-void function [-Werror=return-type]
   50 | }
      | ^
../src/amd/vulkan/radv_sampler.c: In function ‘radv_tex_compare’:
../src/amd/vulkan/radv_sampler.c:76:1: error: control reaches end of non-void function [-Werror=return-type]
   76 | }
      | ^

Fixes: 4de305cb8a
   radv: move sampler related code to radv_sampler.c

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27345>
2024-01-30 20:42:07 +00:00
Gert Wollny
f6383e03f9 zink: use enums as return values in resource_object_create
(As suggested by Mike).

With that replace the goto statements for error cleanup by
a switch/case.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27155>
2024-01-30 20:17:32 +00:00