Age | Commit message (Collapse) | Author |
|
We use eglQueryDeviceStringEXT() later on, which is optional and
requires support for the EGL_EXT_device_query extension.
|
|
Reverts commit c73e20628ad3cf8a38fc1cebd061a49da8708394.
This caused a regression in the GLES2 renderer because `egl->exts.EXT_device_drm` is set in
`egl_init_display()`, which is invoked after `get_egl_device_from_drm_fd()`. So the function will
always return `EGL_NO_DEVICE_EXT`.
|
|
Without EGL_EXT_device_drm, eglQueryDeviceStringEXT(EGL_DRM_DEVICE_FILE_EXT) further below is invalid.
|
|
Some formats like YUV are only supported by Mesa for sampling, not
for rendering. However we always unconditionally added the INVALID
modifier to the list of render formats.
Check whether all modifiers are external-only, in that case, don't
add INVALID to the list of render formats.
|
|
EGL_EXT_image_dma_buf_import_modifiers [1] uses EGLint to carry
formats. We were casting it to int (which may not be the same
width) and uint32_t (which may change the value).
Instead, use EGLint everywhere.
[1]: https://registry.khronos.org/EGL/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt
|
|
This allows the GLES2 renderer to figure out when a GPU reset
happens.
|
|
`modifiers` and `external_only` are never initialized, and free'd later. This
commit explicitly initializes them to NULL to prevent segfaults on `free()`
|
|
Same as WLR_DRM_NO_MODIFIERS but for EGL. For debugging purposes
mostly.
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3451
|
|
See the spec at [1]. tl;dr EGL has terrible defaults: eglTerminate()
may have side-effects on completely unrelated EGLDisplay objects.
This extension allows us to opt-in to get the sane behavior:
eglTerminate() only free's our own EGLDisplay without affecting
others.
[1]: https://registry.khronos.org/EGL/extensions/KHR/EGL_KHR_display_reference.txt
|
|
For each format and modifier, log supported usage. Log a
human-readable format/modifier string.
|
|
I think the second parameter of the function should be void* instead of
void **, because we use it as a right value in the function.
Signed-off-by: fakechen <chenzigui@kylinos.cn>
Signed-off-by: sunzg <sunzhigang1@kylinos.cn>
|
|
|
|
|
|
This allows compositors to integrate with the wlroots GLES2
renderer, if they need to perform custom GL rendering.
|
|
|
|
Support for EXT_image_dma_buf_import_modifiers doesn't necessarily
indicate support for modifiers. For instance, Mesa will advertise
EXT_image_dma_buf_import_modifiers for all drivers. This is a trick
to allow EGL clients to enumerate supported formats (something
EXT_image_dma_buf_import is missing). For more information, see [1].
Add a new wlr_egl.has_modifiers flag which indicates whether
modifiers are supported. It's set to true if any
eglQueryDmaBufModifiersEXT query returned a non-empty list.
Use that flag to figure out whether the buffer modifier should be
passed to the EGL implementation on import.
[1]: https://github.com/KhronosGroup/EGL-Registry/issues/142
|
|
This allows creating a wlr_egl from an already-existing EGL display
and context. This is useful to allow compositors to choose the exact
EGL initialization parameters.
|
|
The next commit will split extension lookup and context
initialization.
|
|
|
|
See [1] for the motivation.
[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/75
|
|
|
|
calloc is moved to right before egl is called to avoid requiring to free()
unused memory.
Found via scan-build
|
|
This reverts commit ea7357b70366588069c83f158e6a4eb2d3a702b3.
|
|
This reverts commit 780052d4da0c93f9210dd87d2100b116af7ff308.
|
|
|
|
See [1] for the motivation.
[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/75
|
|
This will be necessary for the next patch, to avoid messing up BO
handles shared between the GL implementation and the DRM backend.
|
|
Uses the EXT_device_query extension to get the EGL device matching the
requested DRM file descriptor. If the extension is not supported or no device
is found, the EGL device will be retrieved using GBM.
Depends on the EGL_EXT_device_enumeration to get the list of EGL devices.
|
|
|
|
This EGL extension has been added in [1]. The upsides are:
- We directly get a render node, instead of having to convert the
primary node name to a render node name.
- If EGL_DRM_RENDER_NODE_FILE_EXT returns NULL, that means there is
no render node being used by the driver.
[1]: https://github.com/KhronosGroup/EGL-Registry/pull/127
|
|
Without setting this the EGL implementation is allowed to perform
destructive actions on the buffer when imported: its contents
become undefined.
This is mostly a pedantic change, because Mesa processes the attrib
and does absolutely nothing with it.
|
|
Khronos refers to extensions with their namespace as a prefix in
uppercase. Change our naming to align with Khronos conventions.
This also makes grepping easier.
|
|
Our GLES2 renderer doesn't use it anymore, so we can drop it.
|
|
We never create an EGL context with the platform set to something
other than EGL_PLATFORM_GBM_KHR. Let's simplify wlr_egl_create by
taking a DRM FD instead of a (platform, remote_display) tuple.
This hides the internal details of creating an EGL context for a
specific device. This will allow us to transparently use the device
platform [1] when the time comes.
[1]: https://github.com/swaywm/wlroots/pull/2671
|
|
The wlr_egl functions are mostly used internally by the GLES2
renderer. Let's reduce our API surface a bit by hiding them. If
there are good use-cases for one of these, we can always make them
public again.
The functions mutating the current EGL context are not made private
because e.g. Wayfire uses them.
|
|
GL_RENDERER typically displays a human-readable string for the name
of the GPU, and EGL_VENDOR typically displays a human-readable string
for the GPU manufacturer. EGL_DRIVER_NAME_EXT should give the name of
the driver in use.
References: https://github.com/KhronosGroup/EGL-Registry/commit/e8baa0bf39120803505c6e360e1e33af0d9b9745
|
|
|
|
|
|
This is unused in wlroots, and the use-cases for compositors are
pretty niche since they can access the original DMA-BUF via the
wlr_buffer.
|
|
See the
https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_platform_gbm.txt
example code. On EGL_PLATFORM_GBM_KHR platform, we should be check the
"EGL_KHR_platform_gbm" extension.
Change-Id: Icf11c07c2949841a80b10527fb09987257fbd63b
|
|
All backends use the GBM platform. We can't use it to figure out
whether the DRM backend is used anymore.
Let's just try to always request a high-priority EGL context. Failing
to do so is not fatal.
|
|
Split render/display setups have two separate devices: one display-only
with a primary node, and one render-only with a render node. However
in these cases the EGL implementation and the Wayland compositor will
advertise the display device instead of the render device [1]. The EGL
implementation will magically open the render device when the display
device is passed in.
So just pass the display device as if it were a render device. Maybe in
the future Mesa will advertise the render device instead and we'll be
able to remove this workaround.
[1]: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4178
|
|
Mesa may advertise EGL_MESA_device_software even when hardware
drivers are in use [1]. Demote the error to a warning until the Mesa
bug is fixed.
[1]: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4178
References: https://github.com/swaywm/wlroots/pull/2689
|
|
|
|
As surfaces are no longer going to be used for wlr_egl, I may as well just go and add this check as it is needed for safety whenever surface-less rendering is being used.
|
|
Breaking changes:
Both "EGLint *config_attribs" and "wlr_egl->config" no longer exist.
|
|
Breaking changes:
wlr_egl_create_surface and wlr_egl_destroy_surface have been
removed and no longer exist.
|
|
Fixes: 6becc69ec90c ("render/egl: fail to create wlr_egl on software renderer")
|
|
The creation of `wlr_egl` will fail is the device extension
EGL_MESA_device_software is defined. The creation process is allowed to
continue only if the environment variable `WLR_RENDERER_ALLOW_SOFTWARE`
is defined to the value 1.
|
|
This reverts commit ee31be167b4e2c4682f3da6f22bddc23796f213d.
|