Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/atomic: Update old_fb after setting a property.
@ 2015-06-24  6:59 Maarten Lankhorst
  2015-06-24  6:59 ` [PATCH 2/2] drm/atomic: Cleanup on error properly in the atomic ioctl Maarten Lankhorst
  2015-07-02 14:26 ` [PATCH 1/2] drm/atomic: Update old_fb after setting a property Rob Clark
  0 siblings, 2 replies; 4+ messages in thread
From: Maarten Lankhorst @ 2015-06-24  6:59 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx

This change updates the old_fb pointer only after acquiring the plane lock,
if there are no properties the fb cannot have been changed either, so
this works out correctly.

Found in a discussion with Rob Clark.

Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index f6f2fb58eb37..bd7f723c708e 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1472,12 +1472,6 @@ retry:
 			goto fail;
 		}
 
-		if (obj->type == DRM_MODE_OBJECT_PLANE) {
-			plane = obj_to_plane(obj);
-			plane_mask |= (1 << drm_plane_index(plane));
-			plane->old_fb = plane->fb;
-		}
-
 		if (get_user(count_props, count_props_ptr + copied_objs)) {
 			ret = -EFAULT;
 			goto fail;
@@ -1514,6 +1508,12 @@ retry:
 
 			copied_props++;
 		}
+
+		if (obj->type == DRM_MODE_OBJECT_PLANE && count_props) {
+			plane = obj_to_plane(obj);
+			plane_mask |= (1 << drm_plane_index(plane));
+			plane->old_fb = plane->fb;
+		}
 	}
 
 	if (arg->flags & DRM_MODE_PAGE_FLIP_EVENT) {
-- 
2.1.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-07  6:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-24  6:59 [PATCH 1/2] drm/atomic: Update old_fb after setting a property Maarten Lankhorst
2015-06-24  6:59 ` [PATCH 2/2] drm/atomic: Cleanup on error properly in the atomic ioctl Maarten Lankhorst
2015-07-07  6:56   ` Daniel Vetter
2015-07-02 14:26 ` [PATCH 1/2] drm/atomic: Update old_fb after setting a property Rob Clark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox