From 775817e278fde86c8c41e3eee791798781adc0e2 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sun, 4 Aug 2024 16:23:53 +0200 Subject: [PATCH] render: add WLR_RENDER_NO_EXPLICIT_SYNC env var This can be handy to figure out if a bug is due to explicit sync. --- docs/env_vars.md | 2 ++ render/wlr_renderer.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/docs/env_vars.md b/docs/env_vars.md index a2a86c84..06e47ac5 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_RENDER_NO_EXPLICIT_SYNC*: set to 1 to disable explicit synchronization + support in 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. diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index 6a28908c..a580ab56 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -274,6 +274,9 @@ out: if (own_drm_fd && drm_fd >= 0) { close(drm_fd); } + if (renderer != NULL && env_parse_bool("WLR_RENDER_NO_EXPLICIT_SYNC")) { + renderer->features.timeline = false; + } return renderer; }