]> git.baikalelectronics.ru Git - kernel.git/commit
drm: Drop modeset_lock_all from the getproperty ioctl
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 3 Apr 2017 08:32:55 +0000 (10:32 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 5 Apr 2017 07:27:16 +0000 (09:27 +0200)
commitc2c2da91a606899eb85764c5dbacf0c96101d334
treec51333a75cc84ca2cb86ed0d1164debe190f7f11
parent871f5681a31a91259dd6f763870dda302be5d129
drm: Drop modeset_lock_all from the getproperty ioctl

Properties, i.e. the struct drm_property specifying the type and value
range of a property, not the instantiation on a given object, are
invariant over the lifetime of a driver.

Hence no locking at all is needed, we can just remove it.

While at it give the function some love and simplify it, to get it
under the 80 char limit:
- Straighten the loops to reduce the nesting.
- use u64_to_user_ptr casting helper
- use put_user for fixed u64 copies.

Note there's a small behavioural change in that we now copy parts of
the values to userspace if the arrays are a bit too small. Since
userspace will immediately retry anyway, this doesn't matter.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170403083304.9083-7-daniel.vetter@ffwll.ch
drivers/gpu/drm/drm_property.c