aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_atomic_helper.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2019-06-05 21:56:00 -0400
committerDave Airlie <airlied@redhat.com>2019-06-05 21:57:13 -0400
commitdbd9f78ed23746e9708f773224eec2c8b33206e7 (patch)
treec3402e3caf21d9636f3d241d819b536adb0fd735 /drivers/gpu/drm/drm_atomic_helper.c
parent75cb3776fdffa94b424406aeb0efb76b122990f5 (diff)
parent283f1e383e91d96fe652fad549537ae15cf31d60 (diff)
Merge tag 'drm-misc-fixes-2019-06-05' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
- Allow fb changes in async commits (fixes igt failures) (Helen) - Actually unmap the scatterlist when unmapping udmabuf (Lucas) Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Helen Koike <helen.koike@collabora.com> Signed-off-by: Dave Airlie <airlied@redhat.com> From: Sean Paul <sean@poorly.run> Link: https://patchwork.freedesktop.org/patch/msgid/20190605210335.GA35431@art_vandelay
Diffstat (limited to 'drivers/gpu/drm/drm_atomic_helper.c')
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 2e0cb4246cbd..22a5c617f670 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1607,15 +1607,6 @@ int drm_atomic_helper_async_check(struct drm_device *dev,
1607 old_plane_state->crtc != new_plane_state->crtc) 1607 old_plane_state->crtc != new_plane_state->crtc)
1608 return -EINVAL; 1608 return -EINVAL;
1609 1609
1610 /*
1611 * FIXME: Since prepare_fb and cleanup_fb are always called on
1612 * the new_plane_state for async updates we need to block framebuffer
1613 * changes. This prevents use of a fb that's been cleaned up and
1614 * double cleanups from occuring.
1615 */
1616 if (old_plane_state->fb != new_plane_state->fb)
1617 return -EINVAL;
1618
1619 funcs = plane->helper_private; 1610 funcs = plane->helper_private;
1620 if (!funcs->atomic_async_update) 1611 if (!funcs->atomic_async_update)
1621 return -EINVAL; 1612 return -EINVAL;
@@ -1646,6 +1637,8 @@ EXPORT_SYMBOL(drm_atomic_helper_async_check);
1646 * drm_atomic_async_check() succeeds. Async commits are not supposed to swap 1637 * drm_atomic_async_check() succeeds. Async commits are not supposed to swap
1647 * the states like normal sync commits, but just do in-place changes on the 1638 * the states like normal sync commits, but just do in-place changes on the
1648 * current state. 1639 * current state.
1640 *
1641 * TODO: Implement full swap instead of doing in-place changes.
1649 */ 1642 */
1650void drm_atomic_helper_async_commit(struct drm_device *dev, 1643void drm_atomic_helper_async_commit(struct drm_device *dev,
1651 struct drm_atomic_state *state) 1644 struct drm_atomic_state *state)
@@ -1656,6 +1649,9 @@ void drm_atomic_helper_async_commit(struct drm_device *dev,
1656 int i; 1649 int i;
1657 1650
1658 for_each_new_plane_in_state(state, plane, plane_state, i) { 1651 for_each_new_plane_in_state(state, plane, plane_state, i) {
1652 struct drm_framebuffer *new_fb = plane_state->fb;
1653 struct drm_framebuffer *old_fb = plane->state->fb;
1654
1659 funcs = plane->helper_private; 1655 funcs = plane->helper_private;
1660 funcs->atomic_async_update(plane, plane_state); 1656 funcs->atomic_async_update(plane, plane_state);
1661 1657
@@ -1664,11 +1660,17 @@ void drm_atomic_helper_async_commit(struct drm_device *dev,
1664 * plane->state in-place, make sure at least common 1660 * plane->state in-place, make sure at least common
1665 * properties have been properly updated. 1661 * properties have been properly updated.
1666 */ 1662 */
1667 WARN_ON_ONCE(plane->state->fb != plane_state->fb); 1663 WARN_ON_ONCE(plane->state->fb != new_fb);
1668 WARN_ON_ONCE(plane->state->crtc_x != plane_state->crtc_x); 1664 WARN_ON_ONCE(plane->state->crtc_x != plane_state->crtc_x);
1669 WARN_ON_ONCE(plane->state->crtc_y != plane_state->crtc_y); 1665 WARN_ON_ONCE(plane->state->crtc_y != plane_state->crtc_y);
1670 WARN_ON_ONCE(plane->state->src_x != plane_state->src_x); 1666 WARN_ON_ONCE(plane->state->src_x != plane_state->src_x);
1671 WARN_ON_ONCE(plane->state->src_y != plane_state->src_y); 1667 WARN_ON_ONCE(plane->state->src_y != plane_state->src_y);
1668
1669 /*
1670 * Make sure the FBs have been swapped so that cleanups in the
1671 * new_state performs a cleanup in the old FB.
1672 */
1673 WARN_ON_ONCE(plane_state->fb != old_fb);
1672 } 1674 }
1673} 1675}
1674EXPORT_SYMBOL(drm_atomic_helper_async_commit); 1676EXPORT_SYMBOL(drm_atomic_helper_async_commit);