All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/meson: enable runtime PM
@ 2019-09-25 19:31 ` Kevin Hilman
  0 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2019-09-25 19:31 UTC (permalink / raw)
  To: Neil Armstrong, dri-devel; +Cc: linux-amlogic, Kevin Hilman

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

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] drm/meson: enable runtime PM
@ 2019-09-25 19:31 ` Kevin Hilman
  0 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2019-09-25 19:31 UTC (permalink / raw)
  To: Neil Armstrong, dri-devel; +Cc: linux-amlogic, Kevin Hilman

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/meson: enable runtime PM
  2019-09-25 19:31 ` Kevin Hilman
@ 2019-09-30  8:20   ` Neil Armstrong
  -1 siblings, 0 replies; 8+ messages in thread
From: Neil Armstrong @ 2019-09-30  8:20 UTC (permalink / raw)
  To: Kevin Hilman, dri-devel; +Cc: linux-amlogic, Kevin Hilman

Hi Kevin,

On 25/09/2019 21:31, Kevin Hilman wrote:
> 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;
>  };
>  
> 

I'll rather implement true runtime PM instead,

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/meson: enable runtime PM
@ 2019-09-30  8:20   ` Neil Armstrong
  0 siblings, 0 replies; 8+ messages in thread
From: Neil Armstrong @ 2019-09-30  8:20 UTC (permalink / raw)
  To: Kevin Hilman, dri-devel; +Cc: linux-amlogic, Kevin Hilman

Hi Kevin,

On 25/09/2019 21:31, Kevin Hilman wrote:
> 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;
>  };
>  
> 

I'll rather implement true runtime PM instead,

Neil

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/meson: enable runtime PM
  2019-09-30  8:20   ` Neil Armstrong
@ 2019-09-30 15:34     ` Kevin Hilman
  -1 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2019-09-30 15:34 UTC (permalink / raw)
  To: Neil Armstrong, Kevin Hilman, dri-devel; +Cc: linux-amlogic

Neil Armstrong <narmstrong@baylibre.com> writes:

> Hi Kevin,
>
> On 25/09/2019 21:31, Kevin Hilman wrote:
>> 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;
>>  };
>>  
>> 
>
> I'll rather implement true runtime PM instead,

While this is a minimum implementation, can you explain what you mean by
"true" runtime PM?

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/meson: enable runtime PM
@ 2019-09-30 15:34     ` Kevin Hilman
  0 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2019-09-30 15:34 UTC (permalink / raw)
  To: Neil Armstrong, Kevin Hilman, dri-devel; +Cc: linux-amlogic

Neil Armstrong <narmstrong@baylibre.com> writes:

> Hi Kevin,
>
> On 25/09/2019 21:31, Kevin Hilman wrote:
>> 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;
>>  };
>>  
>> 
>
> I'll rather implement true runtime PM instead,

While this is a minimum implementation, can you explain what you mean by
"true" runtime PM?

Kevin

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/meson: enable runtime PM
  2019-09-30 15:34     ` Kevin Hilman
@ 2019-10-01  8:41       ` Neil Armstrong
  -1 siblings, 0 replies; 8+ messages in thread
From: Neil Armstrong @ 2019-10-01  8:41 UTC (permalink / raw)
  To: Kevin Hilman, Kevin Hilman, dri-devel; +Cc: linux-amlogic

On 30/09/2019 17:34, Kevin Hilman wrote:
> Neil Armstrong <narmstrong@baylibre.com> writes:
> 
>> Hi Kevin,
>>
>> On 25/09/2019 21:31, Kevin Hilman wrote:
>>> 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;
>>>  };
>>>  
>>>
>>
>> I'll rather implement true runtime PM instead,
> 
> While this is a minimum implementation, can you explain what you mean by
> "true" runtime PM?

Implementing runtime_sync()/_put when the display is used/unused.

ARM did a good job in their malidp driver.

Neil

> 
> Kevin
> 

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/meson: enable runtime PM
@ 2019-10-01  8:41       ` Neil Armstrong
  0 siblings, 0 replies; 8+ messages in thread
From: Neil Armstrong @ 2019-10-01  8:41 UTC (permalink / raw)
  To: Kevin Hilman, Kevin Hilman, dri-devel; +Cc: linux-amlogic

On 30/09/2019 17:34, Kevin Hilman wrote:
> Neil Armstrong <narmstrong@baylibre.com> writes:
> 
>> Hi Kevin,
>>
>> On 25/09/2019 21:31, Kevin Hilman wrote:
>>> 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;
>>>  };
>>>  
>>>
>>
>> I'll rather implement true runtime PM instead,
> 
> While this is a minimum implementation, can you explain what you mean by
> "true" runtime PM?

Implementing runtime_sync()/_put when the display is used/unused.

ARM did a good job in their malidp driver.

Neil

> 
> Kevin
> 


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-10-01  8:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25 19:31 [PATCH] drm/meson: enable runtime PM Kevin Hilman
2019-09-25 19:31 ` Kevin Hilman
2019-09-30  8:20 ` Neil Armstrong
2019-09-30  8:20   ` Neil Armstrong
2019-09-30 15:34   ` Kevin Hilman
2019-09-30 15:34     ` Kevin Hilman
2019-10-01  8:41     ` Neil Armstrong
2019-10-01  8:41       ` Neil Armstrong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.