- 09 Dec, 2013 1 commit
-
-
Philipp Zabel authored
Currently it is not possible for userspace to map a DMABUF exported buffer with write permissions. This patch allows to also pass O_RDONLY/O_RDWR when exporting the buffer, so that userspace may map it with write permissions. Signed-off-by:
Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by:
Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by:
Mauro Carvalho Chehab <m.chehab@samsung.com>
-
- 29 Nov, 2013 1 commit
-
-
Philipp Zabel authored
Currently it is not possible for userspace to map a DMABUF exported buffer with write permissions. This patch allows to also pass O_RDONLY/O_RDWR when exporting the buffer, so that userspace may map it with write permissions. Signed-off-by:
Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by:
Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by:
Mauro Carvalho Chehab <m.chehab@samsung.com>
-
- 24 Sep, 2013 1 commit
-
-
Marek Szyprowski authored
Earlier version of dma-contig allocator in user ptr mode assumed that in all cases DMA address equals physical address. This was just a special case. Commit e15dab75 introduced correct support for converting userpage to dma address, but unfortunately it broke the support for simple dma address = physical address for the case, when given physical frame has no struct page associated with it (this happens if one use for example dma_declare_coherent api or other reserved memory approach). This commit restores support for such cases. Signed-off-by:
Marek Szyprowski <m.szyprowski@samsung.com> [s.nawrocki@samsung.com: replaced #elsif with #elif] Signed-off-by:
Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by:
Mauro Carvalho Chehab <m.chehab@samsung.com>
-
- 25 Apr, 2013 1 commit
-
-
Mauro Carvalho Chehab authored
Memory maps typically require that the buffer size to be page aligned. Currently, two memops drivers do such alignment internally, but videobuf-vmalloc doesn't. Also, the buffer overflow check doesn't take it into account. So, instead of doing it at each memops driver, enforce it at VB2 core. Reported-by:
Prabhakar lad <prabhakar.csengg@gmail.com> Acked-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by:
Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
- 21 Mar, 2013 1 commit
-
-
Hans Verkuil authored
Some drivers have special memory requirements for their buffers, usually related to DMA (e.g. GFP_DMA or __GFP_DMA32). Make it possible to specify additional GFP flags for those buffers by adding a gfp_flags field to vb2_queue. Note that this field will be replaced in the future with a different mechanism, but that is still work in progress and we need this feature now so we won't be able to convert drivers with such requirements to vb2. Signed-off-by:
Hans Verkuil <hans.verkuil@cisco.com> Acked-by:
Marek Szyprowski <m.szyprowski@samsung.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
- 27 Nov, 2012 1 commit
-
-
Mauro Carvalho Chehab authored
The right solution is to remove the architecture dependency on dma_common_get_sgtable(). Revert this patch to apply the right one. This reverts commit 93049b93.
-
- 26 Nov, 2012 1 commit
-
-
Mauro Carvalho Chehab authored
As reported by Stephen: > After merging the v4l-dvb tree, today's linux-next build (x86_64 > allmodconfig) failed like this: > > ERROR: "dma_common_get_sgtable" [drivers/media/v4l2-core/videobuf2-dma-contig.ko] undefined! > > Caused by commit 9ef2cbeb ("[media] v4l: vb2-dma-contig: add support > for DMABUF exporting"). dma_common_get_sgtable() is called from the > inline dma_get_sgtable_attrs() and dma_get_sgtable_attrs() is "called > from" dma_get_sgtable(). dma_common_get_sgtable() is only defined if > ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY is set which depends on > CONFIG_HAVE_GENERIC_DMA_COHERENT being set which it isn't for this build. The simplest fix is to just not support DMABUF with vb2-contig, on archs where this symbol doesn't exist. Some latter patch can rewrite it to support this outside -arm. Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
- 25 Nov, 2012 11 commits
-
-
Tomasz Stanislawski authored
Most operations on DMA and DMABUF framework require the size of a buffer to be page aligned. This patch guarantees the requirement is satisfied for all vb2-dma-contig buffers. Signed-off-by:
Tomasz Stanislawski <t.stanislaws@samsung.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
Marek Szyprowski authored
The DMA transfer must be aligned to a specific value. If userptr is not aligned to DMA requirements then unexpected corruptions of the memory may occur before or after a buffer. To prevent such situations, all unligned userptr buffers are rejected at VIDIOC_QBUF. Signed-off-by:
Marek Szyprowski <m.szyprowski@samsung.com> Acked-by:
Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
Tomasz Stanislawski authored
This patch adds taking reference to the device for MMAP buffers. Such buffers, may be exported using DMABUF mechanism. If the driver that created a queue is unloaded then the queue is released, the device might be released too. However, buffers cannot be released if they are referenced by DMABUF descriptor(s). The device pointer kept in a buffer must be valid for the whole buffer's lifetime. Therefore MMAP buffers should take a reference to the device to avoid risk of dangling pointers. Signed-off-by:
Tomasz Stanislawski <t.stanislaws@samsung.com> Acked-by:
Hans Verkuil <hans.verkuil@cisco.com> Acked-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by:
Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
Tomasz Stanislawski authored
This patch adds support for exporting a dma-contig buffer using DMABUF interface. Signed-off-by:
Tomasz Stanislawski <t.stanislaws@samsung.com> Signed-off-by:
Kyungmin Park <kyungmin.park@samsung.com> Acked-by:
Hans Verkuil <hans.verkuil@cisco.com> Tested-by:
Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
Marek Szyprowski authored
Let mmap method to use dma_mmap_coherent call. Moreover, this patch removes vb2_mmap_pfn_range from videobuf2 helpers as it was suggested by Laurent Pinchart. The function is no longer used in vb2 code. Signed-off-by:
Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by:
Tomasz Stanislawski <t.stanislaws@samsung.com> Acked-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by:
Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
Sumit Semwal authored
This patch makes changes for adding dma-contig as a dma_buf user. It provides function implementations for the {attach, detach, map, unmap}_dmabuf() mem_ops of DMABUF memory type. [author of the original patch] [integration with refactored dma-contig allocator] Signed-off-by:
Sumit Semwal <sumit.semwal@ti.com> Signed-off-by:
Sumit Semwal <sumit.semwal@linaro.org> Signed-off-by:
Tomasz Stanislawski <t.stanislaws@samsung.com> Acked-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by:
Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
Marek Szyprowski authored
Add prepare/finish callbacks to vb2-dma-contig allocator. Signed-off-by:
Marek Szyprowski <m.szyprowski@samsung.com> Acked-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by:
Hans Verkuil <hans.verkuil@cisco.com> Tested-by:
Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
Tomasz Stanislawski authored
This patch introduces usage of dma_map_sg to map memory behind a userspace pointer to a device as dma-contiguous mapping. This patch contains some of the code kindly provided by Marek Szyprowski <m.szyprowski@samsung.com> and Kamil Debski <k.debski@samsung.com> and Andrzej Pietrasiewicz <andrzej.p@samsung.com>. Kind thanks for bug reports from Laurent Pinchart <laurent.pinchart@ideasonboard.com> and Seung-Woo Kim <sw0312.kim@samsung.com>. Signed-off-by:
Tomasz Stanislawski <t.stanislaws@samsung.com> Signed-off-by:
Kyungmin Park <kyungmin.park@samsung.com> Acked-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by:
Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
Laurent Pinchart authored
Group functions by buffer type. Signed-off-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by:
Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
Tomasz Stanislawski authored
This patch removes a reference to alloc_ctx from an instance of a DMA contiguous buffer. It helps to avoid a risk of a dangling pointer if the context is released while the buffer is still valid. Moreover it removes one dereference step while accessing a device structure. Signed-off-by:
Tomasz Stanislawski <t.stanislaws@samsung.com> Signed-off-by:
Kyungmin Park <kyungmin.park@samsung.com> Acked-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by:
Hans Verkuil <hans.verkuil@cisco.com> Tested-by:
Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
Laurent Pinchart authored
Signed-off-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by:
Hans Verkuil <hans.verkuil@cisco.com> Tested-by:
Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
- 14 Aug, 2012 1 commit
-
-
Mauro Carvalho Chehab authored
Currently, the v4l2 core is mixed together with other non-core drivers. Move them into a separate directory. Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
- 08 May, 2012 4 commits
-
-
H Hartley Sweeten authored
The function vb2_dma_contig_vaddr returns a void * not an integer. Quiets the sparse noise: warning: Using plain integer as NULL pointer Signed-off-by:
H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Pawel Osciak <pawel@osciak.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Acked-by:
Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
H Hartley Sweeten authored
Include the header to pickup the definitions of the exported symbols. Quiets the following sparse warnings: warning: symbol 'vb2_dma_contig_memops' was not declared. Should it be static? warning: symbol 'vb2_dma_contig_init_ctx' was not declared. Should it be static? warning: symbol 'vb2_dma_contig_cleanup_ctx' was not declared. Should it be static? Signed-off-by:
H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Pawel Osciak <pawel@osciak.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Acked-by:
Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
H Hartley Sweeten authored
Include the header to pickup the definitions of the exported symbols. Quiets the following sparse warnings: warning: symbol 'vb2_dma_contig_memops' was not declared. Should it be static? warning: symbol 'vb2_dma_contig_init_ctx' was not declared. Should it be static? warning: symbol 'vb2_dma_contig_cleanup_ctx' was not declared. Should it be static? Signed-off-by:
H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Pawel Osciak <pawel@osciak.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Acked-by:
Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by:
Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
H Hartley Sweeten authored
The function vb2_dma_contig_vaddr returns a void * not an integer. Quiets the sparse noise: warning: Using plain integer as NULL pointer Signed-off-by:
H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Pawel Osciak <pawel@osciak.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Acked-by:
Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by:
Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
- 06 Sep, 2011 1 commit
-
-
Marek Szyprowski authored
Use the correct 'dma_addr' name for the buffer address. 'paddr' suggested that this is the physical address in system memory. For most ARM platforms these two are the same, but this is not a generic rule. 'dma_addr' will also point better to dma-mapping api. Signed-off-by:
Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by:
Kyungmin Park <kyungmin.park@samsung.com> CC: Pawel Osciak <pawel@osciak.com> Acked-by:
Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
- 13 Apr, 2011 1 commit
-
-
Guennadi Liakhovetski authored
buf->size is not yet initialised in videobuf2-dma-contig at the time of the error message, use "size." Signed-off-by:
Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
- 22 Mar, 2011 2 commits
-
-
Pawel Osciak authored
dma_addr_t may not fit into void* on some architectures. To be safe, make vb2_dma_contig_cookie() return a pointer to dma_addr_t and dereference it in vb2_dma_contig_plane_paddr() back to dma_addr_t. Signed-off-by:
Pawel Osciak <pawel@osciak.com> Reported-by:
Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by:
Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
Pawel Osciak authored
Signed-off-by:
Pawel Osciak <pawel@osciak.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-
- 21 Mar, 2011 1 commit
-
-
Pawel Osciak authored
Add an implementation of DMA coherent memory allocator and handling routines for videobuf2, implemented on top of dma_alloc_coherent() call. Signed-off-by:
Pawel Osciak <p.osciak@samsung.com> Signed-off-by:
Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by:
Marek Szyprowski <m.szyprowski@samsung.com> CC: Pawel Osciak <pawel@osciak.com> Reviewed-by:
Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab@redhat.com>
-