drm/exynos: iommu: detach from default dma-mapping domain on init
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 3 Jun 2015 08:26:23 +0000 (10:26 +0200)
committerInki Dae <daeinki@gmail.com>
Fri, 19 Jun 2015 15:33:00 +0000 (00:33 +0900)
This patch adds code, which detach sub-device nodes from default iommu
domain if such has been configured. This lets Exynos DRM driver to properly
attach sub-devices to its own, common for all sub-devices domain.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_iommu.c

index b32b291f88ff0b80ba2919d919413dbe25d2c13b..323601a52a2509dc015bbdc2876a31bb7bdc04a4 100644 (file)
@@ -100,6 +100,9 @@ int drm_iommu_attach_device(struct drm_device *drm_dev,
 
        dma_set_max_seg_size(subdrv_dev, 0xffffffffu);
 
+       if (subdrv_dev->archdata.mapping)
+               arm_iommu_detach_device(subdrv_dev);
+
        ret = arm_iommu_attach_device(subdrv_dev, dev->archdata.mapping);
        if (ret < 0) {
                DRM_DEBUG_KMS("failed iommu attach.\n");