dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Souptick Joarder <jrdr.linux@gmail.com>
To: linux-graphics-maintainer@vmware.com, syeh@vmware.com,
	thellstrom@vmware.com, airlied@linux.ie, ajitn.linux@gmail.com,
	daniel@ffwll.ch
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH] drm/vmwgfx: Convert drm_atomic_helper_suspend/resume()
Date: Sun, 12 Aug 2018 01:41:48 +0530	[thread overview]
Message-ID: <20180811201147.GA14169@jordon-HP-15-Notebook-PC> (raw)

convert drm_atomic_helper_suspend/resume() to use
drm_mode_config_helper_suspend/resume().

suspend_state can be removed from vmw_private as
it will not be used anymore.

Signed-off-by: Ajit Negi <ajitn.linux@gmail.com>
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |  6 +++---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h |  1 -
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 25 ++-----------------------
 3 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index bb6dbbe..a317cda 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -1521,7 +1521,7 @@ static int vmw_pm_freeze(struct device *kdev)
 		WARN_ON(vmw_request_device_late(dev_priv));
 		dev_priv->suspend_locked = false;
 		ttm_suspend_unlock(&dev_priv->reservation_sem);
-		if (dev_priv->suspend_state)
+		if (dev->mode_config.suspend_state)
 			vmw_kms_resume(dev);
 		if (dev_priv->enable_fb)
 			vmw_fb_on(dev_priv);
@@ -1558,8 +1558,8 @@ static int vmw_pm_restore(struct device *kdev)
 	vmw_fence_fifo_up(dev_priv->fman);
 	dev_priv->suspend_locked = false;
 	ttm_suspend_unlock(&dev_priv->reservation_sem);
-	if (dev_priv->suspend_state)
-		vmw_kms_resume(dev_priv->dev);
+	if (dev->mode_config.suspend_state)
+		vmw_kms_resume(dev);
 
 	if (dev_priv->enable_fb)
 		vmw_fb_on(dev_priv);
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
index 1abe217..b8e200b 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
@@ -438,7 +438,6 @@ struct vmw_private {
 	struct vmw_framebuffer *implicit_fb;
 	struct mutex global_kms_state_mutex;
 	spinlock_t cursor_lock;
-	struct drm_atomic_state *suspend_state;
 
 	/*
 	 * Context and surface management.
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index 23beff5..2d011a1 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -3028,19 +3028,7 @@ int vmw_kms_set_config(struct drm_mode_set *set,
  */
 int vmw_kms_suspend(struct drm_device *dev)
 {
-	struct vmw_private *dev_priv = vmw_priv(dev);
-
-	dev_priv->suspend_state = drm_atomic_helper_suspend(dev);
-	if (IS_ERR(dev_priv->suspend_state)) {
-		int ret = PTR_ERR(dev_priv->suspend_state);
-
-		DRM_ERROR("Failed kms suspend: %d\n", ret);
-		dev_priv->suspend_state = NULL;
-
-		return ret;
-	}
-
-	return 0;
+	return drm_mode_config_helper_suspend(dev);
 }
 
 
@@ -3055,16 +3043,7 @@ int vmw_kms_suspend(struct drm_device *dev)
  */
 int vmw_kms_resume(struct drm_device *dev)
 {
-	struct vmw_private *dev_priv = vmw_priv(dev);
-	int ret;
-
-	if (WARN_ON(!dev_priv->suspend_state))
-		return 0;
-
-	ret = drm_atomic_helper_resume(dev, dev_priv->suspend_state);
-	dev_priv->suspend_state = NULL;
-
-	return ret;
+	return drm_mode_config_helper_resume(dev);
 }
 
 /**
-- 
1.9.1

             reply	other threads:[~2018-08-11 20:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-11 20:11 Souptick Joarder [this message]
2018-08-20 21:34 ` [Linux-graphics-maintainer] [PATCH] drm/vmwgfx: Convert drm_atomic_helper_suspend/resume() Deepak Singh Rawat
2018-08-21  9:50   ` Souptick Joarder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180811201147.GA14169@jordon-HP-15-Notebook-PC \
    --to=jrdr.linux@gmail.com \
    --cc=airlied@linux.ie \
    --cc=ajitn.linux@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syeh@vmware.com \
    --cc=thellstrom@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).