aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-video.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88/cx88-video.c')
-rw-r--r--drivers/media/video/cx88/cx88-video.c38
1 files changed, 10 insertions, 28 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 705c29b002ea..1439b7268532 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -534,6 +534,7 @@ buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
534 struct cx8800_dev *dev = fh->dev; 534 struct cx8800_dev *dev = fh->dev;
535 struct cx88_core *core = dev->core; 535 struct cx88_core *core = dev->core;
536 struct cx88_buffer *buf = container_of(vb,struct cx88_buffer,vb); 536 struct cx88_buffer *buf = container_of(vb,struct cx88_buffer,vb);
537 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
537 int rc, init_buffer = 0; 538 int rc, init_buffer = 0;
538 539
539 BUG_ON(NULL == fh->fmt); 540 BUG_ON(NULL == fh->fmt);
@@ -566,30 +567,30 @@ buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
566 switch (buf->vb.field) { 567 switch (buf->vb.field) {
567 case V4L2_FIELD_TOP: 568 case V4L2_FIELD_TOP:
568 cx88_risc_buffer(dev->pci, &buf->risc, 569 cx88_risc_buffer(dev->pci, &buf->risc,
569 buf->vb.dma.sglist, 0, UNSET, 570 dma->sglist, 0, UNSET,
570 buf->bpl, 0, buf->vb.height); 571 buf->bpl, 0, buf->vb.height);
571 break; 572 break;
572 case V4L2_FIELD_BOTTOM: 573 case V4L2_FIELD_BOTTOM:
573 cx88_risc_buffer(dev->pci, &buf->risc, 574 cx88_risc_buffer(dev->pci, &buf->risc,
574 buf->vb.dma.sglist, UNSET, 0, 575 dma->sglist, UNSET, 0,
575 buf->bpl, 0, buf->vb.height); 576 buf->bpl, 0, buf->vb.height);
576 break; 577 break;
577 case V4L2_FIELD_INTERLACED: 578 case V4L2_FIELD_INTERLACED:
578 cx88_risc_buffer(dev->pci, &buf->risc, 579 cx88_risc_buffer(dev->pci, &buf->risc,
579 buf->vb.dma.sglist, 0, buf->bpl, 580 dma->sglist, 0, buf->bpl,
580 buf->bpl, buf->bpl, 581 buf->bpl, buf->bpl,
581 buf->vb.height >> 1); 582 buf->vb.height >> 1);
582 break; 583 break;
583 case V4L2_FIELD_SEQ_TB: 584 case V4L2_FIELD_SEQ_TB:
584 cx88_risc_buffer(dev->pci, &buf->risc, 585 cx88_risc_buffer(dev->pci, &buf->risc,
585 buf->vb.dma.sglist, 586 dma->sglist,
586 0, buf->bpl * (buf->vb.height >> 1), 587 0, buf->bpl * (buf->vb.height >> 1),
587 buf->bpl, 0, 588 buf->bpl, 0,
588 buf->vb.height >> 1); 589 buf->vb.height >> 1);
589 break; 590 break;
590 case V4L2_FIELD_SEQ_BT: 591 case V4L2_FIELD_SEQ_BT:
591 cx88_risc_buffer(dev->pci, &buf->risc, 592 cx88_risc_buffer(dev->pci, &buf->risc,
592 buf->vb.dma.sglist, 593 dma->sglist,
593 buf->bpl * (buf->vb.height >> 1), 0, 594 buf->bpl * (buf->vb.height >> 1), 0,
594 buf->bpl, 0, 595 buf->bpl, 0,
595 buf->vb.height >> 1); 596 buf->vb.height >> 1);
@@ -752,13 +753,13 @@ static int video_open(struct inode *inode, struct file *file)
752 fh->height = 240; 753 fh->height = 240;
753 fh->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24); 754 fh->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24);
754 755
755 videobuf_queue_init(&fh->vidq, &cx8800_video_qops, 756 videobuf_queue_pci_init(&fh->vidq, &cx8800_video_qops,
756 dev->pci, &dev->slock, 757 dev->pci, &dev->slock,
757 V4L2_BUF_TYPE_VIDEO_CAPTURE, 758 V4L2_BUF_TYPE_VIDEO_CAPTURE,
758 V4L2_FIELD_INTERLACED, 759 V4L2_FIELD_INTERLACED,
759 sizeof(struct cx88_buffer), 760 sizeof(struct cx88_buffer),
760 fh); 761 fh);
761 videobuf_queue_init(&fh->vbiq, &cx8800_vbi_qops, 762 videobuf_queue_pci_init(&fh->vbiq, &cx8800_vbi_qops,
762 dev->pci, &dev->slock, 763 dev->pci, &dev->slock,
763 V4L2_BUF_TYPE_VBI_CAPTURE, 764 V4L2_BUF_TYPE_VBI_CAPTURE,
764 V4L2_FIELD_SEQ_TB, 765 V4L2_FIELD_SEQ_TB,
@@ -1104,28 +1105,9 @@ static int vidioc_enum_fmt_cap (struct file *file, void *priv,
1104#ifdef CONFIG_VIDEO_V4L1_COMPAT 1105#ifdef CONFIG_VIDEO_V4L1_COMPAT
1105static int vidiocgmbuf (struct file *file, void *priv, struct video_mbuf *mbuf) 1106static int vidiocgmbuf (struct file *file, void *priv, struct video_mbuf *mbuf)
1106{ 1107{
1107 struct cx8800_fh *fh = priv; 1108 struct cx8800_fh *fh = priv;
1108 struct videobuf_queue *q;
1109 struct v4l2_requestbuffers req;
1110 unsigned int i;
1111 int err;
1112 1109
1113 q = get_queue(fh); 1110 return videobuf_cgmbuf (get_queue(fh), mbuf, 8);
1114 memset(&req,0,sizeof(req));
1115 req.type = q->type;
1116 req.count = 8;
1117 req.memory = V4L2_MEMORY_MMAP;
1118 err = videobuf_reqbufs(q,&req);
1119 if (err < 0)
1120 return err;
1121
1122 mbuf->frames = req.count;
1123 mbuf->size = 0;
1124 for (i = 0; i < mbuf->frames; i++) {
1125 mbuf->offsets[i] = q->bufs[i]->boff;
1126 mbuf->size += q->bufs[i]->bsize;
1127 }
1128 return 0;
1129} 1111}
1130#endif 1112#endif
1131 1113