[PATCH] drm: Support drivers with threaded irqs

Daniel Vetter daniel at ffwll.ch
Wed Aug 9 17:38:29 UTC 2017


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

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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list