mirror of
https://github.com/brl/mutter.git
synced 2025-02-02 14:53:03 +00:00
monitor: Add getter for EDID MD5 checksum
Will be used for colord device matching. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2141>
This commit is contained in:
parent
15bbded86b
commit
8446cd9f4f
@ -473,6 +473,15 @@ meta_monitor_get_serial (MetaMonitor *monitor)
|
||||
return output_info->serial;
|
||||
}
|
||||
|
||||
const char *
|
||||
meta_monitor_get_edid_checksum_md5 (MetaMonitor *monitor)
|
||||
{
|
||||
const MetaOutputInfo *output_info =
|
||||
meta_monitor_get_main_output_info (monitor);
|
||||
|
||||
return output_info->edid_checksum_md5;
|
||||
}
|
||||
|
||||
MetaConnectorType
|
||||
meta_monitor_get_connector_type (MetaMonitor *monitor)
|
||||
{
|
||||
|
@ -155,6 +155,8 @@ const char * meta_monitor_get_product (MetaMonitor *monitor);
|
||||
META_EXPORT_TEST
|
||||
const char * meta_monitor_get_serial (MetaMonitor *monitor);
|
||||
|
||||
const char * meta_monitor_get_edid_checksum_md5 (MetaMonitor *monitor);
|
||||
|
||||
META_EXPORT_TEST
|
||||
MetaConnectorType meta_monitor_get_connector_type (MetaMonitor *monitor);
|
||||
|
||||
|
@ -94,6 +94,7 @@ meta_output_info_unref (MetaOutputInfo *output_info)
|
||||
g_free (output_info->vendor);
|
||||
g_free (output_info->product);
|
||||
g_free (output_info->serial);
|
||||
g_free (output_info->edid_checksum_md5);
|
||||
g_free (output_info->modes);
|
||||
g_free (output_info->possible_crtcs);
|
||||
g_free (output_info->possible_clones);
|
||||
@ -310,11 +311,16 @@ meta_output_info_parse_edid (MetaOutputInfo *output_info,
|
||||
{
|
||||
MetaEdidInfo *parsed_edid;
|
||||
size_t len;
|
||||
gconstpointer data;
|
||||
|
||||
if (!edid)
|
||||
goto out;
|
||||
|
||||
parsed_edid = meta_edid_info_new_parse (g_bytes_get_data (edid, &len));
|
||||
data = g_bytes_get_data (edid, &len);
|
||||
parsed_edid = meta_edid_info_new_parse (data);
|
||||
|
||||
output_info->edid_checksum_md5 = g_compute_checksum_for_data (G_CHECKSUM_MD5,
|
||||
data, len);
|
||||
|
||||
if (parsed_edid)
|
||||
{
|
||||
|
@ -84,6 +84,9 @@ typedef struct _MetaOutputInfo
|
||||
char *vendor;
|
||||
char *product;
|
||||
char *serial;
|
||||
|
||||
char *edid_checksum_md5;
|
||||
|
||||
int width_mm;
|
||||
int height_mm;
|
||||
CoglSubpixelOrder subpixel_order;
|
||||
|
Loading…
x
Reference in New Issue
Block a user