diff options
author | Sakari Ailus <sakari.ailus@iki.fi> | 2012-05-02 08:40:03 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-07-05 17:00:32 -0400 |
commit | 2b719d7baf490e24ce7d817c6337b7c87fda84c1 (patch) | |
tree | 72059aea0fc81e45fdc0eb9b7c41e81a5ad31c36 | |
parent | 5cf73ce15f704876378733794864336fbec6c97e (diff) |
[media] v4l: drop v4l2_buffer.input and V4L2_BUF_FLAG_INPUT
Remove input field in struct v4l2_buffer and flag V4L2_BUF_FLAG_INPUT which
tells the former is valid. The flag is used by no driver currently.
Also change the documentation accordingly.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | Documentation/DocBook/media/v4l/compat.xml | 12 | ||||
-rw-r--r-- | Documentation/DocBook/media/v4l/io.xml | 19 | ||||
-rw-r--r-- | Documentation/DocBook/media/v4l/vidioc-qbuf.xml | 9 | ||||
-rw-r--r-- | drivers/media/video/cpia2/cpia2_v4l.c | 2 | ||||
-rw-r--r-- | drivers/media/video/v4l2-compat-ioctl32.c | 11 | ||||
-rw-r--r-- | drivers/media/video/videobuf-core.c | 16 | ||||
-rw-r--r-- | drivers/media/video/videobuf2-core.c | 5 | ||||
-rw-r--r-- | include/linux/videodev2.h | 3 |
8 files changed, 29 insertions, 48 deletions
diff --git a/Documentation/DocBook/media/v4l/compat.xml b/Documentation/DocBook/media/v4l/compat.xml index ea42ef824948..a8b374930405 100644 --- a/Documentation/DocBook/media/v4l/compat.xml +++ b/Documentation/DocBook/media/v4l/compat.xml | |||
@@ -2458,6 +2458,18 @@ details.</para> | |||
2458 | </orderedlist> | 2458 | </orderedlist> |
2459 | </section> | 2459 | </section> |
2460 | 2460 | ||
2461 | <section> | ||
2462 | <title>V4L2 in Linux 3.5</title> | ||
2463 | <orderedlist> | ||
2464 | <listitem> | ||
2465 | <para>Replaced <structfield>input</structfield> in | ||
2466 | <structname>v4l2_buffer</structname> by | ||
2467 | <structfield>reserved2</structfield> and removed | ||
2468 | <constant>V4L2_BUF_FLAG_INPUT</constant>.</para> | ||
2469 | </listitem> | ||
2470 | </orderedlist> | ||
2471 | </section> | ||
2472 | |||
2461 | <section id="other"> | 2473 | <section id="other"> |
2462 | <title>Relation of V4L2 to other Linux multimedia APIs</title> | 2474 | <title>Relation of V4L2 to other Linux multimedia APIs</title> |
2463 | 2475 | ||
diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml index fd6aca2922b6..1885cc0755cb 100644 --- a/Documentation/DocBook/media/v4l/io.xml +++ b/Documentation/DocBook/media/v4l/io.xml | |||
@@ -683,14 +683,12 @@ memory, set by the application. See <xref linkend="userp" /> for details. | |||
683 | </row> | 683 | </row> |
684 | <row> | 684 | <row> |
685 | <entry>__u32</entry> | 685 | <entry>__u32</entry> |
686 | <entry><structfield>input</structfield></entry> | 686 | <entry><structfield>reserved2</structfield></entry> |
687 | <entry></entry> | 687 | <entry></entry> |
688 | <entry>Some video capture drivers support rapid and | 688 | <entry>A place holder for future extensions and custom |
689 | synchronous video input changes, a function useful for example in | 689 | (driver defined) buffer types |
690 | video surveillance applications. For this purpose applications set the | 690 | <constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher. Applications |
691 | <constant>V4L2_BUF_FLAG_INPUT</constant> flag, and this field to the | 691 | should set this to 0.</entry> |
692 | number of a video input as in &v4l2-input; field | ||
693 | <structfield>index</structfield>.</entry> | ||
694 | </row> | 692 | </row> |
695 | <row> | 693 | <row> |
696 | <entry>__u32</entry> | 694 | <entry>__u32</entry> |
@@ -923,13 +921,6 @@ Drivers set or clear this flag when the <constant>VIDIOC_DQBUF</constant> | |||
923 | ioctl is called.</entry> | 921 | ioctl is called.</entry> |
924 | </row> | 922 | </row> |
925 | <row> | 923 | <row> |
926 | <entry><constant>V4L2_BUF_FLAG_INPUT</constant></entry> | ||
927 | <entry>0x0200</entry> | ||
928 | <entry>The <structfield>input</structfield> field is valid. | ||
929 | Applications set or clear this flag before calling the | ||
930 | <constant>VIDIOC_QBUF</constant> ioctl.</entry> | ||
931 | </row> | ||
932 | <row> | ||
933 | <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry> | 924 | <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry> |
934 | <entry>0x0400</entry> | 925 | <entry>0x0400</entry> |
935 | <entry>The buffer has been prepared for I/O and can be queued by the | 926 | <entry>The buffer has been prepared for I/O and can be queued by the |
diff --git a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml index 9caa49af580f..77ff5be0809d 100644 --- a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml +++ b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml | |||
@@ -71,12 +71,9 @@ initialize the <structfield>bytesused</structfield>, | |||
71 | <structfield>field</structfield> and | 71 | <structfield>field</structfield> and |
72 | <structfield>timestamp</structfield> fields, see <xref | 72 | <structfield>timestamp</structfield> fields, see <xref |
73 | linkend="buffer" /> for details. | 73 | linkend="buffer" /> for details. |
74 | Applications must also set <structfield>flags</structfield> to 0. If a driver | 74 | Applications must also set <structfield>flags</structfield> to 0. |
75 | supports capturing from specific video inputs and you want to specify a video | 75 | The <structfield>reserved2</structfield> and |
76 | input, then <structfield>flags</structfield> should be set to | 76 | <structfield>reserved</structfield> fields must be set to 0. When using |
77 | <constant>V4L2_BUF_FLAG_INPUT</constant> and the field | ||
78 | <structfield>input</structfield> must be initialized to the desired input. | ||
79 | The <structfield>reserved</structfield> field must be set to 0. When using | ||
80 | the <link linkend="planar-apis">multi-planar API</link>, the | 77 | the <link linkend="planar-apis">multi-planar API</link>, the |
81 | <structfield>m.planes</structfield> field must contain a userspace pointer | 78 | <structfield>m.planes</structfield> field must contain a userspace pointer |
82 | to a filled-in array of &v4l2-plane; and the <structfield>length</structfield> | 79 | to a filled-in array of &v4l2-plane; and the <structfield>length</structfield> |
diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c index 55e92902a76c..a62a7b739991 100644 --- a/drivers/media/video/cpia2/cpia2_v4l.c +++ b/drivers/media/video/cpia2/cpia2_v4l.c | |||
@@ -932,7 +932,7 @@ static int cpia2_dqbuf(struct file *file, void *fh, struct v4l2_buffer *buf) | |||
932 | buf->sequence = cam->buffers[buf->index].seq; | 932 | buf->sequence = cam->buffers[buf->index].seq; |
933 | buf->m.offset = cam->buffers[buf->index].data - cam->frame_buffer; | 933 | buf->m.offset = cam->buffers[buf->index].data - cam->frame_buffer; |
934 | buf->length = cam->frame_size; | 934 | buf->length = cam->frame_size; |
935 | buf->input = 0; | 935 | buf->reserved2 = 0; |
936 | buf->reserved = 0; | 936 | buf->reserved = 0; |
937 | memset(&buf->timecode, 0, sizeof(buf->timecode)); | 937 | memset(&buf->timecode, 0, sizeof(buf->timecode)); |
938 | 938 | ||
diff --git a/drivers/media/video/v4l2-compat-ioctl32.c b/drivers/media/video/v4l2-compat-ioctl32.c index 5327ad3a6390..658ba46ee9d2 100644 --- a/drivers/media/video/v4l2-compat-ioctl32.c +++ b/drivers/media/video/v4l2-compat-ioctl32.c | |||
@@ -327,7 +327,7 @@ struct v4l2_buffer32 { | |||
327 | compat_caddr_t planes; | 327 | compat_caddr_t planes; |
328 | } m; | 328 | } m; |
329 | __u32 length; | 329 | __u32 length; |
330 | __u32 input; | 330 | __u32 reserved2; |
331 | __u32 reserved; | 331 | __u32 reserved; |
332 | }; | 332 | }; |
333 | 333 | ||
@@ -387,8 +387,7 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user | |||
387 | get_user(kp->index, &up->index) || | 387 | get_user(kp->index, &up->index) || |
388 | get_user(kp->type, &up->type) || | 388 | get_user(kp->type, &up->type) || |
389 | get_user(kp->flags, &up->flags) || | 389 | get_user(kp->flags, &up->flags) || |
390 | get_user(kp->memory, &up->memory) || | 390 | get_user(kp->memory, &up->memory) |
391 | get_user(kp->input, &up->input)) | ||
392 | return -EFAULT; | 391 | return -EFAULT; |
393 | 392 | ||
394 | if (V4L2_TYPE_IS_OUTPUT(kp->type)) | 393 | if (V4L2_TYPE_IS_OUTPUT(kp->type)) |
@@ -472,8 +471,7 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user | |||
472 | put_user(kp->index, &up->index) || | 471 | put_user(kp->index, &up->index) || |
473 | put_user(kp->type, &up->type) || | 472 | put_user(kp->type, &up->type) || |
474 | put_user(kp->flags, &up->flags) || | 473 | put_user(kp->flags, &up->flags) || |
475 | put_user(kp->memory, &up->memory) || | 474 | put_user(kp->memory, &up->memory) |
476 | put_user(kp->input, &up->input)) | ||
477 | return -EFAULT; | 475 | return -EFAULT; |
478 | 476 | ||
479 | if (put_user(kp->bytesused, &up->bytesused) || | 477 | if (put_user(kp->bytesused, &up->bytesused) || |
@@ -482,7 +480,8 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user | |||
482 | put_user(kp->timestamp.tv_usec, &up->timestamp.tv_usec) || | 480 | put_user(kp->timestamp.tv_usec, &up->timestamp.tv_usec) || |
483 | copy_to_user(&up->timecode, &kp->timecode, sizeof(struct v4l2_timecode)) || | 481 | copy_to_user(&up->timecode, &kp->timecode, sizeof(struct v4l2_timecode)) || |
484 | put_user(kp->sequence, &up->sequence) || | 482 | put_user(kp->sequence, &up->sequence) || |
485 | put_user(kp->reserved, &up->reserved)) | 483 | put_user(kp->reserved2, &up->reserved2) || |
484 | put_user(kp->reserved, &up->reserved) | ||
486 | return -EFAULT; | 485 | return -EFAULT; |
487 | 486 | ||
488 | if (V4L2_TYPE_IS_MULTIPLANAR(kp->type)) { | 487 | if (V4L2_TYPE_IS_MULTIPLANAR(kp->type)) { |
diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c index ffdf59cfe405..bf7a326b1cdc 100644 --- a/drivers/media/video/videobuf-core.c +++ b/drivers/media/video/videobuf-core.c | |||
@@ -359,11 +359,6 @@ static void videobuf_status(struct videobuf_queue *q, struct v4l2_buffer *b, | |||
359 | break; | 359 | break; |
360 | } | 360 | } |
361 | 361 | ||
362 | if (vb->input != UNSET) { | ||
363 | b->flags |= V4L2_BUF_FLAG_INPUT; | ||
364 | b->input = vb->input; | ||
365 | } | ||
366 | |||
367 | b->field = vb->field; | 362 | b->field = vb->field; |
368 | b->timestamp = vb->ts; | 363 | b->timestamp = vb->ts; |
369 | b->bytesused = vb->size; | 364 | b->bytesused = vb->size; |
@@ -402,7 +397,6 @@ int __videobuf_mmap_setup(struct videobuf_queue *q, | |||
402 | break; | 397 | break; |
403 | 398 | ||
404 | q->bufs[i]->i = i; | 399 | q->bufs[i]->i = i; |
405 | q->bufs[i]->input = UNSET; | ||
406 | q->bufs[i]->memory = memory; | 400 | q->bufs[i]->memory = memory; |
407 | q->bufs[i]->bsize = bsize; | 401 | q->bufs[i]->bsize = bsize; |
408 | switch (memory) { | 402 | switch (memory) { |
@@ -566,16 +560,6 @@ int videobuf_qbuf(struct videobuf_queue *q, struct v4l2_buffer *b) | |||
566 | goto done; | 560 | goto done; |
567 | } | 561 | } |
568 | 562 | ||
569 | if (b->flags & V4L2_BUF_FLAG_INPUT) { | ||
570 | if (b->input >= q->inputs) { | ||
571 | dprintk(1, "qbuf: wrong input.\n"); | ||
572 | goto done; | ||
573 | } | ||
574 | buf->input = b->input; | ||
575 | } else { | ||
576 | buf->input = UNSET; | ||
577 | } | ||
578 | |||
579 | switch (b->memory) { | 563 | switch (b->memory) { |
580 | case V4L2_MEMORY_MMAP: | 564 | case V4L2_MEMORY_MMAP: |
581 | if (0 == buf->baddr) { | 565 | if (0 == buf->baddr) { |
diff --git a/drivers/media/video/videobuf2-core.c b/drivers/media/video/videobuf2-core.c index 9d4e9edbd2e7..ec24718b3ed0 100644 --- a/drivers/media/video/videobuf2-core.c +++ b/drivers/media/video/videobuf2-core.c | |||
@@ -336,9 +336,9 @@ static int __fill_v4l2_buffer(struct vb2_buffer *vb, struct v4l2_buffer *b) | |||
336 | struct vb2_queue *q = vb->vb2_queue; | 336 | struct vb2_queue *q = vb->vb2_queue; |
337 | int ret; | 337 | int ret; |
338 | 338 | ||
339 | /* Copy back data such as timestamp, flags, input, etc. */ | 339 | /* Copy back data such as timestamp, flags, etc. */ |
340 | memcpy(b, &vb->v4l2_buf, offsetof(struct v4l2_buffer, m)); | 340 | memcpy(b, &vb->v4l2_buf, offsetof(struct v4l2_buffer, m)); |
341 | b->input = vb->v4l2_buf.input; | 341 | b->reserved2 = vb->v4l2_buf.reserved2; |
342 | b->reserved = vb->v4l2_buf.reserved; | 342 | b->reserved = vb->v4l2_buf.reserved; |
343 | 343 | ||
344 | if (V4L2_TYPE_IS_MULTIPLANAR(q->type)) { | 344 | if (V4L2_TYPE_IS_MULTIPLANAR(q->type)) { |
@@ -860,7 +860,6 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, const struct v4l2_buffer *b, | |||
860 | 860 | ||
861 | vb->v4l2_buf.field = b->field; | 861 | vb->v4l2_buf.field = b->field; |
862 | vb->v4l2_buf.timestamp = b->timestamp; | 862 | vb->v4l2_buf.timestamp = b->timestamp; |
863 | vb->v4l2_buf.input = b->input; | ||
864 | vb->v4l2_buf.flags = b->flags & ~V4L2_BUFFER_STATE_FLAGS; | 863 | vb->v4l2_buf.flags = b->flags & ~V4L2_BUFFER_STATE_FLAGS; |
865 | 864 | ||
866 | return 0; | 865 | return 0; |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index f79d0cc565ab..a61edb353273 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -657,7 +657,7 @@ struct v4l2_buffer { | |||
657 | struct v4l2_plane *planes; | 657 | struct v4l2_plane *planes; |
658 | } m; | 658 | } m; |
659 | __u32 length; | 659 | __u32 length; |
660 | __u32 input; | 660 | __u32 reserved2; |
661 | __u32 reserved; | 661 | __u32 reserved; |
662 | }; | 662 | }; |
663 | 663 | ||
@@ -671,7 +671,6 @@ struct v4l2_buffer { | |||
671 | /* Buffer is ready, but the data contained within is corrupted. */ | 671 | /* Buffer is ready, but the data contained within is corrupted. */ |
672 | #define V4L2_BUF_FLAG_ERROR 0x0040 | 672 | #define V4L2_BUF_FLAG_ERROR 0x0040 |
673 | #define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ | 673 | #define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ |
674 | #define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */ | ||
675 | #define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */ | 674 | #define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */ |
676 | /* Cache handling flags */ | 675 | /* Cache handling flags */ |
677 | #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 | 676 | #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 |