drm: Move ->old_fb from crtc to plane
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 27 Jul 2014 11:42:42 +0000 (13:42 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 8 Aug 2014 15:46:52 +0000 (17:46 +0200)
commit3d30a59bfcb7c96d4aacdb053c2ccc49394b2311
tree6adc99304307bbe49b51a259a72232a13ca7b9ef
parentd059f652e73c35678d28d4cd09ab2cec89696af9
drm: Move ->old_fb from crtc to plane

Atomic implemenations for legacy ioctls must be able to drop locks.
Which doesn't cause havoc since we only do that while constructing
the new state, so no driver or hardware state change has happened.

The only troubling bit is the fb refcounting the core does - if
someone else has snuck in then it might potentially unref an
outdated framebuffer. To fix that move the old_fb temporary storage
into struct drm_plane for all ioctls, so that the atomic helpers can
update it.

v2: Fix up the error case handling as suggested by Matt Roper and just
grab locks uncoditionally - there's no point in optimizing the locking
for when userspace gets it wrong.

Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_crtc.c
include/drm/drm_crtc.h