From 0e95bb5ef686452830cc2b2ce239ab40074af888 Mon Sep 17 00:00:00 2001 From: Ard van Breemen Date: Wed, 22 Mar 2017 16:10:43 +0100 Subject: [PATCH] Revert "It turned out that all versions of MFC v6+ hardware doesn't have a strict requirement for ALL buffers to be allocated on higher addresses than the firmware base like it was documented for MFC v5. This requirement is true only for the device and per-context buffers. All video data buffers can be allocated anywhere for all MFC v6+ versions. Basing on this fact, the special DMA configuration based on two reserved memory regions is not really needed for MFC v6+ devices, because the memory requirements for the firmware, device and per-context buffers can be fulfilled by the simple probe-time pre-allocated block allocator instroduced in previous patch." This reverts commit 67d8fdd38deec1734be23d223d9279169006c812. --- Documentation/devicetree/bindings/media/s5p-mfc.txt | 2 +- drivers/media/platform/s5p-mfc/s5p_mfc.c | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/media/s5p-mfc.txt b/Documentation/devicetree/bindings/media/s5p-mfc.txt index d3404b5d4d17..2c901286d818 100644 --- a/Documentation/devicetree/bindings/media/s5p-mfc.txt +++ b/Documentation/devicetree/bindings/media/s5p-mfc.txt @@ -28,7 +28,7 @@ Optional properties: - memory-region : from reserved memory binding: phandles to two reserved memory regions, first is for "left" mfc memory bus interfaces, second if for the "right" mfc memory bus, used when no SYSMMU - support is available; used only by MFC v5 present in Exynos4 SoCs + support is available Obsolete properties: - samsung,mfc-r, samsung,mfc-l : support removed, please use memory-region diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 5fa080649e2a..45b8cdef94b0 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1182,12 +1182,9 @@ static void s5p_mfc_unconfigure_2port_memory(struct s5p_mfc_dev *mfc_dev) static int s5p_mfc_configure_common_memory(struct s5p_mfc_dev *mfc_dev) { struct device *dev = &mfc_dev->plat_dev->dev; - unsigned long mem_size = SZ_4M; + unsigned long mem_size = SZ_8M; unsigned int bitmap_size; - if (IS_ENABLED(CONFIG_DMA_CMA) || exynos_is_iommu_available(dev)) - mem_size = SZ_8M; - if (mfc_mem_size) mem_size = memparse(mfc_mem_size, NULL); @@ -1247,7 +1244,7 @@ static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev) { struct device *dev = &mfc_dev->plat_dev->dev; - if (exynos_is_iommu_available(dev) || !IS_TWOPORT(mfc_dev)) + if (exynos_is_iommu_available(dev)) return s5p_mfc_configure_common_memory(mfc_dev); else return s5p_mfc_configure_2port_memory(mfc_dev); @@ -1258,7 +1255,7 @@ static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev) struct device *dev = &mfc_dev->plat_dev->dev; s5p_mfc_release_firmware(mfc_dev); - if (exynos_is_iommu_available(dev) || !IS_TWOPORT(mfc_dev)) + if (exynos_is_iommu_available(dev)) s5p_mfc_unconfigure_common_memory(mfc_dev); else s5p_mfc_unconfigure_2port_memory(mfc_dev);