diff options
author | Nikhil Devshatwar | 2014-04-11 12:47:18 -0500 |
---|---|---|
committer | Rakesh Movva | 2014-05-01 14:30:19 -0500 |
commit | e8846792774c4b20ae942c8fbae867a8af4ca332 (patch) | |
tree | 39200103831b9f95d3dd9c420ef8171a3ad81b8d | |
parent | 4933345da3fd96db02d5762f6dfa64f1e6971579 (diff) | |
download | kernel-video-e8846792774c4b20ae942c8fbae867a8af4ca332.tar.gz kernel-video-e8846792774c4b20ae942c8fbae867a8af4ca332.tar.xz kernel-video-e8846792774c4b20ae942c8fbae867a8af4ca332.zip |
v4l: ti-vps: vip: Populate field ID for interlaced capture
When capturing interlaced video, read field ID from the write descriptor
and populate the v4l2_buffer before dequeueing.
Reading field id through write descriptor is preferred over reading it
directly from parser register as the field ID can change anytime
while the frame is being parsed.
Change-Id: I09f6b01c1538431768c3df29be74ee862dbf8ccd
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
-rw-r--r-- | drivers/media/platform/ti-vps/vip.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/media/platform/ti-vps/vip.c b/drivers/media/platform/ti-vps/vip.c index 0c07cc21157..8f4838cbb81 100644 --- a/drivers/media/platform/ti-vps/vip.c +++ b/drivers/media/platform/ti-vps/vip.c | |||
@@ -959,10 +959,20 @@ static void vip_process_buffer_complete(struct vip_stream *stream) | |||
959 | struct vip_dev *dev = stream->port->dev; | 959 | struct vip_dev *dev = stream->port->dev; |
960 | struct vb2_buffer *vb = NULL; | 960 | struct vb2_buffer *vb = NULL; |
961 | struct vip_buffer *buf = stream->cur_buf; | 961 | struct vip_buffer *buf = stream->cur_buf; |
962 | unsigned long flags; | 962 | unsigned long flags, fld; |
963 | |||
964 | if (stream->port->flags & FLAG_INTERLACED) { | ||
965 | vpdma_buf_unmap(dev->shared->vpdma, &dev->desc_list.buf); | ||
966 | |||
967 | fld = dtd_get_field(dev->write_desc); | ||
968 | stream->field = fld ? V4L2_FIELD_TOP : V4L2_FIELD_BOTTOM; | ||
969 | |||
970 | vpdma_buf_map(dev->shared->vpdma, &dev->desc_list.buf); | ||
971 | } | ||
963 | 972 | ||
964 | if (buf) { | 973 | if (buf) { |
965 | vb = &buf->vb; | 974 | vb = &buf->vb; |
975 | vb->v4l2_buf.field = stream->field; | ||
966 | do_gettimeofday(&vb->v4l2_buf.timestamp); | 976 | do_gettimeofday(&vb->v4l2_buf.timestamp); |
967 | 977 | ||
968 | if (buf->drop_count-- == 0) { | 978 | if (buf->drop_count-- == 0) { |
@@ -1219,7 +1229,7 @@ static int vip_try_fmt_vid_cap(struct file *file, void *priv, | |||
1219 | 1229 | ||
1220 | if (field == V4L2_FIELD_ANY) | 1230 | if (field == V4L2_FIELD_ANY) |
1221 | field = V4L2_FIELD_NONE; | 1231 | field = V4L2_FIELD_NONE; |
1222 | else if (V4L2_FIELD_NONE != field) | 1232 | else if (V4L2_FIELD_NONE != field && V4L2_FIELD_ALTERNATE != field) |
1223 | return -EINVAL; | 1233 | return -EINVAL; |
1224 | 1234 | ||
1225 | f->fmt.pix.field = field; | 1235 | f->fmt.pix.field = field; |