22 Jun, 2019

1 commit

  • This completes Emil's series of removing DRM_UNLOCKED from modern
    drivers. It's entirely cargo-culted since we ignore it on
    non-DRIVER_LEGACY drivers since:

    commit ea487835e8876abf7ad909636e308c801a2bcda6
    Author: Daniel Vetter
    Date: Mon Sep 28 21:42:40 2015 +0200

    drm: Enforce unlocked ioctl operation for kms driver ioctls

    Now justifying why we can do this for legacy drives too (and hence
    close the source of all the bogus copypasting) is a bit more involved.
    DRM_UNLOCKED was introduced in:

    commit ed8b67040965e4fe695db333d5914e18ea5f146f
    Author: Arnd Bergmann
    Date: Wed Dec 16 22:17:09 2009 +0000

    drm: convert drm_ioctl to unlocked_ioctl

    As a immediate hack to keep i810 happy, which would have deadlocked
    without this trickery. The old BKL is automatically dropped in
    schedule(), and hence the i810 vs. mmap_sem deadlock didn't actually
    cause a real deadlock. But with a mutex it would. The solution was to
    annotate these as DRM_UNLOCKED and mark i810 unsafe on SMP machines.

    This conversion caused a regression, because unlike the BKL a mutex
    isn't dropped over schedule (that thing again), which caused a vblank
    wait in one thread to block the entire desktop and all its apps. Back
    then we did vblank scheduling by blocking in the client, awesome isn't
    it. This was fixed quickly in (ok not so quickly, took 2 years):

    commit 8f4ff2b06afcd6f151868474a432c603057eaf56
    Author: Ilija Hadzic
    Date: Mon Oct 31 17:46:18 2011 -0400

    drm: do not sleep on vblank while holding a mutex

    All the other DRM_UNLOCKED annotations for all the core ioctls was
    work to reach finer-grained locking for modern drivers. This took
    years, and culminated in:

    commit fdd5b877e9ebc2029e1373b4a3cd057329a9ab7a
    Author: Daniel Vetter
    Date: Sat Dec 10 22:52:54 2016 +0100

    drm: Enforce BKL-less ioctls for modern drivers

    DRM_UNLOCKED was never required by any legacy drivers, except for the
    vblank_wait IOCTL. Therefore we will not regress these old drivers by
    going back to where we've been in 2011. For all modern drivers nothing
    will change.

    To make this perfectly clear, also add a comment to DRM_UNLOCKED.

    v2: Don't forget about drm_ioc32.c (Michel).

    Cc: Michel Dänzer
    Cc: Emil Velikov
    Acked-by: Emil Velikov
    Acked-by: Michel Dänzer
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20190605120835.2798-1-daniel.vetter@ffwll.ch

    Daniel Vetter
     

04 May, 2018

1 commit

  • With the ioctl and driver prep done, we can remove everything else.

    Reviewed-by: Sean Paul
    Signed-off-by: Daniel Vetter
    Cc: Gustavo Padovan
    Cc: Maarten Lankhorst
    Cc: Sean Paul
    Cc: David Airlie
    Link: https://patchwork.freedesktop.org/patch/msgid/20180420065159.4531-4-daniel.vetter@ffwll.ch

    Daniel Vetter
     

28 May, 2017

1 commit


05 Apr, 2017

1 commit

  • Also unify/merge with the existing stuff.

    I was a bit torn where to put this, but in the end I decided to put
    all the ioctl/sysfs/debugfs stuff into drm-uapi.rst. That means we
    have a bit a split with the other uapi related stuff used internally,
    like drm_file.[hc], but I think overall this makes more sense.

    If it's too confusing we can always add more cross-links to make it
    more discoverable. But the auto-sprinkling of links kernel-doc already
    does seems sufficient.

    Also for prettier docs and more cross-links, switch the internal
    defines over to an enum, as usual.

    v2: Update kerneldoc fro drm_compat_ioctl too (caught by 0day), plus a
    bit more drive-by polish.

    v3: Fix typo, spotted by xerpi on irc (Sergi).

    v4: Add missing space in comment (Neil).

    Cc: Sergi Granell
    Reviewed-by: Neil Armstrong
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170404095304.17599-4-daniel.vetter@ffwll.ch

    Daniel Vetter
     

26 Mar, 2017

1 commit