[Intel-gfx] [PATCH 06/15] drm: Drop modeset_lock_all from the getproperty ioctl

Chris Wilson chris at chris-wilson.co.uk
Thu Apr 13 20:18:13 UTC 2017


On Thu, Apr 13, 2017 at 04:03:16PM -0400, Alex Deucher wrote:
> On Mon, Apr 3, 2017 at 4:32 AM, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> > 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.
> >
> > Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> 
> This causes a segfault in our ddx:
> https://bugs.freedesktop.org/show_bug.cgi?id=100673

Should be fixed by:

commit 8cb68c83ab99a474ae847602f0c514d0fe17cc82
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date:   Mon Apr 10 13:54:45 2017 +0200

    drm: Fix get_property logic fumble
    
    Yet again I've proven that I can't negate conditions :(
    
    Testcase: igt/kms_properties/get_property-sanity
    Reviewed-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
    Reviewed-by: Sean Paul <seanpaul at chromium.org>
    Fixes: eb8eb02ed850 ("drm: Drop modeset_lock_all from the getproperty ioctl")

Does that help?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the dri-devel mailing list