aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/saa7134/saa7134-video.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-05-13 13:24:44 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-05-23 13:02:51 -0400
commit5c44046da9e638cd7d8def8a9c8454f4d9ce8435 (patch)
treec70518e8904d686bfb79dfb03b7365bf9baade31 /drivers/media/pci/saa7134/saa7134-video.c
parent4cf743de880e3e60f106b7fc713f235abad9ea7e (diff)
[media] saa7134: rename vbi/cap to vbi_vbq/cap_vbq
Use consistent _vbq suffix for videobuf_queue fields. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/pci/saa7134/saa7134-video.c')
-rw-r--r--drivers/media/pci/saa7134/saa7134-video.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
index 16140ad6ffb3..f2ae8e6c7517 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -1093,10 +1093,10 @@ static struct videobuf_queue *saa7134_queue(struct file *file)
1093 1093
1094 switch (vdev->vfl_type) { 1094 switch (vdev->vfl_type) {
1095 case VFL_TYPE_GRABBER: 1095 case VFL_TYPE_GRABBER:
1096 q = fh->is_empress ? &dev->empress_vbq : &dev->cap; 1096 q = fh->is_empress ? &dev->empress_vbq : &dev->video_vbq;
1097 break; 1097 break;
1098 case VFL_TYPE_VBI: 1098 case VFL_TYPE_VBI:
1099 q = &dev->vbi; 1099 q = &dev->vbi_vbq;
1100 break; 1100 break;
1101 default: 1101 default:
1102 BUG(); 1102 BUG();
@@ -1181,6 +1181,7 @@ video_poll(struct file *file, struct poll_table_struct *wait)
1181 struct saa7134_dev *dev = video_drvdata(file); 1181 struct saa7134_dev *dev = video_drvdata(file);
1182 struct saa7134_fh *fh = file->private_data; 1182 struct saa7134_fh *fh = file->private_data;
1183 struct videobuf_buffer *buf = NULL; 1183 struct videobuf_buffer *buf = NULL;
1184 struct videobuf_queue *q = &dev->video_vbq;
1184 unsigned int rc = 0; 1185 unsigned int rc = 0;
1185 1186
1186 if (v4l2_event_pending(&fh->fh)) 1187 if (v4l2_event_pending(&fh->fh))
@@ -1189,25 +1190,24 @@ video_poll(struct file *file, struct poll_table_struct *wait)
1189 poll_wait(file, &fh->fh.wait, wait); 1190 poll_wait(file, &fh->fh.wait, wait);
1190 1191
1191 if (vdev->vfl_type == VFL_TYPE_VBI) 1192 if (vdev->vfl_type == VFL_TYPE_VBI)
1192 return rc | videobuf_poll_stream(file, &dev->vbi, wait); 1193 return rc | videobuf_poll_stream(file, &dev->vbi_vbq, wait);
1193 1194
1194 if (res_check(fh, RESOURCE_VIDEO)) { 1195 if (res_check(fh, RESOURCE_VIDEO)) {
1195 mutex_lock(&dev->cap.vb_lock); 1196 mutex_lock(&q->vb_lock);
1196 if (!list_empty(&dev->cap.stream)) 1197 if (!list_empty(&q->stream))
1197 buf = list_entry(dev->cap.stream.next, struct videobuf_buffer, stream); 1198 buf = list_entry(q->stream.next, struct videobuf_buffer, stream);
1198 } else { 1199 } else {
1199 mutex_lock(&dev->cap.vb_lock); 1200 mutex_lock(&q->vb_lock);
1200 if (UNSET == dev->cap.read_off) { 1201 if (UNSET == q->read_off) {
1201 /* need to capture a new frame */ 1202 /* need to capture a new frame */
1202 if (res_locked(dev, RESOURCE_VIDEO)) 1203 if (res_locked(dev, RESOURCE_VIDEO))
1203 goto err; 1204 goto err;
1204 if (0 != dev->cap.ops->buf_prepare(&dev->cap, 1205 if (0 != q->ops->buf_prepare(q, q->read_buf, q->field))
1205 dev->cap.read_buf, dev->cap.field))
1206 goto err; 1206 goto err;
1207 dev->cap.ops->buf_queue(&dev->cap, dev->cap.read_buf); 1207 q->ops->buf_queue(q, q->read_buf);
1208 dev->cap.read_off = 0; 1208 q->read_off = 0;
1209 } 1209 }
1210 buf = dev->cap.read_buf; 1210 buf = q->read_buf;
1211 } 1211 }
1212 1212
1213 if (!buf) 1213 if (!buf)
@@ -1216,11 +1216,11 @@ video_poll(struct file *file, struct poll_table_struct *wait)
1216 poll_wait(file, &buf->done, wait); 1216 poll_wait(file, &buf->done, wait);
1217 if (buf->state == VIDEOBUF_DONE || buf->state == VIDEOBUF_ERROR) 1217 if (buf->state == VIDEOBUF_DONE || buf->state == VIDEOBUF_ERROR)
1218 rc |= POLLIN | POLLRDNORM; 1218 rc |= POLLIN | POLLRDNORM;
1219 mutex_unlock(&dev->cap.vb_lock); 1219 mutex_unlock(&q->vb_lock);
1220 return rc; 1220 return rc;
1221 1221
1222err: 1222err:
1223 mutex_unlock(&dev->cap.vb_lock); 1223 mutex_unlock(&q->vb_lock);
1224 return rc | POLLERR; 1224 return rc | POLLERR;
1225} 1225}
1226 1226
@@ -1245,22 +1245,22 @@ static int video_release(struct file *file)
1245 /* stop video capture */ 1245 /* stop video capture */
1246 if (res_check(fh, RESOURCE_VIDEO)) { 1246 if (res_check(fh, RESOURCE_VIDEO)) {
1247 pm_qos_remove_request(&dev->qos_request); 1247 pm_qos_remove_request(&dev->qos_request);
1248 videobuf_streamoff(&dev->cap); 1248 videobuf_streamoff(&dev->video_vbq);
1249 res_free(dev, fh, RESOURCE_VIDEO); 1249 res_free(dev, fh, RESOURCE_VIDEO);
1250 videobuf_mmap_free(&dev->cap); 1250 videobuf_mmap_free(&dev->video_vbq);
1251 INIT_LIST_HEAD(&dev->cap.stream); 1251 INIT_LIST_HEAD(&dev->video_vbq.stream);
1252 } 1252 }
1253 if (dev->cap.read_buf) { 1253 if (dev->video_vbq.read_buf) {
1254 buffer_release(&dev->cap, dev->cap.read_buf); 1254 buffer_release(&dev->video_vbq, dev->video_vbq.read_buf);
1255 kfree(dev->cap.read_buf); 1255 kfree(dev->video_vbq.read_buf);
1256 } 1256 }
1257 1257
1258 /* stop vbi capture */ 1258 /* stop vbi capture */
1259 if (res_check(fh, RESOURCE_VBI)) { 1259 if (res_check(fh, RESOURCE_VBI)) {
1260 videobuf_stop(&dev->vbi); 1260 videobuf_stop(&dev->vbi_vbq);
1261 res_free(dev, fh, RESOURCE_VBI); 1261 res_free(dev, fh, RESOURCE_VBI);
1262 videobuf_mmap_free(&dev->vbi); 1262 videobuf_mmap_free(&dev->vbi_vbq);
1263 INIT_LIST_HEAD(&dev->vbi.stream); 1263 INIT_LIST_HEAD(&dev->vbi_vbq.stream);
1264 } 1264 }
1265 1265
1266 /* ts-capture will not work in planar mode, so turn it off Hac: 04.05*/ 1266 /* ts-capture will not work in planar mode, so turn it off Hac: 04.05*/
@@ -1345,7 +1345,7 @@ static int saa7134_g_fmt_vid_cap(struct file *file, void *priv,
1345 1345
1346 f->fmt.pix.width = dev->width; 1346 f->fmt.pix.width = dev->width;
1347 f->fmt.pix.height = dev->height; 1347 f->fmt.pix.height = dev->height;
1348 f->fmt.pix.field = dev->cap.field; 1348 f->fmt.pix.field = dev->video_vbq.field;
1349 f->fmt.pix.pixelformat = dev->fmt->fourcc; 1349 f->fmt.pix.pixelformat = dev->fmt->fourcc;
1350 f->fmt.pix.bytesperline = 1350 f->fmt.pix.bytesperline =
1351 (f->fmt.pix.width * dev->fmt->depth) >> 3; 1351 (f->fmt.pix.width * dev->fmt->depth) >> 3;
@@ -1467,7 +1467,7 @@ static int saa7134_s_fmt_vid_cap(struct file *file, void *priv,
1467 dev->fmt = format_by_fourcc(f->fmt.pix.pixelformat); 1467 dev->fmt = format_by_fourcc(f->fmt.pix.pixelformat);
1468 dev->width = f->fmt.pix.width; 1468 dev->width = f->fmt.pix.width;
1469 dev->height = f->fmt.pix.height; 1469 dev->height = f->fmt.pix.height;
1470 dev->cap.field = f->fmt.pix.field; 1470 dev->video_vbq.field = f->fmt.pix.field;
1471 return 0; 1471 return 0;
1472} 1472}
1473 1473
@@ -2284,13 +2284,13 @@ int saa7134_video_init1(struct saa7134_dev *dev)
2284 if (saa7134_boards[dev->board].video_out) 2284 if (saa7134_boards[dev->board].video_out)
2285 saa7134_videoport_init(dev); 2285 saa7134_videoport_init(dev);
2286 2286
2287 videobuf_queue_sg_init(&dev->cap, &video_qops, 2287 videobuf_queue_sg_init(&dev->video_vbq, &video_qops,
2288 &dev->pci->dev, &dev->slock, 2288 &dev->pci->dev, &dev->slock,
2289 V4L2_BUF_TYPE_VIDEO_CAPTURE, 2289 V4L2_BUF_TYPE_VIDEO_CAPTURE,
2290 V4L2_FIELD_INTERLACED, 2290 V4L2_FIELD_INTERLACED,
2291 sizeof(struct saa7134_buf), 2291 sizeof(struct saa7134_buf),
2292 dev, NULL); 2292 dev, NULL);
2293 videobuf_queue_sg_init(&dev->vbi, &saa7134_vbi_qops, 2293 videobuf_queue_sg_init(&dev->vbi_vbq, &saa7134_vbi_qops,
2294 &dev->pci->dev, &dev->slock, 2294 &dev->pci->dev, &dev->slock,
2295 V4L2_BUF_TYPE_VBI_CAPTURE, 2295 V4L2_BUF_TYPE_VBI_CAPTURE,
2296 V4L2_FIELD_SEQ_TB, 2296 V4L2_FIELD_SEQ_TB,