Mykhailo Skorokhodov
f45a1d102d
egl/wayland: Fix sRGB format look up for config
...
That check should help with situations when
the dri2_wl_visual_idx_from_pipe_format function
can't recognize pipe_format as before.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10829
Fixes: 6a084e2b("egl/wayland: Use pipe_format to look up configs")
Signed-off-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29052 >
(cherry picked from commit 066fc39f45 )
2024-05-07 15:56:28 +02:00
Mike Blumenkrantz
14c44aacff
dri: plumb a 'implicit' param through createNewScreen interfaces
...
Acked-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28139 >
2024-04-22 23:25:58 +00:00
Eric Engestrom
aeab27cc24
egl: drop dead dri2_dpy param in dri2_wl_visual_idx_from_config()
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28528 >
2024-04-18 11:22:49 +00:00
Mike Blumenkrantz
dd02ea3769
egl: use os_get_option for MESA_LOADER_DRIVER_OVERRIDE
...
this is better for android
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28570 >
2024-04-17 17:19:27 +00:00
Mike Blumenkrantz
6f13b201ad
egl/android: fix zink loading
...
should be as simple as checking whether zink is being used
cc: mesa-stable
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28570 >
2024-04-17 17:19:27 +00:00
Mike Blumenkrantz
ff37271ea7
egl: fix defines for zink's dri3 check
...
if mesa is built without dri3 then dri3 should/can not be checked
cc: mesa-stable
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28570 >
2024-04-17 17:19:27 +00:00
Dave Airlie
223aedfa5d
egl/dri2: don't bind dri2 for zink
...
I'm not sure why zink would want dri2 here instead of kopper,
I'm sure it's some side effect of something else, let zink
use the kopper paths.
This fixes:
dEQP-GL45-ES3.info.vendor
on zink on nvk with GL cts using EGL.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Fixes: 12a47b84b7 ("egl/dri2: trigger drawable invalidation from surface queries for zink")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28707 >
2024-04-12 17:48:51 +00:00
Mike Blumenkrantz
cfa955ed78
glx/egl: fix LIBGL_KOPPER_DISABLE
...
when set, this disables the use of vk swapchains and lets the dri frontend
manage buffers like any other driver
also document some kopper env vars
Acked-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28137 >
2024-04-04 13:18:00 +00:00
Mike Blumenkrantz
d3730fcd2d
egl/x11: disable swapbufferswithdamage for zink without kopper
...
this is broken
Acked-by: Dave Airlie <airlied@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28215 >
2024-04-04 12:48:49 +00:00
Rob Clark
5a45077d84
egl/android: Fix gl_config dereference
...
Fixes: 273e54391a ("egl/android: Remove hard-coded color-channel data")
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28509 >
2024-04-02 15:52:23 +00:00
Joshua Ashton
efa6fac0d7
build: Add linux-drm-syncobj-v1 wayland protocol
...
Signed-off-by: Joshua Ashton <joshua@froggi.es >
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no >
Reviewed-by: Erik Kurzinger <ekurzinger@nvidia.com >
Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25709 >
2024-04-02 13:09:37 +00:00
Lucas Fryzek
b3680c92a1
egl/wayland/sw: don't invert y wl_surface_damage_buffer
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28242 >
2024-03-24 17:27:21 +00:00
Yonggang Luo
1ac1c0843f
treewide: Replace usage of macro DEBUG with MESA_DEBUG when possible
...
This is achieved by the following steps:
#ifndef DEBUG => #if !MESA_DEBUG
defined(DEBUG) => MESA_DEBUG
#ifdef DEBUG => #if MESA_DEBUG
This is done by replace in vscode
excludes
docs,*.rs,addrlib,src/imgui,*.sh,src/intel/vulkan/grl/gpu
These are safe because those files should keep DEBUG macro is already excluded;
and not directly replace DEBUG, as we have some symbols around it.
Use debug or NDEBUG instead of DEBUG in comments when proper
This for reduce the usage of DEBUG,
so it's easier migrating to MESA_DEBUG
These are found when migrating DEBUG to MESA_DEBUG,
these are all comment update, so it's safe
Replace comment /* DEBUG */ and /* !DEBUG */ with proper /* MESA_DEBUG */ or /* !MESA_DEBUG */ manually
DEBUG || !NDEBUG -> MESA_DEBUG || !NDEBUG
!DEBUG && NDEBUG -> !(MESA_DEBUG || !NDEBUG)
Replace the DEBUG present in comment with proper new MESA_DEBUG manually
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com >
Acked-by: David Heidelberg <david.heidelberg@collabora.com >
Reviewed-by: Eric Engestrom <eric@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28092 >
2024-03-22 18:22:34 +00:00
duncan.hopkins
00e1562f5b
gallium/dri: Switch xf86drm.h for util/libdrm.h to allow for the no-op shim to be used.
...
This patch allows MacOS to compile the dri[2] systems by switching from direct xf86drm.h to
the pre-existing util/libdrm.h.
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130 >
2024-03-15 10:50:12 +00:00
duncan.hopkins
1d9215f904
egl: Changed EGLNativeDisplayType size check to make sure it is big enough instead of exactly the same size.
...
MacOS uses a smaller EGLNativeDisplayType than 'void*', which is big enough for the storage.
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130 >
2024-03-15 10:50:12 +00:00
duncan.hopkins
4477139ec2
egl: Added DRI3 code guards.
...
MacOS does not have any DRI3 libraries, these code guards hide the code paths
the fail to compile without DRI3.
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130 >
2024-03-15 10:50:11 +00:00
duncan.hopkins
275fdf709d
egl: MacOS platform guard around pthread_condattr_setclock()
...
This patch disabled the call to pthread_condattr_setclock on MacOS/Apple platforms.
This funciton is missing from the the Xcode pthread implemetation.
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130 >
2024-03-15 10:50:11 +00:00
Daniel Stone
a3418105b9
egl/wayland: Remove EGL_WL_create_wayland_buffer_from_image
...
This extension was originally intended to complement
EGL_WL_bind_wayland_display.
The idea behind bind_wayland_display was that libEGL.so on the server
side could register Wayland extensions for libEGL.so on the client side
to use to create buffers, with eglQueryWaylandBufferWL being used to
query the buffer properties, and EGL_WAYLAND_BUFFER_WL added as an
EGLImage target for texturing.
eglCreateWaylandBufferFromImageWL was then to be used for nested
compositors to perform passthrough: it would take an EGLImage created by
the magical libEGL secret handshake, and make it usable in the parent
compositor by doing the same secret handshake again.
Since that original idea, we've just standardised dmabuf across the
Wayland ecosystem instead. The last known user of this extension was a
sample client in the Weston tree, which was broken quite some years ago
and never ported to the Meson build system when we moved.
Given it won't affect anyone, let's just remove this extension so no-one
thinks it would be a good idea to use it.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27793 >
2024-02-29 18:26:53 +00:00
Mike Blumenkrantz
571effdf08
egl/dri2: use the right egl platform enum
...
this is otherwise completely broken and allows loading zink in all cases
Fixes: 0fd066a1d7 ("egl: only check dri3 on X11")
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27836 >
2024-02-29 13:13:09 +00:00
Mike Blumenkrantz
f0430b095b
egl/wayland: delete swrast references to zink
...
this is an entirely separate path now
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
17355e737d
egl/wayland: split out kopper update_buffers
...
no functional changes
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
1959691033
egl/wayland/kopper: actually call kopper swapbuffer functions
...
this allows passing through the zsbuf discard flag
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
9cf22c5fd0
egl/kopper: call swrast buffer age query for kopper+swrast
...
with zink+lavapipe, this is actually how it works since the vtable is
different
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
1bd28d62e4
egl/wayland: split out kopper swapbuffers functions
...
no functional changes
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
76f74f55a4
egl/wayland: add a separate hook for kopper buffer age
...
this otherwise hits the swrast one which is wrong
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
4345c415d7
egl/wayland: split out kopper vtable
...
no functional changes
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
1188178811
egl/kopper: advertise EXT_swap_buffers_with_damage only in non-sw mode
...
this isn't actually damage-ful otherwise
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
ad8794884c
egl/kopper: plumb through SwapBuffersWithDamage
...
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
c83768c76c
egl/wayland/sw: clamp putimage geometry to surface size
...
this otherwise writes oob
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
fa465e34ca
egl/wayland/sw: pass damage region through from put_image2 to wl_surface_damage
...
this propagates damage from drisw to wayland; y inversion matches protocol
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
d90b14c768
egl/wayland/sw: fix no-op updating of current backbuffer
...
if the frontbuffer is the backbuffer then its contents are up-to-date
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
75cf82005d
egl/wayland/sw: move partial->full copy promotion to swapbuffers
...
this will ensure that the wl_buffer data is always fully updated
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
425d919b0a
egl/wayland/sw: trigger damage from put_image2
...
no functional changes currently
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
e4db8c6e8d
egl/wayland/sw: call dri2_wl_swrast_attach_backbuffer() before swap
...
should be no functional changes
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
448cd2cd37
egl/wayland/sw: split out surface attach from dri2_wl_swrast_commit_backbuffer()
...
no functional changes
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
cce12981e4
egl/wayland: unify back/current swapping between zink and swrast
...
these are functionally the same, they just happened in different places
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
73a3a1c646
egl/wayland/sw: move dri2_wl_swrast_commit_backbuffer() directly into swapbuffers
...
no functional changes
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
81e5f9c398
egl/wayland/sw: move swrast_update_buffers() directly into swapbuffers
...
no functional changes
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
fd6f7e3f16
drisw: plumb through a swapBuffersWithDamage interface
...
currently the same as regular swap
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:23 +00:00
Mike Blumenkrantz
3cca761934
gallium: add a nboxes param to flush_frontbuffer
...
this allows conveying damage regions through the sw presentation interface
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703 >
2024-02-29 01:15:22 +00:00
Simon Ser
af41fad1e9
egl/wayland: explain why implicit modifier downgrade is allowed
...
We break the rule that an explicit modifier cannot be stripped.
Fixing this would require a bit of effort and wl_drm is reaching
its end of life anyways, so leave a TODO instead.
Signed-off-by: Simon Ser <contact@emersion.fr >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26346 >
2024-02-28 21:30:55 +00:00
Simon Ser
35143febba
egl/wayland: ensure wl_drm is available before use
...
Avoid crashing if wl_drm is unavailable. Instead, gracefully error
out.
Signed-off-by: Simon Ser <contact@emersion.fr >
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Fixes: c60fea8c22 ("Revert "egl/wayland: deprecate drm_handle_format() and drm_handle_capabilities()"")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26346 >
2024-02-28 21:30:55 +00:00
Pierre-Eric Pelloux-Prayer
224ff11617
egl/wayland: use __DRI_IMAGE_PRIME_LINEAR_BUFFER in get_back_bo
...
Some drivers (radeonsi, iris) relies on this hint to detect DRI_PRIME
blits and implement a special path (eg: SDMA copy for radeonsi).
Reviewed-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27719 >
2024-02-28 12:47:54 +00:00
Derek Foreman
235144cf51
egl/wayland: Give names to our Wayland event queues
...
Named queues just add a little bit more debugging information.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27824 >
2024-02-28 11:01:31 +00:00
Daniel Stone
dcbf61f5df
egl/dri: Use pipe_format instead of DRI_IMAGE_FORMAT
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
832d814852
egl: Remove shifts/sizes from dri2_add_config argument
...
All the callers now do their own filtering on driver configs to decide
whether or not to add them.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
e66305d681
egl/x11: Compare config shifts/sizes locally
...
Rather than getting the egl_dri2 core to compare our shift/size arrays,
do it in the caller, as X11 is the only caller that constructs configs
like this.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
273e54391a
egl/android: Remove hard-coded color-channel data
...
We don't need to write out tables of the shift/size of every colour
channel, because we already have that as part of the format description
if we use pipe_format.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
d8d153d4c2
gbm: Remove hardcoded color-channel data
...
We don't need to write out the shifts and sizes everywhere; we already
have them as part of the format description.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00
Daniel Stone
6b04b64a21
egl: Use pipe_format for pbuffer configs
...
There's no need to pass shifts and masks now; we can just take a list of
pbuffer configs to add.
Signed-off-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709 >
2024-02-27 10:51:03 +00:00