]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
gpu/drm/hisilicon: Convert drm_atomic_helper_suspend/resume()
authorSouptick Joarder <jrdr.linux@gmail.com>
Mon, 6 Aug 2018 14:49:01 +0000 (20:19 +0530)
committerXinliang Liu <xinliang.liu@linaro.org>
Wed, 26 Sep 2018 03:40:39 +0000 (11:40 +0800)
convert drm_atomic_helper_suspend/resume() to use
drm_mode_config_helper_suspend/resume().

Fixed one sparse warning by making hibmc_drm_interrupt
static.

Signed-off-by: Ajit Negi <ajitn.linux@gmail.com>
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: Xinliang Liu <z.liuxinliang@hisilicon.com>
Signed-off-by: Xinliang Liu <z.liuxinliang@hisilicon.com>
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h

index 79b6bdafdc820c692bd5b9d4758c1a7fd40e5173..ccecda273112bf2d5a8a83607ce963ee18cf08eb 100644 (file)
@@ -37,7 +37,7 @@ static const struct file_operations hibmc_fops = {
        .llseek         = no_llseek,
 };
 
-irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
+static irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
 {
        struct drm_device *dev = (struct drm_device *)arg;
        struct hibmc_drm_private *priv =
@@ -74,30 +74,16 @@ static int __maybe_unused hibmc_pm_suspend(struct device *dev)
 {
        struct pci_dev *pdev = to_pci_dev(dev);
        struct drm_device *drm_dev = pci_get_drvdata(pdev);
-       struct hibmc_drm_private *priv = drm_dev->dev_private;
-
-       drm_kms_helper_poll_disable(drm_dev);
-       priv->suspend_state = drm_atomic_helper_suspend(drm_dev);
-       if (IS_ERR(priv->suspend_state)) {
-               DRM_ERROR("drm_atomic_helper_suspend failed: %ld\n",
-                         PTR_ERR(priv->suspend_state));
-               drm_kms_helper_poll_enable(drm_dev);
-               return PTR_ERR(priv->suspend_state);
-       }
 
-       return 0;
+       return drm_mode_config_helper_suspend(drm_dev);
 }
 
 static int  __maybe_unused hibmc_pm_resume(struct device *dev)
 {
        struct pci_dev *pdev = to_pci_dev(dev);
        struct drm_device *drm_dev = pci_get_drvdata(pdev);
-       struct hibmc_drm_private *priv = drm_dev->dev_private;
 
-       drm_atomic_helper_resume(drm_dev, priv->suspend_state);
-       drm_kms_helper_poll_enable(drm_dev);
-
-       return 0;
+       return drm_mode_config_helper_resume(drm_dev);
 }
 
 static const struct dev_pm_ops hibmc_pm_ops = {
index e195521eb41e9b54c89c428afc3bfbf7c4a41216..45c25a488f429f58b126de5ce1a5c2ef6c4aa8d5 100644 (file)
@@ -47,7 +47,6 @@ struct hibmc_drm_private {
        /* drm */
        struct drm_device  *dev;
        bool mode_config_initialized;
-       struct drm_atomic_state *suspend_state;
 
        /* ttm */
        struct drm_global_reference mem_global_ref;