summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vsp1/vsp1_entity.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2016-06-26 08:09:31 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-19 14:46:31 -0300
commit34e77ed84b274d20415067306b855bd87f761f5e (patch)
tree70982c33f0851c66403cbabcf629cfcea7da2e81 /drivers/media/platform/vsp1/vsp1_entity.h
parente4e70a147a48618a36ae1b81c641516cb9d45993 (diff)
downloadlinux-34e77ed84b274d20415067306b855bd87f761f5e.tar.gz
linux-34e77ed84b274d20415067306b855bd87f761f5e.tar.bz2
linux-34e77ed84b274d20415067306b855bd87f761f5e.zip
[media] v4l: vsp1: Protect against race conditions between get and set format
The subdev userspace API isn't serialized in the core, serialize access to formats and selection rectangles in the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/vsp1/vsp1_entity.h')
-rw-r--r--drivers/media/platform/vsp1/vsp1_entity.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_entity.h b/drivers/media/platform/vsp1/vsp1_entity.h
index b43457fd2c43..b5e4dbb1f7d4 100644
--- a/drivers/media/platform/vsp1/vsp1_entity.h
+++ b/drivers/media/platform/vsp1/vsp1_entity.h
@@ -14,7 +14,7 @@
#define __VSP1_ENTITY_H__
#include <linux/list.h>
-#include <linux/spinlock.h>
+#include <linux/mutex.h>
#include <media/v4l2-subdev.h>
@@ -96,6 +96,8 @@ struct vsp1_entity {
struct v4l2_subdev subdev;
struct v4l2_subdev_pad_config *config;
+
+ struct mutex lock; /* Protects the pad config */
};
static inline struct vsp1_entity *to_vsp1_entity(struct v4l2_subdev *subdev)