]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
drm: Remove dev_pm_ops from drm_class
authorLukas Wunner <lukas@wunner.de>
Wed, 8 Jun 2016 10:49:29 +0000 (12:49 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 9 Jun 2016 06:43:25 +0000 (08:43 +0200)
commitd14d2a8453d650bea32a1c5271af1458cd283a0f
treea6223cbb25dcb9b6d50de1248d96e7f5df9b8519
parent3c85f20a289d044f303f473ee6ab7502303fc3b0
drm: Remove dev_pm_ops from drm_class

The PM core introduced the ability to keep devices runtime suspended
during the entire system suspend/resume process with commit aae4518b3124
("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 1751fcf9f92e
("drm/i915: Fix module initialisation, v2.") and exynos with commit
e7fefb1d5af5 ("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: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/da848fcd5ca72a35d9a722e644719977a47bb7ba.1465382836.git.lukas@wunner.de
drivers/gpu/drm/drm_drv.c
drivers/gpu/drm/drm_sysfs.c
include/drm/drmP.h