aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-07-08 22:07:23 +0200
committerSimon Ser <contact@emersion.fr>2022-07-25 17:28:33 +0000
commit7b5e890e61a27375725068a7d1884b26851b3102 (patch)
treea3e6349bab99de37b8579d7d355e87b46cbace0e /backend/drm
parentbd587a7f431e53764d5e8051f2717d32d4c62b69 (diff)
backend/drm: use drmModeConnectorGetPossibleCrtcs
This function has been merged in libdrm. References: https://gitlab.freedesktop.org/mesa/drm/-/commit/3ee004ef529f43366fdd1f4d32b26872cc82c6ca
Diffstat (limited to 'backend/drm')
-rw-r--r--backend/drm/drm.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 660477b6..6d7168e9 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -1164,23 +1164,6 @@ static void realloc_crtcs(struct wlr_drm_backend *drm) {
}
}
-static uint32_t get_possible_crtcs(int fd, const drmModeConnector *conn) {
- uint32_t possible_crtcs = 0;
-
- for (int i = 0; i < conn->count_encoders; ++i) {
- drmModeEncoder *enc = drmModeGetEncoder(fd, conn->encoders[i]);
- if (!enc) {
- continue;
- }
-
- possible_crtcs |= enc->possible_crtcs;
-
- drmModeFreeEncoder(enc);
- }
-
- return possible_crtcs;
-}
-
static void disconnect_drm_connector(struct wlr_drm_connector *conn);
void scan_drm_connectors(struct wlr_drm_backend *drm,
@@ -1389,7 +1372,8 @@ void scan_drm_connectors(struct wlr_drm_backend *drm,
wl_list_insert(wlr_conn->output.modes.prev, &mode->wlr_mode.link);
}
- wlr_conn->possible_crtcs = get_possible_crtcs(drm->fd, drm_conn);
+ wlr_conn->possible_crtcs =
+ drmModeConnectorGetPossibleCrtcs(drm->fd, drm_conn);
if (wlr_conn->possible_crtcs == 0) {
wlr_drm_conn_log(wlr_conn, WLR_ERROR, "No CRTC possible");
}