diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-05-06 08:28:27 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-14 08:31:03 -0400 |
commit | a3d6e8cc0e6ddc8b3cfdeb3c979f07ed1aa528b3 (patch) | |
tree | 60e69fcac849b505328e5755ee71195d0bc6728b /drivers/media/video/gspca/gspca.h | |
parent | 254902b01d2acc6aced99ec17caa4c6cd890cdea (diff) |
[media] gspca: Switch to V4L2 core locking, except for the buffer queuing ioctls
Due to latency concerns the VIDIOC_QBUF, DQBUF and QUERYBUF do not use the
core lock, instead they rely only on queue_lock.
Changes by HdG:
1) Change release from the video_device to the v4l2_device, to avoid a
race on disconnect.
2) Adjust for the V4L2 core changes which cause non ioctl fops to no longer
take the V4L2 core lock.
[mchehab@redhat.com: fix a merge conflict]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/gspca.h')
-rw-r--r-- | drivers/media/video/gspca/gspca.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h index c1ebf7cd45b3..436d881ce443 100644 --- a/drivers/media/video/gspca/gspca.h +++ b/drivers/media/video/gspca/gspca.h | |||
@@ -163,6 +163,7 @@ struct gspca_dev { | |||
163 | struct v4l2_device v4l2_dev; | 163 | struct v4l2_device v4l2_dev; |
164 | struct usb_device *dev; | 164 | struct usb_device *dev; |
165 | struct file *capt_file; /* file doing video capture */ | 165 | struct file *capt_file; /* file doing video capture */ |
166 | /* protected by queue_lock */ | ||
166 | #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) | 167 | #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) |
167 | struct input_dev *input_dev; | 168 | struct input_dev *input_dev; |
168 | char phys[64]; /* physical device path */ | 169 | char phys[64]; /* physical device path */ |
@@ -192,7 +193,7 @@ struct gspca_dev { | |||
192 | u8 fr_o; /* next frame to dequeue */ | 193 | u8 fr_o; /* next frame to dequeue */ |
193 | __u8 last_packet_type; | 194 | __u8 last_packet_type; |
194 | __s8 empty_packet; /* if (-1) don't check empty packets */ | 195 | __s8 empty_packet; /* if (-1) don't check empty packets */ |
195 | __u8 streaming; | 196 | __u8 streaming; /* protected by both mutexes (*) */ |
196 | 197 | ||
197 | __u8 curr_mode; /* current camera mode */ | 198 | __u8 curr_mode; /* current camera mode */ |
198 | __u32 pixfmt; /* current mode parameters */ | 199 | __u32 pixfmt; /* current mode parameters */ |
@@ -214,6 +215,10 @@ struct gspca_dev { | |||
214 | __u8 iface; /* USB interface number */ | 215 | __u8 iface; /* USB interface number */ |
215 | __u8 alt; /* USB alternate setting */ | 216 | __u8 alt; /* USB alternate setting */ |
216 | u8 audio; /* presence of audio device */ | 217 | u8 audio; /* presence of audio device */ |
218 | |||
219 | /* (*) These variables are proteced by both usb_lock and queue_lock, | ||
220 | that is any code setting them is holding *both*, which means that | ||
221 | any code getting them needs to hold at least one of them */ | ||
217 | }; | 222 | }; |
218 | 223 | ||
219 | int gspca_dev_probe(struct usb_interface *intf, | 224 | int gspca_dev_probe(struct usb_interface *intf, |