]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/exynos: iommu: add a check if all sub-devices have iommu controller
authorMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 17 Jun 2016 07:54:24 +0000 (09:54 +0200)
committerInki Dae <daeinki@gmail.com>
Wed, 13 Jul 2016 14:06:05 +0000 (23:06 +0900)
This patch adds a check if all devices belonging to Exynos DRM have the
same dma_map_ops set. This is required to enable operation with IOMMU
enabled.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_iommu.c

index 1e82529e0c41558a0a6ced31aa16d2a38699f892..36dde9691274323dd8d268da8ec17b509bb60166 100644 (file)
@@ -97,6 +97,11 @@ int drm_iommu_attach_device(struct drm_device *drm_dev,
        if (!priv->mapping)
                return 0;
 
+       if (get_dma_ops(priv->dma_dev) != get_dma_ops(subdrv_dev)) {
+               DRM_ERROR("Device %s lacks support for IOMMU\n",
+                         dev_name(subdrv_dev));
+               return -EINVAL;
+       }
 
        ret = configure_dma_max_seg_size(subdrv_dev);
        if (ret)