diff mbox series

drm/tilcdc: Convert drm_atomic_helper_suspend/resume()

Message ID 20180808161641.GA20483@jordon-HP-15-Notebook-PC (mailing list archive)
State New, archived
Headers show
Series drm/tilcdc: Convert drm_atomic_helper_suspend/resume() | expand

Commit Message

Souptick Joarder Aug. 8, 2018, 4:16 p.m. UTC
convert drm_atomic_helper_suspend/resume() to use
drm_mode_config_helper_suspend/resume().

saved_state in tilcdc_drm_private will not be used
anymore, so it can be removed.

Signed-off-by: Ajit Negi <ajitn.linux@gmail.com>
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 14 ++++----------
 drivers/gpu/drm/tilcdc/tilcdc_drv.h |  3 ---
 2 files changed, 4 insertions(+), 13 deletions(-)

Comments

Souptick Joarder Sept. 10, 2018, 6:45 a.m. UTC | #1
On Wed, Aug 8, 2018 at 9:43 PM Souptick Joarder <jrdr.linux@gmail.com> wrote:
>
> convert drm_atomic_helper_suspend/resume() to use
> drm_mode_config_helper_suspend/resume().
>
> saved_state in tilcdc_drm_private will not be used
> anymore, so it can be removed.

Any comment on this patch ?
>
> Signed-off-by: Ajit Negi <ajitn.linux@gmail.com>
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
> ---
>  drivers/gpu/drm/tilcdc/tilcdc_drv.c | 14 ++++----------
>  drivers/gpu/drm/tilcdc/tilcdc_drv.h |  3 ---
>  2 files changed, 4 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> index 0fb300d..33e5332 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> @@ -554,29 +554,23 @@ static int tilcdc_debugfs_init(struct drm_minor *minor)
>  static int tilcdc_pm_suspend(struct device *dev)
>  {
>         struct drm_device *ddev = dev_get_drvdata(dev);
> -       struct tilcdc_drm_private *priv = ddev->dev_private;
> +       int ret = 0;
>
> -       priv->saved_state = drm_atomic_helper_suspend(ddev);
> +       ret = drm_mode_config_helper_suspend(ddev);
>
>         /* Select sleep pin state */
>         pinctrl_pm_select_sleep_state(dev);
>
> -       return 0;
> +       return ret;
>  }
>
>  static int tilcdc_pm_resume(struct device *dev)
>  {
>         struct drm_device *ddev = dev_get_drvdata(dev);
> -       struct tilcdc_drm_private *priv = ddev->dev_private;
> -       int ret = 0;
>
>         /* Select default pin state */
>         pinctrl_pm_select_default_state(dev);
> -
> -       if (priv->saved_state)
> -               ret = drm_atomic_helper_resume(ddev, priv->saved_state);
> -
> -       return ret;
> +       return  drm_mode_config_helper_resume(ddev);
>  }
>  #endif
>
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
> index ead5122..62cea5f 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
> @@ -70,9 +70,6 @@ struct tilcdc_drm_private {
>         const uint32_t *pixelformats;
>         uint32_t num_pixelformats;
>
> -       /* The context for pm susped/resume cycle is stored here */
> -       struct drm_atomic_state *saved_state;
> -
>  #ifdef CONFIG_CPU_FREQ
>         struct notifier_block freq_transition;
>  #endif
> --
> 1.9.1
>
Jyri Sarha Sept. 10, 2018, 7:41 a.m. UTC | #2
On 10/09/18 09:45, Souptick Joarder wrote:
> On Wed, Aug 8, 2018 at 9:43 PM Souptick Joarder <jrdr.linux@gmail.com> wrote:
>>
>> convert drm_atomic_helper_suspend/resume() to use
>> drm_mode_config_helper_suspend/resume().
>>
>> saved_state in tilcdc_drm_private will not be used
>> anymore, so it can be removed.
> 
> Any comment on this patch ?

I planned to test this out, but I did not find time to do that. But here
is my:

Reviewed-by: Jyri Sarha <jsarha@ti.com>

I'll pick this up for my next pull request.

BR,
Jyri

>>
>> Signed-off-by: Ajit Negi <ajitn.linux@gmail.com>
>> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
>> ---
>>  drivers/gpu/drm/tilcdc/tilcdc_drv.c | 14 ++++----------
>>  drivers/gpu/drm/tilcdc/tilcdc_drv.h |  3 ---
>>  2 files changed, 4 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
>> index 0fb300d..33e5332 100644
>> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
>> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
>> @@ -554,29 +554,23 @@ static int tilcdc_debugfs_init(struct drm_minor *minor)
>>  static int tilcdc_pm_suspend(struct device *dev)
>>  {
>>         struct drm_device *ddev = dev_get_drvdata(dev);
>> -       struct tilcdc_drm_private *priv = ddev->dev_private;
>> +       int ret = 0;
>>
>> -       priv->saved_state = drm_atomic_helper_suspend(ddev);
>> +       ret = drm_mode_config_helper_suspend(ddev);
>>
>>         /* Select sleep pin state */
>>         pinctrl_pm_select_sleep_state(dev);
>>
>> -       return 0;
>> +       return ret;
>>  }
>>
>>  static int tilcdc_pm_resume(struct device *dev)
>>  {
>>         struct drm_device *ddev = dev_get_drvdata(dev);
>> -       struct tilcdc_drm_private *priv = ddev->dev_private;
>> -       int ret = 0;
>>
>>         /* Select default pin state */
>>         pinctrl_pm_select_default_state(dev);
>> -
>> -       if (priv->saved_state)
>> -               ret = drm_atomic_helper_resume(ddev, priv->saved_state);
>> -
>> -       return ret;
>> +       return  drm_mode_config_helper_resume(ddev);
>>  }
>>  #endif
>>
>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
>> index ead5122..62cea5f 100644
>> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h
>> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
>> @@ -70,9 +70,6 @@ struct tilcdc_drm_private {
>>         const uint32_t *pixelformats;
>>         uint32_t num_pixelformats;
>>
>> -       /* The context for pm susped/resume cycle is stored here */
>> -       struct drm_atomic_state *saved_state;
>> -
>>  #ifdef CONFIG_CPU_FREQ
>>         struct notifier_block freq_transition;
>>  #endif
>> --
>> 1.9.1
>>
Souptick Joarder Sept. 10, 2018, 8:07 a.m. UTC | #3
On Mon, Sep 10, 2018 at 1:11 PM Jyri Sarha <jsarha@ti.com> wrote:
>
> On 10/09/18 09:45, Souptick Joarder wrote:
> > On Wed, Aug 8, 2018 at 9:43 PM Souptick Joarder <jrdr.linux@gmail.com> wrote:
> >>
> >> convert drm_atomic_helper_suspend/resume() to use
> >> drm_mode_config_helper_suspend/resume().
> >>
> >> saved_state in tilcdc_drm_private will not be used
> >> anymore, so it can be removed.
> >
> > Any comment on this patch ?
>
> I planned to test this out, but I did not find time to do that. But here
> is my:
>
> Reviewed-by: Jyri Sarha <jsarha@ti.com>
>
> I'll pick this up for my next pull request.
>

Thanks, Hopefully It will make into 4.20 :)

> BR,
> Jyri
>
> >>
> >> Signed-off-by: Ajit Negi <ajitn.linux@gmail.com>
> >> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
> >> ---
> >>  drivers/gpu/drm/tilcdc/tilcdc_drv.c | 14 ++++----------
> >>  drivers/gpu/drm/tilcdc/tilcdc_drv.h |  3 ---
> >>  2 files changed, 4 insertions(+), 13 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> >> index 0fb300d..33e5332 100644
> >> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> >> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> >> @@ -554,29 +554,23 @@ static int tilcdc_debugfs_init(struct drm_minor *minor)
> >>  static int tilcdc_pm_suspend(struct device *dev)
> >>  {
> >>         struct drm_device *ddev = dev_get_drvdata(dev);
> >> -       struct tilcdc_drm_private *priv = ddev->dev_private;
> >> +       int ret = 0;
> >>
> >> -       priv->saved_state = drm_atomic_helper_suspend(ddev);
> >> +       ret = drm_mode_config_helper_suspend(ddev);
> >>
> >>         /* Select sleep pin state */
> >>         pinctrl_pm_select_sleep_state(dev);
> >>
> >> -       return 0;
> >> +       return ret;
> >>  }
> >>
> >>  static int tilcdc_pm_resume(struct device *dev)
> >>  {
> >>         struct drm_device *ddev = dev_get_drvdata(dev);
> >> -       struct tilcdc_drm_private *priv = ddev->dev_private;
> >> -       int ret = 0;
> >>
> >>         /* Select default pin state */
> >>         pinctrl_pm_select_default_state(dev);
> >> -
> >> -       if (priv->saved_state)
> >> -               ret = drm_atomic_helper_resume(ddev, priv->saved_state);
> >> -
> >> -       return ret;
> >> +       return  drm_mode_config_helper_resume(ddev);
> >>  }
> >>  #endif
> >>
> >> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
> >> index ead5122..62cea5f 100644
> >> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h
> >> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
> >> @@ -70,9 +70,6 @@ struct tilcdc_drm_private {
> >>         const uint32_t *pixelformats;
> >>         uint32_t num_pixelformats;
> >>
> >> -       /* The context for pm susped/resume cycle is stored here */
> >> -       struct drm_atomic_state *saved_state;
> >> -
> >>  #ifdef CONFIG_CPU_FREQ
> >>         struct notifier_block freq_transition;
> >>  #endif
> >> --
> >> 1.9.1
> >>
>
>
> --
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 0fb300d..33e5332 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -554,29 +554,23 @@  static int tilcdc_debugfs_init(struct drm_minor *minor)
 static int tilcdc_pm_suspend(struct device *dev)
 {
 	struct drm_device *ddev = dev_get_drvdata(dev);
-	struct tilcdc_drm_private *priv = ddev->dev_private;
+	int ret = 0;
 
-	priv->saved_state = drm_atomic_helper_suspend(ddev);
+	ret = drm_mode_config_helper_suspend(ddev);
 
 	/* Select sleep pin state */
 	pinctrl_pm_select_sleep_state(dev);
 
-	return 0;
+	return ret;
 }
 
 static int tilcdc_pm_resume(struct device *dev)
 {
 	struct drm_device *ddev = dev_get_drvdata(dev);
-	struct tilcdc_drm_private *priv = ddev->dev_private;
-	int ret = 0;
 
 	/* Select default pin state */
 	pinctrl_pm_select_default_state(dev);
-
-	if (priv->saved_state)
-		ret = drm_atomic_helper_resume(ddev, priv->saved_state);
-
-	return ret;
+	return  drm_mode_config_helper_resume(ddev);
 }
 #endif
 
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
index ead5122..62cea5f 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
@@ -70,9 +70,6 @@  struct tilcdc_drm_private {
 	const uint32_t *pixelformats;
 	uint32_t num_pixelformats;
 
-	/* The context for pm susped/resume cycle is stored here */
-	struct drm_atomic_state *saved_state;
-
 #ifdef CONFIG_CPU_FREQ
 	struct notifier_block freq_transition;
 #endif