platform/upstream/mesa.git
16 months agoradeonsi: Fix offset for linear surfaces on GFX < 9
David Rosca [Tue, 31 Oct 2023 09:13:52 +0000 (10:13 +0100)]
radeonsi: Fix offset for linear surfaces on GFX < 9

Fixes: 86262b6eac0 ("radeonsi,radv: fix usages of surf_pitch")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9949
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10073
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25970>
(cherry picked from commit bf364cbdb40f044d2a11b6fe5636e8a039fdad81)

16 months agoAndroid.mk: disable android-libbacktrace to build with Android 14
Mauro Rossi [Sat, 14 Oct 2023 19:39:37 +0000 (21:39 +0200)]
Android.mk: disable android-libbacktrace to build with Android 14

Android libbacktrace is not available in Android 14

Fixes the following build error:

FAILED: src/util/libmesa_util.a.p/u_debug_stack_android.cpp.o
...
../src/util/u_debug_stack_android.cpp:28:10: fatal error: 'backtrace/Backtrace.h' file not found
         ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Cc: mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25963>
(cherry picked from commit 95ad0c750c5891dab3a678f26a74c95edfed87c9)

16 months agoAndroid.mk: filter out cflags to build with Android 14 bundled clang
Mauro Rossi [Sat, 14 Oct 2023 19:51:24 +0000 (21:51 +0200)]
Android.mk: filter out cflags to build with Android 14 bundled clang

Android 14 uses prebuild clang version 17.0.2
By filtering these cflags there are no building errors on previous Android releases.

Fixes the following building errors:

../src/c11/time.h:54:8: error: redefinition of 'timespec'
struct timespec
       ^
/media/bigblissdrive/u-x86/out/soong/.intermediates/bionic/libc/libc/android_vendor.34_x86_x86_64_shared/gen/include/bits/timespec.h:46:8: note: previous definition is here
struct timespec {
       ^
1 error generated.

In file included from ../src/util/disk_cache.c:50:
../src/util/disk_cache.h:86:4: error: use of undeclared identifier 'Dl_info'
   Dl_info info;
   ^
...
./src/util/disk_cache.h:114:30: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *' [-Wint-conversion]
      _mesa_sha1_update(ctx, build_id_data(note), build_id_length(note));
                             ^~~~~~~~~~~~~~~~~~~

10 errors generated.

../src/intel/perf/intel_perf.c:91:10: error: call to undeclared function 'major'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   maj = major(sb.st_rdev);
         ^
../src/intel/perf/intel_perf.c:92:10: error: call to undeclared function 'minor'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   min = minor(sb.st_rdev);
         ^
2 errors generated.

../src/intel/vulkan/anv_allocator.c:295:13: error: call to undeclared function 'futex_wake'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
            futex_wake(&table->state.end, INT_MAX);
            ^
...
../src/intel/vulkan/anv_allocator.c:711:7: error: call to undeclared function 'futex_wait'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      futex_wait(&pool->block.end, block.end, NULL);
      ^
6 errors generated.

Cc: mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25963>
(cherry picked from commit 520e79a3b5841db034d6d962870432d21fd0989c)

16 months ago.pick_status.json: Update to 7d6f9ccfbeab050c26775d5e03578a01526cbfcb
Eric Engestrom [Mon, 6 Nov 2023 09:37:38 +0000 (09:37 +0000)]
.pick_status.json: Update to 7d6f9ccfbeab050c26775d5e03578a01526cbfcb

16 months agoci: Try really hard to print final result string
Daniel Stone [Fri, 3 Nov 2023 15:50:58 +0000 (15:50 +0000)]
ci: Try really hard to print final result string

a630 has been completing jobs, and then corrupting the very last line of
UART output - the one where we pass the overall result back from the DUT
to the job. The bare-metal monitor will wait for this line to appear,
never see it, and then the job times out.

Since this line is the most critical one of all to get out, just spam
the prints to try to make sure they get through.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26032>
(cherry picked from commit 80b87c18d1630dd622bf58e56f3fb3f39e9fb8ef)

16 months agoanv: remove CS_FLUSH from query regression
Felix DeGrood [Tue, 31 Oct 2023 23:15:37 +0000 (23:15 +0000)]
anv: remove CS_FLUSH from query regression

Fixes performance regression introduced by prior refactoring of
pipe control code that unnecessarily added CS_FLUSH to query start
and end. Issue was diagnosed by Ben L (thank you!)

Confirmed this restores performance on:
* Borderlands3 +2%
* Payday +3%
* Factorio +3%
* HogwartsLegacy +4%
* Ghostrunner +7%

Fixes: 6dc95685 (convert genX_query pipe controls to use pc helper)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25983>
(cherry picked from commit aa23120e4fc674d7da42c4895aa204f300155105)

16 months agozink: Fix crash on zink_create_screen error path
José Expósito [Fri, 3 Nov 2023 13:15:06 +0000 (14:15 +0100)]
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: 0c2045553fe4 ("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>
(cherry picked from commit 8a635e516ebb12411de8055c3405f36be43269b3)

16 months agonvk: Should use alignment instead of align
Yonggang Luo [Wed, 1 Nov 2023 20:43:10 +0000 (04:43 +0800)]
nvk: Should use alignment instead of align

align is a function, don't know why align > 0 is working

Fixes: 87686a22205 ("nvk: Rework side-band data upload")
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/26035>
(cherry picked from commit 5e9dcffffde8b4ecf78531c0285a0d296e1fc7a9)

16 months ago.pick_status.json: Mark 8dda860f83ac30d042dc6beb4438cc925d1fd130 as denominated
Eric Engestrom [Sat, 4 Nov 2023 14:16:31 +0000 (14:16 +0000)]
.pick_status.json: Mark 8dda860f83ac30d042dc6beb4438cc925d1fd130 as denominated

16 months agofrontends/va: Map decoder and postproc surfaces for reading
David Rosca [Thu, 2 Nov 2023 08:29:25 +0000 (09:29 +0100)]
frontends/va: Map decoder and postproc surfaces for reading

If application requests to map surface that was most recently used
as decoder or postproc target and also doesn't explicitly set the
map flags (vaMapBuffer2) it's very likely the intent is to read from
this surface, so we need to map it as such.

This fixes regression on radeonsi where mapping NV12 surfaces for
reading would fail with applications using vaDeriveImage. The reason
for this is that the VA frontend doesn't allow vaDeriveImage for
interlaced surfaces so the applications would use vaGetImage fallback,
but radeonsi doesn't allocate NV12 surfaces as interlaced anymore.

This also fixes mapping other formats surfaces (P010, RGBx, ...)
for reading, which never worked before.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9935
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10048
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26008>
(cherry picked from commit c638e61ef5e2e7de097a9b5850eff75022330f68)

16 months agofreedreno/drm: Fix race in zombie import
Rob Clark [Wed, 1 Nov 2023 16:42:21 +0000 (09:42 -0700)]
freedreno/drm: Fix race in zombie import

The check for the zombie case (racing with final unref of the bo vs
removal from table) must be atomic.

Fixes spec@ext_image_dma_buf_import@ext_image_dma_buf_import-refcount-multithread

Fixes: a192923f99e1 ("freedreno/drm: Restart import on zombie race")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25995>
(cherry picked from commit 6ac133c646dd4f6f9d8f644b24da6aeae95c1ce3)

16 months agonir: don't take the derivative of the array index in `nir_lower_tex`
antonino [Thu, 2 Nov 2023 17:03:41 +0000 (18:03 +0100)]
nir: don't take the derivative of the array index in `nir_lower_tex`

Previosuly when lowering to txd for sampler array the index would be
derived as well, therefore the resulting derivative would have been a
vec with one more component than what the txd instruction expects.

This patch truncates the coordinate vector in this case to make sure the
index is not derived.

Fixes: b154a4154b4 ("nir/lower_tex: rewrite tex/txb -> txd/txl before saturating srcs")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26012>
(cherry picked from commit 4a627af0e3670d409d8140c1f9ee1c7ac86b5ddf)

16 months agor600/sfn: Fixup component count only if intrinsic has it
Gert Wollny [Thu, 2 Nov 2023 20:39:42 +0000 (21:39 +0100)]
r600/sfn: Fixup component count only if intrinsic has it

Fixes: 33d878e
   r600/sfn: Handle load_global in 64 to vec2 lowering

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24229>
(cherry picked from commit 28b79b2ea5d13f2499d78f903a335383bb38e5c1)

16 months agor600: Link with libgalliumvl, when enabling rusticl this is needed
Gert Wollny [Thu, 2 Nov 2023 20:24:17 +0000 (21:24 +0100)]
r600: Link with libgalliumvl, when enabling rusticl this is needed

Fixes: 33673bcc2ab84de0b1ff35519e7d7a58ef572fba
    rusticl: stop linking with libgalliumvl

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24229>
(cherry picked from commit 1662897294a3b6b0f8b6004163c016722c634651)

16 months agonvc0: implement PIPE_CAP_TIMER_RESOLUTION
Karol Herbst [Thu, 2 Nov 2023 19:41:25 +0000 (20:41 +0100)]
nvc0: implement PIPE_CAP_TIMER_RESOLUTION

This allows rusticl to create profiling queues.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10042
Fixes: 660f2eabe11 ("gallium: add PIPE_CAP_TIMER_RESOLUTION")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26016>
(cherry picked from commit 7b419215048d63b33d3693206a7319d933c075d8)

16 months agov3d/ci: Remove minetest trace
Connor Abbott [Thu, 2 Nov 2023 17:29:31 +0000 (18:29 +0100)]
v3d/ci: Remove minetest trace

For the same reason as the previous commit. For examples of commits
causing spurious changes see 8019a1b9 and d89ca14e.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25864>
(cherry picked from commit 2313a517d2ddb6395eab802949b2f8461397b1d0)

16 months agofreedreno/ci: Remove minetest trace
Connor Abbott [Tue, 24 Oct 2023 10:23:28 +0000 (12:23 +0200)]
freedreno/ci: Remove minetest trace

I've repeatedly seen minor pixel changes due to changes that only affect
RA decisions, most recently in !22072. We changed the trace to hopefully
remove a use of texture() in control flow, but it seems there are more,
or the problem is something slightly different like reading
uninitialized values. On the other hand minetest has never actually
caught an issue for me that some other trace hasn't also caught. Just
remove it.

Cc: mesa-stable
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25864>
(cherry picked from commit 16214710caaacf4fb8539498a3eb774644921249)

16 months agonir: Handle wildcards with casts in copy_prop_vars
Faith Ekstrand [Wed, 19 Apr 2023 22:18:45 +0000 (17:18 -0500)]
nir: Handle wildcards with casts in copy_prop_vars

If we're propagating a copy from a cast where the copy copies an entire
array, we end up with something like &((S *)ssa_N)->f[*] in the source
where a wildcard has a cast in its parent chain.  If we then try to
propagate the read into a non-wildcard array load, we have to specialize
the wildcard.  This breaks because nir_build_deref_follower() doesn't
handle casts.  Since we know a priori that, because wildcards are only
generated by copy_deref on arrays, we cannot have a cast with a wildcard
parent so simply chasing the source deref to the first wildcard will
ensure that any casts in the deref are handled properly.

Fixes: ba2bd20f8732 ("nir: Rework opt_copy_prop_vars to use deref instructions")
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
(cherry picked from commit 15ab4d397fbd24ac09daab03cc9cd0b750dbace2)

16 months agovenus: fix query feedback batch leak and race upon submission
Yiwei Zhang [Wed, 1 Nov 2023 08:14:00 +0000 (01:14 -0700)]
venus: fix query feedback batch leak and race upon submission

Summary:
- fixed the combined query batches leak
- fixed the race condition of accessing feedback cmd pool
- very scoped code refactor

Cc: 23.3 <mesa-stable>
Fixes: 5b24ab91e43 ("venus: switch to unconditionally deferred query feedback")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25988>
(cherry picked from commit ae3b022fa0568e048ce2013affbd2ca60cc42ec6)

16 months agotu/virtio: Fix timeline semaphore support
Rob Clark [Thu, 2 Nov 2023 14:29:51 +0000 (07:29 -0700)]
tu/virtio: Fix timeline semaphore support

Fixes: f17c5297d7a0 ("tu: Add virtgpu support")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25981>
(cherry picked from commit ceeab44fd1ff116b5a3906044fc33588b65dcbda)

16 months agotu/msm: Fix timeline semaphore support
Rob Clark [Thu, 2 Nov 2023 14:29:23 +0000 (07:29 -0700)]
tu/msm: Fix timeline semaphore support

Fixes: daefc6e2a40b ("turnip: prep work for timeline semaphore support")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25981>
(cherry picked from commit 79b907f9412971b8f6316e1de757a2c3cfdbc603)

16 months agoradv: skip radv_remove_varyings for mesh shaders
Rhys Perry [Wed, 11 Oct 2023 13:46:20 +0000 (14:46 +0100)]
radv: skip radv_remove_varyings for mesh shaders

Fixes compilation of a Talos Principle 2 shader.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 9fa9782c1790 ("radv: stop compiling a noop FS when the application doesn't provide a FS")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25659>
(cherry picked from commit 0a418561dab43a41f21ab209367f88c2ed9eb4a5)

16 months agoradv: call lower_array_deref_of_vec before lower_io_arrays_to_elements
Rhys Perry [Wed, 11 Oct 2023 13:43:03 +0000 (14:43 +0100)]
radv: call lower_array_deref_of_vec before lower_io_arrays_to_elements

nir_lower_io_arrays_to_elements does not support array derefs of vectors,
even when nir_deref_instr_is_known_out_of_bounds is fixed.

They can occur with mesh shaders.

Found by inspection.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25659>
(cherry picked from commit ed12be533e2673b08e958be32fbe5d6af2737fbc)

16 months agonir: add deref follower builder for casts.
Faith Ekstrand [Wed, 1 Nov 2023 20:38:35 +0000 (15:38 -0500)]
nir: add deref follower builder for casts.

This fixes intel_clc builds with llvm 17 on gfx125_bvh_build_DFS_DFS
where it dies in the lower indirect derefs pass.

Co-authored-by: Dave Airlie <airlied@redhat.com>
Fixes: 4a4e1757381c ("nir: Support deref instructions in lower_var_copies")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25536>
(cherry picked from commit 6388896985da7495ad0968322491953894d29637)

16 months agor600: Add callbacks for get_driver_uuid and get_device_uuid
Gert Wollny [Wed, 25 Oct 2023 20:30:37 +0000 (22:30 +0200)]
r600: Add callbacks for get_driver_uuid and get_device_uuid

v2: Evaluate driver ID dynamically (Adam Jackson)
v3: Align the stars (Triang3l)
v4: include "r600" in driver ID for UUID evaluation (Triang3l)
v5: remove unused local variable

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10040
CC: mesa-stable
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25895>
(cherry picked from commit 3ab51c7ebd1e7a65bd928b6142423123c7552927)

16 months agorusticl: Show an error message if the version of bindgen can't be detected
LingMan [Sat, 4 Nov 2023 11:51:51 +0000 (12:51 +0100)]
rusticl: Show an error message if the version of bindgen can't be detected

bindgen 0.69.0 broke the `--version` switch, resulting in misleading errors about requiring at
least bindgen 0.62 or about unexpected arguments.

Ideally the build system would fetch the correct bindgen version automatically like cargo does.
Until then, provide a hopefully more helpful error message to the user.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26046>
(cherry picked from commit 1f1ec1c6bcc2a32a3c1df8c2cc7a2f4e7139b7ec)

16 months agorusticl: Show an error message if the build is attempted with an outdated bindgen...
LingMan [Tue, 24 Oct 2023 03:47:06 +0000 (05:47 +0200)]
rusticl: Show an error message if the build is attempted with an outdated bindgen version

Ideally the build system would fetch the correct bindgen version automatically like cargo does.
Until then, provide an error message that is hopefully more helpful than whatever cryptic error the
build runs into otherwise.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9457
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10029
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25859>
(cherry picked from commit 1cc26e8b6657b5097995470ced9ae9cc7b6f01b9)

16 months ago.pick_status.json: Update to 1f1ec1c6bcc2a32a3c1df8c2cc7a2f4e7139b7ec
Eric Engestrom [Sat, 4 Nov 2023 14:09:43 +0000 (14:09 +0000)]
.pick_status.json: Update to 1f1ec1c6bcc2a32a3c1df8c2cc7a2f4e7139b7ec

16 months agoVERSION: bump for 23.3.0-rc2
Eric Engestrom [Wed, 1 Nov 2023 17:27:10 +0000 (17:27 +0000)]
VERSION: bump for 23.3.0-rc2

16 months agoradv: emit COMPUTE_PIPELINESTAT_ENABLE for CS invocations on ACE
Samuel Pitoiset [Mon, 30 Oct 2023 13:04:38 +0000 (14:04 +0100)]
radv: emit COMPUTE_PIPELINESTAT_ENABLE for CS invocations on ACE

This register seems needed to enable compute shader shader invocations
on GFX7. On GFX8+ it's working fine without emitting this register but
I think it doesn't hurt.

This fixes dEQP-VK.query_pool.statistics_query.*_cq on GFX7.

Fixes: a9945216ba2 ("radv: fix COMPUTE_SHADER_INVOCATIONS query on compute queue")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25957>
(cherry picked from commit 17daa08dff0cf9479b27ed7402de61336607ec10)

16 months agoradv: fix compute shader invocations query on compute queue on GFX6
Samuel Pitoiset [Mon, 30 Oct 2023 11:50:56 +0000 (12:50 +0100)]
radv: fix compute shader invocations query on compute queue on GFX6

Looks like GFX6 always writes the number of compute shader invocations
at offset 0 when used on compute queue.

This fixes dEQP-VK.query_pool.statistics_query.*_cq on GFX6.

Fixes: a9945216ba2 ("radv: fix COMPUTE_SHADER_INVOCATIONS query on compute queue")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25957>
(cherry picked from commit 9a0a77cb53d0d31c7a090d06ac905d69e9c1131c)

16 months ago.pick_status.json: Update to faed5d647f2416bb0ce3a9d33a3955169c70dc52
Eric Engestrom [Wed, 1 Nov 2023 14:52:52 +0000 (14:52 +0000)]
.pick_status.json: Update to faed5d647f2416bb0ce3a9d33a3955169c70dc52

16 months agoradv: bind the non-dynamic graphics state from the pipeline unconditionally
Samuel Pitoiset [Mon, 30 Oct 2023 14:26:15 +0000 (15:26 +0100)]
radv: bind the non-dynamic graphics state from the pipeline unconditionally

The following sequence is valid (although weird) but many other drivers
(including RADV) were broken:
    - bind pipeline with some static state
    - set state command for that static state (to a bad value)
    - bind the same pipeline again
    - draw

Fixes new dEQP-VK.dynamic_state.*.double_static_bind.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25954>
(cherry picked from commit e4a1bc70dd739ca8addddc940af08312b038e288)

16 months agorusticl/mesa/screen: do not derefence the entire pipe_screen struct
Karol Herbst [Fri, 27 Oct 2023 21:27:15 +0000 (23:27 +0200)]
rusticl/mesa/screen: do not derefence the entire pipe_screen struct

Apparently the dereferences made tsan report data races on the pipe_screen
object.

Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25944>
(cherry picked from commit f7830240acc43280154dacd0ab075dcaa0051da8)

16 months ago.pick_status.json: Update to e4a1bc70dd739ca8addddc940af08312b038e288
Eric Engestrom [Wed, 1 Nov 2023 12:48:13 +0000 (12:48 +0000)]
.pick_status.json: Update to e4a1bc70dd739ca8addddc940af08312b038e288

16 months agovenus: switch to unconditionally deferred query feedback
Juston Li [Tue, 26 Sep 2023 23:36:58 +0000 (16:36 -0700)]
venus: switch to unconditionally deferred query feedback

All commands that make queries available have feedback cmds batched
and stored during recording. At submission time, for each batch
(SubmitInfo) these feedback cmds are recorded in a cmd buffer that is
appended after the last original cmd buffer (but before
semaphore/fence feedback).

Query reset cmds are deferred as well and also remove any prior feedback
cmds for queries its resetting within the batch.

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
(cherry picked from commit 5b24ab91e43a54b4f4081db52ebf6653b97e72bb)

16 months agovenus: append query feedback at submission time
Juston Li [Tue, 26 Sep 2023 23:29:17 +0000 (16:29 -0700)]
venus: append query feedback at submission time

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
(cherry picked from commit 7fbf608f2dac486b23030d3b48dd10bb453d9eb8)

16 months agovenus: track/recycle appended query feedback cmds
Juston Li [Tue, 26 Sep 2023 23:04:18 +0000 (16:04 -0700)]
venus: track/recycle appended query feedback cmds

Link the query feedback cmd lifecycle to a cmd in the batch so that when
that last cmd gets reset/freed, we assert its safe to reset the query
feedback cmd. The cmd is then placed on the free list for reuse.

Some edge cases if the the last cmd is simultaneous or gets resubmitted.

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
(cherry picked from commit d2a626787e559dad9105243be9e5043c9230853c)

16 months agovenus: support deferred query feedback recording
Juston Li [Tue, 26 Sep 2023 22:09:54 +0000 (15:09 -0700)]
venus: support deferred query feedback recording

Add function to alloc a cmd buffer and record all the deferred query
feedback cmds into it at submission time.

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
(cherry picked from commit 6dcf033dc30e52c1557999bf7588cf0e1c5dcc8c)

16 months agovenus: refactor out common cmd feedback functions
Juston Li [Tue, 26 Sep 2023 22:34:56 +0000 (15:34 -0700)]
venus: refactor out common cmd feedback functions

defered query feedback cmds have similaries with timeline semaphore
feedback so refactor out some common functions for reuse

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
(cherry picked from commit 99807b3db65e107fc35f9419979600fcec7b8230)

16 months agovenus: add helper function to get cmd handle
Juston Li [Tue, 26 Sep 2023 22:24:17 +0000 (15:24 -0700)]
venus: add helper function to get cmd handle

rename previous vn_get_cmd_handle as that was getting cmd
handles from the temp storage cmd_handle buffer.

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
(cherry picked from commit 2ea6f935ce554c5a1666648a284406db8edc3cc7)

16 months agoanv: fix corner case of mutable descriptor pool creation
Lionel Landwerlin [Mon, 30 Oct 2023 15:57:32 +0000 (17:57 +0200)]
anv: fix corner case of mutable descriptor pool creation

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 63e91148b7 ("anv: Enable VK_VALVE_mutable_descriptor_type")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10065
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25958>
(cherry picked from commit cdca0b2ce4d603d4f5914d7a1e37923a6a959541)

16 months ago.pick_status.json: Update to 4cdd094ae1e97d857a6b9dbc291d7bbe6ea266ac
Eric Engestrom [Tue, 31 Oct 2023 14:33:11 +0000 (14:33 +0000)]
.pick_status.json: Update to 4cdd094ae1e97d857a6b9dbc291d7bbe6ea266ac

16 months agotu: Fix reading of stale (V)PC_PRIMITIVE_CNTL_0
Danylo Piliaiev [Thu, 26 Oct 2023 15:11:30 +0000 (17:11 +0200)]
tu: Fix reading of stale (V)PC_PRIMITIVE_CNTL_0

PC_PRIMITIVE_CNTL_0 is not set in a draw state and may be changed
by 3d blits, so we have to re-emit it a the start of a renderpass.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9941
Fixes: 7be8d0f7f490ea58c89798efca7e45b84dc395da
("tu: Use common dirty tracking for PC_PRIMITIVE_CNTL_0")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25918>
(cherry picked from commit cdbb8b541266b1095c9565eef6d115adac73c1aa)

16 months agoradv: fix a synchronization issue with primitives generated query on RDNA1-2
Samuel Pitoiset [Tue, 3 Oct 2023 15:34:06 +0000 (17:34 +0200)]
radv: fix a synchronization issue with primitives generated query on RDNA1-2

Only RDNA1-2 are affected because RADV needs to handle the legacy vs
NGG path for this query, and the NGG results are stored with 2 extra
64-bit values.

Fixes flakes with
dEQP-VK.transform_feedback.primitives_generated_query.* since VKCTS
1.3.7.0.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25862>
(cherry picked from commit 7d96fe853e1b007293054645caf54ade77a77c90)

16 months agov3d,v3dv: fix MMU error from hardware prefetch after ldunifa
Iago Toral Quiroga [Mon, 16 Oct 2023 14:38:31 +0000 (16:38 +0200)]
v3d,v3dv: fix MMU error from hardware prefetch after ldunifa

ldunifa works exactly the same as ldunif: the hw will prefetch the
next 4 bytes after a read, so if a buffer is exactly a multiple of
a page size and a shader uses ldunifa to read exactly the last 4 bytes
the prefetch will read out of bounds and spam the error on the kernel
log. Avoid that by allocating extra bytes in this scenario.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25752>
(cherry picked from commit 82bef62c17c79b298601fd565ce558c5282a88b7)

16 months agozink: deallocate global_bindings array
Karol Herbst [Fri, 27 Oct 2023 13:53:19 +0000 (15:53 +0200)]
zink: deallocate global_bindings array

Fixes: a6e9e0f0d77 ("zink: add set_global_binding")
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/25937>
(cherry picked from commit 2f34a1db5883a2e5178371d8295f711bd754a1e1)

16 months agorusticl/mesa: pass PIPE_BIND_LINEAR in resource_create_texture_from_user
Karol Herbst [Wed, 25 Oct 2023 21:17:22 +0000 (23:17 +0200)]
rusticl/mesa: pass PIPE_BIND_LINEAR in resource_create_texture_from_user

Host pointer allocations are all linear laid out, so just tell the drivers
in case they don't assume this implicitly.

Fixes: 71a9af49107 ("rusticl/mem: support read/write/copy ops for images")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25937>
(cherry picked from commit 7f08036abc5dd361b2161660f2f7efce8df86056)

16 months agoradeonsi: initialize perfetto in the right place
Marek Olšák [Fri, 20 Oct 2023 21:54:34 +0000 (17:54 -0400)]
radeonsi: initialize perfetto in the right place

Compute contexts don't execute the second half of the function.

Fixes: a164e147e91 - radeonsi: Add perfetto support in radeonsi
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10043
Tested-by: Mike Lothian <mike@fireburn.co.uk>
Tested-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25873>
(cherry picked from commit 276b9b13cf4d073c8a6faa18f41952d2f826679d)

16 months agoanv: Fix leak when compiling internal kernels
Caio Oliveira [Thu, 26 Oct 2023 22:10:36 +0000 (15:10 -0700)]
anv: Fix leak when compiling internal kernels

Cc: mesa-stable
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25928>
(cherry picked from commit 9d73bfc9cdd127a52d07bf8b60e66c5a9495890e)

16 months agozink: check for cbuf0 writes before setting A2C
Mike Blumenkrantz [Thu, 26 Oct 2023 15:34:26 +0000 (11:34 -0400)]
zink: check for cbuf0 writes before setting A2C

VUID-vkCmdDrawMultiIndexedEXT-alphaToCoverageEnable-08919 requires
a cbuf0 write for A2C to be active

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25938>
(cherry picked from commit 736577871b939573af400e4e64ebfe18863d49af)

16 months agoradv: correctly return oom from the device when failing to create a cs
Mike Blumenkrantz [Thu, 26 Oct 2023 19:50:06 +0000 (15:50 -0400)]
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>
(cherry picked from commit c4283e32e3e8d96987358620aa43483a79eea08b)

16 months agozink: add more locking for compute pipelines
Mike Blumenkrantz [Thu, 26 Oct 2023 20:22:27 +0000 (16:22 -0400)]
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>
(cherry picked from commit f8909e7d55e86c7db55f4b9482f94c993f5e2529)

16 months agorusticl/queue: Only take a weak ref to the last Event
Karol Herbst [Thu, 26 Oct 2023 16:50:37 +0000 (18:50 +0200)]
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: 5b3ff7e3f3d ("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>
(cherry picked from commit 9a3af6e1d8a88ff5c919d33966e97168fe780a86)

16 months agoradv: fix buffers in vkGetDescriptorEXT with size not aligned to 4
Karol Herbst [Sun, 22 Oct 2023 19:50:35 +0000 (21:50 +0200)]
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: 46e0c77582d ("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>
(cherry picked from commit 1c619b668d69c66521d1da8edd97e518d6d61857)

16 months agozink: lower fisnormal as it requires the Kernel Cap
Karol Herbst [Sun, 22 Oct 2023 14:49:42 +0000 (16:49 +0200)]
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: 82eed326f47 ("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>
(cherry picked from commit 01b6ccccc6af3111da4466d083335ed5f0646a5e)

16 months agorusticl/mem: properly set pipe_image_view::access
Karol Herbst [Mon, 23 Oct 2023 17:17:16 +0000 (19:17 +0200)]
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>
(cherry picked from commit abd8ef84ff4034a8f159f4743dc025dbfde8b837)

16 months agorusticl/device: restrict param_max_size further
Karol Herbst [Tue, 24 Oct 2023 19:28:02 +0000 (21:28 +0200)]
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>
(cherry picked from commit 694001eef70e220c709523cd71aad4b7b7c6c8db)

16 months agorusticl/device: restrict image_buffer_size
Karol Herbst [Sun, 22 Oct 2023 14:53:54 +0000 (16:53 +0200)]
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>
(cherry picked from commit 9b6ac56d72d6d74cfe85ed9caff663f841dd6def)

16 months agomesa/st/texture: match width+height for texture downloads of cube textures
Mike Blumenkrantz [Thu, 26 Oct 2023 16:36:14 +0000 (12:36 -0400)]
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>
(cherry picked from commit ee1039877c14b9671e08342585bd0e2f4a6decb6)

16 months agozink: unset explicit_xfb_buffer for non-xfb shaders
Mike Blumenkrantz [Thu, 26 Oct 2023 16:05:16 +0000 (12:05 -0400)]
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>
(cherry picked from commit df74ea771782966009def93339d0f4a1d94d12a1)

16 months agoaux/u_transfer_helper: set rendertarget bind for msaa staging resource
Mike Blumenkrantz [Thu, 26 Oct 2023 15:54:40 +0000 (11:54 -0400)]
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>
(cherry picked from commit 87e3720b66aeef08351dc578863360c587514d53)

16 months agozink: only emit xfb execution mode for last vertex stage
Mike Blumenkrantz [Thu, 26 Oct 2023 15:33:47 +0000 (11:33 -0400)]
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>
(cherry picked from commit 694ebe8c7228aa5a2c427cd33b0d6fdf3360174d)

16 months agozink: clamp resolve extents to src/dst geometry
Mike Blumenkrantz [Thu, 26 Oct 2023 15:32:11 +0000 (11:32 -0400)]
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>
(cherry picked from commit e8b2680045b68334f3c82fada27a4edfe83bad22)

16 months agozink: always set VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT for usermem
Mike Blumenkrantz [Thu, 26 Oct 2023 15:00:57 +0000 (11:00 -0400)]
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>
(cherry picked from commit 009d4a5fda58d5bb4c642fe711e19cb91c4bc1f4)

16 months agozink: emit SpvCapabilitySampleRateShading with SampleId
Mike Blumenkrantz [Thu, 26 Oct 2023 15:00:41 +0000 (11:00 -0400)]
zink: emit SpvCapabilitySampleRateShading with SampleId

required by spec

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
(cherry picked from commit 7035b5a8e858ca4c4773baefdd62bf19e7e3ffe6)

16 months agonir/lower_bit_size: Fix subgroup lowering for floats
Faith Ekstrand [Thu, 26 Oct 2023 13:01:15 +0000 (08:01 -0500)]
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: f95665cfebbd ("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>
(cherry picked from commit 5979e74177eb3013ca7e78867295e9a015e6c8ed)

16 months agozink: add copy box locking
Mike Blumenkrantz [Thu, 26 Oct 2023 17:15:57 +0000 (13:15 -0400)]
zink: add copy box locking

this can technically be accessed by multiple threads, so ensure
access is serialized

backport-to: 23.3

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25924>
(cherry picked from commit 782481c429100ebc8df68ca54e4f34722eced1c8)

16 months agomeson: Add gallium-drivers=all option
Alyssa Rosenzweig [Wed, 25 Oct 2023 12:46:30 +0000 (08:46 -0400)]
meson: Add gallium-drivers=all option

Again, useful to lint common code changes and for our macbook-wielding rel
manager <3

Omits i915g due to dependency hell, everything else builds on fedora asahi.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25882>
(cherry picked from commit ef4aa24a15a7a84b6deda058f710e5f4c52e3984)

16 months agomeson: Add vulkan-drivers=all option
Alyssa Rosenzweig [Wed, 25 Oct 2023 12:41:55 +0000 (08:41 -0400)]
meson: Add vulkan-drivers=all option

To build-test everything, helpful to check common code changes before pounding
CI.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25882>
(cherry picked from commit b70e948886976d2fb17b3191c9116c1babe25810)

16 months agocrocus: Support building on non-Intel
Alyssa Rosenzweig [Wed, 25 Oct 2023 12:38:10 +0000 (08:38 -0400)]
crocus: Support building on non-Intel

Ditto.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25882>
(cherry picked from commit 2552ac360d25e6e5f52c0877228540aeb012c858)

16 months agohasvk: Support builiding on non-Intel
Alyssa Rosenzweig [Wed, 25 Oct 2023 12:37:32 +0000 (08:37 -0400)]
hasvk: Support builiding on non-Intel

Should help Eric build test releases on their MacBook :-)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25882>
(cherry picked from commit c8192c1c93ec4a988c14c038f7efcf2343c1f62a)

16 months agod3d12: d3d12_video_buffer_create_impl - Fix resource importing
Sil Vilerino [Thu, 26 Oct 2023 12:24:53 +0000 (08:24 -0400)]
d3d12: d3d12_video_buffer_create_impl - Fix resource importing

Only align resource dimensions on creation, not when importing existing D3D resource object.
Otherwise importing the resource fails since the resource descriptor does not match the aligned
dimensions passed in the template.

Fixes: 62fded5e4f8 ("d3d12: Allocate d3d12_video_buffer with higher alignment for compatibility")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25913>
(cherry picked from commit dfb95160266e1be49edc08863c4c760c3f774f9a)

16 months agonir/split_vars: Don't split arrays of cooperative matrix types
Ian Romanick [Tue, 24 Oct 2023 20:09:13 +0000 (13:09 -0700)]
nir/split_vars: Don't split arrays of cooperative matrix types

glsl_type_is_vector_or_scalar would more accruately be called "can be an
r-value that isn't an array, structure, or matrix. This optimization
pass really shouldn't do anything to cooperative matrices. These
matrices will eventually be lowered to something else (dependent on the
backend), and that thing may (or may not) be handled by this or another
pass.

Fixes: 2d0f4f2c17b ("compiler/types: Add support for Cooperative Matrix types")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25871>
(cherry picked from commit 18d8a96a00a1666fcf202ae89aee6344d295687e)

16 months agomesa/bufferobj: ensure that very large width+offset are always rejected
Corentin Noël [Thu, 26 Oct 2023 10:11:16 +0000 (12:11 +0200)]
mesa/bufferobj: ensure that very large width+offset are always rejected

In the case width+offset is triggering an integer overflow, the checks in place
are not working as the comparison will fail.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25909>
(cherry picked from commit e95c9b0515b85f65e00d47a152a881cc232a0d92)

16 months agoac/gpu_info: remove bogus assertion about number of COMPUTE/SDMA queues
Samuel Pitoiset [Wed, 25 Oct 2023 08:22:46 +0000 (10:22 +0200)]
ac/gpu_info: remove bogus assertion about number of COMPUTE/SDMA queues

For example, my polaris10 GPU now returns 3 compute queues.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25876>
(cherry picked from commit 4f8a2253875fdb677beb85c91ecb033cbf231fc7)

16 months agoanv/meson: add missing dependency on the interface header
Lionel Landwerlin [Thu, 26 Oct 2023 09:07:00 +0000 (12:07 +0300)]
anv/meson: add missing dependency on the interface header

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: db335d9b73 ("anv: factor out host/gpu internal shaders interfaces")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25905>
(cherry picked from commit ce5472137fb57348da59c32944e4b126a8ae795c)

16 months agozink: don't block large vram allocations
Mike Blumenkrantz [Wed, 25 Oct 2023 17:32:22 +0000 (13:32 -0400)]
zink: don't block large vram allocations

I think this was masking some other problem that has long since been fixed

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25893>
(cherry picked from commit ac6139ad73f55595cb089d848d080f8e84689c34)

16 months agontt: lower indirect tesslevels in ntt
Neha Bhende [Tue, 17 Oct 2023 22:58:23 +0000 (15:58 -0700)]
ntt: lower indirect tesslevels in ntt

Tessellation shader which are using indirect
addressing for tesslevels e.g
  gl_TessLevelOuter[gl_InvocationID] = tessLevelOuter;
are crashing because gl_TessLevelOuter is now a
compact array variable and nir expects a constant
array index into the compact array variable.

This patch handles such cases.

This fixes MR 21940
Fixes: 84006587d7e5 ("glsl: Delete the lower_tess_level pass.")
Tested with glretrace

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25773>
(cherry picked from commit 8cfb46e27dfb12acdb1a00f7687a43899d770cca)

16 months agointel/fs: fix dynamic interpolation mode selection
Lionel Landwerlin [Mon, 23 Oct 2023 14:42:35 +0000 (17:42 +0300)]
intel/fs: fix dynamic interpolation mode selection

We can end up in situation where we are dispatched with a multisample
framebuffer but not at per-sample. In this case we would request the
at_sample value with the wrong message configuration.

Relying on the BRW_WM_MSAA_FLAG_MULTISAMPLE_FBO flag superseeds
BRW_WM_MSAA_FLAG_PERSAMPLE_DISPATCH.

Fixes piglit tests :

spec@arb_gpu_shader5@arb_gpu_shader5-interpolateatsample*

With Zink on Anv

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 68027bd38e ("intel/fs: implement dynamic interpolation mode for dynamic persample shaders")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25854>
(cherry picked from commit 439b0e86884eba55a4c25add9fe2763af1782b9f)

16 months ago.pick_status.json: Update to e64a97694ac9dc97f65e1a8e91a5c9789109fd2c
Eric Engestrom [Mon, 30 Oct 2023 15:46:58 +0000 (15:46 +0000)]
.pick_status.json: Update to e64a97694ac9dc97f65e1a8e91a5c9789109fd2c

16 months agoVERSION: bump for rc1
Eric Engestrom [Wed, 25 Oct 2023 20:29:33 +0000 (21:29 +0100)]
VERSION: bump for rc1

16 months agoanv: fix uninitialized use of compute initialization batch
Lionel Landwerlin [Wed, 25 Oct 2023 17:09:13 +0000 (20:09 +0300)]
anv: fix uninitialized use of compute initialization batch

We sometimes fail initialization.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 09d12e6727 ("anv: Add support for I915_ENGINE_CLASS_COMPUTE in init_device_state()")
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25891>

16 months agov3dv: fix confusing nomenclature about DRM nodes
Iago Toral Quiroga [Mon, 16 Oct 2023 08:52:01 +0000 (10:52 +0200)]
v3dv: fix confusing nomenclature about DRM nodes

We have been using drm_render_device to refer to the render device and
drm_primary_device to refer to the display device, but that is confusing
because the render device also has a primary node (for legacy reasons),
so don't use primary to refer to the display device.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25748>

16 months agoci: skip implicit modifier piglits for zink
Mike Blumenkrantz [Wed, 25 Oct 2023 12:40:58 +0000 (08:40 -0400)]
ci: skip implicit modifier piglits for zink

these may work coincidentally but not uniformly

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25299>

16 months agozink: delete some dead modifier handling
Mike Blumenkrantz [Tue, 19 Sep 2023 14:42:35 +0000 (10:42 -0400)]
zink: delete some dead modifier handling

this is no longer hit

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25299>

16 months agozink: blow up broken xservers more reliably
Mike Blumenkrantz [Tue, 19 Sep 2023 17:00:03 +0000 (13:00 -0400)]
zink: blow up broken xservers more reliably

only certain drivers can successfully run an xserver with implicit modifier
handling, and the rest will have broken rendering

until such time that a vk extension emerges to handle this more widely,
break this interop for drivers where it's already broken

fixes #9819

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25299>

16 months agozink: use weston for anv ci
Mike Blumenkrantz [Mon, 23 Oct 2023 13:41:43 +0000 (09:41 -0400)]
zink: use weston for anv ci

gotta get those juicy modifiers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25299>

16 months agoutil: skip zero-sized SHA1Update
Rhys Perry [Wed, 27 Sep 2023 14:55:25 +0000 (15:55 +0100)]
util: skip zero-sized SHA1Update

Fixes UBSan error:
src/util/sha1/sha1.c:140:8: runtime error: null pointer passed as argument 2, which is declared to never be null

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25853>

16 months agonir/lower_shader_calls: skip zero-sized qsort
Rhys Perry [Wed, 27 Sep 2023 13:23:09 +0000 (14:23 +0100)]
nir/lower_shader_calls: skip zero-sized qsort

Fixes UBSan:
src/compiler/nir/nir_lower_shader_calls.c:1681:7: runtime error: null pointer passed as argument 1, which is declared to never be null

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25853>

16 months agonir/serialize: fix signed integer overflow
Rhys Perry [Wed, 27 Sep 2023 13:01:21 +0000 (14:01 +0100)]
nir/serialize: fix signed integer overflow

Fixes UBSan error:
src/compiler/nir/nir_serialize.c:1277:70: runtime error: left shift of 524287 by 13 places cannot be represented in type 'int'

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25853>

16 months agonir/trivialize_registers: Handle obscure load hazard
Alyssa Rosenzweig [Tue, 24 Oct 2023 10:54:17 +0000 (06:54 -0400)]
nir/trivialize_registers: Handle obscure load hazard

Somebody less tired than me would add a unit test for this. Offending snippet:

        32    %58 = @load_reg (%55) (base=0, legacy_fabs=0, legacy_fneg=0)
        32    %57 = @load_reg (%55) (base=0, legacy_fabs=0, legacy_fneg=0)
        32    %21 = iadd %57, %15 (0x1)
                    @store_reg (%21, %55) (base=0, wrmask=x, legacy_fsat=0)
        32    %56 = @load_reg (%55) (base=0, legacy_fabs=0, legacy_fneg=0)
        32    %22 = i2f32 %56
        32    %23 = load_const (0x41000000 = 8.000000)
        32    %24 = fdiv %22, %23 (8.000000)
        32    %90 = mov %24
                    @store_reg_indirect (%90, %78, %58) (base=0, wrmask=x, legacy_fsat=0)

Closes: #10031
Fixes: d313eba94ef ("nir: Add pass for trivializing register access")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reported-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25865>

16 months agodocs/features: remove empty lines confusing mesamatrix
Karol Herbst [Wed, 25 Oct 2023 13:16:14 +0000 (15:16 +0200)]
docs/features: remove empty lines confusing mesamatrix

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25886>

16 months agoradv: report the last GPUVM fault when a device lost is detected
Samuel Pitoiset [Tue, 10 Oct 2023 08:44:00 +0000 (10:44 +0200)]
radv: report the last GPUVM fault when a device lost is detected

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238>

16 months agoradv: query and report the last GPUVM fault with RADV_DEBUG=hang
Samuel Pitoiset [Tue, 10 Oct 2023 08:43:38 +0000 (10:43 +0200)]
radv: query and report the last GPUVM fault with RADV_DEBUG=hang

Tested with a small use-after-free Vulkan test. It's pretty basic
for now but I think I will add status decoding support to report
more useful information.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238>

16 months agoradv/amdgpu: add support quering the last GPUVM fault
Samuel Pitoiset [Tue, 10 Oct 2023 08:43:21 +0000 (10:43 +0200)]
radv/amdgpu: add support quering the last GPUVM fault

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238>

16 months agoamd: add has_gpuvm_fault_query
Samuel Pitoiset [Thu, 25 May 2023 13:04:56 +0000 (15:04 +0200)]
amd: add has_gpuvm_fault_query

Whether the kernel allows to query the last GPUVM fault.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238>

16 months agoamd: update amdgpu_drm.h
Samuel Pitoiset [Tue, 10 Oct 2023 08:37:16 +0000 (10:37 +0200)]
amd: update amdgpu_drm.h

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238>

16 months agoradv: remove outdated RADV_DEBUG=vmfaults support
Samuel Pitoiset [Tue, 24 Oct 2023 07:29:41 +0000 (09:29 +0200)]
radv: remove outdated RADV_DEBUG=vmfaults support

It's been a very long time since this was useless because dmesg
required sudo access for a while.

This will be replaced by the new GPUVM fault interface which allows
to query from the kernel directly instead of trying to parse dmesg.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238>

16 months agozink: Fix SyntaxWarning in zink_extensions script
Seppo Yli-Olli [Wed, 25 Oct 2023 11:55:47 +0000 (11:55 +0000)]
zink: Fix SyntaxWarning in zink_extensions script

Fix regex pattern in zink_extensions to use proper escaping. While the original
code works, it relies on Python ignoring incorrect syntax and fallbacking to
passing through the escape. Current behaviour results in SyntaxWarning
whenever the code is used.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25881>