From 2bddd0c00ca2ada3437d201131eaf36cde36f653 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Wed, 16 Jul 2008 23:33:39 +0200 Subject: videobuf: Add physically contiguous queue code V3 This is V3 of the physically contiguous videobuf queues patch. Useful for hardware such as the SuperH Mobile CEU which doesn't support scatter gatter bus mastering. Since it may be difficult to allocate large chunks of physically contiguous memory after some uptime due to fragmentation, this code allocates memory using dma_alloc_coherent(). Architectures supporting dma_declare_coherent_memory() can easily avoid fragmentation issues by using dma_declare_coherent_memory() to force dma_alloc_coherent() to allocate from a certain pre-allocated memory area. Signed-off-by: Magnus Damm Signed-off-by: Guennadi Liakhovetski --- Changes since V2 - use dma_handle for physical address - use "scatter gather" instead of "scatter gatter" Changes since V1: - use dev_err() instead of pr_err() - remember size in struct videobuf_dma_contig_memory - keep struct videobuf_dma_contig_memory in .c file - let videobuf_to_dma_contig() return dma_addr_t - implement __videobuf_sync() - return statements, white space and other minor fixes drivers/media/video/Kconfig | 5 drivers/media/video/Makefile | 1 drivers/media/video/videobuf-dma-contig.c | 417 +++++++++++++++++++++++++++++ include/media/videobuf-dma-contig.h | 32 ++ 4 files changed, 455 insertions(+) --- linux/drivers/media/video/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'linux/drivers/media/video/Makefile') diff --git a/linux/drivers/media/video/Makefile b/linux/drivers/media/video/Makefile index 0a1837c99..84aa5a5e3 100644 --- a/linux/drivers/media/video/Makefile +++ b/linux/drivers/media/video/Makefile @@ -89,6 +89,7 @@ obj-$(CONFIG_VIDEO_TUNER) += tuner.o obj-$(CONFIG_VIDEOBUF_GEN) += videobuf-core.o obj-$(CONFIG_VIDEOBUF_DMA_SG) += videobuf-dma-sg.o +obj-$(CONFIG_VIDEOBUF_DMA_CONTIG) += videobuf-dma-contig.o obj-$(CONFIG_VIDEOBUF_VMALLOC) += videobuf-vmalloc.o obj-$(CONFIG_VIDEOBUF_DVB) += videobuf-dvb.o obj-$(CONFIG_VIDEO_BTCX) += btcx-risc.o -- cgit v1.2.3