diff --git a/src/backends/native/meta-kms-connector-private.h b/src/backends/native/meta-kms-connector-private.h index b720c8623..c5ae9e251 100644 --- a/src/backends/native/meta-kms-connector-private.h +++ b/src/backends/native/meta-kms-connector-private.h @@ -142,6 +142,8 @@ MetaKmsConnector * meta_kms_connector_new (MetaKmsImplDevice *impl_device, gboolean meta_kms_connector_is_same_as (MetaKmsConnector *connector, drmModeConnector *drm_connector); +uint64_t meta_output_color_space_to_drm_color_space (MetaOutputColorspace color_space); + META_EXPORT_TEST void meta_set_drm_hdr_metadata (MetaOutputHdrMetadata *metadata, struct hdr_output_metadata *drm_metadata); diff --git a/src/backends/native/meta-kms-connector.c b/src/backends/native/meta-kms-connector.c index 5c2e563cc..0f96a5c26 100644 --- a/src/backends/native/meta-kms-connector.c +++ b/src/backends/native/meta-kms-connector.c @@ -343,6 +343,20 @@ supported_drm_color_spaces_to_output_color_spaces (uint64_t drm_support) return supported; } +uint64_t +meta_output_color_space_to_drm_color_space (MetaOutputColorspace color_space) +{ + switch (color_space) + { + case META_OUTPUT_COLORSPACE_BT2020: + return META_KMS_CONNECTOR_COLORSPACE_BT2020_RGB; + case META_OUTPUT_COLORSPACE_UNKNOWN: + case META_OUTPUT_COLORSPACE_DEFAULT: + default: + return META_KMS_CONNECTOR_COLORSPACE_DEFAULT; + } +} + static void state_set_properties (MetaKmsConnectorState *state, MetaKmsImplDevice *impl_device, diff --git a/src/backends/native/meta-kms-impl-device-atomic.c b/src/backends/native/meta-kms-impl-device-atomic.c index 2566cd936..83b217274 100644 --- a/src/backends/native/meta-kms-impl-device-atomic.c +++ b/src/backends/native/meta-kms-impl-device-atomic.c @@ -245,7 +245,8 @@ process_connector_update (MetaKmsImplDevice *impl_device, if (!add_connector_property (impl_device, connector, req, META_KMS_CONNECTOR_PROP_COLORSPACE, - connector_update->colorspace.value, + meta_output_color_space_to_drm_color_space ( + connector_update->colorspace.value), error)) return FALSE; }