]> git.baikalelectronics.ru Git - 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)
commit7ecd322b20cb1f1eae908fc5d521bccaada5d8b2
treea6223cbb25dcb9b6d50de1248d96e7f5df9b8519
parent1e6c95c37a5d684eb05e575b388ce54a50bf2c11
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 3eca042e42bc
("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 2226f5a168d3
("drm/i915: Fix module initialisation, v2.") and exynos with commit
e992f5306471 ("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