[PATCH v4 20/22] drm: omapdrm: Remove global variables

Tomi Valkeinen tomi.valkeinen at ti.com
Fri Dec 16 12:31:45 UTC 2016


On 14/12/16 02:27, Laurent Pinchart wrote:
> Move the list of pending IRQ wait instances to the omap_drm_private
> structure and the wait queue head to the IRQ wait structure.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_drv.h |  3 ++-
>  drivers/gpu/drm/omapdrm/omap_irq.c | 42 ++++++++++++++++++++------------------
>  2 files changed, 24 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
> index 8ef7e8963bd9..b20377efd01b 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.h
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.h
> @@ -88,7 +88,8 @@ struct omap_drm_private {
>  	struct drm_property *zorder_prop;
>  
>  	/* irq handling: */
> -	struct list_head wait_list;     /* list of omap_irq_wait */
> +	spinlock_t wait_lock;		/* protects the wait_list */
> +	struct list_head wait_list;	/* list of omap_irq_wait */
>  	uint32_t irq_mask;		/* enabled irqs in addition to wait_list */
>  
>  	/* atomic commit */
> diff --git a/drivers/gpu/drm/omapdrm/omap_irq.c b/drivers/gpu/drm/omapdrm/omap_irq.c
> index f9510c13e1a2..7555b62f6c53 100644
> --- a/drivers/gpu/drm/omapdrm/omap_irq.c
> +++ b/drivers/gpu/drm/omapdrm/omap_irq.c
> @@ -19,22 +19,21 @@
>  
>  #include "omap_drv.h"
>  
> -static DEFINE_SPINLOCK(list_lock);
> -
>  struct omap_irq_wait {
>  	struct list_head node;
> +	wait_queue_head_t wq;
>  	uint32_t irqmask;
>  	int count;
>  };

The wait_queue_head_t + count combination looks suspiciously like
completion. But as there's no wait_for_completion_count(), I guess the
current implementation is better.

Reviewed-by: Tomi Valkeinen <tomi.valkeinen at ti.com>

 Tomi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20161216/16a89e89/attachment-0001.sig>


More information about the dri-devel mailing list