diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-10 10:29:15 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-24 14:26:49 -0500 |
commit | c7b0ac0546985fc6361a8d92cf808d46da797677 (patch) | |
tree | 2147eb2f6dd7b2b82e0d7b4b9a26e12ef5193252 /drivers/media/video/saa7134/saa7134-ts.c | |
parent | b2fd16b4ff2508ac16ae994f4bcd941f97754c00 (diff) |
V4L/DVB (3516): Make video_buf more generic
Video_buf were concerned to allow PCI devices to be used as
video capture devices. This patch extends video_buf features
by virtualizing pci-dependent functions and allowing other
type of devices to use it.
It is still DMA centric, although it may be used also by
devices that emulates scatter/gather behavior or a DMA device
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-ts.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-ts.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/media/video/saa7134/saa7134-ts.c b/drivers/media/video/saa7134/saa7134-ts.c index 470903e2f5e5..60a90a2617ae 100644 --- a/drivers/media/video/saa7134/saa7134-ts.c +++ b/drivers/media/video/saa7134/saa7134-ts.c | |||
@@ -89,7 +89,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb, | |||
89 | return -EINVAL; | 89 | return -EINVAL; |
90 | 90 | ||
91 | if (buf->vb.size != size) { | 91 | if (buf->vb.size != size) { |
92 | saa7134_dma_free(dev,buf); | 92 | saa7134_dma_free(q,buf); |
93 | } | 93 | } |
94 | 94 | ||
95 | if (STATE_NEEDS_INIT == buf->vb.state) { | 95 | if (STATE_NEEDS_INIT == buf->vb.state) { |
@@ -98,7 +98,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb, | |||
98 | buf->vb.size = size; | 98 | buf->vb.size = size; |
99 | buf->pt = &dev->ts.pt_ts; | 99 | buf->pt = &dev->ts.pt_ts; |
100 | 100 | ||
101 | err = videobuf_iolock(dev->pci,&buf->vb,NULL); | 101 | err = videobuf_iolock(q,&buf->vb,NULL); |
102 | if (err) | 102 | if (err) |
103 | goto oops; | 103 | goto oops; |
104 | err = saa7134_pgtable_build(dev->pci,buf->pt, | 104 | err = saa7134_pgtable_build(dev->pci,buf->pt, |
@@ -126,7 +126,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb, | |||
126 | return 0; | 126 | return 0; |
127 | 127 | ||
128 | oops: | 128 | oops: |
129 | saa7134_dma_free(dev,buf); | 129 | saa7134_dma_free(q,buf); |
130 | return err; | 130 | return err; |
131 | } | 131 | } |
132 | 132 | ||
@@ -152,10 +152,9 @@ static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) | |||
152 | 152 | ||
153 | static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) | 153 | static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) |
154 | { | 154 | { |
155 | struct saa7134_dev *dev = q->priv_data; | ||
156 | struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb); | 155 | struct saa7134_buf *buf = container_of(vb,struct saa7134_buf,vb); |
157 | 156 | ||
158 | saa7134_dma_free(dev,buf); | 157 | saa7134_dma_free(q,buf); |
159 | } | 158 | } |
160 | 159 | ||
161 | struct videobuf_queue_ops saa7134_ts_qops = { | 160 | struct videobuf_queue_ops saa7134_ts_qops = { |