[media] v4l: vb2: Add a function to discard all DONE buffers
[sfrench/cifs-2.6.git] / drivers / media / platform / omap3isp / ispqueue.h
index 3e048ad65647460dfdbb596f67443d4842faec65..ff182086fb40563bc5f4771bbd04fb29bb0e6c53 100644 (file)
@@ -69,14 +69,10 @@ enum isp_video_buffer_state {
  * @skip_cache: Whether to skip cache management operations for this buffer
  * @vaddr: Memory virtual address (for kernel buffers)
  * @vm_flags: Buffer VMA flags (for userspace buffers)
- * @offset: Offset inside the first page (for userspace buffers)
  * @npages: Number of pages (for userspace buffers)
+ * @sgt: Scatter gather table (for userspace buffers)
  * @pages: Pages table (for userspace non-VM_PFNMAP buffers)
- * @paddr: Memory physical address (for userspace VM_PFNMAP buffers)
- * @sglen: Number of elements in the scatter list (for non-VM_PFNMAP buffers)
- * @sglist: Scatter list (for non-VM_PFNMAP buffers)
  * @vbuf: V4L2 buffer
- * @irqlist: List head for insertion into IRQ queue
  * @state: Current buffer state
  * @wait: Wait queue to signal buffer completion
  */
@@ -92,20 +88,17 @@ struct isp_video_buffer {
 
        /* For userspace buffers. */
        vm_flags_t vm_flags;
-       unsigned long offset;
        unsigned int npages;
-       struct page **pages;
-       dma_addr_t paddr;
+       struct sg_table sgt;
 
-       /* For all buffers except VM_PFNMAP. */
-       unsigned int sglen;
-       struct scatterlist *sglist;
+       /* For non-VM_PFNMAP userspace buffers. */
+       struct page **pages;
 
        /* Touched by the interrupt handler. */
        struct v4l2_buffer vbuf;
-       struct list_head irqlist;
        enum isp_video_buffer_state state;
        wait_queue_head_t wait;
+       dma_addr_t dma;
 };
 
 #define to_isp_video_buffer(vb)        container_of(vb, struct isp_video_buffer, vb)
@@ -119,19 +112,13 @@ struct isp_video_buffer {
  *     the userspace memory address for a USERPTR buffer, with the queue lock
  *     held. Drivers should perform device-specific buffer preparation (such as
  *     mapping the buffer memory in an IOMMU). This operation is optional.
- * @buffer_queue: Called when a buffer is being added to the queue with the
- *     queue irqlock spinlock held.
- * @buffer_cleanup: Called before freeing buffers, or before changing the
- *     userspace memory address for a USERPTR buffer, with the queue lock held.
- *     Drivers must perform cleanup operations required to undo the
- *     buffer_prepare call. This operation is optional.
+ * @buffer_queue: Called when a buffer is being added.
  */
 struct isp_video_queue_operations {
        void (*queue_prepare)(struct isp_video_queue *queue,
                              unsigned int *nbuffers, unsigned int *size);
        int  (*buffer_prepare)(struct isp_video_buffer *buf);
        void (*buffer_queue)(struct isp_video_buffer *buf);
-       void (*buffer_cleanup)(struct isp_video_buffer *buf);
 };
 
 /**
@@ -142,8 +129,6 @@ struct isp_video_queue_operations {
  * @bufsize: Size of a driver-specific buffer object
  * @count: Number of currently allocated buffers
  * @buffers: ISP video buffers
- * @lock: Mutex to protect access to the buffers, main queue and state
- * @irqlock: Spinlock to protect access to the IRQ queue
  * @streaming: Queue state, indicates whether the queue is streaming
  * @queue: List of all queued buffers
  */
@@ -155,8 +140,6 @@ struct isp_video_queue {
 
        unsigned int count;
        struct isp_video_buffer *buffers[ISP_VIDEO_MAX_BUFFERS];
-       struct mutex lock;
-       spinlock_t irqlock;
 
        unsigned int streaming:1;