summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/marvell-ccic/mcam-core.h
diff options
context:
space:
mode:
authorJonathan Corbet2011-06-20 21:14:40 +0200
committerMauro Carvalho Chehab2011-07-27 22:53:11 +0200
commita9b36e850782db853b9da050be9ed2050de51ad4 (patch)
tree40f372b8a9e6ad06eca64cc0f199e4edfa7b461a /drivers/media/video/marvell-ccic/mcam-core.h
parent[media] marvell-cam: Don't spam the logs on frame loss (diff)
downloadkernel-qcow2-linux-a9b36e850782db853b9da050be9ed2050de51ad4.tar.gz
kernel-qcow2-linux-a9b36e850782db853b9da050be9ed2050de51ad4.tar.xz
kernel-qcow2-linux-a9b36e850782db853b9da050be9ed2050de51ad4.zip
[media] marvell-cam: implement contiguous DMA operation
The core driver can now operate in either vmalloc or dma-contig modes; obviously the latter is preferable when it is supported. Default is currently vmalloc on all platforms; load the module with buffer_mode=1 for contiguous DMA mode. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/marvell-ccic/mcam-core.h')
-rw-r--r--drivers/media/video/marvell-ccic/mcam-core.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/media/video/marvell-ccic/mcam-core.h b/drivers/media/video/marvell-ccic/mcam-core.h
index f40450cf72a0..2e667a05620a 100644
--- a/drivers/media/video/marvell-ccic/mcam-core.h
+++ b/drivers/media/video/marvell-ccic/mcam-core.h
@@ -27,11 +27,21 @@ enum mcam_state {
S_NOTREADY, /* Not yet initialized */
S_IDLE, /* Just hanging around */
S_FLAKED, /* Some sort of problem */
- S_STREAMING /* Streaming data */
+ S_STREAMING, /* Streaming data */
+ S_BUFWAIT /* streaming requested but no buffers yet */
};
#define MAX_DMA_BUFS 3
/*
+ * Different platforms work best with different buffer modes, so we
+ * let the platform pick.
+ */
+enum mcam_buffer_mode {
+ B_vmalloc = 0,
+ B_DMA_contig
+};
+
+/*
* A description of one of our devices.
* Locking: controlled by s_mutex. Certain fields, however, require
* the dev_lock spinlock; they are marked as such by comments.
@@ -49,7 +59,7 @@ struct mcam_camera {
unsigned int chip_id;
short int clock_speed; /* Sensor clock speed, default 30 */
short int use_smbus; /* SMBUS or straight I2c? */
-
+ enum mcam_buffer_mode buffer_mode;
/*
* Callbacks from the core to the platform code.
*/
@@ -79,7 +89,7 @@ struct mcam_camera {
struct vb2_queue vb_queue;
struct list_head buffers; /* Available frames */
- /* DMA buffers */
+ /* DMA buffers - vmalloc mode */
unsigned int nbufs; /* How many are alloc'd */
int next_buf; /* Next to consume (dev_lock) */
unsigned int dma_buf_size; /* allocated size */
@@ -88,6 +98,11 @@ struct mcam_camera {
unsigned int sequence; /* Frame sequence number */
unsigned int buf_seq[MAX_DMA_BUFS]; /* Sequence for individual bufs */
+ /* DMA buffers - contiguous DMA mode */
+ struct mcam_vb_buffer *vb_bufs[MAX_DMA_BUFS];
+ struct vb2_alloc_ctx *vb_alloc_ctx;
+ unsigned short last_delivered;
+
struct tasklet_struct s_tasklet;
/* Current operating parameters */