diff options
author | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-01-26 21:13:28 -0500 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-01-27 15:50:19 +0100 |
commit | 6becc69ec90c2300d974e653ca50d2d33cf94c00 (patch) | |
tree | 89ac84eee0f7d8f467b5a16869ebd3526c4cc7b3 /render | |
parent | 5a2ef794dcf4fe6099866ff11af44d363e0286a1 (diff) |
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.
Diffstat (limited to 'render')
-rw-r--r-- | render/egl.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/render/egl.c b/render/egl.c index c1734a36..2eea387b 100644 --- a/render/egl.c +++ b/render/egl.c @@ -272,6 +272,18 @@ struct wlr_egl *wlr_egl_create(EGLenum platform, void *remote_display, goto error; } + if (check_egl_ext(device_exts_str, "EGL_MESA_device_software")) { + const char *allow_software = getenv("WLR_RENDERER_ALLOW_SOFTWARE"); + if (strcmp(allow_software, "1") == 0) { + wlr_log(WLR_INFO, "Using software rendering"); + } else { + wlr_log(WLR_ERROR, "Software rendering detected, please use " + "the WLR_RENDERER_ALLOW_SOFTWARE environment variable " + "to proceed"); + goto error; + } + } + egl->exts.device_drm_ext = check_egl_ext(device_exts_str, "EGL_EXT_device_drm"); } |