Skip to content

Commit

Permalink
drm/atomic: Update old_fb after setting a property.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Maarten Lankhorst authored and Daniel Vetter committed Jul 2, 2015
1 parent 0d0b49c commit a9cc54e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/gpu/drm/drm_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1472,12 +1472,6 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
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;
Expand Down Expand Up @@ -1514,6 +1508,12 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,

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) {
Expand Down

0 comments on commit a9cc54e

Please sign in to comment.