core/debug-control: Enable HDR only via DebugControl and META_DEBUG_
This removes the experimental HDR property from the monitor manager and unifies all the debug features in DebugControl. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3902>
This commit is contained in:
parent
2693cac83a
commit
c974bcf4b2
@ -76,7 +76,6 @@ enum
|
|||||||
PROP_PANEL_ORIENTATION_MANAGED,
|
PROP_PANEL_ORIENTATION_MANAGED,
|
||||||
PROP_HAS_BUILTIN_PANEL,
|
PROP_HAS_BUILTIN_PANEL,
|
||||||
PROP_NIGHT_LIGHT_SUPPORTED,
|
PROP_NIGHT_LIGHT_SUPPORTED,
|
||||||
PROP_EXPERIMENTAL_HDR,
|
|
||||||
|
|
||||||
PROP_LAST
|
PROP_LAST
|
||||||
};
|
};
|
||||||
@ -118,7 +117,6 @@ typedef struct _MetaMonitorManagerPrivate
|
|||||||
|
|
||||||
gboolean has_builtin_panel;
|
gboolean has_builtin_panel;
|
||||||
gboolean night_light_supported;
|
gboolean night_light_supported;
|
||||||
char *experimental_hdr;
|
|
||||||
|
|
||||||
guint reload_monitor_manager_id;
|
guint reload_monitor_manager_id;
|
||||||
guint switch_config_handle_id;
|
guint switch_config_handle_id;
|
||||||
@ -535,14 +533,15 @@ set_color_space_and_hdr_metadata (MetaMonitorManager *manager,
|
|||||||
static void
|
static void
|
||||||
ensure_hdr_settings (MetaMonitorManager *manager)
|
ensure_hdr_settings (MetaMonitorManager *manager)
|
||||||
{
|
{
|
||||||
MetaMonitorManagerPrivate *priv =
|
MetaBackend *backend = manager->backend;
|
||||||
meta_monitor_manager_get_instance_private (manager);
|
MetaContext *context = meta_backend_get_context (backend);
|
||||||
|
MetaDebugControl *debug_control = meta_context_get_debug_control (context);
|
||||||
MetaOutputColorspace color_space;
|
MetaOutputColorspace color_space;
|
||||||
MetaOutputHdrMetadata hdr_metadata;
|
MetaOutputHdrMetadata hdr_metadata;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
set_color_space_and_hdr_metadata (manager,
|
set_color_space_and_hdr_metadata (manager,
|
||||||
g_strcmp0 (priv->experimental_hdr, "on") == 0,
|
meta_debug_control_is_hdr_enabled (debug_control),
|
||||||
&color_space,
|
&color_space,
|
||||||
&hdr_metadata);
|
&hdr_metadata);
|
||||||
|
|
||||||
@ -1361,9 +1360,10 @@ on_started (MetaContext *context,
|
|||||||
{
|
{
|
||||||
MetaDebugControl *debug_control = meta_context_get_debug_control (context);
|
MetaDebugControl *debug_control = meta_context_get_debug_control (context);
|
||||||
|
|
||||||
g_signal_connect (monitor_manager, "notify::experimental-hdr",
|
g_signal_connect_data (debug_control, "notify::enable-hdr",
|
||||||
G_CALLBACK (meta_monitor_manager_reconfigure),
|
G_CALLBACK (meta_monitor_manager_reconfigure),
|
||||||
NULL);
|
monitor_manager, NULL,
|
||||||
|
G_CONNECT_SWAPPED | G_CONNECT_AFTER);
|
||||||
g_signal_connect_data (debug_control, "notify::force-linear-blending",
|
g_signal_connect_data (debug_control, "notify::force-linear-blending",
|
||||||
G_CALLBACK (meta_monitor_manager_reconfigure),
|
G_CALLBACK (meta_monitor_manager_reconfigure),
|
||||||
monitor_manager, NULL,
|
monitor_manager, NULL,
|
||||||
@ -1374,17 +1374,12 @@ static void
|
|||||||
meta_monitor_manager_constructed (GObject *object)
|
meta_monitor_manager_constructed (GObject *object)
|
||||||
{
|
{
|
||||||
MetaMonitorManager *manager = META_MONITOR_MANAGER (object);
|
MetaMonitorManager *manager = META_MONITOR_MANAGER (object);
|
||||||
MetaMonitorManagerPrivate *priv =
|
|
||||||
meta_monitor_manager_get_instance_private (manager);
|
|
||||||
MetaBackend *backend = manager->backend;
|
MetaBackend *backend = manager->backend;
|
||||||
MetaContext *context = meta_backend_get_context (backend);
|
MetaContext *context = meta_backend_get_context (backend);
|
||||||
MetaSettings *settings = meta_backend_get_settings (backend);
|
MetaSettings *settings = meta_backend_get_settings (backend);
|
||||||
|
|
||||||
manager->display_config = meta_dbus_display_config_skeleton_new ();
|
manager->display_config = meta_dbus_display_config_skeleton_new ();
|
||||||
|
|
||||||
if (g_strcmp0 (getenv ("MUTTER_DEBUG_ENABLE_HDR"), "1") == 0)
|
|
||||||
priv->experimental_hdr = g_strdup ("on");
|
|
||||||
|
|
||||||
g_signal_connect_object (settings,
|
g_signal_connect_object (settings,
|
||||||
"experimental-features-changed",
|
"experimental-features-changed",
|
||||||
G_CALLBACK (experimental_features_changed),
|
G_CALLBACK (experimental_features_changed),
|
||||||
@ -1433,7 +1428,6 @@ meta_monitor_manager_finalize (GObject *object)
|
|||||||
MetaMonitorManagerPrivate *priv =
|
MetaMonitorManagerPrivate *priv =
|
||||||
meta_monitor_manager_get_instance_private (manager);
|
meta_monitor_manager_get_instance_private (manager);
|
||||||
|
|
||||||
g_clear_pointer (&priv->experimental_hdr, g_free);
|
|
||||||
g_list_free_full (manager->logical_monitors, g_object_unref);
|
g_list_free_full (manager->logical_monitors, g_object_unref);
|
||||||
|
|
||||||
g_warn_if_fail (!priv->virtual_monitors);
|
g_warn_if_fail (!priv->virtual_monitors);
|
||||||
@ -1475,18 +1469,12 @@ meta_monitor_manager_set_property (GObject *object,
|
|||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
MetaMonitorManager *manager = META_MONITOR_MANAGER (object);
|
MetaMonitorManager *manager = META_MONITOR_MANAGER (object);
|
||||||
MetaMonitorManagerPrivate *priv =
|
|
||||||
meta_monitor_manager_get_instance_private (manager);
|
|
||||||
|
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_BACKEND:
|
case PROP_BACKEND:
|
||||||
manager->backend = g_value_get_object (value);
|
manager->backend = g_value_get_object (value);
|
||||||
break;
|
break;
|
||||||
case PROP_EXPERIMENTAL_HDR:
|
|
||||||
g_clear_pointer (&priv->experimental_hdr, g_free);
|
|
||||||
priv->experimental_hdr = g_value_dup_string (value);
|
|
||||||
break;
|
|
||||||
case PROP_PANEL_ORIENTATION_MANAGED:
|
case PROP_PANEL_ORIENTATION_MANAGED:
|
||||||
case PROP_HAS_BUILTIN_PANEL:
|
case PROP_HAS_BUILTIN_PANEL:
|
||||||
case PROP_NIGHT_LIGHT_SUPPORTED:
|
case PROP_NIGHT_LIGHT_SUPPORTED:
|
||||||
@ -1519,9 +1507,6 @@ meta_monitor_manager_get_property (GObject *object,
|
|||||||
case PROP_NIGHT_LIGHT_SUPPORTED:
|
case PROP_NIGHT_LIGHT_SUPPORTED:
|
||||||
g_value_set_boolean (value, priv->night_light_supported);
|
g_value_set_boolean (value, priv->night_light_supported);
|
||||||
break;
|
break;
|
||||||
case PROP_EXPERIMENTAL_HDR:
|
|
||||||
g_value_set_string (value, priv->experimental_hdr);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
}
|
}
|
||||||
@ -1617,12 +1602,6 @@ meta_monitor_manager_class_init (MetaMonitorManagerClass *klass)
|
|||||||
G_PARAM_EXPLICIT_NOTIFY |
|
G_PARAM_EXPLICIT_NOTIFY |
|
||||||
G_PARAM_STATIC_STRINGS);
|
G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
obj_props[PROP_EXPERIMENTAL_HDR] =
|
|
||||||
g_param_spec_string ("experimental-hdr", NULL, NULL,
|
|
||||||
NULL,
|
|
||||||
G_PARAM_READWRITE |
|
|
||||||
G_PARAM_STATIC_STRINGS);
|
|
||||||
|
|
||||||
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
|
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,72 +84,6 @@ on_bus_acquired (GDBusConnection *connection,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
on_enable_hdr_changed (MetaDebugControl *debug_control,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
MetaDBusDebugControl *dbus_debug_control =
|
|
||||||
META_DBUS_DEBUG_CONTROL (debug_control);
|
|
||||||
MetaBackend *backend = meta_context_get_backend (debug_control->context);
|
|
||||||
MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend);
|
|
||||||
gboolean enable;
|
|
||||||
|
|
||||||
enable = meta_dbus_debug_control_get_enable_hdr (dbus_debug_control);
|
|
||||||
g_object_set (G_OBJECT (monitor_manager),
|
|
||||||
"experimental-hdr", enable ? "on" : "off",
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
on_experimental_hdr_changed (MetaMonitorManager *monitor_manager,
|
|
||||||
GParamSpec *pspec,
|
|
||||||
MetaDebugControl *debug_control)
|
|
||||||
{
|
|
||||||
MetaDBusDebugControl *dbus_debug_control =
|
|
||||||
META_DBUS_DEBUG_CONTROL (debug_control);
|
|
||||||
g_autofree char *experimental_hdr = NULL;
|
|
||||||
gboolean enable;
|
|
||||||
|
|
||||||
g_object_get (G_OBJECT (monitor_manager),
|
|
||||||
"experimental-hdr", &experimental_hdr,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
enable = g_strcmp0 (experimental_hdr, "on") == 0;
|
|
||||||
if (enable == meta_dbus_debug_control_get_enable_hdr (dbus_debug_control))
|
|
||||||
return;
|
|
||||||
|
|
||||||
meta_dbus_debug_control_set_enable_hdr (META_DBUS_DEBUG_CONTROL (debug_control),
|
|
||||||
g_strcmp0 (experimental_hdr, "on") == 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
on_context_started (MetaContext *context,
|
|
||||||
MetaDebugControl *debug_control)
|
|
||||||
{
|
|
||||||
MetaBackend *backend = meta_context_get_backend (context);
|
|
||||||
MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend);
|
|
||||||
|
|
||||||
g_signal_connect (monitor_manager, "notify::experimental-hdr",
|
|
||||||
G_CALLBACK (on_experimental_hdr_changed),
|
|
||||||
debug_control);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
meta_debug_control_constructed (GObject *object)
|
|
||||||
{
|
|
||||||
MetaDebugControl *debug_control = META_DEBUG_CONTROL (object);
|
|
||||||
|
|
||||||
g_signal_connect_object (debug_control->context, "started",
|
|
||||||
G_CALLBACK (on_context_started), debug_control,
|
|
||||||
G_CONNECT_DEFAULT);
|
|
||||||
|
|
||||||
g_signal_connect_object (debug_control, "notify::enable-hdr",
|
|
||||||
G_CALLBACK (on_enable_hdr_changed), debug_control,
|
|
||||||
G_CONNECT_DEFAULT);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (meta_debug_control_parent_class)->constructed (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_debug_control_dispose (GObject *object)
|
meta_debug_control_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
@ -203,7 +137,6 @@ meta_debug_control_class_init (MetaDebugControlClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
object_class->constructed = meta_debug_control_constructed;
|
|
||||||
object_class->dispose = meta_debug_control_dispose;
|
object_class->dispose = meta_debug_control_dispose;
|
||||||
object_class->set_property = meta_debug_control_set_property;
|
object_class->set_property = meta_debug_control_set_property;
|
||||||
object_class->get_property = meta_debug_control_get_property;
|
object_class->get_property = meta_debug_control_get_property;
|
||||||
@ -221,8 +154,15 @@ meta_debug_control_init (MetaDebugControl *debug_control)
|
|||||||
{
|
{
|
||||||
MetaDBusDebugControl *dbus_debug_control =
|
MetaDBusDebugControl *dbus_debug_control =
|
||||||
META_DBUS_DEBUG_CONTROL (debug_control);
|
META_DBUS_DEBUG_CONTROL (debug_control);
|
||||||
|
gboolean enable_hdr, force_linear_blending;
|
||||||
|
|
||||||
meta_dbus_debug_control_set_force_linear_blending (dbus_debug_control, FALSE);
|
enable_hdr = g_strcmp0 (getenv ("MUTTER_DEBUG_ENABLE_HDR"), "1") == 0;
|
||||||
|
meta_dbus_debug_control_set_enable_hdr (dbus_debug_control, enable_hdr);
|
||||||
|
|
||||||
|
force_linear_blending =
|
||||||
|
g_strcmp0 (getenv ("MUTTER_DEBUG_FORCE_LINEAR_BLENDING"), "1") == 0;
|
||||||
|
meta_dbus_debug_control_set_force_linear_blending (dbus_debug_control,
|
||||||
|
force_linear_blending);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@ -234,6 +174,15 @@ meta_debug_control_is_linear_blending_forced (MetaDebugControl *debug_control)
|
|||||||
return meta_dbus_debug_control_get_force_linear_blending (dbus_debug_control);
|
return meta_dbus_debug_control_get_force_linear_blending (dbus_debug_control);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
meta_debug_control_is_hdr_enabled (MetaDebugControl *debug_control)
|
||||||
|
{
|
||||||
|
MetaDBusDebugControl *dbus_debug_control =
|
||||||
|
META_DBUS_DEBUG_CONTROL (debug_control);
|
||||||
|
|
||||||
|
return meta_dbus_debug_control_get_enable_hdr (dbus_debug_control);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_debug_control_export (MetaDebugControl *debug_control)
|
meta_debug_control_export (MetaDebugControl *debug_control)
|
||||||
{
|
{
|
||||||
|
@ -30,4 +30,6 @@ G_DECLARE_FINAL_TYPE (MetaDebugControl,
|
|||||||
|
|
||||||
gboolean meta_debug_control_is_linear_blending_forced (MetaDebugControl *debug_control);
|
gboolean meta_debug_control_is_linear_blending_forced (MetaDebugControl *debug_control);
|
||||||
|
|
||||||
|
gboolean meta_debug_control_is_hdr_enabled (MetaDebugControl *debug_control);
|
||||||
|
|
||||||
void meta_debug_control_export (MetaDebugControl *debug_control);
|
void meta_debug_control_export (MetaDebugControl *debug_control);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user