Commit ba2e161f authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Mauro Carvalho Chehab

[media] s5p-mfc: Move setting DMA max segment size to DMA configure function

Setting DMA max segment size to 32 bit mask is a part of DMA memory
configuration, so move those calls to s5p_mfc_configure_dma_memory()
function.
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Tested-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Acked-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Tested-by: default avatarSmitha T Murthy <smitha.t@samsung.com>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 11d1fc3b
...@@ -1117,9 +1117,13 @@ static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev) ...@@ -1117,9 +1117,13 @@ static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev)
if (exynos_is_iommu_available(dev)) { if (exynos_is_iommu_available(dev)) {
int ret = exynos_configure_iommu(dev, S5P_MFC_IOMMU_DMA_BASE, int ret = exynos_configure_iommu(dev, S5P_MFC_IOMMU_DMA_BASE,
S5P_MFC_IOMMU_DMA_SIZE); S5P_MFC_IOMMU_DMA_SIZE);
if (ret == 0) if (ret == 0) {
mfc_dev->mem_dev[BANK1_CTX] = mfc_dev->mem_dev[BANK1_CTX] =
mfc_dev->mem_dev[BANK2_CTX] = dev; mfc_dev->mem_dev[BANK2_CTX] = dev;
vb2_dma_contig_set_max_seg_size(dev,
DMA_BIT_MASK(32));
}
return ret; return ret;
} }
...@@ -1138,6 +1142,11 @@ static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev) ...@@ -1138,6 +1142,11 @@ static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev)
return -ENODEV; return -ENODEV;
} }
vb2_dma_contig_set_max_seg_size(mfc_dev->mem_dev[BANK1_CTX],
DMA_BIT_MASK(32));
vb2_dma_contig_set_max_seg_size(mfc_dev->mem_dev[BANK2_CTX],
DMA_BIT_MASK(32));
return 0; return 0;
} }
...@@ -1147,11 +1156,14 @@ static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev) ...@@ -1147,11 +1156,14 @@ static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev)
if (exynos_is_iommu_available(dev)) { if (exynos_is_iommu_available(dev)) {
exynos_unconfigure_iommu(dev); exynos_unconfigure_iommu(dev);
vb2_dma_contig_clear_max_seg_size(dev);
return; return;
} }
device_unregister(mfc_dev->mem_dev[BANK1_CTX]); device_unregister(mfc_dev->mem_dev[BANK1_CTX]);
device_unregister(mfc_dev->mem_dev[BANK2_CTX]); device_unregister(mfc_dev->mem_dev[BANK2_CTX]);
vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK1_CTX]);
vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK2_CTX]);
} }
/* MFC probe function */ /* MFC probe function */
...@@ -1209,11 +1221,6 @@ static int s5p_mfc_probe(struct platform_device *pdev) ...@@ -1209,11 +1221,6 @@ static int s5p_mfc_probe(struct platform_device *pdev)
goto err_dma; goto err_dma;
} }
vb2_dma_contig_set_max_seg_size(dev->mem_dev[BANK1_CTX],
DMA_BIT_MASK(32));
vb2_dma_contig_set_max_seg_size(dev->mem_dev[BANK2_CTX],
DMA_BIT_MASK(32));
mutex_init(&dev->mfc_mutex); mutex_init(&dev->mfc_mutex);
init_waitqueue_head(&dev->queue); init_waitqueue_head(&dev->queue);
dev->hw_lock = 0; dev->hw_lock = 0;
...@@ -1346,8 +1353,6 @@ static int s5p_mfc_remove(struct platform_device *pdev) ...@@ -1346,8 +1353,6 @@ static int s5p_mfc_remove(struct platform_device *pdev)
v4l2_device_unregister(&dev->v4l2_dev); v4l2_device_unregister(&dev->v4l2_dev);
s5p_mfc_release_firmware(dev); s5p_mfc_release_firmware(dev);
s5p_mfc_unconfigure_dma_memory(dev); s5p_mfc_unconfigure_dma_memory(dev);
vb2_dma_contig_clear_max_seg_size(dev->mem_dev[BANK1_CTX]);
vb2_dma_contig_clear_max_seg_size(dev->mem_dev[BANK2_CTX]);
s5p_mfc_final_pm(dev); s5p_mfc_final_pm(dev);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment