summaryrefslogtreecommitdiff
path: root/xf86drmMode.h
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-02-01 14:33:34 +0100
committerSimon Ser <contact@emersion.fr>2022-07-02 20:13:29 +0000
commit50f8d517733d24fce6693ffae552f9833e2e6aa9 (patch)
tree4ea0b222a2ea19f8b1894528ec82e1cec41c3cc9 /xf86drmMode.h
parentf7828dc180ba3427b5e405fab25e9846c07322bc (diff)
downloaddrm-50f8d517733d24fce6693ffae552f9833e2e6aa9.tar.gz
xf86drmMode: introduce drmModeGetConnectorTypeName
User-space often needs to print the name of a connector type. When a new connector type is added, all user-space programs need to be updated to support the new connector type. Expose a function to get a connector type name in libdrm. The names are taken from the kernel [1]. [1]: https://cgit.freedesktop.org/drm/drm/tree/drivers/gpu/drm/drm_connector.c?h=4fc8cb47fcfdc93e274a1291757e478df4f9c39b#n83 Signed-off-by: Simon Ser <contact@emersion.fr>
Diffstat (limited to 'xf86drmMode.h')
-rw-r--r--xf86drmMode.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/xf86drmMode.h b/xf86drmMode.h
index 08557642..46dc80a2 100644
--- a/xf86drmMode.h
+++ b/xf86drmMode.h
@@ -475,6 +475,15 @@ extern drmModeObjectListPtr drmModeGetLease(int fd);
extern int drmModeRevokeLease(int fd, uint32_t lessee_id);
+/**
+ * Get a string describing a connector type.
+ *
+ * NULL is returned if the connector type is unsupported. Callers should handle
+ * this gracefully, e.g. by falling back to "Unknown" or printing the raw value.
+ */
+extern const char *
+drmModeGetConnectorTypeName(uint32_t connector_type);
+
#if defined(__cplusplus)
}
#endif