aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-10-19 11:22:14 +0200
committerSimon Ser <contact@emersion.fr>2022-10-21 09:52:18 +0200
commit6d90518c974e1dd959ed00c255de5b54595c4e90 (patch)
treee29ce2c9b683f09686d21595a7f4d962634797f0
parentccf4e040367414f53102b5a10507083688dff9b4 (diff)
egl: add WLR_EGL_NO_MODIFIERS
Same as WLR_DRM_NO_MODIFIERS but for EGL. For debugging purposes mostly. References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3451
-rw-r--r--docs/env_vars.md2
-rw-r--r--render/egl.c17
2 files changed, 15 insertions, 4 deletions
diff --git a/docs/env_vars.md b/docs/env_vars.md
index 62472783..39daf9fd 100644
--- a/docs/env_vars.md
+++ b/docs/env_vars.md
@@ -12,6 +12,8 @@ wlroots reads these environment variables
renderers: gles2, pixman, vulkan)
* *WLR_RENDER_DRM_DEVICE*: specifies the DRM node to use for
hardware-accelerated renderers.
+* *WLR_EGL_NO_MODIFIERS*: set to 1 to disable format modifiers in EGL, this can
+ be used to understand and work around driver bugs.
## DRM backend
diff --git a/render/egl.c b/render/egl.c
index 2ba57a92..e3839c7d 100644
--- a/render/egl.c
+++ b/render/egl.c
@@ -107,6 +107,11 @@ static void log_modifier(uint64_t modifier, bool external_only) {
}
static void init_dmabuf_formats(struct wlr_egl *egl) {
+ bool no_modifiers = env_parse_bool("WLR_EGL_NO_MODIFIERS");
+ if (no_modifiers) {
+ wlr_log(WLR_INFO, "WLR_EGL_NO_MODIFIERS set, disabling modifiers for EGL");
+ }
+
int *formats;
int formats_len = get_egl_dmabuf_formats(egl, &formats);
if (formats_len < 0) {
@@ -121,8 +126,10 @@ static void init_dmabuf_formats(struct wlr_egl *egl) {
uint64_t *modifiers;
EGLBoolean *external_only;
- int modifiers_len =
- get_egl_dmabuf_modifiers(egl, fmt, &modifiers, &external_only);
+ int modifiers_len = 0;
+ if (!no_modifiers) {
+ modifiers_len = get_egl_dmabuf_modifiers(egl, fmt, &modifiers, &external_only);
+ }
if (modifiers_len < 0) {
continue;
}
@@ -174,8 +181,10 @@ static void init_dmabuf_formats(struct wlr_egl *egl) {
free(formats);
egl->has_modifiers = has_modifiers;
- wlr_log(WLR_DEBUG, "EGL DMA-BUF format modifiers %s",
- has_modifiers ? "supported" : "unsupported");
+ if (!no_modifiers) {
+ wlr_log(WLR_DEBUG, "EGL DMA-BUF format modifiers %s",
+ has_modifiers ? "supported" : "unsupported");
+ }
}
static struct wlr_egl *egl_create(void) {