diff --git a/client/displayservers/Wayland/colormgmt.c b/client/displayservers/Wayland/colormgmt.c index 6ca5cfb7..e7419a34 100644 --- a/client/displayservers/Wayland/colormgmt.c +++ b/client/displayservers/Wayland/colormgmt.c @@ -26,6 +26,12 @@ #include "common/debug.h" +static void cmIntent(void * data, struct wp_color_manager_v1 * cm, uint32_t intent) +{ + if (intent == WP_COLOR_MANAGER_V1_RENDER_INTENT_PERCEPTUAL) + wlWm.cmHasPerceptualIntent = true; +} + static void cmFeature(void * data, struct wp_color_manager_v1 * cm, uint32_t feature) { switch (feature) @@ -78,7 +84,7 @@ static void cmDone(void * data, struct wp_color_manager_v1 * cm) } static const struct wp_color_manager_v1_listener cmListener = { - .supported_intent = NULL, + .supported_intent = cmIntent, .supported_feature = cmFeature, .supported_tf_named = cmTFNamed, .supported_primaries_named = cmPrimariesNamed, diff --git a/client/displayservers/Wayland/gl.c b/client/displayservers/Wayland/gl.c index cd1c2d02..e0cd0a5f 100644 --- a/client/displayservers/Wayland/gl.c +++ b/client/displayservers/Wayland/gl.c @@ -281,11 +281,12 @@ void waylandSetHDRImageDescription(const uint16_t displayPrimary[3][2], : WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR); // Set luminance range from metadata (values already in 0.0001 cd/m² units) - wp_image_description_creator_params_v1_set_luminances( - wlWm.hdrImageCreator, - minDisplayLuminance > 0 ? minDisplayLuminance : 50, - maxDisplayLuminance > 0 ? maxDisplayLuminance : 10000000, - hdrPQ ? 2030000 : 800000); + if (wlWm.cmHasLuminances) + wp_image_description_creator_params_v1_set_luminances( + wlWm.hdrImageCreator, + minDisplayLuminance > 0 ? minDisplayLuminance : 50, + maxDisplayLuminance > 0 ? maxDisplayLuminance : 10000000, + hdrPQ ? 2030000 : 800000); // Set mastering display primaries from frame HDR metadata. // Always set when the compositor supports it, falling back to the diff --git a/client/displayservers/Wayland/wayland.h b/client/displayservers/Wayland/wayland.h index c5cf74bc..dca9e07e 100644 --- a/client/displayservers/Wayland/wayland.h +++ b/client/displayservers/Wayland/wayland.h @@ -202,6 +202,7 @@ struct WaylandDSState bool cmHasTFExtLinear; bool cmHasPrimariesBT2020; bool cmHasPrimariesSRGB; + bool cmHasPerceptualIntent; bool cmCanDoHDR; // true if compositor supports features needed for HDR // Pending HDR format to apply (set by frame thread, applied in swap buffers).