diff mbox series

[2/2] drm: rcar-du: Add Standby Mode to suspend()

Message ID 1544772318-17408-2-git-send-email-na-hoan@jinso.co.jp (mailing list archive)
State New
Delegated to: Kieran Bingham
Headers show
Series [1/2] drm: rcar-du: Add Standby Mode support | expand

Commit Message

グェン・アン・ホァン Dec. 14, 2018, 7:25 a.m. UTC
From: Hoan Nguyen An <na-hoan@jinso.co.jp>

Enter Standby Mode before suspend by drm
We will not need to "Release from Module Standby Mode"
because after resume() is called, this is done.

Signed-off-by: Hoan Nguyen An <na-hoan@jinso.co.jp>
---
 drivers/gpu/drm/rcar-du/rcar_du_drv.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Laurent Pinchart Dec. 14, 2018, 8:15 a.m. UTC | #1
Hello Hoan-san,

On Friday, 14 December 2018 09:25:18 EET Nguyen An Hoan wrote:
> From: Hoan Nguyen An <na-hoan@jinso.co.jp>
> 
> Enter Standby Mode before suspend by drm
> We will not need to "Release from Module Standby Mode"
> because after resume() is called, this is done.
> 
> Signed-off-by: Hoan Nguyen An <na-hoan@jinso.co.jp>
> ---
>  drivers/gpu/drm/rcar-du/rcar_du_drv.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 32dba13..1ab3f56 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> @@ -426,6 +426,20 @@ static struct drm_driver rcar_du_driver = {
>  static int rcar_du_pm_suspend(struct device *dev)
>  {
>  	struct rcar_du_device *rcdu = dev_get_drvdata(dev);
> +	int ret;
> +	unsigned int i = 0;
> +
> +	for (i = 0; i < rcdu->num_crtcs; i++)
> +	{
> +		struct rcar_du_crtc *rcrtc = &rcdu->crtcs[i];
> +
> +		ret = rcar_du_crtc_standby(rcrtc);
> +		if(ret)
> +		{
> +			dev_err(dev, "failed to enter Standby mode\n");
> +			return ret;
> +		}
> +	}

Could you please explain why this is needed ? The call to 
drm_mode_config_helper_suspend() should disable all CRTCs, so there shouldn't 
be a need to disable them manually first.

>  	return drm_mode_config_helper_suspend(rcdu->ddev);
>  }
diff mbox series

Patch

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
index 32dba13..1ab3f56 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
@@ -426,6 +426,20 @@  static struct drm_driver rcar_du_driver = {
 static int rcar_du_pm_suspend(struct device *dev)
 {
 	struct rcar_du_device *rcdu = dev_get_drvdata(dev);
+	int ret;
+	unsigned int i = 0;
+
+	for (i = 0; i < rcdu->num_crtcs; i++)
+	{
+		struct rcar_du_crtc *rcrtc = &rcdu->crtcs[i];
+
+		ret = rcar_du_crtc_standby(rcrtc);
+		if(ret)
+		{
+			dev_err(dev, "failed to enter Standby mode\n");
+			return ret;
+		}
+	}
 
 	return drm_mode_config_helper_suspend(rcdu->ddev);
 }