dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: dri-devel@lists.freedesktop.org
Cc: daniel.vetter@ffwll.ch, alison.wang@freescale.com,
	linux-kernel@vger.kernel.org, meng.yi@nxp.com
Subject: Re: [PATCH 1/2] drm/fsl-dcu: implement irq_preinstall/uninstall callbacks
Date: Thu, 08 Jun 2017 14:57:40 -0700	[thread overview]
Message-ID: <3cbf67453d1f1724f9f815309b77d1aa@agner.ch> (raw)
In-Reply-To: <37033e2d4e251d3ffaa16f31459864c5ee365b2f.1496372207.git-series.stefan@agner.ch>

On 2017-06-01 20:00, Stefan Agner wrote:
> Make use of the irq_preinstall/uninstall callback to clear and
> mask all interrupts. Use write 1 to clear as documented by the
> data sheet (writing a 0 seems to have cleared interrupt status
> too). Remove fsl_dcu_drm_irq_init and call drm_irq_install
> directly from fsl_dcu_load makes error handling a bit simpler.
> Do not set irq_enabled since drm_irq_install is taking care of
> it.
> 
> Signed-off-by: Stefan Agner <stefan@agner.ch>

Applied to my fsl-dcu branch for 4.13.

--
Stefan

> ---
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 20 ++++++++------------
>  1 file changed, 8 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> index 6e00f4b..d86f35c 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> @@ -51,19 +51,12 @@ static const struct regmap_config fsl_dcu_regmap_config = {
>  	.volatile_reg = fsl_dcu_drm_is_volatile_reg,
>  };
>  
> -static int fsl_dcu_drm_irq_init(struct drm_device *dev)
> +static void fsl_dcu_irq_uninstall(struct drm_device *dev)
>  {
>  	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
> -	int ret;
> -
> -	ret = drm_irq_install(dev, fsl_dev->irq);
> -	if (ret < 0)
> -		dev_err(dev->dev, "failed to install IRQ handler\n");
>  
> -	regmap_write(fsl_dev->regmap, DCU_INT_STATUS, 0);
> +	regmap_write(fsl_dev->regmap, DCU_INT_STATUS, ~0);
>  	regmap_write(fsl_dev->regmap, DCU_INT_MASK, ~0);
> -
> -	return ret;
>  }
>  
>  static int fsl_dcu_load(struct drm_device *dev, unsigned long flags)
> @@ -83,10 +76,11 @@ static int fsl_dcu_load(struct drm_device *dev,
> unsigned long flags)
>  		goto done;
>  	}
>  
> -	ret = fsl_dcu_drm_irq_init(dev);
> -	if (ret < 0)
> +	ret = drm_irq_install(dev, fsl_dev->irq);
> +	if (ret < 0) {
> +		dev_err(dev->dev, "failed to install IRQ handler\n");
>  		goto done;
> -	dev->irq_enabled = true;
> +	}
>  
>  	if (legacyfb_depth != 16 && legacyfb_depth != 24 &&
>  	    legacyfb_depth != 32) {
> @@ -170,6 +164,8 @@ static struct drm_driver fsl_dcu_drm_driver = {
>  	.load			= fsl_dcu_load,
>  	.unload			= fsl_dcu_unload,
>  	.irq_handler		= fsl_dcu_drm_irq,
> +	.irq_preinstall		= fsl_dcu_irq_uninstall,
> +	.irq_uninstall		= fsl_dcu_irq_uninstall,
>  	.gem_free_object_unlocked = drm_gem_cma_free_object,
>  	.gem_vm_ops		= &drm_gem_cma_vm_ops,
>  	.prime_handle_to_fd	= drm_gem_prime_handle_to_fd,
> 
> base-commit: 2a1720376adda5ecf8e636fbfb05339c7dad1c55
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      parent reply	other threads:[~2017-06-08 21:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02  3:00 [PATCH 1/2] drm/fsl-dcu: implement irq_preinstall/uninstall callbacks Stefan Agner
2017-06-02  3:00 ` [PATCH 2/2] drm/fsl-dcu: use new drm_atomic_helper_shutdown Stefan Agner
2017-06-08 21:57 ` Stefan Agner [this message]

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=3cbf67453d1f1724f9f815309b77d1aa@agner.ch \
    --to=stefan@agner.ch \
    --cc=alison.wang@freescale.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meng.yi@nxp.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 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).