aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-05-18 14:27:42 +0200
committerDrew DeVault <sir@cmpwn.com>2020-05-26 23:34:37 +0200
commit15d8f1806e9debd11a1c306e76c97b535e708766 (patch)
tree3aa778104763da145da8a46ddbbba51add72e3d4 /include
parentd6cc7184729029a4d8e9dc5e306a17fe9bb7e342 (diff)
backend/drm: introduce pending and current CRTC state
Previously, we only had the pending state (crtc->pending, crtc->mode and crtc->active). This causes issues when a commit fails: the pending state is left as-is, and the next commit may read stale data from it. This will also cause issues when implementing test-only commits: we need to rollback the pending CRTC state after a test-only commit. Introduce separate pending and current CRTC states. Properly update the current state after a commit.
Diffstat (limited to 'include')
-rw-r--r--include/backend/drm/drm.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h
index dc34c681..7755da59 100644
--- a/include/backend/drm/drm.h
+++ b/include/backend/drm/drm.h
@@ -42,16 +42,16 @@ struct wlr_drm_plane {
union wlr_drm_plane_props props;
};
-enum wlr_drm_crtc_field {
- WLR_DRM_CRTC_MODE = 1 << 0,
+struct wlr_drm_crtc_state {
+ bool active;
+ struct wlr_drm_mode *mode;
};
struct wlr_drm_crtc {
uint32_t id;
- uint32_t pending; // bitfield of enum wlr_drm_crtc_field
- bool active;
- drmModeModeInfo mode;
+ bool pending_modeset;
+ struct wlr_drm_crtc_state pending, current;
// Atomic modesetting only
uint32_t mode_id;