Commit 3158a2d4 authored by Daniel Stone's avatar Daniel Stone

compositor-drm: Calculate atomic-commit flags earlier

Shift up our calculation of the flags we use for atomic commits. We will
later use this to differentiate between test-only and full commits when
printing debug information inside drm_output_state_apply_atomic.
Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
parent ce62cb3d
......@@ -2497,12 +2497,24 @@ drm_pending_state_apply_atomic(struct drm_pending_state *pending_state,
struct drm_output_state *output_state, *tmp;
struct drm_plane *plane;
drmModeAtomicReq *req = drmModeAtomicAlloc();
uint32_t flags = 0;
uint32_t flags;
int ret = 0;
if (!req)
return -1;
switch (mode) {
case DRM_STATE_APPLY_SYNC:
flags = 0;
break;
case DRM_STATE_APPLY_ASYNC:
flags = DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_NONBLOCK;
break;
case DRM_STATE_TEST_ONLY:
flags = DRM_MODE_ATOMIC_TEST_ONLY;
break;
}
if (b->state_invalid) {
struct weston_head *head_base;
struct drm_head *head;
......@@ -2595,17 +2607,6 @@ drm_pending_state_apply_atomic(struct drm_pending_state *pending_state,
goto out;
}
switch (mode) {
case DRM_STATE_APPLY_SYNC:
break;
case DRM_STATE_APPLY_ASYNC:
flags |= DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_NONBLOCK;
break;
case DRM_STATE_TEST_ONLY:
flags |= DRM_MODE_ATOMIC_TEST_ONLY;
break;
}
ret = drmModeAtomicCommit(b->drm.fd, req, flags, b);
/* Test commits do not take ownership of the state; return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment