linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@kernel.org>
To: Neil Armstrong <narmstrong@baylibre.com>,
	dri-devel@lists.freedesktop.org
Cc: linux-amlogic@lists.infradead.org, Kevin Hilman <khilman@baylibre.com>
Subject: [PATCH] drm/meson: enable runtime PM
Date: Wed, 25 Sep 2019 12:31:54 -0700	[thread overview]
Message-ID: <20190925193154.20732-1-khilman@kernel.org> (raw)

From: Kevin Hilman <khilman@baylibre.com>

On some SoCs, the VPU is in a power-domain and needs runtime PM
enabled and used in order to keep the power domain on.

Signed-off-by: Kevin Hilman <khilman@baylibre.com>
---
 drivers/gpu/drm/meson/meson_drv.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index 2310c96fff46..256b6a0e9c6b 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -14,6 +14,7 @@
 #include <linux/platform_device.h>
 #include <linux/component.h>
 #include <linux/of_graph.h>
+#include <linux/pm_runtime.h>
 
 #include <drm/drmP.h>
 #include <drm/drm_atomic.h>
@@ -274,6 +275,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
 
 	/* Hardware Initialization */
 
+	pm_runtime_get_sync(dev);
 	meson_vpu_init(priv);
 	meson_venc_init(priv);
 	meson_vpp_init(priv);
@@ -416,6 +418,7 @@ static int meson_drv_probe(struct platform_device *pdev)
 	struct device_node *ep, *remote;
 	int count = 0;
 
+	pm_runtime_enable(&pdev->dev);
 	for_each_endpoint_of_node(np, ep) {
 		remote = of_graph_get_remote_port_parent(ep);
 		if (!remote || !of_device_is_available(remote)) {
@@ -440,6 +443,7 @@ static int meson_drv_probe(struct platform_device *pdev)
 	}
 
 	/* If no output endpoints were available, simply bail out */
+	pm_runtime_disable(&pdev->dev);
 	return 0;
 };
 
-- 
2.22.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

             reply	other threads:[~2019-09-25 19:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 19:31 Kevin Hilman [this message]
2019-09-30  8:20 ` [PATCH] drm/meson: enable runtime PM Neil Armstrong
2019-09-30 15:34   ` Kevin Hilman
2019-10-01  8:41     ` Neil Armstrong

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=20190925193154.20732-1-khilman@kernel.org \
    --to=khilman@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=narmstrong@baylibre.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).