backends/native: Convert MetaOutputColorspace to DRM Colorspace
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2890>
This commit is contained in:
parent
4a97da3675
commit
950fdc6c04
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user