Commit graph

208830 commits

Author SHA1 Message Date
Eric Engestrom
d3ad9705dd ci: fix rustfmt job rules (one more case)
f065c2f0ac actually always triggers the rule it adds because
that commit itself changes one of these files, so the case where none of
these files are changed was not actually tested.

The two options are to drop the `changes:` line from that commit, to
make every staging pipeline run that job, or to add the missing
"no changes" corresponding rule, which this commit does, which aligns
with the "run when files changed, don't run otherwise" behaviour of the
other rules above.

Fixes: f065c2f0ac ("ci: fix rustfmt job rules")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36306>
(cherry picked from commit f4166ab1e1)
2025-07-23 14:34:43 +02:00
Timothy Arceri
8db845d788 util: add workaround for Interstellar Rift
Without this shaders fail to compile due to use of the texture2D
function.

Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36281>
(cherry picked from commit 971af9cf98)
2025-07-23 14:34:43 +02:00
Alyssa Rosenzweig
d12ffcd3de agx: make sure denorm flushing really happens
Backport-to: 25.1
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36147>
(cherry picked from commit ecc51d9b9b)
2025-07-23 14:34:43 +02:00
Erico Nunes
be29c3d741 lima: fix array limit in texture mipmap descriptor
Fix an off-by-one error in the texture mipmap descriptor code.
This fixes a segfault in applications that acutually use all
available mipmap levels.

Fixes: a3f827319f ("lima: add genxml for texture descriptor")

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36300>
(cherry picked from commit 92213f647e)
2025-07-23 14:34:43 +02:00
Yiwei Zhang
c3b3f80f7e u_gralloc/mapper4: properly expose ChromaSiting types based on api level
ChromaSiting::COSITED_VERTICAL and ChromaSiting::COSITED_BOTH only exist
in api level 35 and above.

Fixes: 64d18f84b0 ("u_gralloc/mapper4: fill u_gralloc_buffer_color_info properly")
Reported-by: Alessandro Astone <ales.astone@gmail.com>
Reviewed-by: Alessandro Astone <ales.astone@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36277>
(cherry picked from commit 2553628369)
2025-07-23 14:34:43 +02:00
Mike Blumenkrantz
3ac8f0de55 zink: remove extra gfx prog unref during separable replacement
programs start with one reference per contained shader. the only other
places they can be referenced are:
* batch refs
* merged separable programs during compile

this unref did not match any of those cases and caused early deletion

caselist:
dEQP-GLES31.functional.atomic_counter.inc.8_counters_5_calls_10_threads
dEQP-GLES31.functional.texture.filtering.cube_array.combinations.linear_mipmap_linear_linear_mirror_repeat
dEQP-GLES31.functional.texture.specification.texsubimage3d_pbo.rgb32i_cube_array
dEQP-GLES31.functional.texture.specification.texsubimage3d_pbo.rgb8_image_height_cube_array
dEQP-GLES31.functional.texture.specification.texsubimage3d_depth.depth24_stencil8_cube_array
dEQP-GLES31.functional.sample_shading.min_sample_shading.multisample_texture_samples_2_color
dEQP-GLES31.functional.vertex_attribute_binding.usage.mixed_usage.mixed_attribs_instanced_binding

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36294>
(cherry picked from commit 6570184201)
2025-07-23 14:34:43 +02:00
Mike Blumenkrantz
09f0cb9803 zink: account for generated tcs when pruning programs
this otherwise doesn't remove programs from the ctx cache before deletion

caselist:
KHR-GL46.shader_image_size.advanced-ms-tes-float
KHR-GL46.es_31_compatibility.shader_image_load_store.basic-allTargets-atomicVS
KHR-GL46.es_31_compatibility.shader_storage_buffer_object.basic-std140Layout-case4-vs

OR:
KHR-GL46.shader_atomic_counters.basic-usage-tes
KHR-GL46.es_31_compatibility.shader_storage_buffer_object.basic-stdLayout-case1-vs

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36294>
(cherry picked from commit f83b36f956)
2025-07-23 14:34:43 +02:00
Dylan Baker
082a1fa48c meson: set the legacy-x11 option as deprecated
Meson may be able to give better error messages and summary outputs when
this is set.

Fixes: 08c6ba223b ("x11: Remove DRI2 support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36126>
(cherry picked from commit 21a5501ece)
2025-07-23 14:34:43 +02:00
Ian Romanick
a2e59f1f7f nir/print: Don't segfault checking has_debug_info
For example, divergence analysis can call nir_print_instr with an
instruction that doesn't have a block set. When that happens,
print_state::shader will be NULL.

I stumbled on this while testing !36147.

v2: Use nir_instr::has_debug_info instead. Suggested by Konstantin.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Fixes: ce0f30b230 ("nir: Add variable debug info to instructions")
Fixes: 3aeab4ce40 ("nir/print: Do not print debug information when gathering it")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36267>
(cherry picked from commit 477c0cbbf9)
2025-07-23 14:34:43 +02:00
Lucas Fryzek
473be875f3 lp: Don't allocate sampler functions if count is 0
This prevents memory being allocated with a size
of 0 as the sampler count will be 0.

Fixes: #13539
Co-authored-by: Stéphane Cerveau <scerveau@igalia.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36165>
(cherry picked from commit b781ae57a5)
2025-07-23 14:34:43 +02:00
Mike Blumenkrantz
ed469ae6eb egl/x11: don't leak device_name when choosing zink
cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36268>
(cherry picked from commit 3951125f98)
2025-07-23 14:34:43 +02:00
Natalie Vock
67271e1e7f radv/winsys: Support vm_always_valid in the NULL winsys
A few device features (most importantly bufferDeviceAddress) are behind
a check for has_vm_always_valid. When replaying fossilize captures using
SPIR-V capabilities like PhysicalStorageBuffer addresses (which itself
depends on bufferDeviceAddress) on a null device, these features will be
hidden and replay will fail. Claim vm_always_valid support in the null
winsys - it's not like we'll ever create any BOs anyway.

Fixes: df1224c8 ("radv: rework VM_ALWAYS_VALID handling")
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36221>
(cherry picked from commit 87ebe6b31a)
2025-07-23 14:34:43 +02:00
Samuel Pitoiset
5b55dd73e7 radv: reject 1D block-compresed formats with mips on GFX6
GFX6 has general issues with 1D BCn formats.

Fixes recent VKCTS coverage
dEQP-VK.api.copy_and_blit.*image_to_buffer.1d_images.mip_copies_*.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36259>
(cherry picked from commit 9f725cf348)
2025-07-23 14:34:43 +02:00
Samuel Pitoiset
855abf6908 radv: fix reporting instance/vertex_count for direct draws with RGP on GFX12
This is a cursed interaction with RGP...

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36188>
(cherry picked from commit 1323a1194e)
2025-07-23 14:34:43 +02:00
Samuel Pitoiset
f3740a4440 radv: fix SQTT shaders relocation on GFX12
This fixes reporting ISA and instruction timing with RGP.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13525
Fixes: 098c15bfc9 ("radv: use paired shader registers for graphics on GFX12")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36188>
(cherry picked from commit 9965a344ae)
2025-07-23 14:34:43 +02:00
Karol Herbst
01548e00a1 rusticl/queue: clear shader images when destroying queues
The pipe_context might never be reused or the new queue won't ever reuse
all shader image slots leading to stale objects being referenced by the
driver.

Fixes: 50dbcb1d00 ("rusticl: stop clearing shader images after every dispatch")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36243>
(cherry picked from commit dad43d6c4a)
2025-07-23 14:34:43 +02:00
Karol Herbst
58c6cf4196 rusticl/mesa: use pipe_sampler_view_reference
pipe_sampler_views are reference counted, so we shouldn't delete them
directly.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36243>
(cherry picked from commit a245ed462a)
2025-07-23 14:34:43 +02:00
Karol Herbst
abe724f38d zink: properly unbind sampler views with imported 2D resource
Fixes: 7167214cab ("zink: support crazy CL buffer-to-texture extension")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36243>
(cherry picked from commit ff1c146453)
2025-07-23 14:34:43 +02:00
Mike Blumenkrantz
08442a9c94 zink: simplify sampler bufferview change for non-db path
all bufferviews are deduplicated now, so this deref is unnecessary

Fixes: ef3f798957 ("zink: prune zink_surface down to the imageview and create/fetch on demand")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36269>
(cherry picked from commit 32937b8804)
2025-07-23 14:34:43 +02:00
Jordan Justen
036ec0bb89 intel/dev: Add WCL PCI IDs
Tested with:

commit 3a252ff9d8b6dc22b20463bfcb31a4e8992b0e8f
Merge: 9800bf6fae3b 11895f375939
Author: Simona Vetter <simona.vetter@ffwll.ch>
Date:   Fri Jul 11 11:25:34 2025 +0200

Note that the kernel treats WCL similar to PTL, so 94de1dfd4729
("drm/xe/ptl: Drop force_probe requirement") also removed the
force_probe for WCL.

Backport-to: 25.1
Ref: 3c0f211bc8fc ("drm/xe: Add Wildcat Lake device IDs to PTL list")
Ref: 94de1dfd4729 ("drm/xe/ptl: Drop force_probe requirement")
Ref: drm/drm-next 3a252ff9d8b6dc22b20463bfcb31a4e8992b0e8f
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36148>
(cherry picked from commit bca1acbb42)
2025-07-23 14:34:43 +02:00
Jordan Justen
632253a5e3 intel/dev: Add WCL device info
Backport-to: 25.1
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36148>
(cherry picked from commit 8b771e8937)
2025-07-23 14:34:43 +02:00
Jordan Justen
a5115fcedd intel/dev/mesa_defs.json: Add WCL WA entries
Backport-to: 25.1
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36148>
(cherry picked from commit ffabca9101)
2025-07-23 14:34:43 +02:00
Jordan Justen
5f5174bcd1 intel/dev: Add WCL platform enum
Backport-to: 25.1
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36148>
(cherry picked from commit 23bc204faa)
2025-07-23 14:34:43 +02:00
Yiwei Zhang
c76107ab89 lavapipe: amend missing object finish on mem alloc failure
Missed since it was still vallium.

Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36252>
(cherry picked from commit 44e6f0abaa)
2025-07-23 14:34:43 +02:00
Pierre-Eric Pelloux-Prayer
6f7c725241 bufferobj: init the return value for GetParam functions
It's helping buggy applications that may use the returned
value without checking for an error first.

For instance, viewperf20/maya uses a sequence like this:
   glGenBuffers(n = 1, buffers = &3458)
   ...
   glGetNamedBufferParameteriv(3458, GL_BUFFER_SIZE, &p)

Since 3458 isn't associated to an object yet, _mesa_lookup_bufferobj_err
will return NULL, leaving 'p' with its original value.
It seems to randomly trigger an exit from the benchmark,
presumably because the content in 'p' is random (for instance
-1879044180).

Cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36190>
(cherry picked from commit d21c8e1bed)
2025-07-23 14:34:43 +02:00
Mary Guillemard
1c0d9dbb5f pan/genxml: Add missing parenthesis on pan_cast_and_pack macros
We were missing parenthesis on pan_cast_and_pack macros causing various
issues.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Fixes: 410e5a36ec ("pan/genxml: Rework gen_pack.py to support OpenCL")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36261>
(cherry picked from commit 455b93601a)
2025-07-23 14:34:43 +02:00
David Rosca
7707e7085b radeonsi/uvd: Set H264 gaps_in_frame_num_value_allowed_flag
Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36223>
(cherry picked from commit 4df3e56fe2)
2025-07-23 14:34:43 +02:00
Patrick Lerda
49af1f5a93 dri: fix image_loader_extensions array
NULL was forgotten.

This issue was detected by the gcc sanitizer.

==30873==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f94f9ad14b0 at pc 0x7f94f04905bc bp 0x7ffe3b1ebcf0 sp 0x7ffe3b1ebce8
READ of size 8 at 0x7f94f9ad14b0 thread T0
    #0 0x7f94f04905bb in loader_bind_extensions ../src/loader/loader.c:783
    #1 0x7f94ee656232 in setupLoaderExtensions ../src/gallium/frontends/dri/dri_util.c:88
    #2 0x7f94ee656232 in driCreateNewScreen3 ../src/gallium/frontends/dri/dri_util.c:111
    #3 0x7f94f98d9a14 in dri2_create_screen ../src/egl/drivers/dri2/egl_dri2.c:774
    #4 0x7f94f98dfbea in surfaceless_probe_device ../src/egl/drivers/dri2/platform_surfaceless.c:298
    #5 0x7f94f98dfbea in dri2_initialize_surfaceless ../src/egl/drivers/dri2/platform_surfaceless.c:390
    #6 0x7f94f98dbc4f in dri2_initialize ../src/egl/drivers/dri2/egl_dri2.c:861
    #7 0x7f94f98dbc4f in dri2_initialize ../src/egl/drivers/dri2/egl_dri2.c:832
    #8 0x7f94f9892843 in eglInitialize ../src/egl/main/eglapi.c:696

Fixes: 56ed5cf1bb ("dri: Get rid of __DRIbackgroundCallableExtension")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36255>
(cherry picked from commit 92dc71dd41)
2025-07-23 14:34:43 +02:00
Eric Engestrom
4ed42a8aaa ci: fix rustfmt job rules
Specifically, fe8bc3f23e made the "default" case `manual`
instead of `never`, which is causing all staging pipelines to have that
job regardless of any file `changes`, and always `manual` making it
block pipelines.

Let's make it automatic for upstream pipelines (ie. staging and
push-to-main), and only run on file `changes`.

Fixes: fe8bc3f23e ("ci: Only run rustfmt when necessary")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36260>
(cherry picked from commit f065c2f0ac)
2025-07-23 14:34:43 +02:00
Karol Herbst
bfe5d10a8b rusticl/queue: do not return event status errors on flush/finish
Fixes random fails in the test_events userevents test as it sets an event
to -1 and clFinish returned that error code making the test fail.

Fixes: 3129fd8dcf ("rusticl/queue: check device error status")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36250>
(cherry picked from commit 7ce8369985)
2025-07-23 14:34:43 +02:00
Mary Guillemard
d4201626c5 panvk: Fix nullDescriptor for dynamic descriptors
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Fixes: a789867cb4 ("panvk/v10+: Implement nullDescriptor support")
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36198>
(cherry picked from commit af5fb42080)
2025-07-23 14:34:43 +02:00
David Rosca
b550d78635 radv/video: Fix encode when using layered source image
Found by inspection.

Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36214>
(cherry picked from commit 211dc09e0f)
2025-07-23 14:34:43 +02:00
Rhys Perry
4d30564f2b nir/divergence: ignore boolean phis for ignore_undef_if_phi_srcs
The only user of this option (ACO) doesn't support this for boolean phis.

fossil-db (navi21):
Totals from 1208 (1.51% of 79825) affected shaders:
Instrs: 826592 -> 823201 (-0.41%); split: -0.41%, +0.00%
CodeSize: 4228296 -> 4224280 (-0.09%); split: -0.11%, +0.01%
Latency: 3030803 -> 3028410 (-0.08%); split: -0.08%, +0.01%
InvThroughput: 578588 -> 578693 (+0.02%); split: -0.00%, +0.02%
VClause: 19500 -> 19494 (-0.03%)
Copies: 60914 -> 57589 (-5.46%); split: -5.47%, +0.01%
PreVGPRs: 50759 -> 50774 (+0.03%)
VALU: 528582 -> 528671 (+0.02%); split: -0.00%, +0.02%
SALU: 121134 -> 117646 (-2.88%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Backport-to: 25.1
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13455
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13509
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36005>
(cherry picked from commit 8fd5266b69)
2025-07-23 14:34:42 +02:00
Asahi Lina
5188b2d4b5 asahi: Ensure shared BOs have a prime_fd
The GL driver expects special sync handling when a buffer is newly
exported, and also requires that bo->prime_fd be set so the batch code
can use it later. Add a function to do this for the KMS export case,
which otherwise would not need a PRIME fd.

agx_bo_export() then becomes a simple dup of bo->prime_fd (which is
probably marginally faster than redoing drmPrimeHandleToFD() anyway).

The thread safety story here is that as long as we do all this the first
time a BO is exported (in any way), there is no way for another thread
to have gotten ahold of the BO already, so no need for extra locking.

This does not affect hk, since it doesn't rely on bo->prime_fd for
anything. It also doesn't affect the timestamp BO and other special
cases.

Fixes: 067d820c9d ("asahi: Mark KMS exported resource BOs as shared")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13563
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36241>
(cherry picked from commit 140c625bda)
2025-07-23 14:34:42 +02:00
K900
4123ad67e1 gfxstream: fix build on 32-bit
VkDeviceMemory is always 64-bit, and %p on 32-bit is, well, 32-bit,
breaking the build.

There doesn't seem to be a good way to printf a Vulkan handle
cross-platform-ly, and it's unlikely to actually be useful,
so just don't print it at all.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36231>
(cherry picked from commit 0dc9108f7a)
2025-07-23 14:34:42 +02:00
Boyuan Zhang
b8a5b20e9b ci/fluster: remove 3 pass cases resulted by gaps_in_frame
These 3 failed tests are passing now by enabling the gaps_in_frame feature.
Therefore, remove all of them.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36056>
(cherry picked from commit 9b158d0512)
2025-07-23 14:34:42 +02:00
Boyuan Zhang
97e6394cf9 radeon/vcn: add gaps_in_frame flag to h264 sps
Implement gaps_in_frame_num_value_allowed_flag in h264 msg buffer.
Replace hardcoded flag values with defines.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36056>
(cherry picked from commit a63e5f015e)
2025-07-23 14:34:42 +02:00
Boyuan Zhang
749e0bc9b9 frontends/va: get gaps_in_frame for h264 dec
Get gaps_in_frame_num_value_allowed_flag value from Va-api interface.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36056>
(cherry picked from commit a7567ec6f4)
2025-07-23 14:34:42 +02:00
Boyuan Zhang
9da18789a1 pipe: add gaps_in_frame for h264
Add gaps_in_frame_num_value_allowed_flag to h264 sps struct.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36056>
(cherry picked from commit 587102196c)
2025-07-23 14:34:42 +02:00
Faith Ekstrand
829bdc2fdb nir/instr_set: Rework tex instr hash/compare
We were missing a couple bits from hash and a bunch of stuff from the
comparison.  This puts most of nir_tex_instr into a single pack_tex
helper that's used by both and grabs everything we were missing.

Cc: mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36234>
(cherry picked from commit 557ac588e4)
2025-07-23 14:34:42 +02:00
Vasily Khoruzhick
eec4d7bb69 lima: ppir: index SSA nodes the same way as we index registers
var_nodes size is x4 of nir defs count, since we need to track a node
for each individual channel of a register write. We don't need that for
SSA, but we used non-shifted indices for SSA, which made the compiler
reliant of reg nir def indeces to start after all the SSA indices.

That has changed with 7b70b419b528("nir: always index SSA defs before
printing").

Fix that by shifting SSA index as well, that would allow not to rely on
any assumptions on nir def indices.

Backport-to: 25.2
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36206>
(cherry picked from commit 2e38cbc40c)
2025-07-23 14:34:42 +02:00
Ruijing Dong
02a6e9137f radeonsi/vcn: vcn5 av1 decoding context buffer fix
In VCN5, the AV1 context buffer has changed to a bigger
one than VCN4. It fixed an AV1 decoding issue on VCN5.

Cc: mesa-stable

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36208>
(cherry picked from commit 32a2012975)
2025-07-23 14:34:42 +02:00
Yiwei Zhang
132471c61c lavapipe: do not short-circuit AHB export alloc (non-import)
Per spec VUID-VkMemoryAllocateInfo-pNext-01874:

If the parameters do not define an import operation, and the pNext chain
includes a VkExportMemoryAllocateInfo structure with
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID
included in its handleTypes member, and the pNext chain includes a
VkMemoryDedicatedAllocateInfo structure with image not equal to
VK_NULL_HANDLE, then allocationSize must be 0

- before: total 116, skip 66, pass 36, fail 14
- after:  total 116, skip 66, pass 50, fail 0

Fixes: cebb2bf266 ("lavapipe: Add AHB extension")
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36204>
(cherry picked from commit 209e402720)
2025-07-23 14:34:42 +02:00
Yiwei Zhang
e88186b30f lavapipe: populate AHB memory mapping
- before: total 116, skip 66, pass 36, fail 14
- after:  total 116, skip 66, pass 38, fail 12

Fixes: cebb2bf266 ("lavapipe: Add AHB extension")
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36204>
(cherry picked from commit 91c8372c67)
2025-07-23 14:34:42 +02:00
Yiwei Zhang
66ec573903 lavapipe: properly handle AHB release
Need to release the AHB ref upon vkFreeMemory.

Fixes: cebb2bf266 ("lavapipe: Add AHB extension")
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36204>
(cherry picked from commit faa71af431)
2025-07-23 14:34:42 +02:00
Yiwei Zhang
f634471a7c lavapipe: do not close import fd on error and amend an error code
The implementation only takes the ownership after a successful import.
On import failure, the caller is going to handle the fd. Meanwhile,
amend a missing error code on an error path.

Fixes: 895d3399f7 ("lavapipe: add support for KHR_external_memory_fd")
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36204>
(cherry picked from commit 160cd3a317)
2025-07-23 14:34:42 +02:00
Yiwei Zhang
b3285b1212 lavapipe: implement GetMemoryAndroidHardwareBufferANDROID
lvp hasn't used common device memory obj, and it allocates and imports
ahb on its own. Thus it has to implement the AHB export api itself.

- before: total 116, skip 66, pass 24, fail 26
- after:  total 116, skip 66, pass 36, fail 14

Fixes: cebb2bf266 ("lavapipe: Add AHB extension")
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36204>
(cherry picked from commit f1af533b2c)
2025-07-23 14:34:42 +02:00
Yiwei Zhang
c5aaeb3c4d lavapipe: allow AHB export allocation
This fix came from below error log:

> E MESA    : lavapipe: unimplemented external memory type 1024

Fixes: cebb2bf266 ("lavapipe: Add AHB extension")
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36204>
(cherry picked from commit 3167e30ee2)
2025-07-23 14:34:42 +02:00
David Rosca
509db43546 radeonsi/vcn: Correctly handle tile swizzle
Currently tile swizzle can only be non zero for single plane
formats, for multi plane formats we always set PIPE_BIND_SHARED.

Luma only (Y400) JPG decode and encode with RGB input surface (EFC)
are the only two cases where we can get surface with tile swizzle
and ignoring it would result in corrupted output.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13346
Acked-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35647>
(cherry picked from commit b665bd21cb)
2025-07-23 14:34:42 +02:00
Karol Herbst
3ea04c268d rusticl/mem: relax flags validation for clGetSupportedImageFormats
While the API spec does describe which flags _may_ be passed in, the
overall CL working group agreement is, that implementations should expect
random flags to be passed in as other implementations _may_ use them to
further restrict or allow image formats.

Also fix validation for importing GL objects while at it.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36216>
(cherry picked from commit d8793e3874)
2025-07-23 14:34:42 +02:00