All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Jyri Sarha <jsarha@ti.com>
Cc: tomi.valkeinen@ti.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/tilcdc: Do not keep vblank interrupts enabled all the time
Date: Tue, 15 Sep 2020 02:50:11 +0300	[thread overview]
Message-ID: <20200914235011.GK15543@pendragon.ideasonboard.com> (raw)
In-Reply-To: <f22f53c569ee2722d909c4673b5c7cd43628bfd6.1600072407.git.jsarha@ti.com>

Hi Jyri,

Thank you for the patch.

On Mon, Sep 14, 2020 at 11:34:49AM +0300, Jyri Sarha wrote:
> END_OF_FRAME interrupts have been enabled all the time since the
> beginning of this driver. It is about time to add this feature.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 36 +++++++++++++++++++++++++---
>  1 file changed, 33 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> index 1856962411c7..29f263e1975a 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> @@ -147,12 +147,9 @@ static void tilcdc_crtc_enable_irqs(struct drm_device *dev)
>  		tilcdc_set(dev, LCDC_RASTER_CTRL_REG,
>  			LCDC_V1_SYNC_LOST_INT_ENA | LCDC_V1_FRAME_DONE_INT_ENA |
>  			LCDC_V1_UNDERFLOW_INT_ENA);
> -		tilcdc_set(dev, LCDC_DMA_CTRL_REG,
> -			LCDC_V1_END_OF_FRAME_INT_ENA);
>  	} else {
>  		tilcdc_write(dev, LCDC_INT_ENABLE_SET_REG,
>  			LCDC_V2_UNDERFLOW_INT_ENA |
> -			LCDC_V2_END_OF_FRAME0_INT_ENA |
>  			LCDC_FRAME_DONE | LCDC_SYNC_LOST);
>  	}
>  }
> @@ -678,11 +675,44 @@ static int tilcdc_crtc_atomic_check(struct drm_crtc *crtc,
>  
>  static int tilcdc_crtc_enable_vblank(struct drm_crtc *crtc)
>  {
> +	struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);
> +	struct drm_device *dev = crtc->dev;
> +	struct tilcdc_drm_private *priv = dev->dev_private;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&tilcdc_crtc->irq_lock, flags);
> +
> +	tilcdc_clear_irqstatus(dev, LCDC_END_OF_FRAME0);
> +
> +	if (priv->rev == 1)
> +		tilcdc_set(dev, LCDC_DMA_CTRL_REG,
> +			   LCDC_V1_END_OF_FRAME_INT_ENA);
> +	else
> +		tilcdc_set(dev, LCDC_INT_ENABLE_SET_REG,
> +			   LCDC_V2_END_OF_FRAME0_INT_ENA);
> +
> +	spin_unlock_irqrestore(&tilcdc_crtc->irq_lock, flags);
> +
>  	return 0;
>  }
>  
>  static void tilcdc_crtc_disable_vblank(struct drm_crtc *crtc)
>  {
> +	struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);
> +	struct drm_device *dev = crtc->dev;
> +	struct tilcdc_drm_private *priv = dev->dev_private;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&tilcdc_crtc->irq_lock, flags);
> +
> +	if (priv->rev == 1)
> +		tilcdc_clear(dev, LCDC_DMA_CTRL_REG,
> +			     LCDC_V1_END_OF_FRAME_INT_ENA);
> +	else
> +		tilcdc_clear(dev, LCDC_INT_ENABLE_SET_REG,
> +			     LCDC_V2_END_OF_FRAME0_INT_ENA);
> +
> +	spin_unlock_irqrestore(&tilcdc_crtc->irq_lock, flags);
>  }
>  
>  static void tilcdc_crtc_reset(struct drm_crtc *crtc)

-- 
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-09-14 23:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14  8:34 [PATCH 0/2] drm/tilcdc: Couple of minor feature improvements Jyri Sarha
2020-09-14  8:34 ` [PATCH 1/2] drm/tilcdc: Do not keep vblank interrupts enabled all the time Jyri Sarha
2020-09-14 23:50   ` Laurent Pinchart [this message]
2020-09-14  8:34 ` [PATCH 2/2] drm/tilcdc: Remove tilcdc_crtc_max_width(), use private data Jyri Sarha
2020-09-14 23:53   ` Laurent Pinchart
2020-09-14  8:53 ` [PATCH 0/2] drm/tilcdc: Couple of minor feature improvements Tomi Valkeinen

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=20200914235011.GK15543@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=tomi.valkeinen@ti.com \
    /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.