linux/drivers/media/video/marvell-ccic
Jonathan Corbet 7498469f61 [media] marvell-cam: Allow selection of supported buffer modes
The Marvell camera core can support all three videobuf2 buffer modes, which
is slick, but it also requires that all three modes be built and present,
even though only one is likely to be used.  This patch allows the supported
modes to be selected at configuration time, reducing the footprint of the
driver.  Prior to this patch, the MMP camera driver looked like this:

mmp_camera             19092  0
videobuf2_core         15542  1 mmp_camera
videobuf2_dma_sg        3173  1 mmp_camera
videobuf2_dma_contig     2188  1 mmp_camera
videobuf2_vmalloc       1718  1 mmp_camera
videobuf2_memops        2100  3 videobuf2_dma_sg,videobuf2_dma_contig,videobuf2_vmalloc

Afterward, instead, with scatter/gather only configured:

mmp_camera             16021  0
videobuf2_core         15542  1 mmp_camera
videobuf2_dma_sg        3173  1 mmp_camera
videobuf2_memops        2100  1 videobuf2_dma_sg

The total goes from 43,813 bytes to 36,836.

The emphasis has been on simplicity and minimal #ifdef use rather than on
squeezing out every possible byte of code.  For configuration, the driver
simply looks at which videobuf2 modes have been configured in and supports
them all; it's simplistic but should be good enough.

The cafe driver is set to support vmalloc and dma-contig; mmp supports only
dma-sg, since that's the only mode that really makes sense to use.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:54 -03:00
..
cafe-driver.c [media] marvell-cam: implement contiguous DMA operation 2011-07-27 17:53:11 -03:00
Kconfig [media] marvell-cam: Allow selection of supported buffer modes 2011-07-27 17:55:54 -03:00
Makefile [media] marvell-cam: Basic working MMP camera driver 2011-07-27 17:53:01 -03:00
mcam-core.c [media] marvell-cam: Allow selection of supported buffer modes 2011-07-27 17:55:54 -03:00
mcam-core.h [media] marvell-cam: Allow selection of supported buffer modes 2011-07-27 17:55:54 -03:00
mmp-driver.c [media] marvell-cam: power down mmp camera on registration failure 2011-07-27 17:55:54 -03:00