From: Marek Szyprowski Date: Fri, 17 Jun 2016 07:54:24 +0000 (+0200) Subject: drm/exynos: iommu: add a check if all sub-devices have iommu controller X-Git-Tag: v4.8~318^2~18^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c04d9eb77340aedeaa8ffd79ed0957c8289d84d3;p=platform%2Fkernel%2Flinux-amlogic.git drm/exynos: iommu: add a check if all sub-devices have iommu controller 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 Signed-off-by: Inki Dae --- diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.c b/drivers/gpu/drm/exynos/exynos_drm_iommu.c index 1e82529..36dde96 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_iommu.c +++ b/drivers/gpu/drm/exynos/exynos_drm_iommu.c @@ -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)