From dde07b68404a54ba0134baae1c1b429fdce6a707 Mon Sep 17 00:00:00 2001 From: llyyr Date: Thu, 2 Oct 2025 11:29:53 +0530 Subject: [PATCH] wlr_scene: fix tf/prim comparison for scanout attempt We were incorrectly doing comparison with `!= 0` to detect non-sRGB tf/primaries. Since these enums are bit flags, the default sRGB values are 1, not 0, so sRGB buffers were incorrectly rejected. Fixes: bf40f396bfd0 ("scene: grab image description from output state") --- types/scene/wlr_scene.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index ac3ea3ecf..c9454abcb 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -1982,7 +1982,8 @@ static enum scene_direct_scanout_result scene_entry_try_direct_scanout( } const struct wlr_output_image_description *img_desc = output_pending_image_description(scene_output->output, state); - if (buffer->transfer_function != 0 || buffer->primaries != 0) { + if (buffer->transfer_function != WLR_COLOR_TRANSFER_FUNCTION_SRGB || + buffer->primaries != WLR_COLOR_NAMED_PRIMARIES_SRGB) { if (img_desc == NULL || img_desc->transfer_function != buffer->transfer_function || img_desc->primaries != buffer->primaries) { return false;