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: bf40f396bf ("scene: grab image description from output state")
This commit is contained in:
llyyr 2025-10-02 11:29:53 +05:30
parent 406aa5f7f5
commit dde07b6840

View file

@ -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;