Hi,

On 05/05/2012 04:44 PM, Hans de Goede wrote:
Hi,

On 05/05/2012 11:14 AM, Hans Verkuil wrote:
So you get:

vidioc_foo()
lock(mylock)
v4l2_ctrl_s_ctrl(ctrl, val)
s_ctrl(ctrl, val)
lock(mylock)

Easy solution here, remove the first lock(mylock), since we are not using 
v4l2-dev's
locking, we are the one doing the first lock, and if we are going to call 
v4l2_ctrl_s_ctrl
we should simply not do that!

Now I see that we are doing exactly that in for example vidioc_g_jpegcomp in 
gspca.c, so
we should stop doing that. We can make vidioc_g/s_jpegcomp only do the usb 
locking if
gspca_dev->vdev.ctrl_handler == NULL, and once all sub drivers are converted 
simply remove
it. Actually I'm thinking about making the jpegqual control part of the 
gspca_dev struct
itself and move all handling of vidioc_g/s_jpegcomp out of the sub drivers and 
into
the core.

Here is an updated version of this patch implementing this approach for
vidioc_g/s_jpegcomp. We may need to do something similar in other places, 
although I cannot
think of any such places atm,

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to