Commit graph

208607 commits

Author SHA1 Message Date
Faith Ekstrand
67ae5ba7b2 egl/surfaceless: Select kopper based on dri2_dpy->kopper
This also cleanly separates kopper and swrast extensions

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:47 +00:00
Faith Ekstrand
e9a7585700 egl/wayland: Delete the kopper checks from the kopper paths
Now that thes are only used if and only if we actually want kopper, we
don't need extra kopper checks in individual callbacks.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:47 +00:00
Faith Ekstrand
938932edb2 egl/wayland: Use the DRM path for Zink when !ForceSoftware
Instead of duplicating half of the DRM path, just use the DRM path.  The
only real functional change that I can see here is that we now advertise
WL_create_wayland_buffer_from_image on Zink, which should be fine.  It
also fixes potential bugs where ForceSoftware && Zink could result in
getting visuals from DRM that don't actually work with wl_shm and then
trying to use them through wl_shm via the kopper path.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:47 +00:00
Faith Ekstrand
aaac64bbe3 egl/wayland: Only use kopper calbacks if kopper is enabled
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:47 +00:00
Faith Ekstrand
cad6ae5c6c egl/wayland: Move kopper higher up the file
No functional change.  This just moves stuff around so it goes DRM then
kopper then swrast rather than having swrast and kopper mixed.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:47 +00:00
Faith Ekstrand
572813d597 egl/x11: Add a separate dri2_initialize_x11_kopper helper
This further detangles things so we just have a kopper initialization
helper that gets invoked whenever dri2_dpy->kopper is set.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:47 +00:00
Faith Ekstrand
0729df3ca6 egl/x11: Only use kopper vtables when kopper is enabled
Otherwise we're sending lavapipe down the kopper path even though it's
not kopper which creates a mess in the code.  Also, in spite of the fact
that there are comments claiming lavapipe hits these paths we also have
asserts that it doesn't.  Make everything consistent.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:47 +00:00
Faith Ekstrand
7de5188342 egl/x11: Rework LIBGL_KOPPER_DRI2 checks
This moves the multibuffers check earlier to make it clear that this is
an early-exit.  We also delete kopper_without_multibuffers in favor of a
local variable that doesn't leak all over everywhere.  The new variable
is named force_zink because that's really what we're doing: force-enable
Zink even if the X11 checks fail.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:46 +00:00
Faith Ekstrand
42b5130ea7 egl/x11: Move the multibuffers check into dri2_initialize_x11()
No functional change.  This just moves code higher up the call stack.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:46 +00:00
Faith Ekstrand
1dde634b6a egl/x11: Always select Zink when requested
Before we were selecting Zink based on dri2_dpy->kopper which also takes
LIBGL_KOPPER_DISABLE into account which doesn't make any sense.  This is
just selecting the driver, not selecting Kopper.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:46 +00:00
Faith Ekstrand
6366a8992f egl/x11: Stop mixing kopper and swrast extensions
Neither has any dependence on the other.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:46 +00:00
Faith Ekstrand
f0c28e0250 egl: Add a shared kopper_pbuffer_loader_extension
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:46 +00:00
Faith Ekstrand
4e88f02ab4 egl,glx,kopper: Switch back to DRIkopperLoaderExtension::GetDrawableInfo
This decouples Kopper and swrast.  With this change, dri/kopper.c no
longer references DRIswrastLoaderEsxtension at all.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:46 +00:00
Faith Ekstrand
1f263aaef9 kopper: Dead code get_image() and get_image_shm()
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:46 +00:00
Faith Ekstrand
9e1a1633c4 loader: Report DRI_PRIME errors earlier
This needs devices[] in order to print an appropriate message but we
free it right after the loop.  Instead, print the error right away and
make the error case after the free just handle jumping to err.

Fixes: ea84b85887 ("loader: add DRI_PRIME_DEBUG env var")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:46 +00:00
Faith Ekstrand
694fe5f7e5 docs: Improve the docs for LIBGL_KOPPER_DRI2
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:46 +00:00
Faith Ekstrand
8d9675520f zink/kopper: Don't recycle unused acquire semaphores
Fixes: e9f18f64b9 ("zink: also cache swapchain semaphores")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
2025-07-14 18:31:46 +00:00
Gurchetan Singh
d978cbf944 mesa: subprojects: remove linux-raw-sys backend and use libc
This is because Android prefers it -- the project likes to make
changes to bionic that have a global effect, and using raw-syscalls
potentially complicates that.  This is a backport of:

https://github.com/bytecodealliance/rustix/pull/1478

In addition, nothing in Mesa3D needs the added functionality provided
by raw syscalls.

Test:

meson setup gfxstream-build -Dvulkan-drivers="gfxstream" -Dgallium-drivers="" -Dvirtgpu_kumquat=true -Dopengl=false -Drust_std=2021

still compiles.

Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36116>
2025-07-14 10:23:47 -07:00
Mike Blumenkrantz
475c43cf8a zink: translate intensity formats
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36031>
2025-07-14 16:37:25 +00:00
Mike Blumenkrantz
eacb167375 aux/trace: sanitize draws
if a draw isn't indexed, don't trace index_bias since this is a garbage value

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36045>
2025-07-14 16:10:35 +00:00
Dave Airlie
e6038645fa nak/sm70: allow first parameter of hfma2 to be non-reg
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Either Rb or Rc can be the non-register, so the copy if both
not reg should be sufficient.

Totals:
CodeSize: 14025216 -> 14022144 (-0.02%)
Static cycle count: 5313517 -> 5312651 (-0.02%)

Totals from 4 (0.30% of 1332) affected shaders:
CodeSize: 119168 -> 116096 (-2.58%)
Static cycle count: 33920 -> 33054 (-2.55%)

Only affects:
 q2rtx/q2rtx-rt-pipeline                42        -0.48%        -0.45%

This also helps with the coop matrix shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36104>
2025-07-14 13:38:37 +00:00
Patrick Lerda
5bee7c0b12 r600: fix rv770 border color
The border color of the rv770 gpu behaves the same way as
the evergreen border color. This change updates the software
accordingly.

This change is enabled for all the pre-evergreen gpus.

This change fixes 120 piglit tests. The rv770 ci is updated
as well.

Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34502>
2025-07-14 11:56:03 +00:00
Christoph Pillmayer
b530692529 panvk: Allow invalid enum values in get_image_format_properties
This is allowed with VK_KHR_maintenance5 which we support for v10+.

Fixes: 85b6bd989e ("panvk: Advertise support for VK_KHR_maintenance5")

Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36065>
2025-07-14 11:21:48 +00:00
Patrick Lerda
d9baadcfb5 r600: set never as the depth compare function when depth compare is disabled
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This is the backport of 0c0b978938 "radeonsi: set NEVER as
the depth compare func if depth compare is disabled".

The function r600_tex_compare arguments are updated with the "const"
keyword.

This change fixes the test below which was broken after 0c6e56c391:
khr-gl4[5-6]/incomplete_texture_access/sampler: fail pass

Fixes: 0c6e56c391 ("mesa: (more) correctly handle incomplete depth textures")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Acked-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35968>
2025-07-14 11:07:18 +00:00
Daniel Schürmann
47ef60cbf1 aco/ra: always use bytes for register stride requirements
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
instead of a mixture between dwords and bytes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36053>
2025-07-14 08:45:29 +00:00
Valentine Burley
84923ccfe9 iris/ci: Lower concurrency of iris-cml-traces
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36074>
2025-07-14 08:15:25 +00:00
Valentine Burley
8f1eca471f radv/ci: Lower concurrency of radv-raven-traces-restricted
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36074>
2025-07-14 08:15:25 +00:00
Valentine Burley
2b50f93fb0 iris/ci: Add a performance traces job on ADL
Add a new `iris-adl-traces-performance` job, which runs the same set of
traces as the `zink-anv-adl-traces-performance` job.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36074>
2025-07-14 08:15:25 +00:00
Valentine Burley
94a2e0a48d zink/ci: Add a performance traces job on ADL
Add a new `zink-anv-adl-traces-performance` job, which runs the same set
of traces as the `iris-anv-adl-traces-performance` job.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36074>
2025-07-14 08:15:25 +00:00
Valentine Burley
7d298e3c4b iris/ci: Simplify performance trace template
The `.profile-traces` template was nearly identical to
`.piglit-performance-base`, differing only by one additional variable.

Since all jobs extending `.piglit-performance-base` were already using
`EGL_PLATFORM: surfaceless`, that setting has been moved into the base
template, allowing `.profile-traces` to be simplified.

This also hides the performance traces jobs from non-Marge pipelines,
as intended.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36074>
2025-07-14 08:15:25 +00:00
David Rosca
f78222dc29 radv/video: Add support for decode tier3
On VCN5 both distinct and coincide output/dpb are supported. Tier3
(coincide) requires tiling, Tier2 (distinct) also works with linear.
Application can decide which one to use.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35878>
2025-07-14 07:42:28 +00:00
David Rosca
2d06b43292 radv: Enable tiling for video images on VCN5
All planes must have the same swizzle mode and no tile swizzle.
Only linear decode target requires the custom height alignment.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35878>
2025-07-14 07:42:27 +00:00
David Rosca
e50ee32876 radv: Don't allow linear tiling for video DPB images
We don't support linear DPB images and they will currently always
be tiled internally.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35878>
2025-07-14 07:42:27 +00:00
David Rosca
e2554c8f51 ac/surface: Support RADEON_SURF_FORCE_SWIZZLE_MODE on gfx12
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35878>
2025-07-14 07:42:26 +00:00
Valentine Burley
cbb9ebcd82 freedreno/ci: Fix configuration for a618-traces-performance
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The a618-traces-performance job wasn’t actually running performance tests
because it didn’t extend the `.piglit-performance-base` template, which
is what sets the traces to be replayed 150 times.

This also hides the job from non-Marge pipelines, as intended.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36070>
2025-07-14 06:48:18 +00:00
Valentine Burley
d1972be598 ci: Fix trace update script following environment variable changes
Since 655cf2f553 ("ci: Simplify filter_env_vars using indirect expansion"),
PIGLIT_REPLAY_DEVICE_NAME is declared using `declare -x`, not `export`.

Update the regex in update_traces_checksum.py accordingly. This is safe
for now, as all performance trace jobs currently run in LAVA and use this
declaration style.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36070>
2025-07-14 06:48:18 +00:00
Samuel Pitoiset
a51afbaff8 radv/sdma: fix unaligned 96-bits copies on GFX9
On SDMA4, when the pitch isn't aligned, the width needs to be scaled
by 3 for 96-bits formats.

On SDMA5+, the pitch is aligned and the driver doesn't need to fallback
to unaligned copies.

CC: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36067>
2025-07-14 06:30:55 +00:00
Sagar Ghuge
36172c41dc intel/compiler: Drop unused param from set_memory_address
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
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/36092>
2025-07-14 03:46:21 +00:00
Caio Oliveira
887642b0f2 intel: Add INTEL_DEBUG=no-vrt
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 disabling the VRT (Variable Register Thread) feature.
The strategy here is to force the old BRW_MAX_GRF limit for the
register allocator (locks the upper limit) and make sure
ptl_register_blocks() always return that amount of blocks (locks
the lower limit).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35781>
2025-07-13 21:11:02 +00:00
Caio Oliveira
636c37990a iris: Refactor BRW_KEY_INIT to get an iris_prog_base_key
Avoids passing individual fields of that key repeatedly in
the call-sites.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35781>
2025-07-13 21:11:00 +00:00
Yogesh Mohan Marimuthu
9fa192ea22 radeonsi: submit cs_preamble_state to as first job in userqueue
Also any other new context's cs_preamble_state will not be submitted.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35106>
2025-07-13 20:05:27 +00:00
Yogesh Mohan Marimuthu
0186977988 ac, radeonsi: prepare cs_preamble_state for userq reg shadowing
register shadowing has to be enabled in CONTEXT_CONTROL packet
in cs_preamble_state for user queue.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35106>
2025-07-13 20:05:27 +00:00
Yogesh Mohan Marimuthu
aab890644b radeonsi: reorder if condition in si_init_cp_reg_shadowing() function
cs_preamble_state can be created before initializing register shadowing
since register shadowing failure means driver failed now.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35106>
2025-07-13 20:05:27 +00:00
Yogesh Mohan Marimuthu
1cb0af6308 radeonsi: add uses_kernelq_reg_shadowing in struct si_context
sctx->uses_kernelq_reg_shadowing instead of sctx->shadowing.registers
for register shadowing enable check.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35106>
2025-07-13 20:05:27 +00:00
Yogesh Mohan Marimuthu
b55ee5f335 radeonsi: rename sctx->has_graphics to sctx->is_gfx_queue
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35106>
2025-07-13 20:05:26 +00:00
Yogesh Mohan Marimuthu
761496b49e radeonsi: has_kernelq_reg_shadowing failure means driver failed
If register shadowing enabling failed, then driver ctx init will
fail instead of disabling register shadowing.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35106>
2025-07-13 20:05:26 +00:00
Yogesh Mohan Marimuthu
0068dbd76b ac: enable kernelq reg shadowing only when userq is disabled
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35106>
2025-07-13 20:05:25 +00:00
Yogesh Mohan Marimuthu
1000ee3d2f ac,radeonsi,radv: rename register_shadowing_required
rename register_shadowing_required to has_kernelq_reg_shadowing

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35106>
2025-07-13 20:05:25 +00:00
Asahi Lina
067d820c9d asahi: Mark KMS exported resource BOs as shared
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixes: #13524

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36097>
2025-07-13 17:43:06 +00:00
Asahi Lina
a8f33c35f9 asahi: Add BO handles to resource debug
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36097>
2025-07-13 17:43:06 +00:00