[mutter] monitor-manager: Initialize MetaOutput even when we can't get the EDID
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor-manager: Initialize MetaOutput even when we can't get the EDID
- Date: Tue, 27 Jan 2015 13:43:31 +0000 (UTC)
commit ad90b7dd2f0eec6c9966e83742e7bfddcea19f76
Author: Rui Matos <tiagomatos gmail com>
Date: Fri Jan 23 17:32:21 2015 +0100
monitor-manager: Initialize MetaOutput even when we can't get the EDID
Otherwise we'll crash later when building a MetaConfiguration.
https://bugzilla.gnome.org/show_bug.cgi?id=743412
src/backends/meta-monitor-manager.c | 4 ++++
src/backends/native/meta-monitor-manager-kms.c | 7 ++-----
src/backends/x11/meta-monitor-manager-xrandr.c | 7 ++-----
3 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index 3f11716..352a182 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -1230,6 +1230,9 @@ meta_output_parse_edid (MetaOutput *meta_output,
MonitorInfo *parsed_edid;
gsize len;
+ if (!edid)
+ goto out;
+
parsed_edid = decode_edid (g_bytes_get_data (edid, &len));
if (parsed_edid)
@@ -1247,6 +1250,7 @@ meta_output_parse_edid (MetaOutput *meta_output,
g_free (parsed_edid);
}
+ out:
if (!meta_output->vendor)
{
meta_output->vendor = g_strdup ("unknown");
diff --git a/src/backends/native/meta-monitor-manager-kms.c b/src/backends/native/meta-monitor-manager-kms.c
index 13709f1..9efba75 100644
--- a/src/backends/native/meta-monitor-manager-kms.c
+++ b/src/backends/native/meta-monitor-manager-kms.c
@@ -512,11 +512,8 @@ meta_monitor_manager_kms_read_current (MetaMonitorManager *manager)
find_properties (manager_kms, output_kms);
edid = read_output_edid (manager_kms, meta_output);
- if (edid)
- {
- meta_output_parse_edid (meta_output, edid);
- g_bytes_unref (edid);
- }
+ meta_output_parse_edid (meta_output, edid);
+ g_bytes_unref (edid);
/* MetaConnectorType matches DRM's connector types */
meta_output->connector_type = (MetaConnectorType) connector->connector_type;
diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c
index 03b4152..d950592 100644
--- a/src/backends/x11/meta-monitor-manager-xrandr.c
+++ b/src/backends/x11/meta-monitor-manager-xrandr.c
@@ -693,11 +693,8 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
meta_output->name = g_strdup (output->name);
edid = read_output_edid (manager_xrandr, meta_output->winsys_id);
- if (edid)
- {
- meta_output_parse_edid (meta_output, edid);
- g_bytes_unref (edid);
- }
+ meta_output_parse_edid (meta_output, edid);
+ g_bytes_unref (edid);
meta_output->width_mm = output->mm_width;
meta_output->height_mm = output->mm_height;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]