]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
drm/msm: call drm_atomic_helper_suspend() and drm_atomic_helper_resume()
authorDaniel Mack <daniel@zonque.org>
Mon, 28 May 2018 19:53:38 +0000 (21:53 +0200)
committerRob Clark <robdclark@gmail.com>
Wed, 25 Jul 2018 11:51:04 +0000 (07:51 -0400)
To make suspend and resume work on msm8916 platforms, call into the generic
helpers and preserve the state across suspends.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/msm/msm_drv.h

index 021a0b6f9a597b0b22795c1fa18f97e5e14eb2c0..7f7321eb531274ae24d2d729bf72544b49e69c46 100644 (file)
@@ -894,16 +894,25 @@ static struct drm_driver msm_driver = {
 static int msm_pm_suspend(struct device *dev)
 {
        struct drm_device *ddev = dev_get_drvdata(dev);
+       struct msm_drm_private *priv = ddev->dev_private;
 
        drm_kms_helper_poll_disable(ddev);
 
+       priv->pm_state = drm_atomic_helper_suspend(ddev);
+       if (IS_ERR(priv->pm_state)) {
+               drm_kms_helper_poll_enable(ddev);
+               return PTR_ERR(priv->pm_state);
+       }
+
        return 0;
 }
 
 static int msm_pm_resume(struct device *dev)
 {
        struct drm_device *ddev = dev_get_drvdata(dev);
+       struct msm_drm_private *priv = ddev->dev_private;
 
+       drm_atomic_helper_resume(ddev, priv->pm_state);
        drm_kms_helper_poll_enable(ddev);
 
        return 0;
index b2da1fbf81e0f373c75a4a34ba62e04d8c10f339..17cefca1d566647db8d0e8e09a5485dcd89be698 100644 (file)
@@ -150,6 +150,7 @@ struct msm_drm_private {
        struct shrinker shrinker;
 
        struct msm_vblank_ctrl vblank_ctrl;
+       struct drm_atomic_state *pm_state;
 };
 
 struct msm_format {