drm/rockchip: Convert drm_atomic_helper_suspend/resume()
authorSouptick Joarder <jrdr.linux@gmail.com>
Tue, 31 Jul 2018 20:34:30 +0000 (02:04 +0530)
committerHeiko Stuebner <heiko@sntech.de>
Wed, 1 Aug 2018 13:22:30 +0000 (15:22 +0200)
convert drm_atomic_helper_suspend/resume() to use
drm_mode_config_helper_suspend/resume().

With this conversion, rockchip_drm_fb_resume() and
rockchip_drm_fb_suspend() will not be used anymore.
Both of these functions can be removed.

Also, in struct rockchip_drm_private state will not be
used anymore. So this can be removed forever.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Co-Developed-by: Ajit Negi <ajitn.linux@gmail.com>
[changed to Co-Developed-by, according to process/submitting-patches.rst]
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20180731203430.GA30136@jordon-HP-15-Notebook-PC
drivers/gpu/drm/rockchip/rockchip_drm_drv.c
drivers/gpu/drm/rockchip/rockchip_drm_drv.h

index 9c846be8fc64c6c58b5f54244ccc93c2b4910f7c..1d9c4a9201c83c0c1f9a68e9f83aaff1e6c9dd89 100644 (file)
@@ -243,60 +243,18 @@ static struct drm_driver rockchip_drm_driver = {
 };
 
 #ifdef CONFIG_PM_SLEEP
-static void rockchip_drm_fb_suspend(struct drm_device *drm)
-{
-       struct rockchip_drm_private *priv = drm->dev_private;
-
-       console_lock();
-       drm_fb_helper_set_suspend(&priv->fbdev_helper, 1);
-       console_unlock();
-}
-
-static void rockchip_drm_fb_resume(struct drm_device *drm)
-{
-       struct rockchip_drm_private *priv = drm->dev_private;
-
-       console_lock();
-       drm_fb_helper_set_suspend(&priv->fbdev_helper, 0);
-       console_unlock();
-}
-
 static int rockchip_drm_sys_suspend(struct device *dev)
 {
        struct drm_device *drm = dev_get_drvdata(dev);
-       struct rockchip_drm_private *priv;
-
-       if (!drm)
-               return 0;
-
-       drm_kms_helper_poll_disable(drm);
-       rockchip_drm_fb_suspend(drm);
 
-       priv = drm->dev_private;
-       priv->state = drm_atomic_helper_suspend(drm);
-       if (IS_ERR(priv->state)) {
-               rockchip_drm_fb_resume(drm);
-               drm_kms_helper_poll_enable(drm);
-               return PTR_ERR(priv->state);
-       }
-
-       return 0;
+       return drm_mode_config_helper_suspend(drm);
 }
 
 static int rockchip_drm_sys_resume(struct device *dev)
 {
        struct drm_device *drm = dev_get_drvdata(dev);
-       struct rockchip_drm_private *priv;
 
-       if (!drm)
-               return 0;
-
-       priv = drm->dev_private;
-       drm_atomic_helper_resume(drm, priv->state);
-       rockchip_drm_fb_resume(drm);
-       drm_kms_helper_poll_enable(drm);
-
-       return 0;
+       return drm_mode_config_helper_resume(drm);
 }
 #endif
 
index 3a6ebfc26036e6a5d3fc396d583028e1633a8907..d67ad0a3cf36710d42fef391d06bccf2196203c4 100644 (file)
@@ -51,7 +51,6 @@ struct rockchip_crtc_state {
 struct rockchip_drm_private {
        struct drm_fb_helper fbdev_helper;
        struct drm_gem_object *fbdev_bo;
-       struct drm_atomic_state *state;
        struct iommu_domain *domain;
        struct mutex mm_lock;
        struct drm_mm mm;