All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
To: Jeykumar Sankaran <jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	hoegsberg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH RESEND 08/10] drm/msm: Sprinkle pm_runtime calls around
Date: Mon, 12 Mar 2018 16:06:26 -0400	[thread overview]
Message-ID: <20180312200626.GW223881@art_vandelay> (raw)
In-Reply-To: <e953b0d8daa63e5cd2f65259b1c80a27-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

On Thu, Mar 08, 2018 at 04:14:38PM -0800, Jeykumar Sankaran wrote:
> On 2018-02-21 07:18, Sean Paul wrote:
> > Adding missing pm_runtime references where appropriate.
> > 
> > Signed-off-by: Sean Paul <seanpaul@chromium.org>
> > ---
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c |  3 +++
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c  | 10 +++++++++-
> >  2 files changed, 12 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> > b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> > index f1642d72469e..df6cbeb15cf5 100644
> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> > @@ -3497,6 +3497,7 @@ static void dpu_crtc_disable(struct drm_crtc
> > *crtc)
> >  	/* disable clk & bw control until clk & bw properties are set */
> >  	cstate->bw_control = false;
> >  	cstate->bw_split_vote = false;
> > +	pm_runtime_put_sync(crtc->dev->dev);
> > 
> >  	mutex_unlock(&dpu_crtc->crtc_lock);
> >  }
> > @@ -3523,6 +3524,8 @@ static void dpu_crtc_enable(struct drm_crtc *crtc,
> >  	DPU_EVT32_VERBOSE(DRMID(crtc));
> >  	dpu_crtc = to_dpu_crtc(crtc);
> > 
> > +	pm_runtime_get_sync(crtc->dev->dev);
> > +
> >  	drm_for_each_encoder(encoder, crtc->dev) {
> >  		if (encoder->crtc != crtc)
> >  			continue;
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> > b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> > index fb4de59d8ed1..b919c9a6a463 100644
> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> > @@ -114,6 +114,7 @@ static int _dpu_danger_signal_status(struct seq_file
> > *s,
> >  	priv = kms->dev->dev_private;
> >  	memset(&status, 0, sizeof(struct dpu_danger_safe_status));
> > 
> > +	pm_runtime_get_sync(kms->dev->dev);
> >  	dpu_power_resource_enable(&priv->phandle, kms->core_client, true);
> >  	if (danger_status) {
> >  		seq_puts(s, "\nDanger signal status:\n");
> > @@ -127,6 +128,7 @@ static int _dpu_danger_signal_status(struct seq_file
> > *s,
> >  					&status);
> >  	}
> >  	dpu_power_resource_enable(&priv->phandle, kms->core_client, false);
> > +	pm_runtime_put_sync(kms->dev->dev);
> > 
> >  	seq_printf(s, "MDP     :  0x%x\n", status.mdp);
> > 
> > @@ -346,12 +348,14 @@ static void _dpu_debugfs_destroy(struct dpu_kms
> > *dpu_kms)
> > 
> >  static int dpu_kms_enable_vblank(struct msm_kms *kms, struct drm_crtc
> > *crtc)
> >  {
> > +	pm_runtime_get_sync(crtc->dev->dev);
> >  	return dpu_crtc_vblank(crtc, true);
> >  }
> > 
> >  static void dpu_kms_disable_vblank(struct msm_kms *kms, struct drm_crtc
> > *crtc)
> >  {
> >  	dpu_crtc_vblank(crtc, false);
> > +	pm_runtime_put_sync(crtc->dev->dev);
> >  }
> > 
> >  static void dpu_kms_wait_for_frame_transfer_complete(struct msm_kms
> > *kms,
> > @@ -413,6 +417,7 @@ static void dpu_kms_prepare_commit(struct msm_kms
> > *kms,
> >  	if (!dev || !dev->dev_private)
> >  		return;
> >  	priv = dev->dev_private;
> > +	pm_runtime_get_sync(dev->dev);
> 
> CONFIG_DEBUG_FS is not enabled yet. Do we need this change here? If yes, we
> need
> to add pm_runtime calls in other files as well e.g:
> sde_plane_danger_read/write in dpu_plane.c.

Hmm, yeah good catch. Aside from the question of debugfs (which I think we
should probably do a deep review of what's being exposed), perhaps we should
move the pm_runtime_(get|put)_sync calls in dpu_power_resource_enable, then we
don't need to worry about adding the calls everywhere.

Thoughts?

Sean


> 
> >  	dpu_power_resource_enable(&priv->phandle, dpu_kms->core_client, true);
> > 
> >  	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head)
> > @@ -471,6 +476,7 @@ static void dpu_kms_complete_commit(struct msm_kms
> > *kms,
> >  	}
> > 
> >  	dpu_power_resource_enable(&priv->phandle, dpu_kms->core_client,
> > false);
> > +	pm_runtime_put_sync(dpu_kms->dev->dev);
> > 
> >  	DPU_EVT32_VERBOSE(DPU_EVTLOG_FUNC_EXIT);
> >  }
> > @@ -1896,7 +1902,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
> >  		dpu_kms->core_client = NULL;
> >  		goto error;
> >  	}
> > -
> > +	pm_runtime_get_sync(dev->dev);
> >  	rc = dpu_power_resource_enable(&priv->phandle, dpu_kms->core_client,
> >  		true);
> >  	if (rc) {
> > @@ -2030,6 +2036,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
> >  			dpu_kms_handle_power_event, dpu_kms, "kms");
> > 
> >  	dpu_power_resource_enable(&priv->phandle, dpu_kms->core_client,
> > false);
> > +	pm_runtime_put_sync(dev->dev);
> > 
> >  	return 0;
> > 
> > @@ -2039,6 +2046,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
> >  perf_err:
> >  power_error:
> >  	dpu_power_resource_enable(&priv->phandle, dpu_kms->core_client,
> > false);
> > +	pm_runtime_put_sync(dev->dev);
> >  error:
> >  	_dpu_kms_hw_destroy(dpu_kms, platformdev);
> >  end:
> 
> -- 
> Jeykumar S

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

  parent reply	other threads:[~2018-03-12 20:06 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21 15:18 [PATCH RESEND 00/10] drm/msm: A handful of dpu fixes Sean Paul
     [not found] ` <20180221151838.224718-1-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-02-21 15:18   ` [PATCH RESEND 01/10] drm/msm: Add displayport files to Makefile Sean Paul
     [not found]     ` <20180221151838.224718-2-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-03-08 22:01       ` Jeykumar Sankaran
2018-02-21 15:18   ` [PATCH RESEND 02/10] drm/msm: Include the dpu_dbg header in msm_drv.c Sean Paul
     [not found]     ` <20180221151838.224718-3-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-03-08 22:03       ` Jeykumar Sankaran
2018-03-08 22:06       ` Jeykumar Sankaran
2018-02-21 15:18   ` [PATCH RESEND 03/10] drm/msm: Change driver name back to msm Sean Paul
     [not found]     ` <20180221151838.224718-4-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-03-08 22:02       ` Jeykumar Sankaran
2018-02-21 15:18   ` [PATCH RESEND 04/10] drm/msm: Remove smmu driver init/cleanup from msm_drv Sean Paul
     [not found]     ` <20180221151838.224718-5-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-03-08 22:04       ` Jeykumar Sankaran
2018-03-08 22:07       ` Jeykumar Sankaran
2018-02-21 15:18   ` [PATCH RESEND 05/10] drm/msm: Defer probe if display component not found Sean Paul
     [not found]     ` <20180221151838.224718-6-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-03-08 22:09       ` Jeykumar Sankaran
2018-02-21 15:18   ` [PATCH RESEND 06/10] drm/msm: Fix deadlock calling msm_gem_new() Sean Paul
     [not found]     ` <20180221151838.224718-7-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-03-08 22:21       ` Jeykumar Sankaran
2018-02-21 15:18   ` [PATCH RESEND 07/10] drm/msm: Populate kms->irq for dpu Sean Paul
     [not found]     ` <20180221151838.224718-8-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-03-08 22:36       ` Jeykumar Sankaran
2018-02-21 15:18   ` [PATCH RESEND 08/10] drm/msm: Sprinkle pm_runtime calls around Sean Paul
     [not found]     ` <20180221151838.224718-9-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-03-09  0:14       ` Jeykumar Sankaran
     [not found]         ` <e953b0d8daa63e5cd2f65259b1c80a27-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-03-12 20:06           ` Sean Paul [this message]
2018-03-14 15:07             ` [DPU PATCH] drm/msm: Add pm_runtime_get/put calls to dpu Sean Paul
     [not found]               ` <20180314150718.254814-1-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-03-15 14:42                 ` skolluku-sgV2jX0FEOL9JmXXK+q4OQ
     [not found]                   ` <94e53348399f60ace8da8281acdaaef0-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-03-15 14:55                     ` skolluku-sgV2jX0FEOL9JmXXK+q4OQ
2018-02-21 15:18   ` [PATCH RESEND 09/10] drm/msm/dpu: Fix writeback compile macros Sean Paul
2018-02-21 15:18   ` [PATCH RESEND 10/10] drm/msm: Restore msm_atomic_check hook Sean Paul
     [not found]     ` <20180221151838.224718-11-seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-02-22 20:08       ` Rob Clark
     [not found]         ` <CAF6AEGswWCtmdCi_Etg8V2Ty9pr1=veHnd8s7iuE4Ot8SB8Ppw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-22 21:01           ` Sean Paul
2018-03-09  0:15       ` Jeykumar Sankaran

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=20180312200626.GW223881@art_vandelay \
    --to=seanpaul-f7+t8e8rja9g9huczpvpmw@public.gmane.org \
    --cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=hoegsberg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@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 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.