[RFC] compositor-drm: name outputs according to connectors if EDID is unavailable
Matt Hoosier
matt.hoosier at gmail.com
Thu Aug 24 01:50:02 UTC 2017
On embedded systems, EDID is typically unavailble for connectors on buses
such as LVDS or DSI. This change enhances the original opportunistic
naming done in 2b2092adb499d8cdc10390cf19876706bcfe69cb to report the
make and model of an output according to the KMS connector (e.g., "DSI-1")
if no dynamic information about an attached monitor is available for
the connector.
---
libweston/compositor-drm.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 10adb46..ccae228 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -2304,7 +2304,7 @@ edid_parse(struct drm_edid *edid, const uint8_t *data, size_t length)
return 0;
}
-static void
+static bool
find_and_parse_output_edid(struct drm_backend *b,
struct drm_output *output,
drmModeConnector *connector)
@@ -2326,7 +2326,7 @@ find_and_parse_output_edid(struct drm_backend *b,
drmModeFreeProperty(property);
}
if (!edid_blob)
- return;
+ return false;
rc = edid_parse(&output->edid,
edid_blob->data,
@@ -2344,6 +2344,7 @@ find_and_parse_output_edid(struct drm_backend *b,
output->base.serial_number = output->edid.serial_number;
}
drmModeFreePropertyBlob(edid_blob);
+ return !rc;
}
@@ -2650,7 +2651,12 @@ drm_output_enable(struct weston_output *base)
output->base.subpixel = drm_subpixel_to_wayland(output->connector->subpixel);
- find_and_parse_output_edid(b, output, output->connector);
+ if (!find_and_parse_output_edid(b, output, output->connector)) {
+ /* Fall back to using connector names if EDID isn't applicable for the connector */
+ output->base.make = output->base.name;
+ output->base.model = output->base.name;
+ }
+
if (output->connector->connector_type == DRM_MODE_CONNECTOR_LVDS ||
output->connector->connector_type == DRM_MODE_CONNECTOR_eDP)
output->base.connection_internal = 1;
--
2.9.5
More information about the wayland-devel
mailing list