|
@@ -1515,7 +1515,8 @@ retry:
|
|
copied_props++;
|
|
copied_props++;
|
|
}
|
|
}
|
|
|
|
|
|
- if (obj->type == DRM_MODE_OBJECT_PLANE && count_props) {
|
|
|
|
|
|
+ if (obj->type == DRM_MODE_OBJECT_PLANE && count_props &&
|
|
|
|
+ !(arg->flags & DRM_MODE_ATOMIC_TEST_ONLY)) {
|
|
plane = obj_to_plane(obj);
|
|
plane = obj_to_plane(obj);
|
|
plane_mask |= (1 << drm_plane_index(plane));
|
|
plane_mask |= (1 << drm_plane_index(plane));
|
|
plane->old_fb = plane->fb;
|
|
plane->old_fb = plane->fb;
|
|
@@ -1537,10 +1538,11 @@ retry:
|
|
}
|
|
}
|
|
|
|
|
|
if (arg->flags & DRM_MODE_ATOMIC_TEST_ONLY) {
|
|
if (arg->flags & DRM_MODE_ATOMIC_TEST_ONLY) {
|
|
|
|
+ /*
|
|
|
|
+ * Unlike commit, check_only does not clean up state.
|
|
|
|
+ * Below we call drm_atomic_state_free for it.
|
|
|
|
+ */
|
|
ret = drm_atomic_check_only(state);
|
|
ret = drm_atomic_check_only(state);
|
|
- /* _check_only() does not free state, unlike _commit() */
|
|
|
|
- if (!ret)
|
|
|
|
- drm_atomic_state_free(state);
|
|
|
|
} else if (arg->flags & DRM_MODE_ATOMIC_NONBLOCK) {
|
|
} else if (arg->flags & DRM_MODE_ATOMIC_NONBLOCK) {
|
|
ret = drm_atomic_async_commit(state);
|
|
ret = drm_atomic_async_commit(state);
|
|
} else {
|
|
} else {
|
|
@@ -1567,25 +1569,30 @@ out:
|
|
plane->old_fb = NULL;
|
|
plane->old_fb = NULL;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (ret && arg->flags & DRM_MODE_PAGE_FLIP_EVENT) {
|
|
|
|
+ /*
|
|
|
|
+ * TEST_ONLY and PAGE_FLIP_EVENT are mutually exclusive,
|
|
|
|
+ * if they weren't, this code should be called on success
|
|
|
|
+ * for TEST_ONLY too.
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+ for_each_crtc_in_state(state, crtc, crtc_state, i) {
|
|
|
|
+ if (!crtc_state->event)
|
|
|
|
+ continue;
|
|
|
|
+
|
|
|
|
+ destroy_vblank_event(dev, file_priv,
|
|
|
|
+ crtc_state->event);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if (ret == -EDEADLK) {
|
|
if (ret == -EDEADLK) {
|
|
drm_atomic_state_clear(state);
|
|
drm_atomic_state_clear(state);
|
|
drm_modeset_backoff(&ctx);
|
|
drm_modeset_backoff(&ctx);
|
|
goto retry;
|
|
goto retry;
|
|
}
|
|
}
|
|
|
|
|
|
- if (ret) {
|
|
|
|
- if (arg->flags & DRM_MODE_PAGE_FLIP_EVENT) {
|
|
|
|
- for_each_crtc_in_state(state, crtc, crtc_state, i) {
|
|
|
|
- if (!crtc_state->event)
|
|
|
|
- continue;
|
|
|
|
-
|
|
|
|
- destroy_vblank_event(dev, file_priv,
|
|
|
|
- crtc_state->event);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ if (ret || arg->flags & DRM_MODE_ATOMIC_TEST_ONLY)
|
|
drm_atomic_state_free(state);
|
|
drm_atomic_state_free(state);
|
|
- }
|
|
|
|
|
|
|
|
drm_modeset_drop_locks(&ctx);
|
|
drm_modeset_drop_locks(&ctx);
|
|
drm_modeset_acquire_fini(&ctx);
|
|
drm_modeset_acquire_fini(&ctx);
|