From dc258b2237df9aaf898efa849bcb8e2d1cddec68 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 28 Jan 2025 12:40:40 +0100 Subject: [PATCH] output: add transfer function to image description --- include/wlr/types/wlr_output.h | 4 ++++ types/output/output.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index c94b82116..e6cd58824 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -89,9 +89,12 @@ enum wlr_output_state_mode_type { * Carries information about the color encoding used for a struct wlr_buffer. * * Supported primaries are advertised in wlr_output.supported_primaries. + * Supported transfer functions are advertised in + * wlr_output.supported_transfer_functions. */ struct wlr_output_image_description { enum wlr_color_named_primaries primaries; + enum wlr_color_transfer_function transfer_function; }; /** @@ -182,6 +185,7 @@ struct wlr_output { int32_t refresh; // mHz, may be zero uint32_t supported_primaries; // bitfield of enum wlr_color_named_primaries + uint32_t supported_transfer_functions; // bitfield of enum wlr_color_transfer_function bool enabled; float scale; diff --git a/types/output/output.c b/types/output/output.c index a0a3f9e02..8576bb0e6 100644 --- a/types/output/output.c +++ b/types/output/output.c @@ -679,6 +679,10 @@ static bool output_basic_test(struct wlr_output *output, wlr_log(WLR_DEBUG, "Unsupported image description primaries"); return false; } + if (!(output->supported_transfer_functions & state->image_description->transfer_function)) { + wlr_log(WLR_DEBUG, "Unsupported image description transfer function"); + return false; + } } return true;