From: Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
To: Bruce Wang <bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 1/2] drm/msm: Use atomic helpers for pm_suspend/resume
Date: Tue, 2 Oct 2018 11:22:53 -0400 [thread overview]
Message-ID: <20181002152253.GB72545@art_vandelay> (raw)
In-Reply-To: <20181002150530.6407-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
On Tue, Oct 02, 2018 at 11:05:29AM -0400, Bruce Wang wrote:
> The dpu implementation of pm_resume were causing a crash. This patch
> changes msm_pm_suspend and msm_pm_resume to use the atomic
> helpers drm_atomic_helper_suspend and drm_atomic_helper_resume.
> Removes the hooks needed for calling the dpu_kms implementations of
> suspend/resume. Note that the poll_disable call is likely not needed as
> of right now as the DRM_CONNECTOR_POLL_CONNECT flag is never set.
>
> Signed-off-by: Bruce Wang <bzwang@chromium.org>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 --
> drivers/gpu/drm/msm/msm_drv.c | 28 +++++++++----------------
> drivers/gpu/drm/msm/msm_kms.h | 3 ---
> 3 files changed, 10 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> index 0a683e65a9f3..e0142912d676 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> @@ -873,8 +873,6 @@ static const struct msm_kms_funcs kms_funcs = {
> .check_modified_format = dpu_format_check_modified_format,
> .get_format = dpu_get_msm_format,
> .round_pixclk = dpu_kms_round_pixclk,
> - .pm_suspend = dpu_kms_pm_suspend,
> - .pm_resume = dpu_kms_pm_resume,
Can you flip the order of these patches such that you remove the dpu
implementation entirely first, and then remove the unused bits in msm core? That
way the dpu and msm bits are clearly delineated.
Sean
> .destroy = dpu_kms_destroy,
> .set_encoder_mode = _dpu_kms_set_encoder_mode,
> #ifdef CONFIG_DEBUG_FS
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index c1abad8a8612..b8dc854c99f2 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -1069,37 +1069,29 @@ static int msm_pm_suspend(struct device *dev)
> {
> struct drm_device *ddev = dev_get_drvdata(dev);
> struct msm_drm_private *priv = ddev->dev_private;
> - struct msm_kms *kms = priv->kms;
> -
> - /* TODO: Use atomic helper suspend/resume */
> - if (kms && kms->funcs && kms->funcs->pm_suspend)
> - return kms->funcs->pm_suspend(dev);
>
> - drm_kms_helper_poll_disable(ddev);
> + if (!IS_ERR_OR_NULL(priv->pm_state))
> + return 0;
>
> 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;
> + return IS_ERR(priv->pm_state) ? PTR_ERR(priv->pm_state) : 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;
> - struct msm_kms *kms = priv->kms;
> + int ret;
>
> - /* TODO: Use atomic helper suspend/resume */
> - if (kms && kms->funcs && kms->funcs->pm_resume)
> - return kms->funcs->pm_resume(dev);
> + if (IS_ERR_OR_NULL(priv->pm_state))
> + return 0;
>
> - drm_atomic_helper_resume(ddev, priv->pm_state);
> - drm_kms_helper_poll_enable(ddev);
> + ret = drm_atomic_helper_resume(ddev, priv->pm_state);
> + if (ret == 0)
> + priv->pm_state = NULL;
>
> - return 0;
> + return ret;
> }
> #endif
>
> diff --git a/drivers/gpu/drm/msm/msm_kms.h b/drivers/gpu/drm/msm/msm_kms.h
> index fd88cebb6adb..2b81b43a4bab 100644
> --- a/drivers/gpu/drm/msm/msm_kms.h
> +++ b/drivers/gpu/drm/msm/msm_kms.h
> @@ -67,9 +67,6 @@ struct msm_kms_funcs {
> void (*set_encoder_mode)(struct msm_kms *kms,
> struct drm_encoder *encoder,
> bool cmd_mode);
> - /* pm suspend/resume hooks */
> - int (*pm_suspend)(struct device *dev);
> - int (*pm_resume)(struct device *dev);
> /* cleanup: */
> void (*destroy)(struct msm_kms *kms);
> #ifdef CONFIG_DEBUG_FS
> --
> 2.19.0.605.g01d371f741-goog
>
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
next prev parent reply other threads:[~2018-10-02 15:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-02 15:05 [PATCH 1/2] drm/msm: Use atomic helpers for pm_suspend/resume Bruce Wang
[not found] ` <20181002150530.6407-1-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-10-02 15:05 ` [PATCH 2/2] drm/msm/dpu: Remove all dpu pm_suspend/resume code Bruce Wang
[not found] ` <20181002150530.6407-2-bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-10-02 15:25 ` Sean Paul
2018-10-02 15:22 ` Sean Paul [this message]
2018-10-02 16:15 ` [PATCH 1/2] drm/msm: Use atomic helpers for pm_suspend/resume Jordan Crouse
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=20181002152253.GB72545@art_vandelay \
--to=sean-p7ytbzm4h96eqtr555yldq@public.gmane.org \
--cc=abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
/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