aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/saa7134/saa7134-ts.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/pci/saa7134/saa7134-ts.c')
-rw-r--r--drivers/media/pci/saa7134/saa7134-ts.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/media/pci/saa7134/saa7134-ts.c b/drivers/media/pci/saa7134/saa7134-ts.c
index bd25323bd947..2709b83d57b1 100644
--- a/drivers/media/pci/saa7134/saa7134-ts.c
+++ b/drivers/media/pci/saa7134/saa7134-ts.c
@@ -94,7 +94,6 @@ int saa7134_ts_buffer_prepare(struct vb2_buffer *vb2)
94 struct saa7134_buf *buf = container_of(vb2, struct saa7134_buf, vb2); 94 struct saa7134_buf *buf = container_of(vb2, struct saa7134_buf, vb2);
95 struct sg_table *dma = vb2_dma_sg_plane_desc(vb2, 0); 95 struct sg_table *dma = vb2_dma_sg_plane_desc(vb2, 0);
96 unsigned int lines, llength, size; 96 unsigned int lines, llength, size;
97 int ret;
98 97
99 dprintk("buffer_prepare [%p]\n", buf); 98 dprintk("buffer_prepare [%p]\n", buf);
100 99
@@ -108,25 +107,11 @@ int saa7134_ts_buffer_prepare(struct vb2_buffer *vb2)
108 vb2_set_plane_payload(vb2, 0, size); 107 vb2_set_plane_payload(vb2, 0, size);
109 vb2->v4l2_buf.field = dev->field; 108 vb2->v4l2_buf.field = dev->field;
110 109
111 ret = dma_map_sg(&dev->pci->dev, dma->sgl, dma->nents, DMA_FROM_DEVICE);
112 if (!ret)
113 return -EIO;
114 return saa7134_pgtable_build(dev->pci, &dmaq->pt, dma->sgl, dma->nents, 110 return saa7134_pgtable_build(dev->pci, &dmaq->pt, dma->sgl, dma->nents,
115 saa7134_buffer_startpage(buf)); 111 saa7134_buffer_startpage(buf));
116} 112}
117EXPORT_SYMBOL_GPL(saa7134_ts_buffer_prepare); 113EXPORT_SYMBOL_GPL(saa7134_ts_buffer_prepare);
118 114
119void saa7134_ts_buffer_finish(struct vb2_buffer *vb2)
120{
121 struct saa7134_dmaqueue *dmaq = vb2->vb2_queue->drv_priv;
122 struct saa7134_dev *dev = dmaq->dev;
123 struct saa7134_buf *buf = container_of(vb2, struct saa7134_buf, vb2);
124 struct sg_table *dma = vb2_dma_sg_plane_desc(&buf->vb2, 0);
125
126 dma_unmap_sg(&dev->pci->dev, dma->sgl, dma->nents, DMA_FROM_DEVICE);
127}
128EXPORT_SYMBOL_GPL(saa7134_ts_buffer_finish);
129
130int saa7134_ts_queue_setup(struct vb2_queue *q, const struct v4l2_format *fmt, 115int saa7134_ts_queue_setup(struct vb2_queue *q, const struct v4l2_format *fmt,
131 unsigned int *nbuffers, unsigned int *nplanes, 116 unsigned int *nbuffers, unsigned int *nplanes,
132 unsigned int sizes[], void *alloc_ctxs[]) 117 unsigned int sizes[], void *alloc_ctxs[])
@@ -142,6 +127,7 @@ int saa7134_ts_queue_setup(struct vb2_queue *q, const struct v4l2_format *fmt,
142 *nbuffers = 3; 127 *nbuffers = 3;
143 *nplanes = 1; 128 *nplanes = 1;
144 sizes[0] = size; 129 sizes[0] = size;
130 alloc_ctxs[0] = dev->alloc_ctx;
145 return 0; 131 return 0;
146} 132}
147EXPORT_SYMBOL_GPL(saa7134_ts_queue_setup); 133EXPORT_SYMBOL_GPL(saa7134_ts_queue_setup);
@@ -187,7 +173,6 @@ struct vb2_ops saa7134_ts_qops = {
187 .queue_setup = saa7134_ts_queue_setup, 173 .queue_setup = saa7134_ts_queue_setup,
188 .buf_init = saa7134_ts_buffer_init, 174 .buf_init = saa7134_ts_buffer_init,
189 .buf_prepare = saa7134_ts_buffer_prepare, 175 .buf_prepare = saa7134_ts_buffer_prepare,
190 .buf_finish = saa7134_ts_buffer_finish,
191 .buf_queue = saa7134_vb2_buffer_queue, 176 .buf_queue = saa7134_vb2_buffer_queue,
192 .wait_prepare = vb2_ops_wait_prepare, 177 .wait_prepare = vb2_ops_wait_prepare,
193 .wait_finish = vb2_ops_wait_finish, 178 .wait_finish = vb2_ops_wait_finish,