summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/exynos/exynos_drm_drv.c
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2018-10-12 13:53:43 +0300
committerInki Dae <inki.dae@samsung.com>2018-12-04 07:23:17 +0300
commit237556962e51150f89bdc8d04171a3619bfeaf8d (patch)
treefcca6f2ffb2247f3143022cb206db129f11af13a /drivers/gpu/drm/exynos/exynos_drm_drv.c
parent69908ed258fce73c75f461339d865a7b4eb6e720 (diff)
downloadlinux-237556962e51150f89bdc8d04171a3619bfeaf8d.tar.xz
drm/exynos/iommu: integrate IOMMU/DMA internal API
Exynos DRM drivers should work with and without IOMMU. Providing common API generic to both scenarios should make code cleaner and allow further code improvements. The patch removes including of exynos_drm_iommu.h as the file contains mostly IOMMU specific stuff, instead it exposes exynos_drm_*_dma functions and puts them into exynos_drm_dma.c. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_drv.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_drv.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 3cf21d84a3d9..2c75e789b2a7 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -30,7 +30,6 @@
#include "exynos_drm_ipp.h"
#include "exynos_drm_vidi.h"
#include "exynos_drm_g2d.h"
-#include "exynos_drm_iommu.h"
#define DRIVER_NAME "exynos"
#define DRIVER_DESC "Samsung SoC DRM"
@@ -45,27 +44,6 @@
#define DRIVER_MAJOR 1
#define DRIVER_MINOR 1
-int exynos_drm_register_dma(struct drm_device *drm, struct device *dev)
-{
- struct exynos_drm_private *priv = drm->dev_private;
- int ret;
-
- if (!priv->dma_dev) {
- priv->dma_dev = dev;
- DRM_INFO("Exynos DRM: using %s device for DMA mapping operations\n",
- dev_name(dev));
- /* create common IOMMU mapping for all Exynos DRM devices */
- ret = drm_create_iommu_mapping(drm);
- if (ret < 0) {
- priv->dma_dev = NULL;
- DRM_ERROR("failed to create iommu mapping.\n");
- return -EINVAL;
- }
- }
-
- return drm_iommu_attach_device(drm, dev);
-}
-
static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
{
struct drm_exynos_file_private *file_priv;
@@ -367,7 +345,7 @@ err_unbind_all:
component_unbind_all(drm->dev, drm);
err_mode_config_cleanup:
drm_mode_config_cleanup(drm);
- drm_release_iommu_mapping(drm);
+ exynos_drm_cleanup_dma(drm);
kfree(private);
err_free_drm:
drm_dev_put(drm);
@@ -386,7 +364,7 @@ static void exynos_drm_unbind(struct device *dev)
component_unbind_all(drm->dev, drm);
drm_mode_config_cleanup(drm);
- drm_release_iommu_mapping(drm);
+ exynos_drm_cleanup_dma(drm);
kfree(drm->dev_private);
drm->dev_private = NULL;