* @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
/* 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)
* 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.
*/
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);
};
/**
* @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
unsigned int count;
struct isp_video_buffer *buffers[ISP_VIDEO_MAX_BUFFERS];
- struct mutex lock;
spinlock_t irqlock;
unsigned int streaming:1;