summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/omap3isp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2014-01-02 10:48:07 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-05-25 11:10:02 -0300
commit84ac0f09aee6c534a86ba8e2598f5e022772f0eb (patch)
treea2f02240263a19334d686de55e29c8af7c0aaf3e /drivers/media/platform/omap3isp
parentcbde9e9d7f2ad0eb9c61563540ef1427e380c5e1 (diff)
downloadop-kernel-dev-84ac0f09aee6c534a86ba8e2598f5e022772f0eb.zip
op-kernel-dev-84ac0f09aee6c534a86ba8e2598f5e022772f0eb.tar.gz
[media] omap3isp: stat: Store sg table in ispstat_buffer
The driver stores the IOMMU mapped iovm struct pointer in the buffer structure but only needs the iovm sg table. Store the sg table instead to prepare the migration to the DMA API. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/platform/omap3isp')
-rw-r--r--drivers/media/platform/omap3isp/ispstat.c19
-rw-r--r--drivers/media/platform/omap3isp/ispstat.h2
2 files changed, 10 insertions, 11 deletions
diff --git a/drivers/media/platform/omap3isp/ispstat.c b/drivers/media/platform/omap3isp/ispstat.c
index dba713f..4cf7eb1 100644
--- a/drivers/media/platform/omap3isp/ispstat.c
+++ b/drivers/media/platform/omap3isp/ispstat.c
@@ -183,8 +183,8 @@ static void isp_stat_buf_sync_for_device(struct ispstat *stat,
if (ISP_STAT_USES_DMAENGINE(stat))
return;
- dma_sync_sg_for_device(stat->isp->dev, buf->iovm->sgt->sgl,
- buf->iovm->sgt->nents, DMA_FROM_DEVICE);
+ dma_sync_sg_for_device(stat->isp->dev, buf->sgt->sgl,
+ buf->sgt->nents, DMA_FROM_DEVICE);
}
static void isp_stat_buf_sync_for_cpu(struct ispstat *stat,
@@ -193,8 +193,8 @@ static void isp_stat_buf_sync_for_cpu(struct ispstat *stat,
if (ISP_STAT_USES_DMAENGINE(stat))
return;
- dma_sync_sg_for_cpu(stat->isp->dev, buf->iovm->sgt->sgl,
- buf->iovm->sgt->nents, DMA_FROM_DEVICE);
+ dma_sync_sg_for_cpu(stat->isp->dev, buf->sgt->sgl,
+ buf->sgt->nents, DMA_FROM_DEVICE);
}
static void isp_stat_buf_clear(struct ispstat *stat)
@@ -363,10 +363,9 @@ static void isp_stat_bufs_free(struct ispstat *stat)
if (!ISP_STAT_USES_DMAENGINE(stat)) {
if (IS_ERR_OR_NULL((void *)buf->dma_addr))
continue;
- if (buf->iovm)
- dma_unmap_sg(isp->dev, buf->iovm->sgt->sgl,
- buf->iovm->sgt->nents,
- DMA_FROM_DEVICE);
+ if (buf->sgt)
+ dma_unmap_sg(isp->dev, buf->sgt->sgl,
+ buf->sgt->nents, DMA_FROM_DEVICE);
omap_iommu_vfree(isp->domain, isp->dev, buf->dma_addr);
} else {
if (!buf->virt_addr)
@@ -374,7 +373,7 @@ static void isp_stat_bufs_free(struct ispstat *stat)
dma_free_coherent(stat->isp->dev, stat->buf_alloc_size,
buf->virt_addr, buf->dma_addr);
}
- buf->iovm = NULL;
+ buf->sgt = NULL;
buf->dma_addr = 0;
buf->virt_addr = NULL;
buf->empty = 1;
@@ -407,7 +406,7 @@ static int isp_stat_bufs_alloc_iommu(struct ispstat *stat,
DMA_FROM_DEVICE))
return -ENOMEM;
- buf->iovm = iovm;
+ buf->sgt = iovm->sgt;
buf->virt_addr = omap_da_to_va(stat->isp->dev, buf->dma_addr);
return 0;
diff --git a/drivers/media/platform/omap3isp/ispstat.h b/drivers/media/platform/omap3isp/ispstat.h
index 8e76846..857f45e 100644
--- a/drivers/media/platform/omap3isp/ispstat.h
+++ b/drivers/media/platform/omap3isp/ispstat.h
@@ -46,7 +46,7 @@
struct ispstat;
struct ispstat_buffer {
- struct iovm_struct *iovm;
+ const struct sg_table *sgt;
void *virt_addr;
dma_addr_t dma_addr;
struct timespec ts;
OpenPOWER on IntegriCloud