On Wednesday, December 01, 2010 17:58:35 Hadli, Manjunath wrote:
> >
> > You may want to consider using the new core-assisted locking support. That 
> > > will simplify your driver. It seems that this driver just locks at every  
> > > ioctl, so
> > in that case it is easier to let the core do that.
> 
> Hans,
>   I looked into the mailing lists discussion on the core-assisted locking 
> support but could not get a clear picture. Could you point me to the 
> implementation snippet or some example of where it is done? Or for now is it 
> OK to use .unlocked_ioctl?

Sure. But it is documented in v4l2-framework.txt, section 'v4l2_file_operations
and locking'.

The vivi driver uses this in fact.

Basically it is nothing more then assigning a pointer to a mutex to the lock 
field
of struct video_device:

        vdev->lock = &v4l2_dev->lock;

After that all fops are serialized through this mutex.

Regards,

        Hans

-- 
Hans Verkuil - video4linux developer - sponsored by Cisco
--
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