Commit Graph

523 Commits

Author SHA1 Message Date
David Rosca
2089eaa39e frontends/va: Fix SyncSurface when used to sync coded buffer
This would skip the coded buffer fence wait if the surface fence is NULL.

Fixes: 0f20a3a4f1 ("frontends/va: Add surface pipe_fence for vl_compositor rendering")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35782>
(cherry picked from commit 53e3e44eb3)
2025-07-02 16:19:32 +02:00
Pierre-Eric Pelloux-Prayer
f3f56a8668 ac/virtio: fix alignment of metadata command
Command size must be aligned to 8.

Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 22263616ed ("amd: amdgpu-virtio implementation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34470>
(cherry picked from commit 3210484fe2)
2025-07-02 16:19:32 +02:00
Hans-Kristian Arntzen
11bc07dcf5 radv: Timestamps are not valid on dedicated sparse queue.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35766>
(cherry picked from commit ac16b8c439)
2025-07-02 16:19:32 +02:00
James Price
e9629998aa spirv: Fix cooperative matrix in OpVariable initializer
Check for cooperative matrix types first in the
nir_lower_variable_initializers pass, since they are also considered
to be scalar types.

Fixes: 7e6cd395c7 ("nir: Handle cmat types in lower_variable_initializers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13388
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35668>
(cherry picked from commit 10ae673368)
2025-07-02 16:19:32 +02:00
Konstantin Seurer
b474d8e858 lavapipe: Suspend conditional rendering around ray tracing dispatches
cc: mesa-stable

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35754>
(cherry picked from commit 131b917246)
2025-07-02 16:19:32 +02:00
mojyack
27df7b4a8c mesa: reorder mesa format corresponding to GL_BGRA
current `st_ChooseTextureFormat(..., internalFormat=GL_BGRA8, ...)`
returns `PIPE_FORMAT_R8G8B8A8_UNORM`.
this causes significant performance loss in apps that use BGRA texture
format(e.g. firefox) when transferring textures because of format
conversions, if the driver doesn't support PIPE_TEXTURE_TRANSFER_BLIT.
fix this by modifying the texture format mapping.

See Also: https://community.mnt.re/t/poor-browser-performance/2042/30

Signed-off-by: mojyack <mojyack@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Backport-to: 25.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35678>
(cherry picked from commit db383ceb64)
2025-07-02 16:19:32 +02:00
Pierre-Eric Pelloux-Prayer
74e35799b2 radeonsi: transition to TC-compatible HTILE on full clears
The new layout affects the whole buffer so it needs to be done
on a full clear.

This fixes this piglit test on a RX 6800 XT:
   ext_framebuffer_multisample-accuracy 6 depth_resolve small depthstencil

Fixes: 75a03d733a ("radeonsi: simplify and fix enable_tc_compatible_htile_next_clear logic")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35582>
(cherry picked from commit 04d283c628)
2025-07-02 16:19:31 +02:00
Samuel Pitoiset
d9b72d2987 radv: gather nir shader info at the end of radv_optimize_nir()
Otherwise, outputs_read/outputs_written might not be up-to-date
(mostly after nir_remove_dead_variables) and remove_point_size() might
reach an assertion later because the output variable isn't found.

It seems better to run nir_shader_gather_info() at the very end of
radv_optimize_nir() which can change a lot of things anyways.

No fossils-db changes.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35707>
(cherry picked from commit 30ccd97cd2)
2025-07-02 16:19:31 +02:00
Rob Clark
8a8f5b6962 freedreno/a6xx: Fix max_threads to account for reg footprint
The register footprint could limit occupancy.  We need to take this into
account to avoid deadlocks when a kernel is using barriers.

Fixes: 6d85cd6a3b ("freedreno: Implement get_compute_state_info for Adreno 6xx/7xx")
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35745>
(cherry picked from commit 2e00925c81)
2025-07-02 16:19:31 +02:00
Eric Engestrom
27ba4a7eab freedreno/drm: fix libvdrm inclusion logic
Fixes: 0e3584df44 ("freedreno/drm/virtio: Switch to vdrm helper")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35723>
(cherry picked from commit 2801c51a9e)
2025-07-02 16:19:31 +02:00
Eric Engestrom
1bc18de415 meson: fix vdrm inclusion logic
This is about which driver use vdrm, not which OS we're on.

Fixes the build on non-KMS/DRM system.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12899
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35723>
(cherry picked from commit a1daeb87a8)
2025-07-02 16:19:31 +02:00
Eric Engestrom
b615e50845 meson: allow "venus without virgl" builds
`cc: mesa-stable` instead of `fixes:` because several commits have
modified this but keeping this bug:
- 06e57e3231 ("virtio: Add vdrm native-context helper") made
  an unconditional copy of subdir(virtio)
- cede4e7ac3 ("meson: Only include virtio when DRM available")
  introduced a new condition, which doesn't cover everything that was
  needed
- other commits made more changes

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35723>
(cherry picked from commit d0c7bea727)
2025-07-02 16:19:31 +02:00
Antonino Maniscalco
b5964cd623 zink: wait for sparse queue to go idle
When destroying the context we should also wait for the sparse queue to
go idle.

cc: mesa-stable

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35750>
(cherry picked from commit 8ea0b00a75)
2025-07-02 16:19:31 +02:00
Pierre-Eric Pelloux-Prayer
f8411611b3 radeonsi: check set_debug_callback before use
The callback might not be installed yet if si_create_context fails
early.

Fixes: 59a3f38ff6 ("radeonsi: clear the debug callback on ctx destroy")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35733>
(cherry picked from commit 613e9e9c23)
2025-07-02 16:19:31 +02:00
Adrián Larumbe
a4b30d9fd0 panfrost: Add missing util_range_init()
It was absent when initialising a panfrost_resource from a winsys handle.

Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Fixes: 7da251fc72 ("panfrost: Check in sources for command stream")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34224>
(cherry picked from commit cf4a137459)
2025-07-02 16:19:31 +02:00
Adrián Larumbe
e1f6a0c4df panfrost: Fix Panfrost BO leak in error handling path
When panfrost_resource_init_afbc_headers() fails, freeing the newly
created resource is not enough, because we need to unreference its BOs.
This will also take care of freeing its resource label.

Also replace instances of FREE() in error-handling paths with
panfrost_resource_destroy(), as it is capable of handling partially
initialised resources.

Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Fixes: e3f2bc7963 ("panfrost: handle mmap failures")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34224>
(cherry picked from commit 32b128be01)
2025-07-02 16:19:31 +02:00
Romaric Jodin
c76a7410dc panvk: fix bi_emit_alu calling bi_make_vec_to
bi_emit_alu needs to fully set the vector of bi_index pass to
bi_make_vec_to, as it is expected by the callee.

Fixes: 3cc6a4c5 ("pan/bi: Handle swizzles in i2i8")
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35642>
(cherry picked from commit bc973d687c)
2025-07-02 16:19:31 +02:00
Emma Anholt
2fb2db4d3a turnip: Fix subpass depth/stencil change detection.
Subpass had a postfix increment, not prefix, so last_subpass was the same
as subpass.

Fixes: 550975f229 ("turnip: Don't disable LRZ in subpasses after the first in the easy case.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17943>
(cherry picked from commit 2b0e6f42de)
2025-07-02 16:19:31 +02:00
Emma Anholt
69d345c4f6 freedreno/a2xx: Disable interpolated input intrinsics.
We never wanted them, it appears to be a refactor bug.

Fixes: 25d4943481 ("nir: make use_interpolated_input_intrinsics a nir_lower_io parameter")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8431>
(cherry picked from commit 5a3300f4a3)
2025-07-02 16:19:31 +02:00
Patrick Lerda
b89b1ffb2b r600: fix emit_image_load_or_atomic() snorm formats
The snorm formats are not compatible with the srf flag
which was set by the emit_image_load_or_atomic() function.
In this specific case, "use_const_fields" is not set which
implies that the format definition is local. The other
supported formats do not require the srf flag as well.

This change was tested on cypress, barts and cayman. Here are the tests fixed:
khr-gl4[2-6]/shader_image_load_store/basic-allformats-load: fail pass
khr-gl4[2-6]/shader_image_load_store/basic-alltargets-loadstorecs: fail pass
khr-gl4[5-6]/es_31_compatibility/shader_image_load_store/basic-allformats-loadstorecomputestage: fail pass
khr-gl4[5-6]/es_31_compatibility/shader_image_load_store/basic-alltargets-loadstorecs: fail pass
khr-gles31/core/shader_image_load_store/basic-allformats-loadstorecomputestage: fail pass
khr-gles31/core/shader_image_load_store/basic-alltargets-loadstorecs: fail pass
deqp-gles31/functional/image_load_store/2d/format_reinterpret/r32f_rgba8_snorm: fail pass
deqp-gles31/functional/image_load_store/2d/format_reinterpret/rgba8_rgba8_snorm: fail pass
deqp-gles31/functional/image_load_store/2d_array/format_reinterpret/r32f_rgba8_snorm: fail pass
deqp-gles31/functional/image_load_store/2d_array/format_reinterpret/rgba8_rgba8_snorm: fail pass
deqp-gles31/functional/image_load_store/3d/format_reinterpret/r32f_rgba8_snorm: fail pass
deqp-gles31/functional/image_load_store/3d/format_reinterpret/rgba8_rgba8_snorm: fail pass
deqp-gles31/functional/image_load_store/buffer/format_reinterpret/r32f_rgba8_snorm: fail pass
deqp-gles31/functional/image_load_store/buffer/format_reinterpret/rgba8_rgba8_snorm: fail pass
deqp-gles31/functional/image_load_store/cube/format_reinterpret/r32f_rgba8_snorm: fail pass
deqp-gles31/functional/image_load_store/cube/format_reinterpret/rgba8_rgba8_snorm: fail pass

Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35548>
(cherry picked from commit d27ed38d1a)
2025-07-02 16:19:31 +02:00
Patrick Lerda
72ccce7953 r600: make vertex r10g10b10a2_snorm conformant on palm and beyond
The mode r10g10b10a2_snorm processed as vertex on palm at the
hardware level doesn't follow the current standard. Indeed, the .w
component (2-bits) is not calculated as expected. The table below
describes the situation.

This change fixes this issue by adding three gpu instructions at
the vertex fetch shader stage. An equivalent C representation and
a gpu asm dump of the generated sequence are available below.

.w(2-bits) expected	palm
0	    0.0		0.000000
1 	    1.0		0.333333
2	   -1.0		0.666667
3	   -1.0		1.000000

w_out = (4.*w_in > 1. ? 1. : 4.*w_in) - (w_in > 0.5 ? 2. : 0.);

0002 00000008 A0080000  ALU 3 @16
 0016 00000C02 A0000CC0     1 y:     MOV*4_sat              __.y,  R2.w
 0018 801F8C02 600004A0       w:     SETGT*2                __.w,  R2.w, 0.5
 0020 839FC4FE 60400010     2 w:     ADD                    R2.w,  PV.y, -PV.w

Note: The rv770 and cypress don't need this correction. This is
definitely a hardware change between these gpus.

This change was tested on palm, barts and cayman. Here are the tests fixed:
spec/arb_vertex_type_2_10_10_10_rev/arb_vertex_type_2_10_10_10_rev-array_types: fail pass
deqp-gles3/functional/draw/random/124: fail pass
deqp-gles3/functional/vertex_arrays/single_attribute/normalize/int2_10_10_10/components4_quads1: fail pass
deqp-gles3/functional/vertex_arrays/single_attribute/normalize/int2_10_10_10/components4_quads256: fail pass
khr-gl43/vertex_attrib_binding/basic-input-case5: fail pass
khr-gl44/vertex_attrib_binding/basic-input-case5: fail pass
khr-gl45/vertex_attrib_binding/basic-input-case5: fail pass

Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32427>
(cherry picked from commit e8fa3b4950)
2025-07-02 16:19:31 +02:00
Lionel Landwerlin
8a951265e0 anv: fix sampler hashing in set layouts
The logic needs to handle embedded samplers without conversion state.

Fixes vkd3d-proton's test_sampler_border_color

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35679>
(cherry picked from commit 786bace191)
2025-07-02 16:19:31 +02:00
Lionel Landwerlin
1dde4bccd4 anv: fix clears on single aspect of YCbCr images
Fixes vkd3d-proton's test_planar_video_formats

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35679>
(cherry picked from commit 32b53a7c6a)
2025-07-02 16:19:30 +02:00
Lionel Landwerlin
e4f52e75ef isl: handle DISABLE_AUX in get_mcs_surf
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35679>
(cherry picked from commit 691ac65000)
2025-07-02 16:19:30 +02:00
Doug Nazar
813fe7e59d glx: Fix memory leak with software dri
dri_screen_init() now calls glx_screen_init() directly. Calling
twice overwrites the config.

Fixes: 7930fe5f01 ("glx: unify dri screen init")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35525>
(cherry picked from commit c3980bb4ec)
2025-07-02 16:19:30 +02:00
Alyssa Rosenzweig
6d258a379e asahi,hk: fix ts allocation for more shader types
3c5c3d7819 ("hk: fix texture state count"), part 2.

Backport-to: 25.1
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35662>
(cherry picked from commit cdb4463b52)
2025-07-02 16:19:30 +02:00
Eric Engestrom
d994ff9c89 intel/compiler tests: fix variable type for getopt_long() return value
`getopt_long()` returns an `int`, not a `char`; putting the value in
a `char` before comparing it to `-1` was making the comparison always
fail, resulting in the invalid codepath taken that then fails with:

    option `-' is invalid: ignored

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34756>
(cherry picked from commit 99e8d804bf)
2025-07-02 16:19:30 +02:00
Eric Engestrom
08edf564a7 intel/compiler tests: fix "is there something after the options" check
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34756>
(cherry picked from commit f545f9eed4)
2025-07-02 16:19:30 +02:00
Eric Engestrom
f36dcedc36 intel/compiler tests: fix path-to-string conversion
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34756>
(cherry picked from commit 729922cdae)
2025-07-02 16:19:30 +02:00
Eric Engestrom
aea08bbb1f intel/compiler tests: rewrite subprocess handling in run-test.py
`subprocess.Popen()` returns immediately, and the subprocess might not
have finished by the time `stdout` is read on the next line, spuriously
failing the tests.

`subprocess.check_output()` makes sure the output is available before
returning, solving this issue; it additionally raises an error if the
subprocess failed, giving a better error than a failed diff later in the
script.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34756>
(cherry picked from commit de6ab1beda)
2025-07-02 16:19:30 +02:00
Eric Engestrom
22debc9b65 hasvk: only run tests on x86 (32 & 64 bit)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13305
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35635>
(cherry picked from commit 6addaca3d4)
2025-07-02 16:19:30 +02:00
Yiwei Zhang
1e63392359 u_gralloc/mapper4: fill u_gralloc_buffer_color_info properly
Clients are expecting the color info to be fully filled when the api
exists. Give proper defaults for the metadata to stay aligned with
legacy backends.

Also amend the missing ChromaSiting cases.

Fixes: ee42e2166d ("android: Introduce the Android buffer info abstraction")
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35613>
(cherry picked from commit 64d18f84b0)
2025-07-02 16:19:30 +02:00
Yiwei Zhang
8ce5dadcce u_gralloc/mapper5: fill u_gralloc_buffer_color_info properly
Clients are expecting the color info to be fully filled when the api
exists. Give proper defaults for the metadata to stay aligned with
legacy backends.

Fixes: 122fd46b15 ("Android15 support gralloc IMapper5")
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35613>
(cherry picked from commit 0ac1e05f65)
2025-07-02 16:19:30 +02:00
Mike Blumenkrantz
fd81fda9ef zink: don't use TRANSFER bit as default pipeline stage if no access is set
should be TOP_OF_PIPE

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35476>
(cherry picked from commit cb026adc4c)
2025-07-02 16:19:30 +02:00
Yiwei Zhang
8701d0e4da radv: relax the native_handle_t::numFds requirement
For modern gralloc impl, usually there's other fds appended in the
native_handle_t for gralloc buffer metadata sharing. So numFds can be
greater than 1, while the common agreement is still that the format
plane handles being placed at the beginning in the lack of a standard
format plane fd metadata query mapper api.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13163

Cc: mesa-stable
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35038>
(cherry picked from commit 41d241bf6e)
2025-07-02 16:19:30 +02:00
Erik Faye-Lund
653f9e1239 pan/bi: rework memory barriers
The MEMORY_BARRIER instruction has some issues, where we end up
dead-code eliminating it before it gets to do what it's supposed to do.

But even if we fix that, we have issues where we can end up inserting
flow control into it, which isn't going to work because we have nothing
to emit here either.

So let's rework this to a special-cased NOP instruction, which is marked
as a scheduling barrier. The beneft here is that NOPs are already properly
handled when it comes to flow control.

Note that this isn't perfect either; this only prevents memory operations
from crossing the scheduling barrier. We should really prevent any
operation with observable side effects from crossing the barrier. This
includes things like reading clocks etc.

But that's a larger change, and it's a step in the right direction to get
this to no longer be dead-code eliminated. So let's put this band-aid on
for now.

Fixes: f77a50e45e ("pan/bi: add a MEMORY_BARRIER pseudo-instruction")
Reviewed-by: Caterina Shablia <caterina.shablia@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35502>
(cherry picked from commit 18893a250f)
2025-07-02 16:19:30 +02:00
Eric Engestrom
33f6a87b75 .pick_status.json: Mark 3778b22268 as denominated 2025-07-02 16:19:30 +02:00
Marek Olšák
be5227e654 radeonsi: don't clamp the shadow comparison value for nir_texop_lod on gfx8-9
It doesn't have the value. This fixes a crash on gfx8-9.

Cc: mesa-stable

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35344>
(cherry picked from commit 56ed949e08)
2025-07-02 16:19:30 +02:00
Lionel Landwerlin
cd001c54a5 anv: only use compressed memory types on Xe2+
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 252cac1e5c ("anv: avoid memory type changes with INTEL_DEBUG=noccs")
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35615>
(cherry picked from commit bfee389f0c)
2025-07-02 16:19:29 +02:00
Rhys Perry
be6ede15eb aco/lower_branches: keep blocks with multiple logical successors
It might be the case that both the branch and exec mask write in a
divergent branch block are removed. try_remove_simple_block() might then
try to remove it, but fail because it has multiple logical successors.
Instead, just skip these blocks.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Backport-to: 25.1
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35202>
(cherry picked from commit 5344abbc56)
2025-07-02 16:19:29 +02:00
Olivia Lee
bbb75759ef panvk: return error when mmap fails in BindImageMemory2 and BindBufferMemory2
Previous code crashed with an assertion failure in this case.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Fixes: 211aa20194 ("panvk: Move away from panfrost_{bo,device}")
Reviewed-by: John Anthony <john.anthony@arm.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35528>
(cherry picked from commit b31dee9b7e)
2025-07-02 16:19:29 +02:00
Olivia Lee
67e969ee89 panfrost: fix depth clip range with u_blitter
u_blitter sets a viewport transform with depth range [-1,1], which is
outside the [0,1] range that is allowed by opengl.

The mali hardware docs state that setting the LOW_DEPTH_CLAMP register
outside of [0,1] is undefined behavior. We haven't observed any problems
with this so far, but better to fix it.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Fixes: 810135fb42 ("gallium/u_blitter: Fix depth.")
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35225>
(cherry picked from commit b8c7fcda27)
2025-07-02 16:19:29 +02:00
Christopher Gautier
ebae6797d6 panfrost, panvk: The size of resource tables needs to be a multiple of 4.
The HW specifications require the size of shader resource tables to be a
multiple of 4, otherwise correct behaviour is not guaranteed.

Fixes: 713f5c3600 ("panvk: Prepare the cmd_desc_state logic for Valhall")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35553>
(cherry picked from commit 48e8d6d207)
2025-07-02 16:19:29 +02:00
Faith Ekstrand
f9b1adcc7e nir/lower_input_attachments: Don't ignore tex coordinates
The SPIR-V spec is pretty clear that coordinates on subpass attachments
are relative to the current pixel.  They're required to be zero but we
should stay consistent with ourselves (we already do this for image
intrinsics) and with the spec.

Fixes: 84b08971fb ("nir/lower_input_attachments: lower nir_texop_fragment_{mask}_fetch")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35551>
(cherry picked from commit 2c13e1e655)
2025-07-02 16:19:29 +02:00
Faith Ekstrand
1631acbd52 nir/lower_input_attachments: Stop assuming tex src indices
There's nothing in NIR which guarantees that the deref is the first
source or that the coordinate is the second.  Use
nir_tex_instr_src_index() to get the actual indices.

Fixes: 84b08971fb ("nir/lower_input_attachments: lower nir_texop_fragment_{mask}_fetch")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35551>
(cherry picked from commit 9a52b9372c)
2025-07-02 16:19:29 +02:00
Ryan Houdek
551045b217 tu: Fixes missing sse2 flags
Turnip when cross-compiled for i386 needs to be built with SSE2 as a
minimum spec, as it uses clflush unconditionally. Make sure to pass in
the sse2_args, which will be empty on Arm64 targets.

Fixes: 7231eef630
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35621>
(cherry picked from commit f872cbea37)
2025-07-02 16:19:29 +02:00
Emma Anholt
312c62a6d7 intel/shim: Report support for PXP status.
Otherwise drm-shim complains on every shader-db run.

Fixes: e358173fbf ("iris: Add GET_PARAM for protected context capability support")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25190>
(cherry picked from commit 1b6689d79e)
2025-07-02 16:19:29 +02:00
Sagar Ghuge
1cf750367a anv: Apply flush during WriteAccelerationStructures
We are reading accel header parameter those are updated by CS, so we
need to apply flushes to make L3 coherent with CS.

This fixes ray query tests on MTL:
- dEQP-VK.ray_query.*.serialization.*

Cc: mesa-stable

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35590>
(cherry picked from commit a676ba9294)
2025-07-02 16:19:29 +02:00
José Roberto de Souza
b09fcbc09b Revert "anv: Enable preemption due 3DPRIMITIVE in GFX 12"
Enabling preemption in 3DPRIMITIVE is causing glitches on Dota 2,
so reverting this until the issue with preemption is fixed.

This reverts commit 3cd972a2d3.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13289
Fixes: 12ddaa6b8b ("anv: Enable preemption due 3DPRIMITIVE in GFX 12")
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35586>
(cherry picked from commit 37f4182ac3)
2025-07-02 16:19:29 +02:00
Georg Lehmann
5afe7c8f1a nir/opt_intrinsic: fix inclusive scan rewrite with multiple uses
Modifying the iterated list is a footgun, so just create a new instruction.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13364
Fixes: 5c70a55bf3 ("nir/opt_intrinsics: optimize (exclusive_scan(op, a) op a) to inclusive scan")

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35577>
(cherry picked from commit e9c886c331)
2025-07-02 16:19:29 +02:00