• Lukas Wunner's avatar
    drm: Remove dev_pm_ops from drm_class · d14d2a84
    Lukas Wunner authored
    The PM core introduced the ability to keep devices runtime suspended
    during the entire system suspend/resume process with commit aae4518b
    ("PM / sleep: Mechanism to avoid resuming runtime-suspended devices
    unnecessarily"). Before this so-called "direct-complete" procedure was
    introduced, devices were always runtime resumed only to be immediately
    put to sleep again using their ->suspend hook. Direct-complete is
    enabled by returning a positive value from the ->prepare hook. The PCI
    core usually does this automatically.
    
    Direct-complete is only available for a device if all children use it as
    well. Currently we cannot support direct-complete for DRM drivers
    because the DRM core automatically registers multiple DRM minors which
    belong to device class drm_class, and drm_class uses a struct dev_pm_ops
    which lacks the ->prepare callback.
    
    While this could be solved by adding the missing ->prepare callback,
    closer inspection shows that there are no DRM drivers left which declare
    the legacy ->suspend and ->resume callbacks in their drm_driver struct.
    The last ones to remove them were i915 with commit 1751fcf9
    ("drm/i915: Fix module initialisation, v2.") and exynos with commit
    e7fefb1d ("drm/exynos: remove legacy ->suspend()/resume()").
    
    Consequently the struct dev_pm_ops of drm_class is now dead code. Remove
    it. If no dev_pm_ops is declared for a device, the PM core automatically
    enables direct-complete for it, thereby making that mechanism available
    to the parent DRM PCI devices.
    Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    Link: http://patchwork.freedesktop.org/patch/msgid/da848fcd5ca72a35d9a722e644719977a47bb7ba.1465382836.git.lukas@wunner.de
    d14d2a84
drmP.h 37.1 KB