Re: v4l2 + kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> I would like to propose a third method, which may contain the best of
> both worlds (although it may also be hopelessly impractical):
> 
> 1) Retain only 1 registration method (Gerd's fops method).
> 2) Remove all v4l1 compatibility into a separate module.
> 3) Have the compatibility module register distinct devices for v4l1
> compatibily.

I still don't like the separate devices for v4l1/2.

> 2) v4l2 drivers must do their own userspace copying (probably a single
> helper function in videodev that v4l2 modules must call).

Hmm, I think we don't have to do that way.  The ioctl function (maybe
mmap too) in the compatibility module can be build in such a way that
a driver can hook these directly into his struct file_operations.

The ioctl function which does the real work (and no userspace copying)
can go into struct video_device.  Like this:

int generic_video_ioctl(struct inode *inode, struct file *file,
	unsigned int cmd, unsigned long arg)
{
	// videodev.c must export the get_vfl() lookup function
	struct video_device *vfl = get_vfl(inode);

	// copy from userspace

	err = vfl->kernel_ioctl(inode,file,cmd,copied_arg);
	if (err == -ENOIOCTLCMD)
		err = translate_ioctl(...)
	
	// copy to userspace

	return err;
}

Comes close to what videodevX.c does today.  And we can easily split
videodev.c and the compatibility/helper code into multiple modules.

  Gerd





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux