Re: [PATCH] drm: Support drivers with threaded irqs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 09, 2017 at 07:17:54PM +0200, Sinclair Yeh wrote:
> From: Thomas Hellstrom <thellstrom@xxxxxxxxxx>
> 
> See LWN article at
> https://lwn.net/Articles/302043/
> 
> Signed-off-by: Thomas Hellstrom <thellstrom@xxxxxxxxxx>
> Reviewed-by: Deepak Singh Rawat <drawat@xxxxxxxxxx>
> Reviewed-by: Sinclair Yeh <syeh@xxxxxxxxxx>

We definitely can't do this in general due to latency reasons.  Please
read the kerneldoc of drm_irq_install and just roll your own. This also
seems to like break every driver's compilation.

Thanks, Daniel

> ---
>  drivers/gpu/drm/drm_irq.c | 6 ++++--
>  include/drm/drm_drv.h     | 1 +
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index 3b04c2510..ef9b4be 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -127,8 +127,10 @@ int drm_irq_install(struct drm_device *dev, int irq)
>  	if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED))
>  		sh_flags = IRQF_SHARED;
>  
> -	ret = request_irq(irq, dev->driver->irq_handler,
> -			  sh_flags, dev->driver->name, dev);
> +	ret = request_threaded_irq(irq,
> +				   dev->driver->irq_handler,
> +				   dev->driver->irq_thread_fn,
> +				   sh_flags, dev->driver->name, dev);
>  
>  	if (ret < 0) {
>  		dev->irq_enabled = false;
> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
> index 81971dc..c47abbf 100644
> --- a/include/drm/drm_drv.h
> +++ b/include/drm/drm_drv.h
> @@ -333,6 +333,7 @@ struct drm_driver {
>  	 * drivers which implement their own interrupt handling.
>  	 */
>  	irqreturn_t(*irq_handler) (int irq, void *arg);
> +	irqreturn_t (*irq_thread_fn)(int irq, void *arg);
>  
>  	/**
>  	 * @irq_preinstall:
> -- 
> 2.7.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux