aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/env_vars.md1
-rw-r--r--include/wlr/types/wlr_scene.h1
-rw-r--r--types/scene/wlr_scene.c18
3 files changed, 20 insertions, 0 deletions
diff --git a/docs/env_vars.md b/docs/env_vars.md
index 6a0a9442..e5d5d62b 100644
--- a/docs/env_vars.md
+++ b/docs/env_vars.md
@@ -50,6 +50,7 @@ wlroots reads these environment variables
* *WLR_SCENE_DEBUG_DAMAGE*: specifies debug options for screen damage related
tasks for compositors that use scenes (available options: none, rerender,
highlight)
+* *WLR_SCENE_DISABLE_DIRECT_SCANOUT*: disables direct scan-out for debugging.
# Generic
diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h
index 85d0f94e..a8737921 100644
--- a/include/wlr/types/wlr_scene.h
+++ b/include/wlr/types/wlr_scene.h
@@ -93,6 +93,7 @@ struct wlr_scene {
struct wl_listener presentation_destroy;
enum wlr_scene_debug_damage_option debug_damage_option;
+ bool direct_scanout;
};
/** A scene-graph node displaying a single surface. */
diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c
index 68b05b7c..3c458116 100644
--- a/types/scene/wlr_scene.c
+++ b/types/scene/wlr_scene.c
@@ -164,6 +164,20 @@ struct wlr_scene *wlr_scene_create(void) {
scene->debug_damage_option = WLR_SCENE_DEBUG_DAMAGE_NONE;
}
+ char *disable_direct_scanout = getenv("WLR_SCENE_DISABLE_DIRECT_SCANOUT");
+ if (disable_direct_scanout) {
+ wlr_log(WLR_INFO, "Loading WLR_SCENE_DISABLE_DIRECT_SCANOUT option: %s", disable_direct_scanout);
+ }
+
+ if (!disable_direct_scanout || strcmp(disable_direct_scanout, "0") == 0) {
+ scene->direct_scanout = true;
+ } else if (strcmp(disable_direct_scanout, "1") == 0) {
+ scene->direct_scanout = false;
+ } else {
+ wlr_log(WLR_ERROR, "Unknown WLR_SCENE_DISABLE_DIRECT_SCANOUT option: %s", disable_direct_scanout);
+ scene->direct_scanout = true;
+ }
+
return scene;
}
@@ -1140,6 +1154,10 @@ static void check_scanout_iterator(struct wlr_scene_node *node,
}
static bool scene_output_scanout(struct wlr_scene_output *scene_output) {
+ if (!scene_output->scene->direct_scanout) {
+ return false;
+ }
+
if (scene_output->scene->debug_damage_option ==
WLR_SCENE_DEBUG_DAMAGE_HIGHLIGHT) {
// We don't want to enter direct scan out if we have highlight regions