mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 04:42:14 +00:00
monitor-manager: Add logging to enabling and disabling HDR mode
It's hard to tell why turning on HDR mode failed without these log messages. It could be missing support in the sink (EDID/DisplayID) or missing support in the driver/display hardware (connector properties) or just a failure turning it on. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3251>
This commit is contained in:
parent
c96341dcd5
commit
e3b659cfe8
@ -501,6 +501,10 @@ ensure_hdr_settings (MetaMonitorManager *manager)
|
||||
.active = TRUE,
|
||||
.eotf = META_OUTPUT_HDR_METADATA_EOTF_PQ,
|
||||
};
|
||||
|
||||
meta_topic (META_DEBUG_COLOR,
|
||||
"MonitorManager: Trying to enabling HDR mode "
|
||||
"(Colorimetry: bt.2020, TF: PQ, HDR Metadata: Minimal):");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -508,6 +512,10 @@ ensure_hdr_settings (MetaMonitorManager *manager)
|
||||
hdr_metadata = (MetaOutputHdrMetadata) {
|
||||
.active = FALSE,
|
||||
};
|
||||
|
||||
meta_topic (META_DEBUG_COLOR,
|
||||
"MonitorManager: Trying to enable default mode "
|
||||
"(Colorimetry: default, TF: default, HDR Metadata: None):");
|
||||
}
|
||||
|
||||
for (l = manager->monitors; l; l = l->next)
|
||||
@ -517,27 +525,6 @@ ensure_hdr_settings (MetaMonitorManager *manager)
|
||||
|
||||
if (!meta_monitor_set_color_space (monitor, color_space, &error))
|
||||
{
|
||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED))
|
||||
continue;
|
||||
|
||||
g_warning ("Failed to set color space on monitor %s: %s",
|
||||
meta_monitor_get_display_name (monitor), error->message);
|
||||
|
||||
meta_monitor_set_color_space (monitor,
|
||||
META_OUTPUT_COLORSPACE_DEFAULT,
|
||||
NULL);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!meta_monitor_set_hdr_metadata (monitor, &hdr_metadata, &error))
|
||||
{
|
||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED))
|
||||
continue;
|
||||
|
||||
g_warning ("Failed to set HDR metadata on monitor %s: %s",
|
||||
meta_monitor_get_display_name (monitor), error->message);
|
||||
|
||||
meta_monitor_set_color_space (monitor,
|
||||
META_OUTPUT_COLORSPACE_DEFAULT,
|
||||
NULL);
|
||||
@ -545,8 +532,51 @@ ensure_hdr_settings (MetaMonitorManager *manager)
|
||||
.active = FALSE,
|
||||
}, NULL);
|
||||
|
||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED))
|
||||
{
|
||||
meta_topic (META_DEBUG_COLOR,
|
||||
"MonitorManager: Colorimetry not supported "
|
||||
"on monitor %s",
|
||||
meta_monitor_get_display_name (monitor));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Failed to set color space on monitor %s: %s",
|
||||
meta_monitor_get_display_name (monitor), error->message);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!meta_monitor_set_hdr_metadata (monitor, &hdr_metadata, &error))
|
||||
{
|
||||
meta_monitor_set_color_space (monitor,
|
||||
META_OUTPUT_COLORSPACE_DEFAULT,
|
||||
NULL);
|
||||
meta_monitor_set_hdr_metadata (monitor, &(MetaOutputHdrMetadata) {
|
||||
.active = FALSE,
|
||||
}, NULL);
|
||||
|
||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED))
|
||||
{
|
||||
meta_topic (META_DEBUG_COLOR,
|
||||
"MonitorManager: HDR Metadata not supported "
|
||||
"on monitor %s",
|
||||
meta_monitor_get_display_name (monitor));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Failed to set HDR metadata on monitor %s: %s",
|
||||
meta_monitor_get_display_name (monitor),
|
||||
error->message);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
meta_topic (META_DEBUG_COLOR,
|
||||
"MonitorManager: successfully set on monitor %s",
|
||||
meta_monitor_get_display_name (monitor));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -565,6 +565,21 @@ meta_output_peek_color_space (MetaOutput *output)
|
||||
return priv->color_space;
|
||||
}
|
||||
|
||||
const char *
|
||||
meta_output_colorspace_get_name (MetaOutputColorspace color_space)
|
||||
{
|
||||
switch (color_space)
|
||||
{
|
||||
case META_OUTPUT_COLORSPACE_UNKNOWN:
|
||||
return "Unknown";
|
||||
case META_OUTPUT_COLORSPACE_DEFAULT:
|
||||
return "Default";
|
||||
case META_OUTPUT_COLORSPACE_BT2020:
|
||||
return "bt.2020";
|
||||
}
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_output_is_hdr_metadata_supported (MetaOutput *output,
|
||||
MetaOutputHdrMetadataEOTF eotf)
|
||||
|
@ -162,6 +162,8 @@ gboolean
|
||||
meta_tile_info_equal (MetaTileInfo *a,
|
||||
MetaTileInfo *b);
|
||||
|
||||
const char * meta_output_colorspace_get_name (MetaOutputColorspace color_space);
|
||||
|
||||
#define META_TYPE_OUTPUT_INFO (meta_output_info_get_type ())
|
||||
META_EXPORT_TEST
|
||||
GType meta_output_info_get_type (void);
|
||||
|
@ -148,13 +148,27 @@ meta_output_kms_is_color_space_supported (MetaOutput *output,
|
||||
output_info = meta_output_get_info (output);
|
||||
|
||||
if (!meta_output_info_is_color_space_supported (output_info, color_space))
|
||||
return FALSE;
|
||||
{
|
||||
meta_topic (META_DEBUG_COLOR,
|
||||
"MetaOutput: Output %s signals that it doesn't support "
|
||||
"Colorspace %s",
|
||||
meta_output_get_name (output),
|
||||
meta_output_colorspace_get_name (color_space));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
connector_state =
|
||||
meta_kms_connector_get_current_state (output_kms->kms_connector);
|
||||
|
||||
if (!(connector_state->colorspace.supported & (1 << color_space)))
|
||||
return FALSE;
|
||||
{
|
||||
meta_topic (META_DEBUG_COLOR,
|
||||
"MetaOutput: KMS Connector for output %s doesn't support "
|
||||
"Colorspace %s",
|
||||
meta_output_get_name (output),
|
||||
meta_output_colorspace_get_name (color_space));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user