From 92890583627ee2a0518e55b063fcff86826fef96 Mon Sep 17 00:00:00 2001 From: Matt Roper Date: Mon, 19 Jan 2015 08:31:49 -0800 Subject: drm/plane-helper: Skip prepare_fb/cleanup_fb when newfb==oldfb When commiting a plane update where the framebuffer doesn't change, we can skip the prepare_fb/cleanup_fb steps. This also allows us to avoid an unnecessary vblank wait at the end of the operation when we're just moving a plane and not changing its image (e.g., for a cursor). At the moment, i915 is the only upstream driver using the transitional plane helpers, and thus the only driver affected by this change. Note that this replicates a corresponding change in the atomic helpers implemented in commit ab58e3384b9f9863bfd029b458ff337d381bf6d2 Author: Daniel Vetter Date: Mon Nov 24 20:42:42 2014 +0100 drm/atomic-helper: Skip vblank waits for unchanged fbs Reported-by: Jeremiah Mahler Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88540 Signed-off-by: Matt Roper Tested-by: Tested-by: Rodrigo Vivi Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_plane_helper.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/drm/drm_plane_helper.c') diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index f24c4cf..7a5814a 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c @@ -435,7 +435,8 @@ int drm_plane_helper_commit(struct drm_plane *plane, goto out; } - if (plane_funcs->prepare_fb && plane_state->fb) { + if (plane_funcs->prepare_fb && plane_state->fb && + plane_state->fb != old_fb) { ret = plane_funcs->prepare_fb(plane, plane_state->fb); if (ret) goto out; @@ -456,6 +457,13 @@ int drm_plane_helper_commit(struct drm_plane *plane, crtc_funcs[i]->atomic_flush(crtc[i]); } + /* + * If we only moved the plane and didn't change fb's, there's no need to + * wait for vblank. + */ + if (plane->state->fb == old_fb) + goto out; + for (i = 0; i < 2; i++) { if (!crtc[i]) continue; -- cgit v1.1 From 6a425c2a9b37ca3d2c37e3c1cdf973dba53eaa79 Mon Sep 17 00:00:00 2001 From: Matt Roper Date: Thu, 15 Jan 2015 18:34:22 -0800 Subject: drm/plane-helper: Fix transitional helper kerneldocs drm_plane_helper_{update,disable} are not specific to primary planes; fix some copy/paste summaries to avoid confusion. Cc: dri-devel@lists.freedesktop.org Signed-off-by: Matt Roper Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_plane_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/drm/drm_plane_helper.c') diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index 7a5814a..510fe03 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c @@ -492,7 +492,7 @@ out: } /** - * drm_plane_helper_update() - Helper for primary plane update + * drm_plane_helper_update() - Transitional helper for plane update * @plane: plane object to update * @crtc: owning CRTC of owning plane * @fb: framebuffer to flip onto plane @@ -549,7 +549,7 @@ int drm_plane_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, EXPORT_SYMBOL(drm_plane_helper_update); /** - * drm_plane_helper_disable() - Helper for primary plane disable + * drm_plane_helper_disable() - Transitional helper for plane disable * @plane: plane to disable * * Provides a default plane disable handler using the atomic plane update -- cgit v1.1