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/common | |
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/common')
-rw-r--r-- | drivers/media/common/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/common/saa7146_core.c | 2 | ||||
-rw-r--r-- | drivers/media/common/saa7146_fops.c | 5 | ||||
-rw-r--r-- | drivers/media/common/saa7146_vbi.c | 9 | ||||
-rw-r--r-- | drivers/media/common/saa7146_video.c | 9 |
5 files changed, 16 insertions, 11 deletions
diff --git a/drivers/media/common/Kconfig b/drivers/media/common/Kconfig index 5c63c8e24ee7..c5092ef1082f 100644 --- a/drivers/media/common/Kconfig +++ b/drivers/media/common/Kconfig | |||
@@ -5,5 +5,5 @@ config VIDEO_SAA7146 | |||
5 | config VIDEO_SAA7146_VV | 5 | config VIDEO_SAA7146_VV |
6 | tristate | 6 | tristate |
7 | depends on VIDEO_DEV | 7 | depends on VIDEO_DEV |
8 | select VIDEO_BUF | 8 | select VIDEOBUF_DMA_SG |
9 | select VIDEO_SAA7146 | 9 | select VIDEO_SAA7146 |
diff --git a/drivers/media/common/saa7146_core.c b/drivers/media/common/saa7146_core.c index 1c962a2b44df..365a22118a09 100644 --- a/drivers/media/common/saa7146_core.c +++ b/drivers/media/common/saa7146_core.c | |||
@@ -100,7 +100,7 @@ int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop) | |||
100 | * general helper functions | 100 | * general helper functions |
101 | ****************************************************************************/ | 101 | ****************************************************************************/ |
102 | 102 | ||
103 | /* this is videobuf_vmalloc_to_sg() from video-buf.c | 103 | /* this is videobuf_vmalloc_to_sg() from videobuf-dma-sg.c |
104 | make sure virt has been allocated with vmalloc_32(), otherwise the BUG() | 104 | make sure virt has been allocated with vmalloc_32(), otherwise the BUG() |
105 | may be triggered on highmem machines */ | 105 | may be triggered on highmem machines */ |
106 | static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages) | 106 | static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages) |
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c index b4770aecc01d..67d1b1b1b254 100644 --- a/drivers/media/common/saa7146_fops.c +++ b/drivers/media/common/saa7146_fops.c | |||
@@ -53,13 +53,14 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits) | |||
53 | void saa7146_dma_free(struct saa7146_dev *dev,struct videobuf_queue *q, | 53 | void saa7146_dma_free(struct saa7146_dev *dev,struct videobuf_queue *q, |
54 | struct saa7146_buf *buf) | 54 | struct saa7146_buf *buf) |
55 | { | 55 | { |
56 | struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); | ||
56 | DEB_EE(("dev:%p, buf:%p\n",dev,buf)); | 57 | DEB_EE(("dev:%p, buf:%p\n",dev,buf)); |
57 | 58 | ||
58 | BUG_ON(in_interrupt()); | 59 | BUG_ON(in_interrupt()); |
59 | 60 | ||
60 | videobuf_waiton(&buf->vb,0,0); | 61 | videobuf_waiton(&buf->vb,0,0); |
61 | videobuf_dma_unmap(q, &buf->vb.dma); | 62 | videobuf_dma_unmap(q, dma); |
62 | videobuf_dma_free(&buf->vb.dma); | 63 | videobuf_dma_free(dma); |
63 | buf->vb.state = STATE_NEEDS_INIT; | 64 | buf->vb.state = STATE_NEEDS_INIT; |
64 | } | 65 | } |
65 | 66 | ||
diff --git a/drivers/media/common/saa7146_vbi.c b/drivers/media/common/saa7146_vbi.c index 063608462ebe..6103484e4442 100644 --- a/drivers/media/common/saa7146_vbi.c +++ b/drivers/media/common/saa7146_vbi.c | |||
@@ -165,7 +165,7 @@ static void saa7146_set_vbi_capture(struct saa7146_dev *dev, struct saa7146_buf | |||
165 | /* we don't wait here for the first field anymore. this is different from the video | 165 | /* we don't wait here for the first field anymore. this is different from the video |
166 | capture and might cause that the first buffer is only half filled (with only | 166 | capture and might cause that the first buffer is only half filled (with only |
167 | one field). but since this is some sort of streaming data, this is not that negative. | 167 | one field). but since this is some sort of streaming data, this is not that negative. |
168 | but by doing this, we can use the whole engine from video-buf.c... */ | 168 | but by doing this, we can use the whole engine from videobuf-dma-sg.c... */ |
169 | 169 | ||
170 | /* | 170 | /* |
171 | WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | e_wait); | 171 | WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | e_wait); |
@@ -239,6 +239,8 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e | |||
239 | saa7146_dma_free(dev,q,buf); | 239 | saa7146_dma_free(dev,q,buf); |
240 | 240 | ||
241 | if (STATE_NEEDS_INIT == buf->vb.state) { | 241 | if (STATE_NEEDS_INIT == buf->vb.state) { |
242 | struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); | ||
243 | |||
242 | buf->vb.width = llength; | 244 | buf->vb.width = llength; |
243 | buf->vb.height = lines; | 245 | buf->vb.height = lines; |
244 | buf->vb.size = size; | 246 | buf->vb.size = size; |
@@ -250,7 +252,8 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e | |||
250 | err = videobuf_iolock(q,&buf->vb, NULL); | 252 | err = videobuf_iolock(q,&buf->vb, NULL); |
251 | if (err) | 253 | if (err) |
252 | goto oops; | 254 | goto oops; |
253 | err = saa7146_pgtable_build_single(dev->pci, &buf->pt[2], buf->vb.dma.sglist, buf->vb.dma.sglen); | 255 | err = saa7146_pgtable_build_single(dev->pci, &buf->pt[2], |
256 | dma->sglist, dma->sglen); | ||
254 | if (0 != err) | 257 | if (0 != err) |
255 | return err; | 258 | return err; |
256 | } | 259 | } |
@@ -404,7 +407,7 @@ static int vbi_open(struct saa7146_dev *dev, struct file *file) | |||
404 | fh->vbi_fmt.start[1] = 312; | 407 | fh->vbi_fmt.start[1] = 312; |
405 | fh->vbi_fmt.count[1] = 16; | 408 | fh->vbi_fmt.count[1] = 16; |
406 | 409 | ||
407 | videobuf_queue_init(&fh->vbi_q, &vbi_qops, | 410 | videobuf_queue_pci_init(&fh->vbi_q, &vbi_qops, |
408 | dev->pci, &dev->slock, | 411 | dev->pci, &dev->slock, |
409 | V4L2_BUF_TYPE_VBI_CAPTURE, | 412 | V4L2_BUF_TYPE_VBI_CAPTURE, |
410 | V4L2_FIELD_SEQ_TB, // FIXME: does this really work? | 413 | V4L2_FIELD_SEQ_TB, // FIXME: does this really work? |
diff --git a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c index 664280c78ff2..29dbc602a484 100644 --- a/drivers/media/common/saa7146_video.c +++ b/drivers/media/common/saa7146_video.c | |||
@@ -594,8 +594,9 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c) | |||
594 | static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *buf) | 594 | static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *buf) |
595 | { | 595 | { |
596 | struct pci_dev *pci = dev->pci; | 596 | struct pci_dev *pci = dev->pci; |
597 | struct scatterlist *list = buf->vb.dma.sglist; | 597 | struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); |
598 | int length = buf->vb.dma.sglen; | 598 | struct scatterlist *list = dma->sglist; |
599 | int length = dma->sglen; | ||
599 | struct saa7146_format *sfmt = format_by_fourcc(dev,buf->fmt->pixelformat); | 600 | struct saa7146_format *sfmt = format_by_fourcc(dev,buf->fmt->pixelformat); |
600 | 601 | ||
601 | DEB_EE(("dev:%p, buf:%p, sg_len:%d\n",dev,buf,length)); | 602 | DEB_EE(("dev:%p, buf:%p, sg_len:%d\n",dev,buf,length)); |
@@ -655,7 +656,7 @@ static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *bu | |||
655 | 656 | ||
656 | /* if we have a user buffer, the first page may not be | 657 | /* if we have a user buffer, the first page may not be |
657 | aligned to a page boundary. */ | 658 | aligned to a page boundary. */ |
658 | pt1->offset = buf->vb.dma.sglist->offset; | 659 | pt1->offset = list->offset; |
659 | pt2->offset = pt1->offset+o1; | 660 | pt2->offset = pt1->offset+o1; |
660 | pt3->offset = pt1->offset+o2; | 661 | pt3->offset = pt1->offset+o2; |
661 | 662 | ||
@@ -1411,7 +1412,7 @@ static int video_open(struct saa7146_dev *dev, struct file *file) | |||
1411 | sfmt = format_by_fourcc(dev,fh->video_fmt.pixelformat); | 1412 | sfmt = format_by_fourcc(dev,fh->video_fmt.pixelformat); |
1412 | fh->video_fmt.sizeimage = (fh->video_fmt.width * fh->video_fmt.height * sfmt->depth)/8; | 1413 | fh->video_fmt.sizeimage = (fh->video_fmt.width * fh->video_fmt.height * sfmt->depth)/8; |
1413 | 1414 | ||
1414 | videobuf_queue_init(&fh->video_q, &video_qops, | 1415 | videobuf_queue_pci_init(&fh->video_q, &video_qops, |
1415 | dev->pci, &dev->slock, | 1416 | dev->pci, &dev->slock, |
1416 | V4L2_BUF_TYPE_VIDEO_CAPTURE, | 1417 | V4L2_BUF_TYPE_VIDEO_CAPTURE, |
1417 | V4L2_FIELD_INTERLACED, | 1418 | V4L2_FIELD_INTERLACED, |