diff options
author | Keith Packard <[email protected]> | 2016-06-04 01:16:22 -0700 |
---|---|---|
committer | Daniel Vetter <[email protected]> | 2016-08-08 10:59:56 +0200 |
commit | fcc60b413d14dd06ddbd79ec50e83c4fb2a097ba (patch) | |
tree | f1f3cf50c3ce94ad80e9b8494d5b7e25fa8682a9 | |
parent | fa5386459f06dc3b9181d4c954f980b127d1a32f (diff) |
drm: Don't prepare or cleanup unchanging frame buffers [v3]
When reconfiguring a plane position (as in moving the cursor), the
frame buffer for the cursor isn't changing, so don't call the prepare
or cleanup driver functions.
This avoids making cursor position updates block on all pending rendering.
v3: use drm_atomic_helper_framebuffer_changed in both prepare and
cleanup phases instead of keeping state in the plane.
cc: [email protected]
cc: David Airlie <[email protected]>
cc: Daniel Vetter <[email protected]>
Signed-off-by: Keith Packard <[email protected]>
[danvet: Rebase onto 4.8]
Signed-off-by: Daniel Vetter <[email protected]>
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 20be86d89a20..813821e15f93 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1631,6 +1631,9 @@ int drm_atomic_helper_prepare_planes(struct drm_device *dev, funcs = plane->helper_private; + if (!drm_atomic_helper_framebuffer_changed(dev, state, plane_state->crtc)) + continue; + if (funcs->prepare_fb) { ret = funcs->prepare_fb(plane, plane_state); if (ret) @@ -1647,11 +1650,13 @@ fail: if (j >= i) continue; + if (!drm_atomic_helper_framebuffer_changed(dev, state, plane_state->crtc)) + continue; + funcs = plane->helper_private; if (funcs->cleanup_fb) funcs->cleanup_fb(plane, plane_state); - } return ret; @@ -1894,6 +1899,9 @@ void drm_atomic_helper_cleanup_planes(struct drm_device *dev, for_each_plane_in_state(old_state, plane, plane_state, i) { const struct drm_plane_helper_funcs *funcs; + if (!drm_atomic_helper_framebuffer_changed(dev, old_state, plane_state->crtc)) + continue; + funcs = plane->helper_private; if (funcs->cleanup_fb) |