K900
3d7bfcf984
meson: support building with system libgbm
...
This is the next step towards making libgbm just a loader.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33890 >
2025-04-09 12:15:33 +00:00
Aaron Ruby
d64df991bb
gbm/dri: Match zink autoloading from egl
...
Essentially, match the Zink autoloading order that was implemented as
part of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25640
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34163 >
2025-03-29 09:18:47 +00:00
Mike Blumenkrantz
0e87acb2f3
dri: delete INVALIDATE extension
...
this shouldn't be needed anymore since it doesn't do anything
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33774 >
2025-02-26 21:46:06 +00:00
Simon Ser
5a19323d0e
gbm: fix get_back_bo() failure with gbm_surface and implicit modifiers
...
Before 361f362258 ("dri: Unify createImage and
createImageWithModifiers"), gbm_surface_create_with_modifiers() would
fail with ENOSYS on drivers missing explicit modifiers support. After
that commit, it succeeds and fails later when it tries to allocate a
new back buffer.
Restore the previous behavior.
Signed-off-by: Simon Ser <contact@emersion.fr >
Fixes: 105fcb9cfd ("dri: revert INVALID modifier special-casing")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12283
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32726 >
2025-02-14 16:41:07 +00:00
Qiang Yu
ef0b6f8262
egl,gallium,gbm,mesa: replace get_param with pipe_caps access
...
Use command:
find . -path "./.git" -prune -o -type f -exec sed -i ':a;N;$!ba;s/->get_param([^,]*,[[:space:]]*PIPE_CAP_\([^)]*\))/->caps.\L\1/g' {} +
And some manual adjustment.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32955 >
2025-01-17 04:39:46 +00:00
Marek Olšák
1a7c54b840
Revert "gbm: mark surface buffers as explicit flushed"
...
This reverts commit c49a71c03c .
It broke radeonsi.
GBM can't set __DRI_IMAGE_USE_BACKBUFFER if gbm itself doesn't use it as
a back buffer by rendering to it and calling SwapBuffers. If another
library uses it as a back buffer, that library should set
__DRI_IMAGE_USE_BACKBUFFER, not GBM. A different flag could be added
to indicate the behavior that the original commit expected.
Fixes: c49a71c03c - gbm: mark surface buffers as explicit flushed
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11996
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32345 >
2024-11-27 22:48:04 +00:00
Eric Engestrom
aa31c286c6
meson: drop unused variables
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32333 >
2024-11-26 20:45:41 +00:00
Jocelyn Falempe
b24d4f0c86
gbm/dri: Fix color format for big endian.
...
Using wayland on s390x has all the colors wrong.
Mesa reports using GBM_FORMAT_XRGB8888 but inside the buffer, the
colors are in GBM_FORMAT_BGRX8888 order.
This patch fixes it for common formats, and also introduced BGRX8888
which is the default on big endian.
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
Jocelyn Falempe
3814dee11a
gbm/dri: Use PIPE_FORMAT_* instead of using __DRI_IMAGE_*
...
__DRI_IMAGE formats are not well defined for big endian.
This patch has no functionnal change and prepare the work to better support
big endian.
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
0bffe8ec05
mesa_interface: rename __DRIimage to struct dri_image
...
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
Marek Olšák
ee54fe9f69
mesa_interface: rename __DRIconfig to struct dri_config
...
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
Marek Olšák
186a3b6dad
mesa_interface: replace opaque __DRIdrawable with struct dri_drawable everywhere
...
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
Marek Olšák
329e03535b
mesa_interface: replace opaque __DRIcontext with struct dri_context everywhere
...
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
Marek Olšák
1ce9aa3d65
mesa_interface: replace opaque __DRIscreen with struct dri_screen everywhere
...
it's always struct dri_screen
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
Lucas Stach
c49a71c03c
gbm: mark surface buffers as explicit flushed
...
Some drivers are able to optimize buffer usage when it is known that
external visibility of buffer changes only needs to be guaranteed
after well defined transition points, like eglSwapBuffers.
Add a BO flag to specify this behavior and set it with GBM surfaces.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de >
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30077 >
2024-09-26 09:36:46 +00:00
K900
395cd8643f
meson/gbm: fix meson devenv for GBM backends
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31223 >
2024-09-19 05:06:50 +00:00
K900
03a4e857fd
meson/gbm: clean up dependencies
...
- move everything that's actually only used by the DRI backend to the backend
- remove some things that aren't used at all
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31223 >
2024-09-19 05:06:50 +00:00
K900
514df444eb
gbm: split the DRI backend into a separate library and unify backend handling
...
This does a few things:
1. Applications linked against a non-matching GBM can load the right version of the backend
from the environment, avoiding GBM/Mesa version mismatches in many cases
2. Distros that want to split off libgbm into a separate package from the actual drivers
get to not ship 40MB of libgallium_dri
3. The loader logic becomes way less complex
See also: https://github.com/NixOS/nixpkgs/pull/338109 for original rationale.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31074 >
2024-09-17 22:17:10 +00:00
Mike Blumenkrantz
8f6fca89aa
meson: delete dri3 build option
...
this existed for historical reasons, but realistically now it should
be possible to build mesa with dri3 always enabled. additionally,
this check was often used as a substitute for having drm functionality,
which is sort of similar but also not really a direct match
this simplifies a bunch of conditionals and prevents users from footgunnning
themselves into orbit
Reviewed-by: Adam Jackson <ajax@redhat.com >
Reviewed-by: Eric Engestrom <eric@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30952 >
2024-09-04 14:48:17 +00:00
Tapani Pälli
35a6824e88
gbm: depend on libdrm indepedent of dri2 setting
...
Suggested-by: @stefan11111
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10585
Signed-off-by: Tapani Pälli <tapani.palli@intel.com >
Reviewed-by: Eric Engestrom <eric@igalia.com >
Reviewed-by: Simon Ser <contact@emersion.fr >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30716 >
2024-08-20 04:55:58 +00:00
Mike Blumenkrantz
af6d3fdf6e
dri: pass has_multibuffers through from the loader
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30619 >
2024-08-19 17:43:58 +00:00
Mike Blumenkrantz
2cbb92d656
gbm: stop loading driver extensions
...
this is pointless now
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/30524 >
2024-08-09 14:23:28 +00:00
Mike Blumenkrantz
1de7c86bc1
dri: pass through a type enum for creating screen instead of driver_extensions
...
the caller always knows what type of screen this will be, which means
it's finally possible to kill off passing a vtable here
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/30524 >
2024-08-09 14:23:28 +00:00
Mike Blumenkrantz
a04f8cba53
gbm: delete DRI_FLUSH remnants
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30494 >
2024-08-05 20:33:14 +00:00
Mike Blumenkrantz
1ecb4c5cf7
gbm: inline DRI_FLUSH
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30494 >
2024-08-05 20:33:14 +00:00
Mike Blumenkrantz
9eccbe3a81
gbm: delete DRI_IMAGE remnants
...
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:32 +00:00
Mike Blumenkrantz
ab08b79ef7
gbm: use driver check for dmabuf export
...
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:32 +00:00
Mike Blumenkrantz
9ec286b037
gbm: check for compression modifiers on device create
...
remove the last DRI_IMAGE check
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:32 +00:00
Mike Blumenkrantz
8364f2e571
gbm: always pass through images to unmap
...
this should be fine?
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:32 +00:00
Mike Blumenkrantz
4a0a39245d
gbm: use new dmabuf import flag to replace DRI_IMAGE checks
...
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:32 +00:00
Mike Blumenkrantz
d26d2603cc
gbm: check for dmabuf import on device creation
...
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:32 +00:00
Mike Blumenkrantz
20d3e1ad14
gbm: inline simple DRI_IMAGE usage
...
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:32 +00:00
Mike Blumenkrantz
59e4d558ba
gbm: inline dri2_from_dma_bufs and delete now-redundant check in dmabuf import
...
dri will check this
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:32 +00:00
Mike Blumenkrantz
027de039a3
egl/gbm: delete DRI_IMAGE_DRIVER remnants
...
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:32 +00:00
Mike Blumenkrantz
ea1855caba
gbm: inline DRI_IMAGE_DRIVER
...
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:32 +00:00
Mike Blumenkrantz
f43883cf67
egl/gbm: rip out DRI_SWRAST
...
the swrast struct member is now a bool for consistency
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:31 +00:00
Mike Blumenkrantz
789df29fc3
egl/gbm: remove DRI_KOPPER remnants
...
kopper struct member is still useful as a check, so replace it accordingly
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:31 +00:00
Mike Blumenkrantz
0d9f69de2c
gbm: delete DRI_MESA remnants
...
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:31 +00:00
Mike Blumenkrantz
f51857aac2
gbm: inline DRI_MESA
...
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:31 +00:00
Mike Blumenkrantz
0ae7349e06
egl/gbm: delete remnants of DRI_CORE
...
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:31 +00:00
Mike Blumenkrantz
3698e10356
gbm: inline DRI_CORE usage
...
Reviewed-by: Adam Jackson <ajax@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472 >
2024-08-02 20:49:31 +00:00
Daniel Stone
cd961a7e3f
gbm/dri: Remove erroneous assert
...
The user is allowed to pass a list of modifiers including
DRM_FORMAT_MOD_INVALID, meaning that the user is OK with implicit
modifiers. Since merging the DRI interfaces, this assert that we are
never returning an implicit modifier is unnecessary and also wrong. It
was originally added to be super-safe, but we now know that our drivers
work very well with modifiers, so don't need it.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Fixes: 0b16d7ebb9 ("dri: Allow INVALID for modifier-less drivers")
Closes : mesa/mesa#11591
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30464 >
2024-08-02 08:40:43 +00:00
Mike Blumenkrantz
35d518fcde
dri: use image loader function directly in dri_create_image_with_modifiers
...
it can't be anything else
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
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
9b7bb6cc9f
gallium: install gallium-$version.so to libdir
...
Installing this private library into the default library
search path avoids needing to rely on -Wl,-rpath,
which is inconsistently implemented as either DT_RUNPATH
or DT_RPATH on different distributions; in particular,
on distributions that implement it as DT_RPATH,
it interferes with use of LD_LIBRARY_PATH and has semantics
that are difficult to reason about, and is incompatible with
Steam's container runtime (which has the known limitation that
it only implements DT_RUNPATH and not DT_RPATH).
To avoid third-party developers being tempted to link to the
unstable libgallium, give it a name that varies with each Mesa release,
so that there is no obvious way for third-party software to link to it.
This is similar to the way the proprietary Nvidia driver sets up its similar
implementation-detail libraries such as libnvidia-glcore.so.535.183.01.
Fixes: 50fc7cc2 ("glx: directly link to gallium")
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30328 >
2024-07-24 12:15:55 +00:00
Pierre-Eric Pelloux-Prayer
159a3edd80
egl,gbm,glx: fix log message spam
...
Based on the other similar logs we only want to log when extensions
is NULL.
Use this opportunity to indicate the source of the log and remove
the extra ')' at the end of each line.
Fixes: 50fc7cc290 ("glx: directly link to gallium")
Reviewed-by: Eric Engestrom <eric@igalia.com >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30257 >
2024-07-22 10:09:34 +00:00
Mike Blumenkrantz
93511c1c5c
gbm: link directly with libgallium
...
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
Mike Blumenkrantz
69c772e4ea
egl: link with libgallium directly
...
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
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
Emma Anholt
2ef4b6ed54
dri: Drop the old lookupEGLImage wrapper function.
...
All the loaders implemented the split version. We don't need to maintain
the old function and struct layout, because we're version locked
between loader and driver.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30245 >
2024-07-18 14:16:51 +00:00