summaryrefslogtreecommitdiff
path: root/drivers/media/test-drivers/vimc/vimc-common.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2021-07-30 15:18:29 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-02-16 12:47:02 +0100
commit4a2e0a806cb58a4d3106add079488e0b56a221b6 (patch)
treeed222cfea93b957a9e606b548c25a881a13d0240 /drivers/media/test-drivers/vimc/vimc-common.h
parent79e8c421a099bfbcebe59740153e55aa0442ced6 (diff)
downloadlwn-4a2e0a806cb58a4d3106add079488e0b56a221b6.tar.gz
lwn-4a2e0a806cb58a4d3106add079488e0b56a221b6.zip
media: vimc: Add support for contiguous DMA buffers
The vimc driver is used for testing purpose, and some test use cases involve sharing buffers with a consumer device. Consumers often require DMA contiguous memory, which vimc doesn't currently support. This leads in the best case to usage of bounce buffers, which is very slow, and in the worst case in a complete failure. Add support for the dma-contig allocator in vimc to support those use cases properly. The allocator is selected through a new "allocator" module parameter, which defaults to vmalloc. [hverkuil: add missing 'select VIDEOBUF2_DMA_CONFIG' to Kconfig] Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/test-drivers/vimc/vimc-common.h')
-rw-r--r--drivers/media/test-drivers/vimc/vimc-common.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/test-drivers/vimc/vimc-common.h b/drivers/media/test-drivers/vimc/vimc-common.h
index a289434e75ba..ba1930772589 100644
--- a/drivers/media/test-drivers/vimc/vimc-common.h
+++ b/drivers/media/test-drivers/vimc/vimc-common.h
@@ -35,6 +35,13 @@
#define VIMC_PIX_FMT_MAX_CODES 8
+extern unsigned int vimc_allocator;
+
+enum vimc_allocator_type {
+ VIMC_ALLOCATOR_VMALLOC = 0,
+ VIMC_ALLOCATOR_DMA_CONTIG = 1,
+};
+
/**
* vimc_colorimetry_clamp - Adjust colorimetry parameters
*