summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/rkisp1/rkisp1-common.h
diff options
context:
space:
mode:
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>2020-06-26 10:51:40 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-07-19 10:48:12 +0200
commitb512ab7a85268b3d43d8c504a3e84dbdd923c52b (patch)
tree8fdf33fdf47118aed208983f7515af3ce0001751 /drivers/staging/media/rkisp1/rkisp1-common.h
parent46c308a964fe6515845eacb8765a2c2e2b8c1570 (diff)
downloadlinux-b512ab7a85268b3d43d8c504a3e84dbdd923c52b.tar.bz2
media: staging: rkisp1: stats: replace locks wq_lock, irq_lock with one lock
This patch removes two locks in the rkisp1_stats struct: - The mutex 'wq_lock' that is used to protect the buffers list 'stat' - The spin_lock 'irq_lock' that is used to protect the variable 'is_streaming' It replaces them with one spin_lock 'lock' that protects both the buffers list and the 'is_streaming' variable. In later patch the reading of the statistics will move to the isr so there will be no need for the mutex 'wq_lock' Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Acked-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/rkisp1/rkisp1-common.h')
-rw-r--r--drivers/staging/media/rkisp1/rkisp1-common.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/media/rkisp1/rkisp1-common.h b/drivers/staging/media/rkisp1/rkisp1-common.h
index 43fe4dc2c7c4..d62f5d6fbc81 100644
--- a/drivers/staging/media/rkisp1/rkisp1-common.h
+++ b/drivers/staging/media/rkisp1/rkisp1-common.h
@@ -181,7 +181,7 @@ struct rkisp1_capture {
/*
* struct rkisp1_stats - ISP Statistics device
*
- * @irq_lock: buffer queue lock
+ * @lock: locks the buffer list 'stat' and 'is_streaming'
* @stat: stats buffer list
* @readout_wq: workqueue for statistics information read
*/
@@ -189,13 +189,12 @@ struct rkisp1_stats {
struct rkisp1_vdev_node vnode;
struct rkisp1_device *rkisp1;
- spinlock_t irq_lock;
+ spinlock_t lock; /* locks 'is_streaming', and 'stats' */
struct list_head stat;
struct v4l2_format vdev_fmt;
bool is_streaming;
struct workqueue_struct *readout_wq;
- struct mutex wq_lock;
};
/*