diff options
Diffstat (limited to 'patches/collateral-evolutions/media/0002-no_dmabuf/v4l2.patch')
-rw-r--r-- | patches/collateral-evolutions/media/0002-no_dmabuf/v4l2.patch | 385 |
1 files changed, 0 insertions, 385 deletions
diff --git a/patches/collateral-evolutions/media/0002-no_dmabuf/v4l2.patch b/patches/collateral-evolutions/media/0002-no_dmabuf/v4l2.patch deleted file mode 100644 index e668bb7e..00000000 --- a/patches/collateral-evolutions/media/0002-no_dmabuf/v4l2.patch +++ /dev/null @@ -1,385 +0,0 @@ ---- a/drivers/media/v4l2-core/Kconfig -+++ b/drivers/media/v4l2-core/Kconfig -@@ -79,7 +79,7 @@ config VIDEOBUF_DVB - - # Used by drivers that need Videobuf2 modules - config VIDEOBUF2_CORE -- select DMA_SHARED_BUFFER -+ select DMA_SHARED_BUFFER if !KERNEL_3_5 - tristate - - config VIDEOBUF2_MEMOPS -@@ -91,13 +91,13 @@ config VIDEOBUF2_DMA_CONTIG - depends on HAS_DMA - select VIDEOBUF2_CORE - select VIDEOBUF2_MEMOPS -- select DMA_SHARED_BUFFER -+ select DMA_SHARED_BUFFER if !KERNEL_3_5 - - config VIDEOBUF2_VMALLOC - tristate - select VIDEOBUF2_CORE - select VIDEOBUF2_MEMOPS -- select DMA_SHARED_BUFFER -+ select DMA_SHARED_BUFFER if !KERNEL_3_5 - - config VIDEOBUF2_DMA_SG - tristate ---- a/drivers/media/v4l2-core/v4l2-mem2mem.c -+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c -@@ -466,6 +466,7 @@ int v4l2_m2m_create_bufs(struct file *fi - } - EXPORT_SYMBOL_GPL(v4l2_m2m_create_bufs); - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - /** - * v4l2_m2m_expbuf() - export a source or destination buffer, depending on - * the type -@@ -479,6 +480,7 @@ int v4l2_m2m_expbuf(struct file *file, s - return vb2_expbuf(vq, eb); - } - EXPORT_SYMBOL_GPL(v4l2_m2m_expbuf); -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - /** - * v4l2_m2m_streamon() - turn on streaming for a video queue - */ -@@ -841,6 +843,7 @@ int v4l2_m2m_ioctl_prepare_buf(struct fi - } - EXPORT_SYMBOL_GPL(v4l2_m2m_ioctl_prepare_buf); - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - int v4l2_m2m_ioctl_expbuf(struct file *file, void *priv, - struct v4l2_exportbuffer *eb) - { -@@ -849,6 +852,7 @@ int v4l2_m2m_ioctl_expbuf(struct file *f - return v4l2_m2m_expbuf(file, fh->m2m_ctx, eb); - } - EXPORT_SYMBOL_GPL(v4l2_m2m_ioctl_expbuf); -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - int v4l2_m2m_ioctl_streamon(struct file *file, void *priv, - enum v4l2_buf_type type) ---- a/drivers/media/v4l2-core/videobuf2-core.c -+++ b/drivers/media/v4l2-core/videobuf2-core.c -@@ -254,6 +254,7 @@ static void __vb2_buf_userptr_put(struct - } - } - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - /** - * __vb2_plane_dmabuf_put() - release memory associated with - * a DMABUF shared plane -@@ -284,6 +285,7 @@ static void __vb2_buf_dmabuf_put(struct - for (plane = 0; plane < vb->num_planes; ++plane) - __vb2_plane_dmabuf_put(vb, &vb->planes[plane]); - } -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - /** - * __setup_offsets() - setup unique offsets ("cookies") for every plane in -@@ -399,8 +401,10 @@ static void __vb2_free_mem(struct vb2_qu - /* Free MMAP buffers or release USERPTR buffers */ - if (q->memory == VB2_MEMORY_MMAP) - __vb2_buf_mem_free(vb); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - else if (q->memory == VB2_MEMORY_DMABUF) - __vb2_buf_dmabuf_put(vb); -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - else - __vb2_buf_userptr_put(vb); - } -@@ -498,11 +502,13 @@ static int __vb2_queue_free(struct vb2_q - pr_info("vb2: attach_dmabuf: %u detach_dmabuf: %u map_dmabuf: %u unmap_dmabuf: %u\n", - vb->cnt_mem_attach_dmabuf, vb->cnt_mem_detach_dmabuf, - vb->cnt_mem_map_dmabuf, vb->cnt_mem_unmap_dmabuf); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - pr_info("vb2: get_dmabuf: %u num_users: %u vaddr: %u cookie: %u\n", - vb->cnt_mem_get_dmabuf, - vb->cnt_mem_num_users, - vb->cnt_mem_vaddr, - vb->cnt_mem_cookie); -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - } - } - #endif -@@ -600,6 +606,7 @@ static int __verify_mmap_ops(struct vb2_ - return 0; - } - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - /** - * __verify_dmabuf_ops() - verify that all memory operations required for - * DMABUF queue type have been provided -@@ -613,6 +620,7 @@ static int __verify_dmabuf_ops(struct vb - - return 0; - } -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - /** - * vb2_verify_memory_type() - Check whether the memory type and buffer type -@@ -646,10 +654,12 @@ int vb2_verify_memory_type(struct vb2_qu - return -EINVAL; - } - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - if (memory == VB2_MEMORY_DMABUF && __verify_dmabuf_ops(q)) { - dprintk(1, "DMABUF for current setup unsupported\n"); - return -EINVAL; - } -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - /* - * Place the busy tests at the end: -EBUSY can be ignored when -@@ -1183,6 +1193,7 @@ err: - return ret; - } - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - /** - * __qbuf_dmabuf() - handle qbuf of a DMABUF buffer - */ -@@ -1311,6 +1322,7 @@ err: - - return ret; - } -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - /** - * __enqueue_in_driver() - enqueue a vb2_buffer in driver for processing -@@ -1351,9 +1363,11 @@ static int __buf_prepare(struct vb2_buff - case VB2_MEMORY_USERPTR: - ret = __qbuf_userptr(vb, pb); - break; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - case VB2_MEMORY_DMABUF: - ret = __qbuf_dmabuf(vb, pb); - break; -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - default: - WARN(1, "Invalid queue type\n"); - ret = -EINVAL; -@@ -1691,8 +1705,10 @@ EXPORT_SYMBOL_GPL(vb2_wait_for_all_buffe - */ - static void __vb2_dqbuf(struct vb2_buffer *vb) - { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - struct vb2_queue *q = vb->vb2_queue; - unsigned int i; -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - /* nothing to do if the buffer is already dequeued */ - if (vb->state == VB2_BUF_STATE_DEQUEUED) -@@ -1700,6 +1716,7 @@ static void __vb2_dqbuf(struct vb2_buffe - - vb->state = VB2_BUF_STATE_DEQUEUED; - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - /* unmap DMABUF buffer */ - if (q->memory == VB2_MEMORY_DMABUF) - for (i = 0; i < vb->num_planes; ++i) { -@@ -1708,6 +1725,7 @@ static void __vb2_dqbuf(struct vb2_buffe - call_void_memop(vb, unmap_dmabuf, vb->planes[i].mem_priv); - vb->planes[i].dbuf_mapped = 0; - } -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - } - - /** -@@ -1961,6 +1979,7 @@ static int __find_plane_by_offset(struct - return -EINVAL; - } - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - /** - * vb2_core_expbuf() - Export a buffer as a file descriptor - * @q: videobuf2 queue -@@ -2044,6 +2063,7 @@ int vb2_core_expbuf(struct vb2_queue *q, - return 0; - } - EXPORT_SYMBOL_GPL(vb2_core_expbuf); -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - /** - * vb2_mmap() - map video buffers into application address space ---- a/drivers/media/v4l2-core/videobuf2-v4l2.c -+++ b/drivers/media/v4l2-core/videobuf2-v4l2.c -@@ -709,6 +709,7 @@ int vb2_streamoff(struct vb2_queue *q, e - } - EXPORT_SYMBOL_GPL(vb2_streamoff); - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - /** - * vb2_expbuf() - Export a buffer as a file descriptor - * @q: videobuf2 queue -@@ -724,6 +725,7 @@ int vb2_expbuf(struct vb2_queue *q, stru - eb->plane, eb->flags); - } - EXPORT_SYMBOL_GPL(vb2_expbuf); -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - /** - * vb2_queue_init() - initialize a videobuf2 queue -@@ -951,6 +953,7 @@ int vb2_ioctl_streamoff(struct file *fil - } - EXPORT_SYMBOL_GPL(vb2_ioctl_streamoff); - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - int vb2_ioctl_expbuf(struct file *file, void *priv, struct v4l2_exportbuffer *p) - { - struct video_device *vdev = video_devdata(file); -@@ -960,6 +963,7 @@ int vb2_ioctl_expbuf(struct file *file, - return vb2_expbuf(vdev->queue, p); - } - EXPORT_SYMBOL_GPL(vb2_ioctl_expbuf); -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - /* v4l2_file_operations helpers */ - ---- a/drivers/media/v4l2-core/videobuf2-dma-contig.c -+++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c -@@ -78,8 +78,10 @@ static void *vb2_dc_vaddr(void *buf_priv - { - struct vb2_dc_buf *buf = buf_priv; - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - if (!buf->vaddr && buf->db_attach) - buf->vaddr = dma_buf_vmap(buf->db_attach->dmabuf); -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - return buf->vaddr; - } -@@ -253,6 +255,7 @@ static int vb2_dc_mmap(void *buf_priv, s - } - #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)) */ - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - /*********************************************/ - /* DMABUF ops for exporters */ - /*********************************************/ -@@ -425,6 +428,7 @@ static struct sg_table *vb2_dc_get_base_ - - return sgt; - } -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags) - { ---- a/drivers/media/v4l2-core/videobuf2-vmalloc.c -+++ b/drivers/media/v4l2-core/videobuf2-vmalloc.c -@@ -28,7 +28,9 @@ struct vb2_vmalloc_buf { - unsigned long size; - atomic_t refcount; - struct vb2_vmarea_handler handler; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - struct dma_buf *dbuf; -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - }; - - static void vb2_vmalloc_put(void *buf_priv); ---- a/include/media/v4l2-mem2mem.h -+++ b/include/media/v4l2-mem2mem.h -@@ -125,8 +125,10 @@ int v4l2_m2m_prepare_buf(struct file *fi - int v4l2_m2m_create_bufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, - struct v4l2_create_buffers *create); - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - int v4l2_m2m_expbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, - struct v4l2_exportbuffer *eb); -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - int v4l2_m2m_streamon(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, - enum v4l2_buf_type type); -@@ -265,8 +267,10 @@ int v4l2_m2m_ioctl_create_bufs(struct fi - struct v4l2_create_buffers *create); - int v4l2_m2m_ioctl_querybuf(struct file *file, void *fh, - struct v4l2_buffer *buf); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - int v4l2_m2m_ioctl_expbuf(struct file *file, void *fh, - struct v4l2_exportbuffer *eb); -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - int v4l2_m2m_ioctl_qbuf(struct file *file, void *fh, - struct v4l2_buffer *buf); - int v4l2_m2m_ioctl_dqbuf(struct file *file, void *fh, ---- a/include/media/videobuf2-core.h -+++ b/include/media/videobuf2-core.h -@@ -97,7 +97,9 @@ struct vb2_mem_ops { - enum dma_data_direction dma_dir, - gfp_t gfp_flags); - void (*put)(void *buf_priv); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - struct dma_buf *(*get_dmabuf)(void *buf_priv, unsigned long flags); -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - void *(*get_userptr)(void *alloc_ctx, unsigned long vaddr, - unsigned long size, -@@ -107,12 +109,14 @@ struct vb2_mem_ops { - void (*prepare)(void *buf_priv); - void (*finish)(void *buf_priv); - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - void *(*attach_dmabuf)(void *alloc_ctx, struct dma_buf *dbuf, - unsigned long size, - enum dma_data_direction dma_dir); - void (*detach_dmabuf)(void *buf_priv); - int (*map_dmabuf)(void *buf_priv); - void (*unmap_dmabuf)(void *buf_priv); -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - void *(*vaddr)(void *buf_priv); - void *(*cookie)(void *buf_priv); ---- a/include/media/videobuf2-v4l2.h -+++ b/include/media/videobuf2-v4l2.h -@@ -55,7 +55,9 @@ int vb2_create_bufs(struct vb2_queue *q, - int vb2_prepare_buf(struct vb2_queue *q, struct v4l2_buffer *b); - - int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - int vb2_expbuf(struct vb2_queue *q, struct v4l2_exportbuffer *eb); -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking); - - int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type); -@@ -87,8 +89,10 @@ int vb2_ioctl_qbuf(struct file *file, vo - int vb2_ioctl_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p); - int vb2_ioctl_streamon(struct file *file, void *priv, enum v4l2_buf_type i); - int vb2_ioctl_streamoff(struct file *file, void *priv, enum v4l2_buf_type i); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - int vb2_ioctl_expbuf(struct file *file, void *priv, - struct v4l2_exportbuffer *p); -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - /* struct v4l2_file_operations helpers */ - ---- a/drivers/media/usb/uvc/uvc_queue.c -+++ b/drivers/media/usb/uvc/uvc_queue.c -@@ -271,6 +271,7 @@ int uvc_queue_buffer(struct uvc_video_qu - return ret; - } - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - int uvc_export_buffer(struct uvc_video_queue *queue, - struct v4l2_exportbuffer *exp) - { -@@ -282,6 +283,7 @@ int uvc_export_buffer(struct uvc_video_q - - return ret; - } -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - - int uvc_dequeue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf, - int nonblocking) ---- a/drivers/media/v4l2-core/videobuf2-dma-sg.c -+++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c -@@ -317,9 +317,11 @@ static void *vb2_dma_sg_vaddr(void *buf_ - BUG_ON(!buf); - - if (!buf->vaddr) { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) - if (buf->db_attach) - buf->vaddr = dma_buf_vmap(buf->db_attach->dmabuf); - else -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) */ - buf->vaddr = vm_map_ram(buf->pages, - buf->num_pages, -1, PAGE_KERNEL); - } |