-
Notifications
You must be signed in to change notification settings - Fork 342
render/egl: fail to create wlr_egl on software renderer #2689
Conversation
5810fbb
to
b3fc5d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we log an INFO message when we're using a software renderer and WLR_RENDERER_ALLOW_SOFTWARE=1
is set? Juts to make it clear software rendering is used.
Can we document this new env var in doc/env_vars.md
?
render/egl.c
Outdated
@@ -272,6 +272,14 @@ struct wlr_egl *wlr_egl_create(EGLenum platform, void *remote_display, | |||
goto error; | |||
} | |||
|
|||
if (check_egl_ext(device_exts_str, "EGL_MESA_device_software") && | |||
!getenv("WLR_RENDERER_ALLOW_SOFTWARE")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we only lift the check if the env var is exactly "1"? Other WLR_
env vars ignore other values (like "0").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
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.
b3fc5d0
to
a01012e
Compare
I added the doc, tell me if you see any spelling mistake. |
@@ -39,6 +39,11 @@ wlroots reads these environment variables | |||
|
|||
* *WLR_X11_OUTPUTS*: when using the X11 backend specifies the number of outputs | |||
|
|||
## gles2 renderer | |||
|
|||
* *WLR_RENDERER_ALLOW_SOFTWARE*: allows the gles2 renderer to use software |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: this is a GLES2-specific variable, but it doesn't contain "GLES2" in the name. I'd like to implement a similar check in other non-GLES2 renderers such as Vulkan.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Mesa may advertise EGL_MESA_device_software even when hardware drivers are in use. Demote the error to a warning until the Mesa bug is fixed. [1]: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4178 References: swaywm#2689
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: swaywm#2689
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: #2689
The creation of
wlr_egl
will fail is the device extensionEGL_MESA_device_software is defined. The creation process is allowed to
continue only if the environment variable
WLR_RENDERER_ALLOW_SOFTWARE
is defiled.