v4l: vsp1: Fill display list headers without holding dlm spinlock
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 30 May 2017 00:40:35 +0000 (03:40 +0300)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sat, 29 Jul 2017 20:46:55 +0000 (23:46 +0300)
The display list headers are filled using information from the display
list only. Lower the display list manager spinlock contention by filling
the headers without holding the lock.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Acked-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/vsp1/vsp1_dl.c

index aaf17b13fd7875f29c6c966e4caae234cb4d29e6..dc47e236c780da70011ee2749f5c352f77105349 100644 (file)
@@ -483,8 +483,6 @@ void vsp1_dl_list_commit(struct vsp1_dl_list *dl)
        unsigned long flags;
        bool update;
 
-       spin_lock_irqsave(&dlm->lock, flags);
-
        if (dl->dlm->mode == VSP1_DL_MODE_HEADER) {
                struct vsp1_dl_list *dl_child;
 
@@ -501,7 +499,11 @@ void vsp1_dl_list_commit(struct vsp1_dl_list *dl)
 
                        vsp1_dl_list_fill_header(dl_child, last);
                }
+       }
 
+       spin_lock_irqsave(&dlm->lock, flags);
+
+       if (dl->dlm->mode == VSP1_DL_MODE_HEADER) {
                /*
                 * Commit the head display list to hardware. Chained headers
                 * will auto-start.