public inbox for linux-arm-msm@vger.kernel.org
 help / color / mirror / Atom feed
From: Abhinav Kumar <abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jeykumar Sankaran
	<jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/msm: dpu: Don't enable vblank interrupts in irq_control
Date: Fri, 07 Dec 2018 13:16:54 -0800	[thread overview]
Message-ID: <f07098f4aee56c9658cca3cdfbee968b@codeaurora.org> (raw)
In-Reply-To: <20181207171703.56029-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>

On 2018-12-07 09:16, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
> 
> The irq_control function is called upon encoder enable/disable and 
> turns
> on/off the vblank interrupts. Unfortunately, it enables them when the
> drm code is not expecting them to be on. As a result, we can get into
> nasty locking situations.
> 
> vblank interrupts should be solely managed by the drm core via
> control_vblank_irq(). This patch removes the vblank irq handling from
> irq_control.
> 
> Here's some tracing before this patch:
> -- CRTC is enabled, irq_control is called, drm_vblank reference is 0
>    25.078455: dpu_crtc_enable: id:46 enable:true state{enabled:false}
> -- vblank irqs incorrectly firing, drm_crtc_handle_vblank is called 
> from them
>    25.290067: dpu_crtc_vblank_cb: id=46
>    25.306691: dpu_crtc_vblank_cb: id=46
> -- drm core enables vblank interrupts, drm_vblank_reference > 0
>    25.311527: dpu_crtc_vblank: id:46 enable:true state{enabled:true}
> -- vblank irqs continue (correctly)
>    25.323351: dpu_crtc_vblank_cb: id=46
>    25.340033: dpu_crtc_vblank_cb: id=46
>    25.356701: dpu_crtc_vblank_cb: id=46
> 
> And after this patch:
> -- CRTC is enabled, irq_control does not enable vblank interrupts
>   123.861353: dpu_crtc_enable: id:46 enable:true state{enabled:false}
> -- drm core enables vblank, we enable the irq
>   124.192916: dpu_crtc_vblank: id:46 enable:true state{enabled:true}
> -- vblank irqs start at the correct time
>   124.200548: dpu_crtc_vblank_cb: id=46
>   124.217195: dpu_crtc_vblank_cb: id=46
>   124.233848: dpu_crtc_vblank_cb: id=46
> 
> Signed-off-by: Sean Paul <seanpaul@chromium.org>

With this change "FROMLIST: drm/msm: Grab a vblank reference when 
waiting for commit_done"
in place, this patch looks fine to me as we are protected to disable 
vblank
right after commit hence cases such as idle power collapse for smart 
panels ideally
shouldnt get impacted.

However, since we are not validating smart panels do we want to remove
changes to dpu_encoder_phys_cmd.c and just keep it for video mode?

> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 2 --
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 6 ------
>  2 files changed, 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
> index 99ab5ca9bed3..c9eaa3516e9a 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
> @@ -339,7 +339,6 @@ static void
> dpu_encoder_phys_cmd_irq_control(struct dpu_encoder_phys *phys_enc,
>  	if (enable) {
>  		dpu_encoder_helper_register_irq(phys_enc, INTR_IDX_PINGPONG);
>  		dpu_encoder_helper_register_irq(phys_enc, INTR_IDX_UNDERRUN);
> -		dpu_encoder_phys_cmd_control_vblank_irq(phys_enc, true);
> 
>  		if (dpu_encoder_phys_cmd_is_master(phys_enc))
>  			dpu_encoder_helper_register_irq(phys_enc,
> @@ -350,7 +349,6 @@ static void
> dpu_encoder_phys_cmd_irq_control(struct dpu_encoder_phys *phys_enc,
>  					INTR_IDX_CTL_START);
> 
>  		dpu_encoder_helper_unregister_irq(phys_enc, INTR_IDX_UNDERRUN);
> -		dpu_encoder_phys_cmd_control_vblank_irq(phys_enc, false);
>  		dpu_encoder_helper_unregister_irq(phys_enc, INTR_IDX_PINGPONG);
>  	}
>  }
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> index acdab5b0db18..e3125a1ab3dc 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> @@ -706,7 +706,6 @@ static void
> dpu_encoder_phys_vid_irq_control(struct dpu_encoder_phys *phys_enc,
>  		bool enable)
>  {
>  	struct dpu_encoder_phys_vid *vid_enc;
> -	int ret;
> 
>  	if (!phys_enc)
>  		return;
> @@ -719,13 +718,8 @@ static void
> dpu_encoder_phys_vid_irq_control(struct dpu_encoder_phys *phys_enc,
>  			    atomic_read(&phys_enc->vblank_refcount));
> 
>  	if (enable) {
> -		ret = dpu_encoder_phys_vid_control_vblank_irq(phys_enc, true);
> -		if (ret)
> -			return;
> -
>  		dpu_encoder_helper_register_irq(phys_enc, INTR_IDX_UNDERRUN);
>  	} else {
> -		dpu_encoder_phys_vid_control_vblank_irq(phys_enc, false);
>  		dpu_encoder_helper_unregister_irq(phys_enc, INTR_IDX_UNDERRUN);
>  	}
>  }
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

  parent reply	other threads:[~2018-12-07 21:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-07 17:16 [PATCH] drm/msm: dpu: Don't enable vblank interrupts in irq_control Sean Paul
     [not found] ` <20181207171703.56029-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
2018-12-07 21:16   ` Abhinav Kumar [this message]
     [not found]     ` <f07098f4aee56c9658cca3cdfbee968b-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-12-07 21:50       ` Sean Paul
2018-12-07 21:58         ` Abhinav Kumar

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=f07098f4aee56c9658cca3cdfbee968b@codeaurora.org \
    --to=abhinavk-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=jsanka-sgV2jX0FEOL9JmXXK+q4OQ@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