color-device: Set the color state to BT2020+PQ when HDR is forced

Sets the color state of all monitors to BT2020+PQ even if the monitor
isn't accpeting such a signal.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4035>
This commit is contained in:
Sebastian Wick 2024-09-17 17:20:57 +02:00 committed by Marge Bot
parent 2f3ad4be5c
commit 245dafe811
2 changed files with 11 additions and 0 deletions

View File

@ -697,6 +697,13 @@ update_color_state (MetaColorDevice *color_device)
colorspace = get_color_space_from_monitor (monitor);
eotf = get_eotf_from_monitor (monitor);
if (meta_debug_control_is_hdr_forced (debug_control))
{
colorspace = CLUTTER_COLORSPACE_BT2020;
eotf.type = CLUTTER_EOTF_TYPE_NAMED;
eotf.tf_name = CLUTTER_TRANSFER_FUNCTION_PQ;
}
luminance = clutter_eotf_get_default_luminance (eotf);
reference_luminance_factor =

View File

@ -1288,6 +1288,10 @@ on_started (MetaContext *context,
G_CALLBACK (meta_monitor_manager_reconfigure),
monitor_manager, NULL,
G_CONNECT_SWAPPED | G_CONNECT_AFTER);
g_signal_connect_data (debug_control, "notify::force-hdr",
G_CALLBACK (meta_monitor_manager_reconfigure),
monitor_manager, NULL,
G_CONNECT_SWAPPED | G_CONNECT_AFTER);
g_signal_connect_data (debug_control, "notify::force-linear-blending",
G_CALLBACK (meta_monitor_manager_reconfigure),
monitor_manager, NULL,