kms/connector: Add support for the Broadcast RGB property

It can be used to force a specific RGB range. Some monitors don't follow
the specification and expect a signal different from what we send. This
property allows to force a mode which hopefully then works correctly for
the sink.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3535>
This commit is contained in:
Sebastian Wick
2024-01-17 13:22:56 +01:00
committed by Marge Bot
parent d45104c14a
commit c4399bd94d
8 changed files with 170 additions and 2 deletions

View File

@ -292,6 +292,25 @@ process_connector_update (MetaKmsImplDevice *impl_device,
return FALSE;
}
if (connector_update->broadcast_rgb.has_update)
{
MetaOutputRGBRange rgb_range = connector_update->broadcast_rgb.value;
uint64_t value = meta_output_rgb_range_to_drm_broadcast_rgb (rgb_range);
meta_topic (META_DEBUG_KMS,
"[atomic] Setting Broadcast RGB to %u on connector %u (%s)",
rgb_range,
meta_kms_connector_get_id (connector),
meta_kms_impl_device_get_path (impl_device));
if (!add_connector_property (impl_device,
connector, req,
META_KMS_CONNECTOR_PROP_BROADCAST_RGB,
value,
error))
return FALSE;
}
return TRUE;
}