|
|
@@ -1573,15 +1573,6 @@ int drm_atomic_helper_async_check(struct drm_device *dev,
|
|
|
if (old_plane_state->fb != new_plane_state->fb)
|
|
|
return -EINVAL;
|
|
|
|
|
|
- /*
|
|
|
- * FIXME: Since prepare_fb and cleanup_fb are always called on
|
|
|
- * the new_plane_state for async updates we need to block framebuffer
|
|
|
- * changes. This prevents use of a fb that's been cleaned up and
|
|
|
- * double cleanups from occuring.
|
|
|
- */
|
|
|
- if (old_plane_state->fb != new_plane_state->fb)
|
|
|
- return -EINVAL;
|
|
|
-
|
|
|
funcs = plane->helper_private;
|
|
|
if (!funcs->atomic_async_update)
|
|
|
return -EINVAL;
|
|
|
@@ -1612,6 +1603,8 @@ EXPORT_SYMBOL(drm_atomic_helper_async_check);
|
|
|
* drm_atomic_async_check() succeeds. Async commits are not supposed to swap
|
|
|
* the states like normal sync commits, but just do in-place changes on the
|
|
|
* current state.
|
|
|
+ *
|
|
|
+ * TODO: Implement full swap instead of doing in-place changes.
|
|
|
*/
|
|
|
void drm_atomic_helper_async_commit(struct drm_device *dev,
|
|
|
struct drm_atomic_state *state)
|
|
|
@@ -1622,6 +1615,9 @@ void drm_atomic_helper_async_commit(struct drm_device *dev,
|
|
|
int i;
|
|
|
|
|
|
for_each_new_plane_in_state(state, plane, plane_state, i) {
|
|
|
+ struct drm_framebuffer *new_fb = plane_state->fb;
|
|
|
+ struct drm_framebuffer *old_fb = plane->state->fb;
|
|
|
+
|
|
|
funcs = plane->helper_private;
|
|
|
funcs->atomic_async_update(plane, plane_state);
|
|
|
|
|
|
@@ -1630,11 +1626,17 @@ void drm_atomic_helper_async_commit(struct drm_device *dev,
|
|
|
* plane->state in-place, make sure at least common
|
|
|
* properties have been properly updated.
|
|
|
*/
|
|
|
- WARN_ON_ONCE(plane->state->fb != plane_state->fb);
|
|
|
+ WARN_ON_ONCE(plane->state->fb != new_fb);
|
|
|
WARN_ON_ONCE(plane->state->crtc_x != plane_state->crtc_x);
|
|
|
WARN_ON_ONCE(plane->state->crtc_y != plane_state->crtc_y);
|
|
|
WARN_ON_ONCE(plane->state->src_x != plane_state->src_x);
|
|
|
WARN_ON_ONCE(plane->state->src_y != plane_state->src_y);
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Make sure the FBs have been swapped so that cleanups in the
|
|
|
+ * new_state performs a cleanup in the old FB.
|
|
|
+ */
|
|
|
+ WARN_ON_ONCE(plane_state->fb != old_fb);
|
|
|
}
|
|
|
}
|
|
|
EXPORT_SYMBOL(drm_atomic_helper_async_commit);
|