Commit graph

71677 commits

Author SHA1 Message Date
Samuel Pitoiset
8434109b0c zink/ci: update list of expected failures for NAVI31
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36280>
2025-07-22 06:54:15 +00:00
Karol Herbst
15b4ecf104 rusticl/kernel: unbind trailing shader images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36243>
2025-07-21 22:37:04 +00:00
Karol Herbst
aa5f8b9d35 rusticl/queue: cache samplers
OpenCL doesn't really allow a wide range of different samplers, so the
cache hit rate is pretty high across all applications.

This also allows us to stop unbinding samplers after each kernel launch.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36243>
2025-07-21 22:37:04 +00:00
Karol Herbst
eb904cd51c rusticl/kernel: stop clearing sampler views on kernel launches
Instead we just unbind on the next launch by using the
unbind_num_trailing_slots parameter.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36243>
2025-07-21 22:37:03 +00:00
Karol Herbst
2e54e8e89e rusticl/queue: remove RefCell<QueueKernelState>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36243>
2025-07-21 22:37:03 +00:00
Karol Herbst
e6dc4ceaf1 rusticl/queue: commit lifetime crimes
For annoying reasons we need to add another layer of wrapping around the
queues PipeContext so that we can finally start to turn a few methods &mut
self.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36243>
2025-07-21 22:37:02 +00:00
Karol Herbst
b291ca1b65 rusticl/queue: pass a mut reference to QueueContext around
It better reflects the ownership, but also allows us to clean up a few
things.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36243>
2025-07-21 22:37:01 +00:00
Karol Herbst
dad43d6c4a 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>
2025-07-21 22:37:01 +00:00
Karol Herbst
a245ed462a 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>
2025-07-21 22:37:01 +00:00
Karol Herbst
ff1c146453 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>
2025-07-21 22:37:00 +00:00
Karol Herbst
23be1f10e2 rusticl/kernel: fix clippy lint needless-question-mark
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36243>
2025-07-21 22:37:00 +00:00
Mike Blumenkrantz
32937b8804 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>
2025-07-21 21:48:31 +00:00
Pierre-Eric Pelloux-Prayer
ae1aeafe49 radeonsi/gfx12: dont use HTILE for imported textures
Same as other chips.

Reviewed-by: Ganesh Belgur Ramachandra <ganesh.belgurramachandra@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36228>
2025-07-21 19:22:40 +00:00
Pierre-Eric Pelloux-Prayer
7c2a9e8d2a radeonsi: fix refcount with memobj
The existing refcounting code is correct, unless si_texture_from_winsys_buffer
fails in which case we get a refcount error.

The error code path will use si_texture_reference(&tex, NULL), which
will drop a reference to the memobj buffer, but none was taken yet.

Reviewed-by: Ganesh Belgur Ramachandra <ganesh.belgurramachandra@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36228>
2025-07-21 19:22:40 +00:00
Pierre-Eric Pelloux-Prayer
7ed553ba09 radeonsi/tests: enable vk interop testing
Reviewed-by: Ganesh Belgur Ramachandra <ganesh.belgurramachandra@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36228>
2025-07-21 19:22:40 +00:00
Nanley Chery
e3503d3416 iris: Drop iris_resource_image_is_pat_compressible
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The functionality is provided by isl_surf_supports_ccs().

Also, move the protected content restriction to
iris_resource_configure_aux(). I'm not aware of any reason protected
content wouldn't support CCS. However, to keep this series simple,
enabling that combination is left for another time.

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32120>
2025-07-21 18:36:31 +00:00
Nanley Chery
c769790695 iris: Fix image reallocation for sharing
On XeKMD, BOs need to be created with a vm_id of zero in order to get
prime handles. That only occurs if the image was created with
PIPE_BIND_SHARED/BO_ALLOC_SHARED. Ensure that shareable images have this
flag in iris_flush_resource().

Fixes the dmabufshare demo on BMG with INTEL_DEBUG=noccs and mesa hacked
to disable suballocation.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13511
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32120>
2025-07-21 18:36:31 +00:00
Nanley Chery
28938e2167 iris: Add PIPE_BIND_SCANOUT when exporting textures
I don't see anything preventing images from being used for display via
EGL_MESA_image_dma_buf_export. When CCS is enabled on linear surfaces in
a future patch, this will prevent exported DRM_FORMAT_MOD_LINEAR images
from being compressed.

On BMG, this fixes the mesa demo, dmabufshare:
https://gitlab.freedesktop.org/mesa/demos/-/blob/main/src/egl/opengl/dmabufshare.c

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32120>
2025-07-21 18:36:31 +00:00
Nanley Chery
fa9f359b91 iris: Disable fast-clears on linear surfaces
Bspec 57340 does not have a fast-clear rectangle for linear surfaces.

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32120>
2025-07-21 18:36:31 +00:00
Yiwei Zhang
ab6141561d lavapipe: use common tracked size and override if needed
For lavapipe, there's no need for a separate internally tracked size.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36252>
2025-07-21 18:19:50 +00:00
Yiwei Zhang
addd65241a lavapipe: use common export and import info tracked
The AHB type is no longer needed there as the assert check is no longer
used on the export path. One less DETECT_OS_ANDROID.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36252>
2025-07-21 18:19:50 +00:00
Yiwei Zhang
a7beff896e lavapipe: use common host ptr info
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36252>
2025-07-21 18:19:49 +00:00
Yiwei Zhang
d360ea7762 lavapipe: drop redundant memory type index tracking
...since it's not used anywhere

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36252>
2025-07-21 18:19:49 +00:00
Yiwei Zhang
63aedb5922 lavapipe: use common vk_device_memory::ahardware_buffer
This drops most of the lavapipe specific codes for AHB handling.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36252>
2025-07-21 18:19:48 +00:00
Yiwei Zhang
0e77c3e44d lavapipe: do not early return for mem alloc size being zero
Per spec VUID-VkMemoryAllocateInfo-allocationSize-07897

> If the parameters do not define an import or export operation,
  allocationSize must be greater than 0.

So early return there is simply messing up with external memory.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36252>
2025-07-21 18:19:48 +00:00
Yiwei Zhang
7cd8510240 lavapipe: adopt common vk_device_memory
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36252>
2025-07-21 18:19:47 +00:00
Yiwei Zhang
44e6f0abaa 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>
2025-07-21 18:19:47 +00:00
Erik Faye-Lund
69b98dfec3 panfrost: enable robust_buffer_access_behavior
This is already supported on at v6 and later, so let's enable it.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31868>
2025-07-21 17:16:35 +00:00
Boris Brezillon
0122df0262 panfrost: Log when an unusable group caused a context re-initialization
Useful to track GPU context re-initialization.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31868>
2025-07-21 17:16:35 +00:00
Boris Brezillon
a54c39e460 panfrost: Add a GPU fault injection mechanism
Every PAN_FAULT_INJECTION_RATE allocation from a mempool, we generate an
invalid GPU address which will cause a GPU fault.

This is useful to debug the GPU reset / context recover path.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31868>
2025-07-21 17:16:35 +00:00
Boris Brezillon
4eb3e865ce panfrost: Add get_device_reset_status() to the CSF backend
Panthor can report the group state, so let's provide a
get_device_reset_status() querying this state and turning it into a
pipe_reset_status status.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31868>
2025-07-21 17:16:35 +00:00
David Rosca
4df3e56fe2 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>
2025-07-21 16:13:26 +00:00
Valentine Burley
2b871958dc freedreno/ci: Streamline using common a6xx-skips
Use the existing DRIVER_NAME mechanism to pick up common skips.
This is less error prone than manually adding the skips.

A redundant freedreno-a618-skips.txt is also dropped, as it's already
included via GPU_VERSION.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36215>
2025-07-21 15:35:25 +00:00
Valentine Burley
89fc986e9f freedreno/ci: Remove a630 jobs
The cheza runners were decommissioned.

Rename the restricted trace results to a618 (same GPU generation) to keep
the history.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36215>
2025-07-21 15:35:25 +00:00
Alyssa Rosenzweig
a85219f89f asahi: use tex builders
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36050>
2025-07-21 12:11:42 +00:00
Alyssa Rosenzweig
d1f5953965 freedreno: use tex builder
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36050>
2025-07-21 12:11:42 +00:00
Alyssa Rosenzweig
6b34e2174e nir: introduce ergonomic tex builder
for intrinsics, we have these really nice builders using designated initializers
+ macros to specify optional indices. texture instrs have even more craziness
involved, but we can do the same trick. this commit takes the existing "fixed
form" deref-centric tex builders and generalizes them to work with non-deref
textures, making it useful also for GL and late VK passes, while providing an
API that strives to be ergonomic and consistent.

this series only implements a subset of possible texture operations for now, but
more generalizing could be added as people have need.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36050>
2025-07-21 12:11:41 +00:00
Alyssa Rosenzweig
2dd91b0d1c agx: simplify block image store offset
just make 32-bit offset.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36257>
2025-07-21 11:42:20 +00:00
Alyssa Rosenzweig
ecfca8ec6f util: crib SWAP macro from freedreno
we have a bunch of copies across the tree, unify them.

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/36257>
2025-07-21 11:42:18 +00:00
Karol Herbst
7ce8369985 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>
2025-07-21 11:26:52 +00:00
David Rosca
21573c3d2d radeonsi/video: Use ac_modifier_supports_video
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36192>
2025-07-21 10:56:34 +00:00
Marek Olšák
c1a939ca11 gallium: replace get_compiler_options with pipe_screen::nir_options
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36094>
2025-07-21 00:18:20 +00:00
Marek Olšák
a30f1fa7f0 gallium: make pipe_screen::finalize_nir return void
The returned message was replaced by create_xx_state returning the message.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36094>
2025-07-21 00:18:20 +00:00
Lucas Stach
5afcf93a59 etnaviv: use new shader range registers when icache is present
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
As seen in the Vivante kernel driver context init, GPUs with the icache
feature have a new set of states to specify the shader ranges. While the
old state still seems to work, it limits the size of the shader that can
be executed to 64K instructions. The new range states holds up to 20 bits
according to the comment in the Vivante kernel driver, which allows up
to 1M instructions.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36114>
2025-07-20 11:44:52 +00:00
Lucas Stach
534b948a9c etnaviv: don't emit start/end PC states when unified instmem is present
Cores with unified instruction memory get the start and end points of
the shaders via the shader range registers. Don't emit the unnecessary
START_PC and END_PC states on those cores.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36114>
2025-07-20 11:44:52 +00:00
Lucas Stach
a0d4418de3 etnaviv: update code steering bit when writing shader instructions
When writing new shader instructions through the unified state area
we must tell the GPU which caches to flush by setting the appropriate
code steering bit. Failing to do this doesn't seem to have much of an
effect when only loading shaders through the state memory, but when
toggling between using icache (as in load shaders from memory) and
loading instructions from the state area, this fixes severe corruption
and GPU hangs due to old code being executed.

Programming the steering bits is only needed for GPUs with either
unified instruction or unified uniform states.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36114>
2025-07-20 11:44:51 +00:00
Lucas Stach
845e7c4426 etnaviv: stop touching code steering bits while updating uniforms
Bit 0 of the SH_CONTROL register does not control uniform cache
flushes so stop touching this bit when updating the uniforms.
While it is harmless to change the bit at this time in the emit
sequence, it's confusing and not needed.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36114>
2025-07-20 11:44:51 +00:00
Lucas Stach
b093fa9dcf etnaviv: Update headers from rnndb
Update from rnndb commit 19bc9377a80a ("rnndb: rename
UNIFORM_CACHE to CONTROL and document code cache flushing")

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36114>
2025-07-20 11:44:51 +00:00
Asahi Lina
140c625bda 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>
2025-07-20 00:45:48 +09:00
Pohsiang (John) Hsu
4f7076f458 mediafoundation: change frame preanalysis rc from ifdef to runtime control
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
add support for specifying the following experimental controls

- CODECAPI_AVEncVideoRateControlFramePreAnalysis
- CODECAPI_AVEncVideoRateControlFramePreAnalysisExternalReconDownscale

to make testing easier.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36236>
2025-07-19 01:28:01 +00:00