Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

render/egl: fail to create wlr_egl on software renderer #2689

Merged
merged 1 commit into from
Jan 27, 2021

Conversation

bl4ckb0ne
Copy link
Contributor

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 defiled.

Copy link
Member

@emersion emersion left a 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")) {
Copy link
Member

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").

Copy link
Contributor Author

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.
@bl4ckb0ne
Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@emersion emersion merged commit 6becc69 into swaywm:master Jan 27, 2021
emersion added a commit to emersion/wlroots that referenced this pull request Mar 15, 2021
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
emersion added a commit to emersion/wlroots that referenced this pull request Mar 15, 2021
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
emersion added a commit that referenced this pull request Mar 15, 2021
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants