dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v2 4/5] drm: hdlcd: Don't touch vsync interrupts during vblank enable/disable.
Date: Wed, 1 Jun 2016 16:51:40 +0200	[thread overview]
Message-ID: <20160601145140.GZ7231@phenom.ffwll.local> (raw)
In-Reply-To: <1464792519-24530-5-git-send-email-Liviu.Dudau@arm.com>

On Wed, Jun 01, 2016 at 03:48:38PM +0100, Liviu Dudau wrote:
> Because the HDLCD lacks a hardware counter for vsync signal, the DRM
> framework expects that the vsync interrupts are left running to feed
> the internal software counter. Currently the HDLCD is masking/unmasking
> the vsync interrupt on vblank enable/disable calls, which break that
> expectation. Fix that.
> 
> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>

As discussed, this is actually not needed. The only thing you need to do
is set max_vblank_count = 0. If vblank enable/disable is causing problems,
then that would indicate an issue in the core drm_irq.c code, and should
be fixed there.

And if the docs are confusion, then please update those insted. This patch
here shouldn't be needed at all.
-Daniel

> ---
>  drivers/gpu/drm/arm/hdlcd_drv.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index fb172d2..3f92dfa 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -183,9 +183,13 @@ static int hdlcd_irq_postinstall(struct drm_device *drm)
>  
>  	/* enable debug interrupts */
>  	irq_mask |= HDLCD_DEBUG_INT_MASK;
> +#endif
> +
> +	/* enable vsync interrupts */
> +	irq_mask |= HDLCD_INTERRUPT_VSYNC;
>  
>  	hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, irq_mask);
> -#endif
> +
>  	return 0;
>  }
>  
> @@ -208,20 +212,11 @@ static void hdlcd_irq_uninstall(struct drm_device *drm)
>  
>  static int hdlcd_enable_vblank(struct drm_device *drm, unsigned int crtc)
>  {
> -	struct hdlcd_drm_private *hdlcd = drm->dev_private;
> -	unsigned int mask = hdlcd_read(hdlcd, HDLCD_REG_INT_MASK);
> -
> -	hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, mask | HDLCD_INTERRUPT_VSYNC);
> -
>  	return 0;
>  }
>  
>  static void hdlcd_disable_vblank(struct drm_device *drm, unsigned int crtc)
>  {
> -	struct hdlcd_drm_private *hdlcd = drm->dev_private;
> -	unsigned int mask = hdlcd_read(hdlcd, HDLCD_REG_INT_MASK);
> -
> -	hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, mask & ~HDLCD_INTERRUPT_VSYNC);
>  }
>  
>  #ifdef CONFIG_DEBUG_FS
> -- 
> 2.8.2
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-06-01 14:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 14:48 [PATCH v2 0/5] HDLCD cleanups for v4.7 Liviu Dudau
2016-06-01 14:48 ` [PATCH v2 1/5] drm: hdlcd: Revamp runtime power management Liviu Dudau
2016-06-01 14:48 ` [PATCH v2 2/5] drm/hdlcd: Fix up crtc_state->event handling Liviu Dudau
2016-06-01 14:48 ` [PATCH v2 3/5] drm: hdlcd: Cleanup the atomic plane operations Liviu Dudau
2016-06-01 14:48 ` [PATCH v2 4/5] drm: hdlcd: Don't touch vsync interrupts during vblank enable/disable Liviu Dudau
2016-06-01 14:51   ` Daniel Vetter [this message]
2016-06-01 14:48 ` [PATCH v2 5/5] drm: hdlcd: Add information about the underlying framebuffers in debugfs Liviu Dudau

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=20160601145140.GZ7231@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=Liviu.Dudau@arm.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.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