diff options
author | Alexander Orzechowski <[email protected]> | 2022-08-08 00:40:21 -0400 |
---|---|---|
committer | Alexander Orzechowski <[email protected]> | 2022-08-08 00:40:21 -0400 |
commit | d165c3d5454d47ea25fa81d07f68e3a963d80310 (patch) | |
tree | 466f242de13b613e91d775a6826e85f8f2808e80 | |
parent | b36818c39a6e2d4312888694d34e75eddb42fa56 (diff) |
wlr_scene: Add option to disable direct scanout
Closes: #3405
Supersedes: !3562
Co-authored-by: Xiao YaoBing <[email protected]>
-rw-r--r-- | wlr_scene.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/wlr_scene.c b/wlr_scene.c index 68b05b7..3c45811 100644 --- a/wlr_scene.c +++ b/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 |