From 13b9b54f3f22e6c932207f6cad9632782ec86d71 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Fri, 24 May 2024 17:23:14 +0200 Subject: [PATCH] wlr_scene: Skip direct scanout on color transform If we need to apply a color transform to rendered content, we will not be able to use direct scanout. Explicitly skip it to not accidentally show frames lacking the color transform. --- types/scene/wlr_scene.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index da851bf3..e3e49584 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -1830,8 +1830,12 @@ bool wlr_scene_output_build_state(struct wlr_scene_output *scene_output, output_state_apply_damage(&render_data, state); - // don't enter direct scanout if we're using the highlight debug option - bool scanout = list_len == 1 && debug_damage != WLR_SCENE_DEBUG_DAMAGE_HIGHLIGHT && + // We only want to try direct scanout if: + // - There is only one entry in the render list + // - There are no color transforms that need to be applied + // - Damage highlight debugging is not enabled + bool scanout = options->color_transform == NULL && + list_len == 1 && debug_damage != WLR_SCENE_DEBUG_DAMAGE_HIGHLIGHT && scene_entry_try_direct_scanout(&list_data[0], state, &render_data); if (scene_output->prev_scanout != scanout) {