Commit 08af245d authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] V4L: remove V4L1 compatibility mode

Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b69a219e
......@@ -53,21 +53,6 @@ config VIDEO_ALLOW_V4L1
If you are unsure as to whether this is required, answer Y.
config VIDEO_V4L1_COMPAT
bool "Enable Video For Linux API 1 compatible Layer" if !VIDEO_ALLOW_V4L1
depends on VIDEO_DEV
default y
---help---
Enables a compatibility API used by most V4L2 devices to allow
its usage with legacy applications that supports only V4L1 api.
Documentation for the original API is included in the file
<Documentation/video4linux/API.html>.
User tools for this are available from
<ftp://ftp.uk.linux.org/pub/linux/video4linux/>.
If you are unsure as to whether this is required, answer Y.
#
# DVB Core
......
......@@ -1129,35 +1129,6 @@ static int vidioc_g_chip_ident(struct file *file, void *__fh,
core, g_chip_ident, chip);
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
static int vidiocgmbuf(struct file *file, void *__fh, struct video_mbuf *mbuf)
{
struct saa7146_fh *fh = __fh;
struct videobuf_queue *q = &fh->video_q;
int err, i;
/* fixme: number of capture buffers and sizes for v4l apps */
int gbuffers = 2;
int gbufsize = 768 * 576 * 4;
DEB_D(("VIDIOCGMBUF \n"));
q = &fh->video_q;
err = videobuf_mmap_setup(q, gbuffers, gbufsize,
V4L2_MEMORY_MMAP);
if (err < 0)
return err;
gbuffers = err;
memset(mbuf, 0, sizeof(*mbuf));
mbuf->frames = gbuffers;
mbuf->size = gbuffers * gbufsize;
for (i = 0; i < gbuffers; i++)
mbuf->offsets[i] = i * gbufsize;
return 0;
}
#endif
const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = {
.vidioc_querycap = vidioc_querycap,
.vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
......@@ -1186,9 +1157,6 @@ const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = {
.vidioc_streamon = vidioc_streamon,
.vidioc_streamoff = vidioc_streamoff,
.vidioc_g_parm = vidioc_g_parm,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = vidiocgmbuf,
#endif
};
/*********************************************************************************/
......
......@@ -22,10 +22,6 @@ endif
obj-$(CONFIG_VIDEO_V4L2_COMMON) += v4l2-common.o
ifeq ($(CONFIG_VIDEO_V4L1_COMPAT),y)
obj-$(CONFIG_VIDEO_DEV) += v4l1-compat.o
endif
# All i2c modules must come first:
obj-$(CONFIG_VIDEO_TUNER) += tuner.o
......
......@@ -1809,15 +1809,6 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b)
return videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK);
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
{
struct au0828_fh *fh = priv;
return videobuf_cgmbuf(&fh->vb_vidq, mbuf, 8);
}
#endif
static struct v4l2_file_operations au0828_v4l_fops = {
.owner = THIS_MODULE,
.open = au0828_v4l2_open,
......@@ -1861,9 +1852,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
.vidioc_s_register = vidioc_s_register,
#endif
.vidioc_g_chip_ident = vidioc_g_chip_ident,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = vidiocgmbuf,
#endif
};
static const struct video_device au0828_video_template = {
......
......@@ -2597,31 +2597,6 @@ static int bttv_s_fmt_vid_overlay(struct file *file, void *priv,
return setup_window_lock(fh, btv, &f->fmt.win, 1);
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
{
int retval;
unsigned int i;
struct bttv_fh *fh = priv;
retval = __videobuf_mmap_setup(&fh->cap, gbuffers, gbufsize,
V4L2_MEMORY_MMAP);
if (retval < 0) {
return retval;
}
gbuffers = retval;
memset(mbuf, 0, sizeof(*mbuf));
mbuf->frames = gbuffers;
mbuf->size = gbuffers * gbufsize;
for (i = 0; i < gbuffers; i++)
mbuf->offsets[i] = i * gbufsize;
return 0;
}
#endif
static int bttv_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{
......@@ -3354,9 +3329,6 @@ static const struct v4l2_ioctl_ops bttv_ioctl_ops = {
.vidioc_streamoff = bttv_streamoff,
.vidioc_g_tuner = bttv_g_tuner,
.vidioc_s_tuner = bttv_s_tuner,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = vidiocgmbuf,
#endif
.vidioc_g_crop = bttv_g_crop,
.vidioc_s_crop = bttv_s_crop,
.vidioc_g_fbuf = bttv_g_fbuf,
......
......@@ -417,28 +417,6 @@ static int sync(struct camera_data *cam, int frame_nr)
}
}
/******************************************************************************
*
* ioctl_get_mbuf
*
*****************************************************************************/
#ifdef CONFIG_VIDEO_V4L1_COMPAT
static int ioctl_get_mbuf(void *arg, struct camera_data *cam)
{
struct video_mbuf *vm;
int i;
vm = arg;
memset(vm, 0, sizeof(*vm));
vm->size = cam->frame_size*cam->num_frames;
vm->frames = cam->num_frames;
for (i = 0; i < cam->num_frames; i++)
vm->offsets[i] = cam->frame_size * i;
return 0;
}
#endif
/******************************************************************************
*
* ioctl_set_gpio
......@@ -1380,17 +1358,6 @@ static long cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
}
break;
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
case VIDIOCGMBUF:
{
struct cpia2_fh *fh = file->private_data;
if(fh->prio != V4L2_PRIORITY_RECORD) {
mutex_unlock(&cam->busy_lock);
return -EBUSY;
}
break;
}
#endif
default:
break;
}
......@@ -1400,11 +1367,6 @@ static long cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
case CPIA2_IOC_SET_GPIO:
retval = ioctl_set_gpio(arg, cam);
break;
#ifdef CONFIG_VIDEO_V4L1_COMPAT
case VIDIOCGMBUF: /* mmap interface */
retval = ioctl_get_mbuf(arg, cam);
break;
#endif
case VIDIOC_QUERYCAP:
retval = ioctl_querycap(arg,cam);
break;
......
......@@ -2044,15 +2044,6 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b)
return videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK);
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
{
struct cx231xx_fh *fh = priv;
return videobuf_cgmbuf(&fh->vb_vidq, mbuf, 8);
}
#endif
/* ----------------------------------------------------------- */
/* RADIO ESPECIFIC IOCTLS */
/* ----------------------------------------------------------- */
......@@ -2507,9 +2498,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
.vidioc_g_register = vidioc_g_register,
.vidioc_s_register = vidioc_s_register,
#endif
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = vidiocgmbuf,
#endif
};
static struct video_device cx231xx_vbi_template;
......
......@@ -1024,35 +1024,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
return 0;
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
static int vidiocgmbuf(struct file *file, void *priv,
struct video_mbuf *mbuf)
{
struct cx23885_fh *fh = priv;
struct videobuf_queue *q;
struct v4l2_requestbuffers req;
unsigned int i;
int err;
q = get_queue(fh);
memset(&req, 0, sizeof(req));
req.type = q->type;
req.count = 8;
req.memory = V4L2_MEMORY_MMAP;
err = videobuf_reqbufs(q, &req);
if (err < 0)
return err;
mbuf->frames = req.count;
mbuf->size = 0;
for (i = 0; i < mbuf->frames; i++) {
mbuf->offsets[i] = q->bufs[i]->boff;
mbuf->size += q->bufs[i]->bsize;
}
return 0;
}
#endif
static int vidioc_reqbufs(struct file *file, void *priv,
struct v4l2_requestbuffers *p)
{
......@@ -1427,9 +1398,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
.vidioc_s_ctrl = vidioc_s_ctrl,
.vidioc_streamon = vidioc_streamon,
.vidioc_streamoff = vidioc_streamoff,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = vidiocgmbuf,
#endif
.vidioc_g_tuner = vidioc_g_tuner,
.vidioc_s_tuner = vidioc_s_tuner,
.vidioc_g_frequency = vidioc_g_frequency,
......
......@@ -1179,15 +1179,6 @@ static int vidioc_enum_fmt_vid_cap (struct file *file, void *priv,
return 0;
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
static int vidiocgmbuf (struct file *file, void *priv, struct video_mbuf *mbuf)
{
struct cx8800_fh *fh = priv;
return videobuf_cgmbuf (get_queue(fh), mbuf, 8);
}
#endif
static int vidioc_reqbufs (struct file *file, void *priv, struct v4l2_requestbuffers *p)
{
struct cx8800_fh *fh = priv;
......@@ -1731,9 +1722,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
.vidioc_s_ctrl = vidioc_s_ctrl,
.vidioc_streamon = vidioc_streamon,
.vidioc_streamoff = vidioc_streamoff,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = vidiocgmbuf,
#endif
.vidioc_g_tuner = vidioc_g_tuner,
.vidioc_s_tuner = vidioc_s_tuner,
.vidioc_g_frequency = vidioc_g_frequency,
......
......@@ -1934,19 +1934,6 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b)
O_NONBLOCK);
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
{
struct em28xx_fh *fh = priv;
if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
return videobuf_cgmbuf(&fh->vb_vidq, mbuf, 8);
else
return videobuf_cgmbuf(&fh->vb_vbiq, mbuf, 8);
}
#endif
/* ----------------------------------------------------------- */
/* RADIO ESPECIFIC IOCTLS */
/* ----------------------------------------------------------- */
......@@ -2359,9 +2346,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
.vidioc_s_register = vidioc_s_register,
.vidioc_g_chip_ident = vidioc_g_chip_ident,
#endif
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = vidiocgmbuf,
#endif
};
static const struct video_device em28xx_video_template = {
......
......@@ -852,8 +852,8 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
#endif
default :
ret = v4l_compat_translate_ioctl(file, cmd,
arg, pvr2_v4l2_do_ioctl);
ret = -EINVAL;
break;
}
pvr2_hdw_commit_ctl(hdw);
......
......@@ -362,23 +362,6 @@ long pwc_video_do_ioctl(struct file *file, unsigned int cmd, void *arg)
switch (cmd) {
#ifdef CONFIG_VIDEO_V4L1_COMPAT
/* mmap() functions */
case VIDIOCGMBUF:
{
/* Tell the user program how much memory is needed for a mmap() */
struct video_mbuf *vm = arg;
int i;
memset(vm, 0, sizeof(*vm));
vm->size = pwc_mbufs * pdev->len_per_image;
vm->frames = pwc_mbufs; /* double buffering should be enough for most applications */
for (i = 0; i < pwc_mbufs; i++)
vm->offsets[i] = i * pdev->len_per_image;
break;
}
#endif
/* V4L2 Layer */
case VIDIOC_QUERYCAP:
{
......
......@@ -1097,15 +1097,6 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p)
return rc;
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
static int vidioc_cgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
{
struct s2255_fh *fh = priv;
return videobuf_cgmbuf(&fh->vb_vidq, mbuf, 8);
}
#endif
/* write to the configuration pipe, synchronously */
static int s2255_write_config(struct usb_device *udev, unsigned char *pbuf,
int size)
......@@ -1909,9 +1900,6 @@ static const struct v4l2_ioctl_ops s2255_ioctl_ops = {
.vidioc_s_ctrl = vidioc_s_ctrl,
.vidioc_streamon = vidioc_streamon,
.vidioc_streamoff = vidioc_streamoff,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = vidioc_cgmbuf,
#endif
.vidioc_s_jpegcomp = vidioc_s_jpegcomp,
.vidioc_g_jpegcomp = vidioc_g_jpegcomp,
.vidioc_s_parm = vidioc_s_parm,
......
......@@ -2211,14 +2211,6 @@ static int saa7134_overlay(struct file *file, void *f, unsigned int on)
return 0;
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
{
struct saa7134_fh *fh = file->private_data;
return videobuf_cgmbuf(saa7134_queue(fh), mbuf, 8);
}
#endif
static int saa7134_reqbufs(struct file *file, void *priv,
struct v4l2_requestbuffers *p)
{
......@@ -2456,9 +2448,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
.vidioc_streamoff = saa7134_streamoff,
.vidioc_g_tuner = saa7134_g_tuner,
.vidioc_s_tuner = saa7134_s_tuner,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = vidiocgmbuf,
#endif
.vidioc_g_crop = saa7134_g_crop,
.vidioc_s_crop = saa7134_s_crop,
.vidioc_g_fbuf = saa7134_g_fbuf,
......
......@@ -1273,9 +1273,6 @@ static const struct v4l2_ioctl_ops usbvision_ioctl_ops = {
.vidioc_s_ctrl = vidioc_s_ctrl,
.vidioc_streamon = vidioc_streamon,
.vidioc_streamoff = vidioc_streamoff,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
/* .vidiocgmbuf = vidiocgmbuf, */
#endif
.vidioc_g_tuner = vidioc_g_tuner,
.vidioc_s_tuner = vidioc_s_tuner,
.vidioc_g_frequency = vidioc_g_frequency,
......
......@@ -1035,11 +1035,8 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
return uvc_xu_ctrl_query(chain, arg, 1);
default:
if ((ret = v4l_compat_translate_ioctl(file, cmd, arg,
uvc_v4l2_do_ioctl)) == -ENOIOCTLCMD)
uvc_trace(UVC_TRACE_IOCTL, "Unknown ioctl 0x%08x\n",
cmd);
return ret;
uvc_trace(UVC_TRACE_IOCTL, "Unknown ioctl 0x%08x\n", cmd);
return -EINVAL;
}
return ret;
......
This diff is collapsed.
This diff is collapsed.
......@@ -18,12 +18,8 @@
#include <linux/kernel.h>
#define __OLD_VIDIOC_ /* To allow fixing old calls */
#include <linux/videodev.h>
#include <linux/videodev2.h>
#ifdef CONFIG_VIDEO_V4L1
#include <linux/videodev.h>
#endif
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-ctrls.h>
......@@ -183,42 +179,6 @@ static const char *v4l2_memory_names[] = {
/* ------------------------------------------------------------------ */
/* debug help functions */
#ifdef CONFIG_VIDEO_V4L1_COMPAT
static const char *v4l1_ioctls[] = {
[_IOC_NR(VIDIOCGCAP)] = "VIDIOCGCAP",
[_IOC_NR(VIDIOCGCHAN)] = "VIDIOCGCHAN",
[_IOC_NR(VIDIOCSCHAN)] = "VIDIOCSCHAN",
[_IOC_NR(VIDIOCGTUNER)] = "VIDIOCGTUNER",
[_IOC_NR(VIDIOCSTUNER)] = "VIDIOCSTUNER",
[_IOC_NR(VIDIOCGPICT)] = "VIDIOCGPICT",
[_IOC_NR(VIDIOCSPICT)] = "VIDIOCSPICT",
[_IOC_NR(VIDIOCCAPTURE)] = "VIDIOCCAPTURE",
[_IOC_NR(VIDIOCGWIN)] = "VIDIOCGWIN",
[_IOC_NR(VIDIOCSWIN)] = "VIDIOCSWIN",
[_IOC_NR(VIDIOCGFBUF)] = "VIDIOCGFBUF",
[_IOC_NR(VIDIOCSFBUF)] = "VIDIOCSFBUF",
[_IOC_NR(VIDIOCKEY)] = "VIDIOCKEY",
[_IOC_NR(VIDIOCGFREQ)] = "VIDIOCGFREQ",
[_IOC_NR(VIDIOCSFREQ)] = "VIDIOCSFREQ",
[_IOC_NR(VIDIOCGAUDIO)] = "VIDIOCGAUDIO",
[_IOC_NR(VIDIOCSAUDIO)] = "VIDIOCSAUDIO",
[_IOC_NR(VIDIOCSYNC)] = "VIDIOCSYNC",
[_IOC_NR(VIDIOCMCAPTURE)] = "VIDIOCMCAPTURE",
[_IOC_NR(VIDIOCGMBUF)] = "VIDIOCGMBUF",
[_IOC_NR(VIDIOCGUNIT)] = "VIDIOCGUNIT",
[_IOC_NR(VIDIOCGCAPTURE)] = "VIDIOCGCAPTURE",
[_IOC_NR(VIDIOCSCAPTURE)] = "VIDIOCSCAPTURE",
[_IOC_NR(VIDIOCSPLAYMODE)] = "VIDIOCSPLAYMODE",
[_IOC_NR(VIDIOCSWRITEMODE)] = "VIDIOCSWRITEMODE",
[_IOC_NR(VIDIOCGPLAYINFO)] = "VIDIOCGPLAYINFO",
[_IOC_NR(VIDIOCSMICROCODE)] = "VIDIOCSMICROCODE",
[_IOC_NR(VIDIOCGVBIFMT)] = "VIDIOCGVBIFMT",
[_IOC_NR(VIDIOCSVBIFMT)] = "VIDIOCSVBIFMT"
};
#define V4L1_IOCTLS ARRAY_SIZE(v4l1_ioctls)
#endif
static const char *v4l2_ioctls[] = {
[_IOC_NR(VIDIOC_QUERYCAP)] = "VIDIOC_QUERYCAP",
[_IOC_NR(VIDIOC_RESERVED)] = "VIDIOC_RESERVED",
......@@ -310,15 +270,6 @@ void v4l_printk_ioctl(unsigned int cmd)
case 'd':
type = "v4l2_int";
break;
#ifdef CONFIG_VIDEO_V4L1_COMPAT
case 'v':
if (_IOC_NR(cmd) >= V4L1_IOCTLS) {
type = "v4l1";
break;
}
printk("%s", v4l1_ioctls[_IOC_NR(cmd)]);
return;
#endif
case 'V':
if (_IOC_NR(cmd) >= V4L2_IOCTLS) {
type = "v4l2";
......@@ -622,20 +573,6 @@ static long __video_do_ioctl(struct file *file,
return -EINVAL;
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
/********************************************************
All other V4L1 calls are handled by v4l1_compat module.
Those calls will be translated into V4L2 calls, and
__video_do_ioctl will be called again, with one or more
V4L2 ioctls.
********************************************************/
if (_IOC_TYPE(cmd) == 'v' && cmd != VIDIOCGMBUF &&
_IOC_NR(cmd) < BASE_VIDIOCPRIVATE) {
return v4l_compat_translate_ioctl(file, cmd, arg,
__video_do_ioctl);
}
#endif
if ((vfd->debug & V4L2_DEBUG_IOCTL) &&
!(vfd->debug & V4L2_DEBUG_IOCTL_ARG)) {
v4l_print_ioctl(vfd->name, cmd);
......@@ -644,29 +581,6 @@ static long __video_do_ioctl(struct file *file,
switch (cmd) {
#ifdef CONFIG_VIDEO_V4L1_COMPAT
/***********************************************************
Handles calls to the obsoleted V4L1 API
Due to the nature of VIDIOCGMBUF, each driver that supports
V4L1 should implement its own handler for this ioctl.
***********************************************************/
/* --- streaming capture ------------------------------------- */
case VIDIOCGMBUF:
{
struct video_mbuf *p = arg;
if (!ops->vidiocgmbuf)
break;
ret = ops->vidiocgmbuf(file, fh, p);
if (!ret)
dbgarg(cmd, "size=%d, frames=%d, offsets=0x%08lx\n",
p->size, p->frames,
(unsigned long)p->offsets);
break;
}
#endif
/* --- capabilities ------------------------------------------ */
case VIDIOC_QUERYCAP:
{
......
......@@ -1161,16 +1161,6 @@ static int viacam_streamoff(struct file *filp, void *priv, enum v4l2_buf_type t)
return ret;
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
static int viacam_vidiocgmbuf(struct file *filp, void *priv,
struct video_mbuf *mbuf)
{
struct via_camera *cam = priv;
return videobuf_cgmbuf(&cam->vb_queue, mbuf, 6);
}
#endif
/* G/S_PARM */
static int viacam_g_parm(struct file *filp, void *priv,
......@@ -1251,9 +1241,6 @@ static const struct v4l2_ioctl_ops viacam_ioctl_ops = {
.vidioc_s_parm = viacam_s_parm,
.vidioc_enum_framesizes = viacam_enum_framesizes,
.vidioc_enum_frameintervals = viacam_enum_frameintervals,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = viacam_vidiocgmbuf,
#endif
};
/*----------------------------------------------------------------------------*/
......
......@@ -1202,33 +1202,3 @@ int videobuf_mmap_mapper(struct videobuf_queue *q, struct vm_area_struct *vma)
return rc;
}
EXPORT_SYMBOL_GPL(videobuf_mmap_mapper);
#ifdef CONFIG_VIDEO_V4L1_COMPAT
int videobuf_cgmbuf(struct videobuf_queue *q,
struct video_mbuf *mbuf, int count)
{
struct v4l2_requestbuffers req;
int rc, i;
MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);
memset(&req, 0, sizeof(req));
req.type = q->type;
req.count = count;
req.memory = V4L2_MEMORY_MMAP;
rc = videobuf_reqbufs(q, &req);
if (rc < 0)
return rc;
mbuf->frames = req.count;
mbuf->size = 0;
for (i = 0; i < mbuf->frames; i++) {
mbuf->offsets[i] = q->bufs[i]->boff;
mbuf->size += PAGE_ALIGN(q->bufs[i]->bsize);
}
return 0;
}
EXPORT_SYMBOL_GPL(videobuf_cgmbuf);
#endif
......@@ -570,29 +570,6 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q,
}
last = first;
#ifdef CONFIG_VIDEO_V4L1_COMPAT
if (size != (vma->vm_end - vma->vm_start)) {
/* look for last buffer to map */
for (last = first + 1; last < VIDEO_MAX_FRAME; last++) {
if (NULL == q->bufs[last])
continue;
if (V4L2_MEMORY_MMAP != q->bufs[last]->memory)
continue;
if (q->bufs[last]->map) {
retval = -EBUSY;
goto done;
}
size += PAGE_ALIGN(q->bufs[last]->bsize);
if (size == (vma->vm_end - vma->vm_start))
break;
}
if (VIDEO_MAX_FRAME == last) {
dprintk(1, "mmap app bug: size invalid [size=0x%lx]\n",
(vma->vm_end - vma->vm_start));
goto done;
}
}
#endif
/* create mapping + update buffer list */
retval = -ENOMEM;
......
......@@ -870,15 +870,6 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p)
file->f_flags & O_NONBLOCK);
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
{
struct vivi_dev *dev = video_drvdata(file);
return videobuf_cgmbuf(&dev->vb_vidq, mbuf, 8);
}
#endif
static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
{
struct vivi_dev *dev = video_drvdata(file);
......@@ -1105,9 +1096,6 @@ static const struct v4l2_ioctl_ops vivi_ioctl_ops = {
.vidioc_queryctrl = vidioc_queryctrl,
.vidioc_g_ctrl = vidioc_g_ctrl,
.vidioc_s_ctrl = vidioc_s_ctrl,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = vidiocgmbuf,
#endif
};
static struct video_device vivi_template = {
......
......@@ -1188,34 +1188,6 @@ int cx25821_vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
return 0;
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
int cx25821_vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
{
struct cx25821_fh *fh = priv;
struct videobuf_queue *q;
struct v4l2_requestbuffers req;
unsigned int i;
int err;
q = get_queue(fh);
memset(&req, 0, sizeof(req));
req.type = q->type;
req.count = 8;
req.memory = V4L2_MEMORY_MMAP;
err = videobuf_reqbufs(q, &req);
if (err < 0)
return err;
mbuf->frames = req.count;
mbuf->size = 0;
for (i = 0; i < mbuf->frames; i++) {
mbuf->offsets[i] = q->bufs[i]->boff;
mbuf->size += q->bufs[i]->bsize;
}
return 0;
}
#endif
int cx25821_vidioc_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *p)
{
struct cx25821_fh *fh = priv;
......@@ -2016,9 +1988,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
.vidioc_log_status = vidioc_log_status,
.vidioc_g_priority = cx25821_vidioc_g_priority,
.vidioc_s_priority = cx25821_vidioc_s_priority,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = cx25821_vidiocgmbuf,
#endif
#ifdef TUNER_FLAG
.vidioc_g_tuner = cx25821_vidioc_g_tuner,
.vidioc_s_tuner = cx25821_vidioc_s_tuner,
......
......@@ -40,11 +40,6 @@
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#ifdef CONFIG_VIDEO_V4L1_COMPAT
/* Include V4L1 specific functions. Should be removed soon */
#include <linux/videodev.h>
#endif
#define TUNER_FLAG
#define VIDEO_DEBUG 0
......@@ -134,7 +129,6 @@ extern int cx25821_vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap);
extern int cx25821_vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f);
extern int cx25821_vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf);
extern int cx25821_vidioc_reqbufs(struct file *file, void *priv,
struct v4l2_requestbuffers *p);
extern int cx25821_vidioc_querybuf(struct file *file, void *priv,
......
......@@ -876,9 +876,6 @@ static const struct v4l2_ioctl_ops dt3155_ioctl_ops = {
.vidioc_s_crop = dt3155_ioc_s_crop,
.vidioc_enum_framesizes = dt3155_ioc_enum_framesizes,
.vidioc_enum_frameintervals = dt3155_ioc_enum_frameintervals,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = iocgmbuf,
#endif
*/
};
......
......@@ -986,15 +986,6 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p)
file->f_flags & O_NONBLOCK);
}
#ifdef CONFIG_VIDEO_V4L1_COMPAT
static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
{
struct tm6000_fh *fh = priv;
return videobuf_cgmbuf(&fh->vb_vidq, mbuf, 8);
}
#endif
static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
{
struct tm6000_fh *fh = priv;
......@@ -1438,9 +1429,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
.vidioc_querybuf = vidioc_querybuf,
.vidioc_qbuf = vidioc_qbuf,
.vidioc_dqbuf = vidioc_dqbuf,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = vidiocgmbuf,
#endif
};
static struct video_device tm6000_template = {
......
......@@ -16,24 +16,7 @@
#include <linux/ioctl.h>
#include <linux/videodev2.h>
#if defined(__MIN_V4L1) && defined (__KERNEL__)
/*
* Used by those V4L2 core functions that need a minimum V4L1 support,
* in order to allow V4L1 Compatibilty code compilation.
*/
struct video_mbuf
{
int size; /* Total memory to map */
int frames; /* Frames */
int offsets[VIDEO_MAX_FRAME];
};
#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */
#else
#if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__)
#if defined(CONFIG_VIDEO_V4L1) || defined(CONFIG_VIDEO_V4L1_MODULE) || !defined(__KERNEL__)
#define VID_TYPE_CAPTURE 1 /* Can capture */
#define VID_TYPE_TUNER 2 /* Can tune */
......@@ -328,8 +311,7 @@ struct video_code
#define VID_PLAY_RESET 13
#define VID_PLAY_END_MARK 14
#endif /* CONFIG_VIDEO_V4L1_COMPAT */
#endif /* __MIN_V4L1 */
#endif /* CONFIG_VIDEO_V4L1 */
#endif /* __LINUX_VIDEODEV_H */
......
......@@ -14,12 +14,7 @@
#include <linux/device.h>
#include <linux/mutex.h>
#include <linux/compiler.h> /* need __user */
#ifdef CONFIG_VIDEO_V4L1_COMPAT
#define __MIN_V4L1
#include <linux/videodev.h>
#else
#include <linux/videodev2.h>
#endif
struct v4l2_fh;
......@@ -113,10 +108,6 @@ struct v4l2_ioctl_ops {
int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i);
#ifdef CONFIG_VIDEO_V4L1_COMPAT
/* buffer type is struct vidio_mbuf * */
int (*vidiocgmbuf) (struct file *file, void *fh, struct video_mbuf *p);
#endif
int (*vidioc_g_fbuf) (struct file *file, void *fh,
struct v4l2_framebuffer *a);
int (*vidioc_s_fbuf) (struct file *file, void *fh,
......@@ -300,22 +291,15 @@ extern void v4l_printk_ioctl(unsigned int cmd);
extern const char *v4l2_field_names[];
extern const char *v4l2_type_names[];
/* Compatibility layer interface -- v4l1-compat module */
typedef long (*v4l2_kioctl)(struct file *file,
unsigned int cmd, void *arg);
#ifdef CONFIG_VIDEO_V4L1_COMPAT
long v4l_compat_translate_ioctl(struct file *file,
int cmd, void *arg, v4l2_kioctl driver_ioctl);
#else
#define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL)
#endif
#ifdef CONFIG_COMPAT
/* 32 Bits compatibility layer for 64 bits processors */
extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd,
unsigned long arg);
#endif
typedef long (*v4l2_kioctl)(struct file *file,
unsigned int cmd, void *arg);
/* Include support for obsoleted stuff */
extern long video_usercopy(struct file *file, unsigned int cmd,
unsigned long arg, v4l2_kioctl func);
......
......@@ -17,10 +17,6 @@
#define _VIDEOBUF_CORE_H
#include <linux/poll.h>
#ifdef CONFIG_VIDEO_V4L1_COMPAT
#define __MIN_V4L1
#include <linux/videodev.h>
#endif
#include <linux/videodev2.h>
#define UNSET (-1U)
......@@ -212,10 +208,6 @@ int videobuf_qbuf(struct videobuf_queue *q,
struct v4l2_buffer *b);
int videobuf_dqbuf(struct videobuf_queue *q,
struct v4l2_buffer *b, int nonblocking);
#ifdef CONFIG_VIDEO_V4L1_COMPAT
int videobuf_cgmbuf(struct videobuf_queue *q,
struct video_mbuf *mbuf, int count);
#endif
int videobuf_streamon(struct videobuf_queue *q);
int videobuf_streamoff(struct videobuf_queue *q);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment