backend/drm: use drmModeGetConnectorTypeName

No need to manually maintain this table now.

The wlroots names and the libdrm (= kernel) names all match.

References: 50f8d51773
This commit is contained in:
Simon Ser 2022-07-08 22:04:20 +02:00
parent 972a5cdf7a
commit bd587a7f43
4 changed files with 8 additions and 36 deletions

View file

@ -1250,9 +1250,14 @@ void scan_drm_connectors(struct wlr_drm_backend *drm,
wlr_conn->status = WLR_DRM_CONN_DISCONNECTED;
wlr_conn->id = drm_conn->connector_id;
const char *conn_name =
drmModeGetConnectorTypeName(drm_conn->connector_type);
if (conn_name == NULL) {
conn_name = "Unknown";
}
snprintf(wlr_conn->name, sizeof(wlr_conn->name),
"%s-%"PRIu32, conn_get_name(drm_conn->connector_type),
drm_conn->connector_type_id);
"%s-%"PRIu32, conn_name, drm_conn->connector_type_id);
wl_list_insert(drm->outputs.prev, &wlr_conn->link);
wlr_log(WLR_INFO, "Found connector '%s'", wlr_conn->name);