[client] wayland: fix color management errors

This commit is contained in:
Geoffrey McRae
2026-07-16 04:09:50 +10:00
committed by Geoffrey McRae
parent 82d36a858f
commit da7d1a2ead
3 changed files with 14 additions and 6 deletions

View File

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

View File

@@ -281,6 +281,7 @@ 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)
if (wlWm.cmHasLuminances)
wp_image_description_creator_params_v1_set_luminances(
wlWm.hdrImageCreator,
minDisplayLuminance > 0 ? minDisplayLuminance : 50,

View File

@@ -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).