From 15d8f1806e9debd11a1c306e76c97b535e708766 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 18 May 2020 14:27:42 +0200 Subject: 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. --- include/backend/drm/drm.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') 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; -- cgit v1.2.3