提交 1e345d4a 编写于 作者: L Laurent Pinchart 提交者: Mauro Carvalho Chehab

[media] omap3isp: queue: Don't build scatterlist for kernel buffer

The scatterlist is not needed for those buffers, don't build it.
Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: NSakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
上级 2a0a5472
...@@ -146,21 +146,6 @@ static int isp_video_buffer_lock_vma(struct isp_video_buffer *buf, int lock) ...@@ -146,21 +146,6 @@ static int isp_video_buffer_lock_vma(struct isp_video_buffer *buf, int lock)
return ret; return ret;
} }
/*
* isp_video_buffer_prepare_kernel - Build scatter list for a kernel-allocated
* buffer
*
* Retrieve the sgtable using the DMA API.
*/
static int isp_video_buffer_prepare_kernel(struct isp_video_buffer *buf)
{
struct isp_video_fh *vfh = isp_video_queue_to_isp_video_fh(buf->queue);
struct isp_video *video = vfh->video;
return dma_get_sgtable(video->isp->dev, &buf->sgt, buf->vaddr,
buf->dma, PAGE_ALIGN(buf->vbuf.length));
}
/* /*
* isp_video_buffer_cleanup - Release pages for a userspace VMA. * isp_video_buffer_cleanup - Release pages for a userspace VMA.
* *
...@@ -181,9 +166,8 @@ static void isp_video_buffer_cleanup(struct isp_video_buffer *buf) ...@@ -181,9 +166,8 @@ static void isp_video_buffer_cleanup(struct isp_video_buffer *buf)
? DMA_FROM_DEVICE : DMA_TO_DEVICE; ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
dma_unmap_sg_attrs(buf->queue->dev, buf->sgt.sgl, dma_unmap_sg_attrs(buf->queue->dev, buf->sgt.sgl,
buf->sgt.orig_nents, direction, &attrs); buf->sgt.orig_nents, direction, &attrs);
}
sg_free_table(&buf->sgt); sg_free_table(&buf->sgt);
}
if (buf->pages != NULL) { if (buf->pages != NULL) {
isp_video_buffer_lock_vma(buf, 0); isp_video_buffer_lock_vma(buf, 0);
...@@ -400,7 +384,7 @@ static int isp_video_buffer_prepare_vm_flags(struct isp_video_buffer *buf) ...@@ -400,7 +384,7 @@ static int isp_video_buffer_prepare_vm_flags(struct isp_video_buffer *buf)
* *
* - validating VMAs (userspace buffers only) * - validating VMAs (userspace buffers only)
* - locking pages and VMAs into memory (userspace buffers only) * - locking pages and VMAs into memory (userspace buffers only)
* - building page and scatter-gather lists * - building page and scatter-gather lists (userspace buffers only)
* - mapping buffers for DMA operation * - mapping buffers for DMA operation
* - performing driver-specific preparation * - performing driver-specific preparation
* *
...@@ -416,9 +400,7 @@ static int isp_video_buffer_prepare(struct isp_video_buffer *buf) ...@@ -416,9 +400,7 @@ static int isp_video_buffer_prepare(struct isp_video_buffer *buf)
switch (buf->vbuf.memory) { switch (buf->vbuf.memory) {
case V4L2_MEMORY_MMAP: case V4L2_MEMORY_MMAP:
ret = isp_video_buffer_prepare_kernel(buf); ret = 0;
if (ret < 0)
goto done;
break; break;
case V4L2_MEMORY_USERPTR: case V4L2_MEMORY_USERPTR:
......
...@@ -70,8 +70,8 @@ enum isp_video_buffer_state { ...@@ -70,8 +70,8 @@ enum isp_video_buffer_state {
* @vaddr: Memory virtual address (for kernel buffers) * @vaddr: Memory virtual address (for kernel buffers)
* @vm_flags: Buffer VMA flags (for userspace buffers) * @vm_flags: Buffer VMA flags (for userspace buffers)
* @npages: Number of pages (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) * @pages: Pages table (for userspace non-VM_PFNMAP buffers)
* @sgt: Scatter gather table
* @vbuf: V4L2 buffer * @vbuf: V4L2 buffer
* @irqlist: List head for insertion into IRQ queue * @irqlist: List head for insertion into IRQ queue
* @state: Current buffer state * @state: Current buffer state
...@@ -90,11 +90,11 @@ struct isp_video_buffer { ...@@ -90,11 +90,11 @@ struct isp_video_buffer {
/* For userspace buffers. */ /* For userspace buffers. */
vm_flags_t vm_flags; vm_flags_t vm_flags;
unsigned int npages; unsigned int npages;
struct page **pages;
/* For all buffers. */
struct sg_table sgt; struct sg_table sgt;
/* For non-VM_PFNMAP userspace buffers. */
struct page **pages;
/* Touched by the interrupt handler. */ /* Touched by the interrupt handler. */
struct v4l2_buffer vbuf; struct v4l2_buffer vbuf;
struct list_head irqlist; struct list_head irqlist;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册