Mel Henning
4be68b119e
loader: Don't load nouveau GL on nvidia kmd
...
The vulkan driver already has a check for this. This prevents the GL
driver from loading too.
Reviewed-by: Karol Herbst <kherbst@redhat.com >
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13484
Fixes: e99446fc ("egl: Add EGL_EXT_device_query_name and EGL_EXT_device_persistent_id")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36449 >
2025-07-29 23:52:32 +00:00
Faith Ekstrand
36631a4edc
loader: Ignore NOUVEAU_USE_ZINK on Hopper+
...
The old Nouveau GL driver has no support for GPUs after Ada. Instead,
users will always get NVK+Zink on Hopper+. Right now, if the user sets
NOUVEAU_USE_ZINK=false, the loader will return "nouveau" and EGL/GLX
will try to load that, fail, and then fall back to Zink. With this
patch, we instead print a warning message and then load Zink anyway.
Backport-to: 25.2
Reviewed-by: Mel Henning <mhenning@darkrefraction.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36329 >
2025-07-23 20:19:38 +00:00
Rob Clark
6d3f266406
dri: Add additional 16/32b float/int formats
...
Add additional 16 and 32b float formats, and the missing BGR161616.
For the dri2_format_table, just use the pipe formats twice, rather than
introducing new __DRI_IMAGE_FORMAT_x in this day and age (they are the
same thing).
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com >
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36081 >
2025-07-15 12:37:10 +00:00
Daniel Stone
0fcb0ac1c5
dri: Expand pipe_format <-> FourCC lookup table
...
This pulls in every known mapping from the core DRI frontend, as well as
from GBM and Wayland. We can then start using it to de-duplicate the
lookups all throughout the tree.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36081 >
2025-07-15 12:37:10 +00:00
Daniel Stone
d6e639816f
dri: Convert pipe_format <-> FourCC lookup to a table
...
Saves typing it out twice.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36081 >
2025-07-15 12:37:10 +00:00
Daniel Stone
b6332eb43b
dri: Convert DRI_IMAGE_FORMAT to pipe_format
...
No functional change.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36081 >
2025-07-15 12:37:09 +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
Timothy Arceri
2ca46c7a7a
dri: fix __DRI_IMAGE_FORMAT* to PIPE_FORMAT* mappings
...
As per the old comment:
"These formats correspond to the similarly named MESA_FORMAT_*
tokens, except in the native endian of the CPU. For example, on
little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to
MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian."
Fixes: 7e10601786 ("dri: Redeclare __DRI_IMAGE_FORMAT_* as PIPE_FORMAT_*")
Acked-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35814 >
2025-06-30 23:04:57 +00:00
Ryan Mckeever
4848fbf774
gallium: Support RGB888/BGR888 formats
...
Signed-off-by: Ryan Mckeever <ryan.mckeever@collabora.com >
Reviewed-by: Eric R. Smith <eric.smith@collabora.com >
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34889 >
2025-06-24 05:41:48 +00:00
Derek Foreman
b3e3f0fc2e
loader/wayland: Move acquisition time tracking into perfetto flows
...
We only use the acquisition time for calculating latency for perfetto
tracks later, and the acquisition time should ideally be the start of the
perfetto flow.
This has been more or less true with very small error margin for vk wsi,
but the wayland EGL buffer handling is a lot more complicated. Moving the
time check into the flow start will make re-using this code for EGL much
simpler.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32757 >
2025-05-26 16:13:25 -05:00
Derek Foreman
336cbc499f
wsi/wayland: Move presentation tracing code into loader
...
Push the presentation feedback code into the common code in the loader,
so we're one step closer to using the perfetto instrumentation here in
the EGL code.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32757 >
2025-05-26 16:13:25 -05:00
Derek Foreman
94b45c6c8a
wsi/wayland: Refactor some surface management code into loader
...
Share some wayland surface setup code in the loader so we can use it in
both VK and (in an upcoming commit) EGL.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32757 >
2025-05-26 16:13:25 -05:00
Derek Foreman
aefd3d835e
wsi/wayland: Move buffer name string into common code
...
Push this into the loader bits so it will be available to egl when we
add profiling later.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32757 >
2025-05-26 16:13:25 -05:00
Derek Foreman
6946758682
wsi/wayland: Move perfetto flow_ids into loader_wayland_buffer
...
Pull some more common stuff into the new abstraction.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32757 >
2025-05-26 16:13:25 -05:00
Derek Foreman
c06624d797
wsi/wayland: Refactor some buffer management code into loader
...
For now just pull the tiny bit that looks up the wayland buffer id for
profiling. The end goal is to promote more code sharing between vk and egl
and improving wayland egl's perfetto profiling.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32757 >
2025-05-26 16:13:25 -05:00
Derek Foreman
d8c8a7fb6e
loader: Move the wayland protocol build into loader
...
We can hang this here instead of off wayland-drm's build.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32757 >
2025-05-26 16:13:19 -05:00
Adam Jackson
9a610c5ab9
loader: Use RTLD_LOCAL not RTLD_GLOBAL
...
The gallium driver does not expose any symbols that anybody else wants
to see. But if we load it with RTLD_GLOBAL that's what happens, along
with all the symbols in the libraries it depends on.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30417 >
2025-04-18 07:14:56 +00:00
Adam Jackson
e06b834dfa
loader: Stop looking in ${libdir}/tls/
...
We don't install there, haven't in a long time.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34058 >
2025-03-13 19:45:45 +00:00
Faith Ekstrand
dcbf5f08eb
loader/nouveau: Fix the comment in nouveau_zink_predicate()
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34009 >
2025-03-11 23:00:09 +00:00
Dave Airlie
2983ca0d20
loader/nouveau: load zink as the GL driver for turing and above.
...
If the kernel supports modifiers and the GPU is a Turing+ then
force using zink instead of nvc0.
Signed-off-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Acked-by: Karol Herbst <kherbst@redhat.com >
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Reviewed-by: Mel Henning <mhenning@darkrefraction.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29232 >
2025-03-11 17:39:14 +00:00
Lucas Stach
7e76c67632
kmsro: look for graphics capable screen as renderonly device
...
Exposing a rendernode from a supported driver is not a sufficient
matching criteria to qualify as the render part of a renderonly
device, as the rendernode might only expose compute or 2D accel
capabilities.
Look for a screen that actually supports gallium graphics operations
to qualify as a renderonly screen.
v2 (Tomeu): Have pipe-loader return a list of FDs for kmsro to choose
based on capabilities.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30096 >
2025-03-05 10:48:28 +00:00
Karmjit Mahil
54928d643e
loader/wayland: Fix missing timespec.h include
...
`loader_wayland_dispatch()` also makes use of `timespec` so we
need `timespec.h`. Otherwise it fails to build due to
`timespec_sub_saturate()` missing.
Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com >
Fixes: 90effcceab ("wsi/wayland: refactor wayland dispatch")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12580
Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33423 >
2025-02-06 10:39:25 +01:00
Marek Olšák
6e3ee3a072
loader: improve the existing loader-libgallium non-matching version error
...
Reviewed-by: Adam Jackson <ajax@redhat.com >
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32789 >
2025-01-23 00:49:05 +00:00
Pierre-Eric Pelloux-Prayer
1021d6fe62
dri: deal with ARGB1555
...
This helps fixing "glx-visuals-... -pixmap" which uses this
format.
cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Reviewed-by: Eric Engestrom <eric@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33036 >
2025-01-21 14:33:13 +00:00
Jocelyn Falempe
c6d7ab7c1f
loader: Fix typo in __DRI_IMAGE_FORMAT_XBGR16161616 definition
...
The X and A format are inverted by mistake.
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com >
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31707 >
2024-10-25 14:18:24 +00:00
Marek Olšák
872b5c70d1
mesa_interface: remove redundant __DRI*Rec types
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31752 >
2024-10-22 06:48:02 +00:00
K900
41e83b243c
meson: remove dri-search-path
...
It's not actually used anywhere.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31223 >
2024-09-19 05:06:50 +00:00
Mike Blumenkrantz
2b042cb9c2
gallium: move loader_dri_create_image to dri frontend
...
this is another case of bad dependencies leaving dri the only place to
move something, which then exposes some other snags to be resolved later
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30450 >
2024-08-01 15:28:03 +00:00
Mike Blumenkrantz
0d83c570af
dri: move swapinterval functions from loader to dri frontend
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30450 >
2024-08-01 15:28:03 +00:00
Mike Blumenkrantz
f9f8652445
loader: split out dri3 into subdir
...
this fixes dependency hell
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30400 >
2024-07-31 18:50:38 +00:00
Mike Blumenkrantz
4095fac72b
loader: move some common dri3 functions out of dri3 loader
...
fixing dependency hell
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30400 >
2024-07-31 18:50:38 +00:00
Eric Engestrom
dfd70bab4a
loader: gc loader_get_extensions_name() and __DRI_DRIVER_{GET_,}EXTENSIONS defines
...
Leaving the defines in include/GL/internal/dri_interface.h because I'm
not sure if something needs it.
Fixes: fa541a887c ("loader: delete loader_open_driver()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30266 >
2024-07-19 20:38:19 +00:00
Daniel Stone
e05415a82e
format: Generate endian-independent format aliases
...
Instead of having a hardcoded list of endian-independent format aliases
in the header, generate them from the format definitions.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29649 >
2024-07-19 13:50:42 +00:00
Mike Blumenkrantz
293c7b38ff
loader/glx: move multibuffers check to loader
...
make this code more reusable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30128 >
2024-07-18 21:58:49 +00:00
Mike Blumenkrantz
63191107ab
loader/dri3: avoid killing the xcb connection if dri3 not found
...
calling open if the extension is unsupported closes the connection
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30128 >
2024-07-18 21:58:49 +00:00
Mike Blumenkrantz
c24891e044
loader/dri3: check xfixes version in loader_dri3_open()
...
this will allow simplifying some code without losing functionality
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30128 >
2024-07-18 21:58:49 +00:00
Mike Blumenkrantz
fa541a887c
loader: delete loader_open_driver()
...
no longer used
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29771 >
2024-07-18 20:30:43 +00:00
Daniel Stone
80bcdc08ec
loader/dri3: Use FourCC for buffer allocations
...
Switch to using FourCC for buffer allocations instead of
DRI_IMAGE_FORMAT, albeit with a transient helper to convert from FourCC
to DRI_IMAGE_FORMAT for createImage.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30245 >
2024-07-18 14:16:51 +00:00
Daniel Stone
361f362258
dri: Unify createImage and createImageWithModifiers
...
There's no real reason for the two to exist separately. Nuke the old
createImage in favour of just having createImageWithModifiers.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30245 >
2024-07-18 14:16:51 +00:00
Daniel Stone
efb88deb36
loader/dri3: Use FourCC for create-image entrypoints
...
Use FourCC for everything winsys-facing, instead of pipe_format.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30245 >
2024-07-18 14:16:51 +00:00
Daniel Stone
60cb420996
dri: Remove old createImageWithModifiers
...
Everyone can use createImageWithModifiers2, which is now just called
createImageWithModifiers.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30245 >
2024-07-18 14:16:50 +00:00
Emma Anholt
26c1354578
dri: Consistently use createImageFromDmabufs() not createImageFromFds()
...
They're calling the same thing in the backend, so reduce the proliferation
of interfaces consumed within our implementation.
driVkImageExtensionSw now sets dri2_from_dma_bufs, which means that
egl_dri2 will now expose EXT_image_dma_buf_import. Given that it
previously set dri2_from_fds suggesting that it can import dmabufs, this
is presumably OK.
Reviewed-by: Adam Jackson <ajax@redhat.com >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30245 >
2024-07-18 14:16:50 +00:00
Emma Anholt
24d03a1c0f
dri: Replace createImageFromDmaBufs() with createImageFromDmaBufs3()
...
If FromDmaBufs()/FromDmaBufs2() are available, then FromDmaBufs3() is.
Drop the old method (unused by third parties) and make the new preferred
entrypoint take its name.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30245 >
2024-07-18 14:16:50 +00:00
Emma Anholt
13ea03f088
dri: Consistently use createImageFromFds2(), not createImageFromFds()
...
dri_screen.c supports it if it supports createImageFromFds().
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30245 >
2024-07-18 14:16:50 +00:00
Emma Anholt
9a026df0f7
dri: Consistently use createImageWithModifiers2()
...
dri_screen.c supports it regardless.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30245 >
2024-07-18 14:16:50 +00:00
Adam Jackson
d709b42180
dri: Let dril handle the DRI driver link farm
...
xserver's loader will look for drivers this way, but there's no reason
we need to keep hurting ourselves like that.
Co-authored-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28378 >
2024-07-17 23:47:05 +00:00
Adam Jackson
91e1ea52c9
mesa_interface: Move out of GL/internal/
...
Move it into src/gallium/include/ to make it absolutely clear this is a Mesa detail.
While we're at it, clean up its include sites, including some places
where we can just include kopper_interface.h instead since it includes
mesa_interface.h as its first act.
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28378 >
2024-07-17 23:47:05 +00:00
Adam Jackson
6be17e222d
treewide: Include mesa_interface.h not dri_interface.h
...
We're about to split the latter off as a compatibility detail for older
versions of Xorg, and the former includes the latter at this point, so
this should be just to prove no functional change.
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28378 >
2024-07-17 23:47:04 +00:00
David Heidelberg
68215332a8
build: pass licensing information in SPDX form
...
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Acked-by: Dylan Baker <dylan.c.baker@intel.com >
Acked-by: Eric Engestrom <eric@igalia.com >
Acked-by: Daniel Stone <daniels@collabora.com >
Signed-off-by: David Heidelberg <david@ixit.cz >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29972 >
2024-06-29 12:42:49 -07:00
Eric Engestrom
787e0751c5
loader: use os_get_option() to allow android to set LIBGL_DRIVERS_PATH, GBM_BACKENDS_PATH, GALLIUM_PIPE_SEARCH_DIR
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29816 >
2024-06-21 07:44:36 +00:00