diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-08-23 15:37:49 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-09 21:14:55 -0400 |
commit | c1accaa21bdef38ec0f36eaaf7ce3384fff9d0c5 (patch) | |
tree | 3a2c8206555af6c9e2eecdb20b052be70e6b93dd /drivers/media/video/saa7134/saa7134-video.c | |
parent | 7a7d9a89d0307b1743d782197e2c5fc5ddf183f3 (diff) |
V4L/DVB (6252): Adapt drivers to use the newer videobuf modules
PCI-dependent videobuf_foo methods were renamed as videobuf_pci_foo.
Also, videobuf_dmabuf is now part of videobuf-dma-sg private struct.
So, to access it, a subroutine call is needed.
This patch renames all occurences of those function calls to be
consistent with the video-buf split.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
http://thread.gmane.org/gmane.comp.video.video4linux/34978/focus=34981
Reviewed-by: Ricardo Cerqueira <v4l@cerqueira.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-video.c | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index 9c317ed6b210..cf40a9690a50 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -1037,6 +1037,8 @@ static int buffer_prepare(struct videobuf_queue *q, | |||
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | if (STATE_NEEDS_INIT == buf->vb.state) { | 1039 | if (STATE_NEEDS_INIT == buf->vb.state) { |
1040 | struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); | ||
1041 | |||
1040 | buf->vb.width = fh->width; | 1042 | buf->vb.width = fh->width; |
1041 | buf->vb.height = fh->height; | 1043 | buf->vb.height = fh->height; |
1042 | buf->vb.size = size; | 1044 | buf->vb.size = size; |
@@ -1048,8 +1050,8 @@ static int buffer_prepare(struct videobuf_queue *q, | |||
1048 | if (err) | 1050 | if (err) |
1049 | goto oops; | 1051 | goto oops; |
1050 | err = saa7134_pgtable_build(dev->pci,buf->pt, | 1052 | err = saa7134_pgtable_build(dev->pci,buf->pt, |
1051 | buf->vb.dma.sglist, | 1053 | dma->sglist, |
1052 | buf->vb.dma.sglen, | 1054 | dma->sglen, |
1053 | saa7134_buffer_startpage(buf)); | 1055 | saa7134_buffer_startpage(buf)); |
1054 | if (err) | 1056 | if (err) |
1055 | goto oops; | 1057 | goto oops; |
@@ -1309,13 +1311,13 @@ static int video_open(struct inode *inode, struct file *file) | |||
1309 | fh->height = 576; | 1311 | fh->height = 576; |
1310 | v4l2_prio_open(&dev->prio,&fh->prio); | 1312 | v4l2_prio_open(&dev->prio,&fh->prio); |
1311 | 1313 | ||
1312 | videobuf_queue_init(&fh->cap, &video_qops, | 1314 | videobuf_queue_pci_init(&fh->cap, &video_qops, |
1313 | dev->pci, &dev->slock, | 1315 | dev->pci, &dev->slock, |
1314 | V4L2_BUF_TYPE_VIDEO_CAPTURE, | 1316 | V4L2_BUF_TYPE_VIDEO_CAPTURE, |
1315 | V4L2_FIELD_INTERLACED, | 1317 | V4L2_FIELD_INTERLACED, |
1316 | sizeof(struct saa7134_buf), | 1318 | sizeof(struct saa7134_buf), |
1317 | fh); | 1319 | fh); |
1318 | videobuf_queue_init(&fh->vbi, &saa7134_vbi_qops, | 1320 | videobuf_queue_pci_init(&fh->vbi, &saa7134_vbi_qops, |
1319 | dev->pci, &dev->slock, | 1321 | dev->pci, &dev->slock, |
1320 | V4L2_BUF_TYPE_VBI_CAPTURE, | 1322 | V4L2_BUF_TYPE_VBI_CAPTURE, |
1321 | V4L2_FIELD_SEQ_TB, | 1323 | V4L2_FIELD_SEQ_TB, |
@@ -2137,29 +2139,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
2137 | } | 2139 | } |
2138 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | 2140 | #ifdef CONFIG_VIDEO_V4L1_COMPAT |
2139 | case VIDIOCGMBUF: | 2141 | case VIDIOCGMBUF: |
2140 | { | 2142 | return videobuf_cgmbuf(saa7134_queue(fh), arg, gbuffers); |
2141 | struct video_mbuf *mbuf = arg; | ||
2142 | struct videobuf_queue *q; | ||
2143 | struct v4l2_requestbuffers req; | ||
2144 | unsigned int i; | ||
2145 | |||
2146 | q = saa7134_queue(fh); | ||
2147 | memset(&req,0,sizeof(req)); | ||
2148 | req.type = q->type; | ||
2149 | req.count = gbuffers; | ||
2150 | req.memory = V4L2_MEMORY_MMAP; | ||
2151 | err = videobuf_reqbufs(q,&req); | ||
2152 | if (err < 0) | ||
2153 | return err; | ||
2154 | memset(mbuf,0,sizeof(*mbuf)); | ||
2155 | mbuf->frames = req.count; | ||
2156 | mbuf->size = 0; | ||
2157 | for (i = 0; i < mbuf->frames; i++) { | ||
2158 | mbuf->offsets[i] = q->bufs[i]->boff; | ||
2159 | mbuf->size += q->bufs[i]->bsize; | ||
2160 | } | ||
2161 | return 0; | ||
2162 | } | ||
2163 | #endif | 2143 | #endif |
2164 | case VIDIOC_REQBUFS: | 2144 | case VIDIOC_REQBUFS: |
2165 | return videobuf_reqbufs(saa7134_queue(fh),arg); | 2145 | return videobuf_reqbufs(saa7134_queue(fh),arg); |