devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jayant Shekhar <jshekhar@codeaurora.org>
To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org, devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, abhinavk@codeaurora.org,
	Jayant Shekhar <jshekhar@codeaurora.org>,
	seanpaul@chromium.org, hoegsberg@chromium.org,
	chandanu@codeaurora.org
Subject: [v1] drm/msm: Remove clock and bandwidth votes in mdss pm suspend
Date: Wed, 23 Jan 2019 16:42:40 +0530	[thread overview]
Message-ID: <1548241960-7412-1-git-send-email-jshekhar@codeaurora.org> (raw)

MDSS PM suspend is dependent on runtime suspend for disabling
clocks and removing bandwidth votes. In case of pm_suspend
triggered, dpm_prepare hold a refcount on power usage of device
and hence runtime suspend is never triggered during pm_suspend.
As runtime suspend is not triggered, clocks and bandwidth votes
remain. Hence explicitly trigger mdss disable in msm_pm_suspend
to disable clocks and remove the votes.

Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
---
 drivers/gpu/drm/msm/msm_drv.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 5c60bb3..ffe3a25 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -1068,12 +1068,16 @@ static int msm_pm_suspend(struct device *dev)
 {
 	struct drm_device *ddev = dev_get_drvdata(dev);
 	struct msm_drm_private *priv = ddev->dev_private;
+	struct msm_mdss *mdss = priv->mdss;
 
 	if (!IS_ERR_OR_NULL(priv->pm_state))
 		return 0;
 
 	priv->pm_state = drm_atomic_helper_suspend(ddev);
 
+	if (mdss && mdss->funcs)
+		mdss->funcs->disable(mdss);
+
 	return IS_ERR(priv->pm_state) ? PTR_ERR(priv->pm_state) : 0;
 }
 
@@ -1081,11 +1085,15 @@ static int msm_pm_resume(struct device *dev)
 {
 	struct drm_device *ddev = dev_get_drvdata(dev);
 	struct msm_drm_private *priv = ddev->dev_private;
+	struct msm_mdss *mdss = priv->mdss;
 	int ret;
 
 	if (IS_ERR_OR_NULL(priv->pm_state))
 		return 0;
 
+	if (mdss && mdss->funcs)
+		mdss->funcs->enable(mdss);
+
 	ret = drm_atomic_helper_resume(ddev, priv->pm_state);
 	if (ret == 0)
 		priv->pm_state = NULL;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2019-01-23 11:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-23 11:12 Jayant Shekhar [this message]
     [not found] ` <1548241960-7412-1-git-send-email-jshekhar-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2019-02-17 17:40   ` [v1] drm/msm: Remove clock and bandwidth votes in mdss pm suspend Rob Clark

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=1548241960-7412-1-git-send-email-jshekhar@codeaurora.org \
    --to=jshekhar@codeaurora.org \
    --cc=abhinavk@codeaurora.org \
    --cc=chandanu@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=hoegsberg@chromium.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seanpaul@chromium.org \
    /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).