Skip to content

Commit a9cc54e

Browse files
mlankhorstdanvet
authored andcommitted
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>
1 parent 0d0b49c commit a9cc54e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/gpu/drm/drm_atomic.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,12 +1472,6 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
14721472
goto fail;
14731473
}
14741474

1475-
if (obj->type == DRM_MODE_OBJECT_PLANE) {
1476-
plane = obj_to_plane(obj);
1477-
plane_mask |= (1 << drm_plane_index(plane));
1478-
plane->old_fb = plane->fb;
1479-
}
1480-
14811475
if (get_user(count_props, count_props_ptr + copied_objs)) {
14821476
ret = -EFAULT;
14831477
goto fail;
@@ -1514,6 +1508,12 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
15141508

15151509
copied_props++;
15161510
}
1511+
1512+
if (obj->type == DRM_MODE_OBJECT_PLANE && count_props) {
1513+
plane = obj_to_plane(obj);
1514+
plane_mask |= (1 << drm_plane_index(plane));
1515+
plane->old_fb = plane->fb;
1516+
}
15171517
}
15181518

15191519
if (arg->flags & DRM_MODE_PAGE_FLIP_EVENT) {

0 commit comments

Comments
 (0)