aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-yuv.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-08-19 11:25:39 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:05:46 -0400
commit0989fd2c88a11aa5014b2b348ed51872d14d536d (patch)
treeb01ba5de69e17fcf408ce597af966e4f0949e7c4 /drivers/media/video/ivtv/ivtv-yuv.c
parent3869c6a088c2eb165abe476c3372c6a3653649b3 (diff)
V4L/DVB (6058): ivtv: add support for highmem udma
When trying to DMA userspace buffers to the cx23415 you need to check whether the page is in highmem. If this is the case, then bounce buffers have to be used to allow DMA. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-yuv.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-yuv.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/video/ivtv/ivtv-yuv.c b/drivers/media/video/ivtv/ivtv-yuv.c
index fa8c76f3d359..2ae7556f5e68 100644
--- a/drivers/media/video/ivtv/ivtv-yuv.c
+++ b/drivers/media/video/ivtv/ivtv-yuv.c
@@ -83,7 +83,14 @@ static int ivtv_yuv_prep_user_dma(struct ivtv *itv, struct ivtv_user_dma *dma,
83 } 83 }
84 84
85 /* Fill & map SG List */ 85 /* Fill & map SG List */
86 ivtv_udma_fill_sg_list (dma, &uv_dma, ivtv_udma_fill_sg_list (dma, &y_dma, 0)); 86 if (ivtv_udma_fill_sg_list (dma, &uv_dma, ivtv_udma_fill_sg_list (dma, &y_dma, 0))) {
87 IVTV_DEBUG_WARN("could not allocate bounce buffers for highmem userspace buffers\n");
88 for (i = 0; i < dma->page_count; i++) {
89 put_page(dma->map[i]);
90 }
91 dma->page_count = 0;
92 return -ENOMEM;
93 }
87 dma->SG_length = pci_map_sg(itv->dev, dma->SGlist, dma->page_count, PCI_DMA_TODEVICE); 94 dma->SG_length = pci_map_sg(itv->dev, dma->SGlist, dma->page_count, PCI_DMA_TODEVICE);
88 95
89 /* Fill SG Array with new values */ 96 /* Fill SG Array with new values */