linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeykumar Sankaran <jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
Cc: Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	dri-devel
	<dri-devel-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 2/4] drm/msm: dpu: Simplify frame_done watchdog timeout calculation
Date: Wed, 06 Feb 2019 11:42:04 -0800	[thread overview]
Message-ID: <6e29730f71bedbc9bf10ab61f28e4913@codeaurora.org> (raw)
In-Reply-To: <20190128204306.95076-2-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>

On 2019-01-28 12:42, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
> 
> Instead of setting the timeout and then immediately reading it back
> (along with the hand-rolled msecs_to_jiffies calculation), just
> calculate it once and set it in both places at the same time.
> 
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index dd71cb6ba4f5c..83a4c47dbed2d 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -1791,6 +1791,7 @@ void dpu_encoder_kickoff(struct drm_encoder 
> *drm_enc,
> bool async)
>  {
>  	struct dpu_encoder_virt *dpu_enc;
>  	struct dpu_encoder_phys *phys;
> +	unsigned long timeout_ms;
>  	ktime_t wakeup_time;
>  	unsigned int i;
> 
> @@ -1803,11 +1804,12 @@ void dpu_encoder_kickoff(struct drm_encoder
> *drm_enc, bool async)
> 
>  	trace_dpu_enc_kickoff(DRMID(drm_enc));
> 
> -	atomic_set(&dpu_enc->frame_done_timeout,
> -			DPU_FRAME_DONE_TIMEOUT * 1000 /
> -			drm_mode_vrefresh(&drm_enc->crtc->state->adjusted_mode));
> -	mod_timer(&dpu_enc->frame_done_timer, jiffies +
> -		((atomic_read(&dpu_enc->frame_done_timeout) * HZ) / 1000));
> +	timeout_ms = DPU_FRAME_DONE_TIMEOUT * 1000 /
> +		drm_mode_vrefresh(&drm_enc->crtc->state->adjusted_mode);

For future cleanup: Is drm_enc->crtc a valid usage here?

> +
> +	atomic_set(&dpu_enc->frame_done_timeout, timeout_ms);
> +	mod_timer(&dpu_enc->frame_done_timer,
> +		  jiffies + msecs_to_jiffies(timeout_ms));
> 
>  	/* All phys encs are ready to go, trigger the kickoff */
>  	_dpu_encoder_kickoff_phys(dpu_enc, async);

Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org>
-- 
Jeykumar S
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

  parent reply	other threads:[~2019-02-06 19:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-28 20:42 [PATCH 1/4] drm/msm: Use drm_mode_vrefresh instead of mode->vrefresh Sean Paul
2019-01-28 20:42 ` [PATCH 3/4] drm/msm: dpu: Untangle frame_done timeout units Sean Paul
     [not found]   ` <20190128204306.95076-3-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
2019-02-05 21:51     ` Fritz Koenig
2019-02-06 19:50     ` Jeykumar Sankaran
2019-01-28 21:05 ` [PATCH 1/4] drm/msm: Use drm_mode_vrefresh instead of mode->vrefresh Abhinav Kumar
2019-01-29  8:59 ` Daniel Vetter
     [not found]   ` <20190129085940.GM3271-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-01-29 15:53     ` Sean Paul
     [not found] ` <20190128204306.95076-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
2019-01-28 20:42   ` [PATCH 2/4] drm/msm: dpu: Simplify frame_done watchdog timeout calculation Sean Paul
2019-01-28 21:06     ` Abhinav Kumar
     [not found]     ` <20190128204306.95076-2-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
2019-02-06 19:42       ` Jeykumar Sankaran [this message]
2019-01-28 20:42   ` [PATCH 4/4] drm/msm: dpu: Don't queue the frame_done watchdog for cursor Sean Paul
2019-02-05 20:13     ` Fritz Koenig
2019-02-06 19:53     ` Jeykumar Sankaran
2019-02-06 18:52   ` [PATCH 1/4] drm/msm: Use drm_mode_vrefresh instead of mode->vrefresh 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=6e29730f71bedbc9bf10ab61f28e4913@codeaurora.org \
    --to=jsanka-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=dri-devel-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sean-p7yTbzM4H96eqtR555YLDQ@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;
as well as URLs for NNTP newsgroup(s).