aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2015-06-24 08:59:24 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-07-02 17:00:49 +0200
commita9cc54eeba635d2feb2ed4bf43d4ea4e08e7e0a9 (patch)
tree72c5bd78e43a0e218d389f54a73171525e0dcc79
parent0d0b49c51e0c1b5f4facbf7191db82b39ac99b96 (diff)
drm/atomic: Update old_fb after setting a property.
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> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/drm_atomic.c12
1 files 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) {