aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/atomic.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-04-06 17:06:37 +0200
committerKenny Levinsen <kl@kl.wtf>2021-04-29 19:51:57 +0200
commit485ecc11a6d31c1a2ba3724dd61ce34f77e7436f (patch)
tree6da8c9ede14785a3d8abffc9e5a3329af133f53b /backend/drm/atomic.c
parentc9c2d7539c69c8bf349a5b633ab61ce2d7c20e8a (diff)
backend/drm: remove wlr_drm_crtc.pending_modeset
Replace it with a new drm_connector_state_is_modeset function that decides whether a modeset is necessary directly from the wlr_output_state which is going to be applied.
Diffstat (limited to 'backend/drm/atomic.c')
-rw-r--r--backend/drm/atomic.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c
index 4a33d358..ac586bb5 100644
--- a/backend/drm/atomic.c
+++ b/backend/drm/atomic.c
@@ -169,8 +169,10 @@ static bool atomic_crtc_commit(struct wlr_drm_backend *drm,
struct wlr_output *output = &conn->output;
struct wlr_drm_crtc *crtc = conn->crtc;
+ bool modeset = drm_connector_state_is_modeset(state);
+
uint32_t mode_id = crtc->mode_id;
- if (crtc->pending_modeset) {
+ if (modeset) {
if (!create_mode_blob(drm, crtc, &mode_id)) {
return false;
}
@@ -203,7 +205,7 @@ static bool atomic_crtc_commit(struct wlr_drm_backend *drm,
vrr_enabled = state->adaptive_sync_enabled;
}
- if (crtc->pending_modeset) {
+ if (modeset) {
flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
} else if (!(flags & DRM_MODE_ATOMIC_TEST_ONLY)) {
flags |= DRM_MODE_ATOMIC_NONBLOCK;
@@ -213,7 +215,7 @@ static bool atomic_crtc_commit(struct wlr_drm_backend *drm,
atomic_begin(&atom);
atomic_add(&atom, conn->id, conn->props.crtc_id,
crtc->pending.active ? crtc->id : 0);
- if (crtc->pending_modeset && crtc->pending.active &&
+ if (modeset && crtc->pending.active &&
conn->props.link_status != 0) {
atomic_add(&atom, conn->id, conn->props.link_status,
DRM_MODE_LINK_STATUS_GOOD);