diff options
author | Simon Ser <contact@emersion.fr> | 2021-04-06 17:14:17 +0200 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2021-04-29 19:51:57 +0200 |
commit | dfea0ff31dbf74f4d310df8eb55a57a51878e1fc (patch) | |
tree | ce503b3393a17db49f8c1deed0bcbbc40ff8cc31 /backend/drm/legacy.c | |
parent | 485ecc11a6d31c1a2ba3724dd61ce34f77e7436f (diff) |
backend/drm: remove wlr_drm_crtc_state.active
Replace it with drm_connector_state_active, which figures out
whether the connector is active depending on the wlr_output_state
to be applied.
Diffstat (limited to 'backend/drm/legacy.c')
-rw-r--r-- | backend/drm/legacy.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/backend/drm/legacy.c b/backend/drm/legacy.c index 2f573899..dad45253 100644 --- a/backend/drm/legacy.c +++ b/backend/drm/legacy.c @@ -15,8 +15,10 @@ static bool legacy_crtc_commit(struct wlr_drm_backend *drm, struct wlr_drm_crtc *crtc = conn->crtc; struct wlr_drm_plane *cursor = crtc->cursor; + bool active = drm_connector_state_active(conn, state); + uint32_t fb_id = 0; - if (crtc->pending.active) { + if (active) { struct wlr_drm_fb *fb = plane_get_next_fb(crtc->primary); if (fb == NULL) { wlr_log(WLR_ERROR, "%s: failed to acquire primary FB", @@ -30,14 +32,13 @@ static bool legacy_crtc_commit(struct wlr_drm_backend *drm, uint32_t *conns = NULL; size_t conns_len = 0; drmModeModeInfo *mode = NULL; - if (crtc->pending.active) { + if (active) { conns = &conn->id; conns_len = 1; mode = &crtc->pending.mode->drm_mode; } - uint32_t dpms = crtc->pending.active ? - DRM_MODE_DPMS_ON : DRM_MODE_DPMS_OFF; + uint32_t dpms = active ? DRM_MODE_DPMS_ON : DRM_MODE_DPMS_OFF; if (drmModeConnectorSetProperty(drm->fd, conn->id, conn->props.dpms, dpms) != 0) { wlr_drm_conn_log_errno(conn, WLR_ERROR, |