Re: [PATCH RESEND 1/2] drm/msm: call drm_atomic_helper_suspend() and drm_atomic_helper_resume()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 24, 2018 at 3:24 AM, Daniel Mack <daniel@xxxxxxxxxx> wrote:
> To make suspend and resume work on msm8916 platforms, call into the generic
> helpers and preserve the state across suspends.
>
> Signed-off-by: Daniel Mack <daniel@xxxxxxxxxx>
> ---
> I've sent these two small patches twice already in May, but I haven't
> gotten any feedback, not sure why.

These two are in msm-next (and will be in my next pull request in the
coming days)

Thanks

BR,
-R

>
> We're using these on a number of prototypes and they seem to do work
> just fine.
>
>  drivers/gpu/drm/msm/msm_drv.c | 9 +++++++++
>  drivers/gpu/drm/msm/msm_drv.h | 1 +
>  2 files changed, 10 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index 0a3ea3034e39..cdbe9249bff2 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -907,16 +907,25 @@ static struct drm_driver msm_driver = {
>  static int msm_pm_suspend(struct device *dev)
>  {
>         struct drm_device *ddev = dev_get_drvdata(dev);
> +       struct msm_drm_private *priv = ddev->dev_private;
>
>         drm_kms_helper_poll_disable(ddev);
>
> +       priv->pm_state = drm_atomic_helper_suspend(ddev);
> +       if (IS_ERR(priv->pm_state)) {
> +               drm_kms_helper_poll_enable(ddev);
> +               return PTR_ERR(priv->pm_state);
> +       }
> +
>         return 0;
>  }
>
>  static int msm_pm_resume(struct device *dev)
>  {
>         struct drm_device *ddev = dev_get_drvdata(dev);
> +       struct msm_drm_private *priv = ddev->dev_private;
>
> +       drm_atomic_helper_resume(ddev, priv->pm_state);
>         drm_kms_helper_poll_enable(ddev);
>
>         return 0;
> diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
> index 0a653dd2e618..459d06a1ab9f 100644
> --- a/drivers/gpu/drm/msm/msm_drv.h
> +++ b/drivers/gpu/drm/msm/msm_drv.h
> @@ -155,6 +155,7 @@ struct msm_drm_private {
>         struct shrinker shrinker;
>
>         struct msm_vblank_ctrl vblank_ctrl;
> +       struct drm_atomic_state *pm_state;
>  };
>
>  struct msm_format {
> --
> 2.14.3
>
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux