Commit graph

2672 commits

Author SHA1 Message Date
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
Eric R. Smith
1ea79ec164 egl, mesa: add support for NV15 and NV20 textures
Support external images with 10 bit YUV in NV15 and NV20 formats.
These are produced by some hardware decoders, so this will be
useful.

Signed-off-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/31854>
2024-11-25 13:04:19 +00:00
Derek Foreman
c26ab1aee1 vulkan/wsi/wayland: Pace frames with commit-timing-v1
Instead of using frame callbacks - which may stop firing if our surface is
occluded - use the new commit-timing-v1 protocol in combination with the
presentation feedback protocol.

If the required protocols are unavailable, or the environment variable
MESA_VK_WSI_DEBUG contains "nowlts", we fall back to frame callback
based pacing behaviour.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26150>
2024-11-07 00:03:23 +00:00
Derek Foreman
d052b0201e vulkan/wsi/wayland: Use fifo protocol for FIFO
The fifo protocol allows us to ensure that a compositor presents
an image that we submit to it. Use this to reliably implement FIFO
semantics.

Note: On systems where the fifo protocol is available an occluded
surface may find itself unthrottled when previously it would have
been frozen.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26150>
2024-11-07 00:03:23 +00:00
Eric Engestrom
09a2de2a51 egl: error out during setup if the configuration is invalid
If EGL is built, it needs a driver; if we don't abort setup here,
the compilation fails with:

    ld: error: undefined symbol: _eglDriver

See #11397 or #11956 for instance.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31870>
2024-10-29 17:25:08 +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
Daniel Stone
3dcb6a0f23 egl/x11: Downgrade warning to info
This warning is emitted 10,074 times during a virpipe-on-gl job. Let's
emit it zero times.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31591>
2024-10-10 20:52:02 +00:00
Eric Engestrom
842a7b2821 egl: fix dri2_from_names() call
The offset argument is `int *offsets`.

!31406 pointed this out and I checked for other instances of the same bug.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31484>
2024-10-02 18:33:03 +00:00
Valentine Burley
83c2f30349 egl: Fix missing libdrm check
Guard the usage of DRM_PRIME_CAP_IMPORT and DRM_PRIME_CAP_EXPORT behind HAVE_LIBDRM.

Fixes: c20d6a9197 ("egl: make dmabuf/modifier display bools a bit more precise/intelligible")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31430>
2024-09-28 18:07:01 +00:00
GKraats
6c84103276 X11: fix crash of gnome-shell if mesa is compiled with legacy-x11=dri2
X11 starts up if Mesa is compiled with legacy-x11=dri2 and shows
the desktop.
It crashes with segfault as soon as an application is started.
At src/egl/drivers/dri2/platform_x11.c function dri2_from_names
(at src/gallium/frontends/dri/dri2.c) should be called
with offset address instead of with offset value.

Signed-off-by: GKraats <vd.kraats@hccnet.nl>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31406>
2024-09-27 22:55:20 +00:00
Mary Guillemard
43db7e5323 egl: Support NV_context_priority_realtime
This extension extends EGL_IMG_context_priority with a new
EGL_CONTEXT_PRIORITY_REALTIME_NV attribute.

Effectively, Gallium drivers would need to implement
PIPE_CONTEXT_REALTIME_PRIORITY flag in context_create and expose
PIPE_CONTEXT_PRIORITY_REALTIME on PIPE_CAP_CONTEXT_PRIORITY_MASK to
enable this extension.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30989>
2024-09-25 20:17:27 +00:00
Mike Blumenkrantz
33335fdd89 egl/kopper: hook up EGL_EXT_surface_compression on wayland
the driver hook isn't supported yet, so this does nothing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31024>
2024-09-25 02:30:40 +00:00
Mike Blumenkrantz
f57d8028bd egl/x11: fix dri3 connect conditional for kopper without modifiers
kopper_without_modifiers is set by dri2_load_driver(), which depends
on dri3_x11_connect(), so this flag can't be used here

this is just cosmetic and fixes error spam

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31255>
2024-09-19 13:00:59 +00:00
Mike Blumenkrantz
d6d33843d9 egl: replace fd check with swrast check for dri2
Fixes: 93aea6df07 ("egl/x11: replace DRI_DRI2 check with fd check")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31234>
2024-09-19 10:29:21 +00:00
Lucas Fryzek
32af15384d egl/dri/wl: Move swrast damage region from put to swap
Pass application provided damage region to the compositor instead
of damaging the entire display. This also gives us the possibility
in the future to have put image only copy the parts of the framebuffer
that were modified.

Fixes: fa465e34ca
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31210>
2024-09-19 09:00:33 +00:00
Mike Blumenkrantz
b6f201b173 meson: require dri3 modifiers
the year is 2024 and we have the technology

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31044>
2024-09-06 17:34:17 +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
Robert Mader
90d91f739f egl: Stop requiring EXT_create_context_robustness for EGL 1.5
For the similar commit c738cfe8 a review comment was:
> The EGL 1.5 changelog says that it incorporates the 3D texture
> extension's methods, but does not seem to require that they succeed.

The same could be said for Reset Notification Strategy and Robust Buffer
Access as implementations seem to be explicitely allowed to not succeed.
The EGL 1.5 spec says:
> "An EGL_BAD_MATCH error is generated if an OpenGL or OpenGL ES
> context is requested with robust buffer access and with a
> specified reset notification behavior, and the implementation
> does not support that behavior."

As we do return these errors accordingly during context creation, stop
requiring drivers to implement successfull creation of robust contexts,
as indicated by the extension.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30764>
2024-09-04 02:36:54 +00:00
Robert Mader
ec0c103b32 egl: Add more errors cases during context creation
In 9cc3e842bb an explicit check whether drivers support
PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR was added to
EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT. Add respective checks in similar
places as well.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30728>
2024-09-02 21:59:09 +00:00
David Rosca
c447c6fe17 egl/wayland: Fix flush after blit in swap buffers multi-GPU case
dri2_wl_swap_buffers_with_damage is not used by swrast, so the swrast
condition there is wrong and instead it should always flush.

Fixes: fd17c018e9 ("egl/wayland: replace a couple DRI2_FLUSH checks with non-kms_swrast checks")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30964>
2024-09-02 13:22:30 +00:00
Mike Blumenkrantz
898012ba11 egl: use more precise conditional for passing fd through to dri screen create
kms_swrast is included in the swrast conditional and needs a fd,
and there is a flag which indicates pure swrast which can be used to
ensure this case is detected

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30951>
2024-08-30 18:42:27 +00:00
Mike Blumenkrantz
ecb788624b revert part of 94e470a32d
accidentally added during rebase

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30949>
2024-08-30 17:08:33 +00:00
Mike Blumenkrantz
94e470a32d zink: update profile with missing extensions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30944>
2024-08-30 13:37:25 +00:00
Mike Blumenkrantz
9777f016c7 egl/x11: pretend kopper is software with LIBGL_KOPPER_DRI2
there's no render device fd here, so take the sw path on startup

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30872>
2024-08-27 17:41:37 +00:00
Mike Blumenkrantz
aae62e5d29 egl: unify LIBGL_KOPPER_DRI2 checks
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30872>
2024-08-27 17:41:37 +00:00
Lepton Wu
72506ac8c7 egl/android: Fix wrong pipe format for RGB_565
We were actually using PIPE_FORMAT_B5G6R5_UNORM for HAL_PIXEL_FORMAT_RGB_565
since Android support was added to Mesa. This restores the original behavior.

Fixes: 273e54391a ("egl/android: Remove hard-coded color-channel data")

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Signed-off-by: Lepton Wu <lepton@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30827>
2024-08-25 21:01:15 +00:00
Mike Blumenkrantz
13066905d3 egl/android: call dri2_display_create() like every other driver
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30773>
2024-08-22 14:22:41 +00:00
Mike Blumenkrantz
fceb122a2e egl/wayland: do display gpu fd dance for non-sw zink init
Fixes: 991cc686a5f (egl: really fix kopper fd passing)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30647>
2024-08-21 16:51:19 +00:00
Mike Blumenkrantz
b38480d6c7 egl: pass real value for software to dri2_setup_device()
this was otherwise breaking zink

Fixes: 991cc686a5f (egl: really fix kopper fd passing)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30647>
2024-08-21 16:51:19 +00:00
Mike Blumenkrantz
7deb96a5f9 egl/wayland: split out dmabuf extension stuff for kopper
this allows deleting the fd check which is really what this was
intending to do (but is still broken because llvmpipe supports this)

Fixes: 991cc686a5f (egl: really fix kopper fd passing)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30647>
2024-08-21 16:51:19 +00:00
Mike Blumenkrantz
28b291446b egl: really fix kopper fd passing
for real this time.

Fixes: c8c46bf900 ("egl: fix fd passing on init with zink")

Fixes: 991cc686a5f (egl: really fix kopper fd passing)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30647>
2024-08-21 16:51:19 +00:00
Mike Blumenkrantz
b66743984c egl: add DRI_USE_INVALIDATE with non-sw kopper
Fixes: 991cc686a5f (egl: really fix kopper fd passing)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30647>
2024-08-21 16:51:19 +00:00
Scott Moreau
7cbe8c390d egl: hook up swap interval bits when using zink on wayland
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25358>
2024-08-20 16:19:17 -06:00
Scott Moreau
a641ca34fa egl: small refactor to avoid code duplication
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25358>
2024-08-20 16:18:04 -06:00
Mike Blumenkrantz
9042e9a8c0 dri: rework drawable creation
this consolidates all the creation code into the dri frontend,
enabling a single caller 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
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
576015f735 egl: check x11 multibuffer support before screen create
no functional changes

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
8cc95baf7b dri: merge in loader_dri3
this simplifies dependencies

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
af3df1133b egl: initialize dri error code variables
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
694478025d egl/glx: make detecting explicit modifier support more explicit
explicit modifier usage is different from general modifier capability

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11652, https://gitlab.freedesktop.org/mesa/mesa/-/issues/11663
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30662>
2024-08-19 15:00:51 +00:00
Mike Blumenkrantz
c20d6a9197 egl: make dmabuf/modifier display bools a bit more precise/intelligible
'has_modifiers' was misleading and not actually useful

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30662>
2024-08-19 15:00:51 +00:00
Robert Mader
c738cfe8dd egl: Stop requiring texture_3D_image for EGL 1.5
Neither VK-GL-CTS nor dri2_setup_screen() require it, unlike
texture_2D_image and texture_cubemap_image. Crucially, older etnaviv
generations and vc4 in general do not support 3d textures.

Thus drop the requirement in order to support EGL 1.5 across the board.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30680>
2024-08-16 13:36:47 +00:00
Mike Blumenkrantz
c8c46bf900 egl: fix fd passing on init with zink
this should be passed with gbm but not for any other display type

Fixes: 5ab29555cf ("egl/x11: pass render fd to screen create for zink")

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30588>
2024-08-12 14:58:05 +00:00
Mike Blumenkrantz
d120992e1a egl/wayland: bail on zink init in non-sw mode if extension check fails
cc: mesa-stable

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30479>
2024-08-12 13:02:20 +00:00
Rob Clark
19d44313a4 egl: Fix surfaceless + modifiers
Modifiers are not restricted to dri3.

Fixes: d86f39e7cf ("egl: swap DRI_IMAGE checks for dmabuf/modifier support for driver check")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30579>
2024-08-09 16:14:43 +00:00