From patchwork Tue Sep 25 08:23:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10613625 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C3DC13A4 for ; Tue, 25 Sep 2018 08:23:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EC3A298B3 for ; Tue, 25 Sep 2018 08:23:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 326DC29A34; Tue, 25 Sep 2018 08:23:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8948C298B3 for ; Tue, 25 Sep 2018 08:23:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727531AbeIYO3l (ORCPT ); Tue, 25 Sep 2018 10:29:41 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:45464 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726963AbeIYO3l (ORCPT ); Tue, 25 Sep 2018 10:29:41 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180925082316euoutp01d74cbc9b384a587af7f75b5c1c034cfd~Xlvl8gmib2046120461euoutp01b for ; Tue, 25 Sep 2018 08:23:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180925082316euoutp01d74cbc9b384a587af7f75b5c1c034cfd~Xlvl8gmib2046120461euoutp01b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1537863796; bh=m4uaaZJGZwelOi/v5wckP3rLcFQGT1UBFJ76AQngkss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SMOdN2g5z252WXLV7Ad64yz79jiXhKusf7I6d/AO5JYEZA8ZyihYkHaTQW9kSWkFr Vms3XJvJi+XDgtKRSge7jM4uQrjsXhBpwNMErZ4DAX7HkfPlRbx4UbybHnBAf73vVv Hg/LGuYWFyI6JA6tH9tquO6R5Gz+15ToSjn4McQM= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180925082315eucas1p1a91166c610d61ffdcccca63258f65b13~XlvlW9PwN1260012600eucas1p1W; Tue, 25 Sep 2018 08:23:15 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 39.0A.04441.370F9AB5; Tue, 25 Sep 2018 09:23:15 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180925082314eucas1p1056cf03877de6110a6b97f4652944d6f~XlvkbEK7P0327803278eucas1p1A; Tue, 25 Sep 2018 08:23:14 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180925082314eusmtrp12c2da62122b203e675d7045e99546e3e~XlvkKJhLH2383123831eusmtrp1v; Tue, 25 Sep 2018 08:23:14 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-40-5ba9f0732d48 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id C1.D8.04284.270F9AB5; Tue, 25 Sep 2018 09:23:14 +0100 (BST) Received: from AMDC2768.DIGITAL.local (unknown [106.120.43.17]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180925082313eusmtip1e22ce05e66543013151704682f690104~XlvjyVyr61179111791eusmtip1d; Tue, 25 Sep 2018 08:23:13 +0000 (GMT) From: Andrzej Hajda To: Inki Dae Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 3/6] drm/exynos/iommu: integrate IOMMU/DMA internal API Date: Tue, 25 Sep 2018 10:23:05 +0200 X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180925082308.1388-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJIsWRmVeSWpSXmKPExsWy7djP87rFH1ZGGxzexWxxa905VouNM9az Wlz5+p7NYtL9CSwWM87vY7JYe+QuuwObx/3u40wefVtWMXp83iQXwBzFZZOSmpNZllqkb5fA lXGt5xRLwaXyimWHLzA3MP5J62Lk4JAQMJGYdMq+i5GTQ0hgBaPElhbxLkYuIPsLo8SnC3/Z IZzPjBI7fjcwgVSBNBz7sJ8ZomM5o8SRCaFwHU9vdoIl2AQ0Jf5uvskGYosIKEus2tcONolZ 4BKjxOuT3YwgCWEBd4mbZ46ygNgsAqoS6/6tYIfYIC/x8Hg7WA2ngIXE5YarjCDNEgK32SQ2 /j3GBnI3r0CZxPULIRD1LhLzN22C6hWWeHV8C5QtI3F6cg8LhF0v0TTzCjPEnA5GiROLl7NB JKwlDh+/yAoykxno6vW79CHB4ihxAyIqIcAnceOtIEgxM5A5adt0Zogwr0RHmxDEDEWJ+2e3 MkPY4hJLL3yFmu0hsejRWWZI8HQzSrzZ8Il9AqP8LIRdCxgZVzGKp5YW56anFhvmpZbrFSfm Fpfmpesl5+duYgQmgNP/jn/awfj1UtIhRgEORiUeXoOXK6KFWBPLiitzDzFKcDArifA26a6M FuJNSaysSi3Kjy8qzUktPsQozcGiJM7Lp5UWLSSQnliSmp2aWpBaBJNl4uCUamB0LDpfeL2z PN6q+5mRndOGj5GsbKbBbXprDxUphP1LVJ1hFsLMs1D8qL129JR8T3kJ8ez/Ad7zmD45bF95 x/ZdwM1Sxd07gmdFWhxqt+fcfGx/xlq9y7x3Y6Tdz1gzCS2v3/V/VcoKvussvZ9e7piQ+FNp 9tekDr0zE47f0purt+5Wzrm+2flKLMUZiYZazEXFiQCErf2k/AIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPLMWRmVeSWpSXmKPExsVy+t/xu7pFH1ZGG1x5yGxxa905VouNM9az Wlz5+p7NYtL9CSwWM87vY7JYe+QuuwObx/3u40wefVtWMXp83iQXwBylZ1OUX1qSqpCRX1xi qxRtaGGkZ2hpoWdkYqlnaGwea2VkqqRvZ5OSmpNZllqkb5egl3Gt5xRLwaXyimWHLzA3MP5J 62Lk5JAQMJE49mE/cxcjF4eQwFJGiZOdh5khEuISu+e/hbKFJf5c62KDKPrEKHG0/zEbSIJN QFPi7+abYLaIgLLEqn3t7CBFzALXGCX2r/vEApIQFnCXuHnmKJjNIqAqse7fCnYQm1fAXGLL i4lsEBvkJR4eb2cEsTkFLCQuN1wFs4WAao70XmCewMi3gJFhFaNIamlxbnpusaFecWJucWle ul5yfu4mRmBgbjv2c/MOxksbgw8xCnAwKvHw3ni2IlqINbGsuDL3EKMEB7OSCG+T7spoId6U xMqq1KL8+KLSnNTiQ4ymQEdNZJYSTc4HRk1eSbyhqaG5haWhubG5sZmFkjjveYPKKCGB9MSS 1OzU1ILUIpg+Jg5OqQZG8bNPpz7w5L+ZzrMuV6e+f+Ela4srwstsDERKN0Zt7P3g7DGv5t3N Ryt1z/+OCH699/dpif4jj7/LH8ufzsMzK1JgseplvwN+K2bz1sW8eOXY8Na2at5Uj5KrlUmf N8UvVbF+VvJtE9faOpVfDOePlEz59DdLS3Zjr3D3XmneMga/W68V867IKrEUZyQaajEXFScC ACNXEo5iAgAA Message-Id: <20180925082314eucas1p1056cf03877de6110a6b97f4652944d6f~XlvkbEK7P0327803278eucas1p1A@eucas1p1.samsung.com> X-CMS-MailID: 20180925082314eucas1p1056cf03877de6110a6b97f4652944d6f X-Msg-Generator: CA X-RootMTR: 20180925082314eucas1p1056cf03877de6110a6b97f4652944d6f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180925082314eucas1p1056cf03877de6110a6b97f4652944d6f References: <20180925082308.1388-1-a.hajda@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/gpu/drm/exynos/Makefile | 2 +- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 3 +- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 3 +- drivers/gpu/drm/exynos/exynos_drm_dma.c | 40 +++++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_drv.c | 26 +----------- drivers/gpu/drm/exynos/exynos_drm_drv.h | 9 +++++ drivers/gpu/drm/exynos/exynos_drm_fb.c | 1 - drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 1 - drivers/gpu/drm/exynos/exynos_drm_fimc.c | 3 +- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 3 +- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 3 +- drivers/gpu/drm/exynos/exynos_drm_gem.c | 1 - drivers/gpu/drm/exynos/exynos_drm_gsc.c | 3 +- drivers/gpu/drm/exynos/exynos_drm_iommu.h | 12 ------ drivers/gpu/drm/exynos/exynos_drm_rotator.c | 3 +- drivers/gpu/drm/exynos/exynos_drm_scaler.c | 3 +- drivers/gpu/drm/exynos/exynos_mixer.c | 3 +- 17 files changed, 61 insertions(+), 58 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_dma.c diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index ab763977ab28..94433838445f 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -4,7 +4,7 @@ # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. exynosdrm-y := exynos_drm_drv.o exynos_drm_crtc.o exynos_drm_fb.o \ - exynos_drm_gem.o exynos_drm_plane.o + exynos_drm_gem.o exynos_drm_plane.o exynos_drm_dma.o exynosdrm-$(CONFIG_DRM_FBDEV_EMULATION) += exynos_drm_fbdev.o exynosdrm-$(CONFIG_EXYNOS_IOMMU) += exynos_drm_iommu.o diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c index b0d80e17ab85..6c821a16e95e 100644 --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c @@ -25,7 +25,6 @@ #include "exynos_drm_crtc.h" #include "exynos_drm_fb.h" #include "exynos_drm_plane.h" -#include "exynos_drm_iommu.h" #include "regs-decon5433.h" #define DSD_CFG_MUX 0x1004 @@ -588,7 +587,7 @@ static void decon_unbind(struct device *dev, struct device *master, void *data) decon_disable(ctx->crtc); /* detach this sub driver from iommu mapping if supported. */ - drm_iommu_detach_device(ctx->drm_dev, ctx->dev); + exynos_drm_unregister_dma(ctx->drm_dev, ctx->dev); } static const struct component_ops decon_component_ops = { diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c index e78978eea5cb..381aa3d60e37 100644 --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c @@ -30,7 +30,6 @@ #include "exynos_drm_plane.h" #include "exynos_drm_drv.h" #include "exynos_drm_fb.h" -#include "exynos_drm_iommu.h" #include "regs-decon7.h" /* @@ -139,7 +138,7 @@ static int decon_ctx_initialize(struct decon_context *ctx, static void decon_ctx_remove(struct decon_context *ctx) { /* detach this sub driver from iommu mapping if supported. */ - drm_iommu_detach_device(ctx->drm_dev, ctx->dev); + exynos_drm_unregister_dma(ctx->drm_dev, ctx->dev); } static u32 decon_calc_clkdiv(struct decon_context *ctx, diff --git a/drivers/gpu/drm/exynos/exynos_drm_dma.c b/drivers/gpu/drm/exynos/exynos_drm_dma.c new file mode 100644 index 000000000000..f01cb102956d --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_drm_dma.c @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-2.0 +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// Author: Andrzej Hajda + +#include "exynos_drm_drv.h" +#include "exynos_drm_iommu.h" + +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); +} + +void exynos_drm_unregister_dma(struct drm_device *drm, struct device *dev) +{ + if (IS_ENABLED(CONFIG_EXYNOS_IOMMU)) + drm_iommu_detach_device(drm, dev); +} + +void exynos_drm_cleanup_dma(struct drm_device *drm) +{ + if (IS_ENABLED(CONFIG_EXYNOS_IOMMU)) + drm_release_iommu_mapping(drm); +} diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index bc20fb1b26e1..cb5d0e395883 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; @@ -389,7 +367,7 @@ static int exynos_drm_bind(struct device *dev) 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); @@ -408,7 +386,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; diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 583b7d794aca..e4b7f8f89058 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -214,7 +214,16 @@ static inline struct device *to_dma_dev(struct drm_device *dev) return priv->dma_dev; } +static inline bool is_drm_iommu_supported(struct drm_device *drm_dev) +{ + struct exynos_drm_private *priv = drm_dev->dev_private; + + return priv->mapping ? true : false; +} + int exynos_drm_register_dma(struct drm_device *drm, struct device *dev); +void exynos_drm_unregister_dma(struct drm_device *drm, struct device *dev); +void exynos_drm_cleanup_dma(struct drm_device *drm); #ifdef CONFIG_DRM_EXYNOS_DPI struct drm_encoder *exynos_dpi_probe(struct device *dev); diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index 9f52382e19ee..31eb538a44ae 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c @@ -24,7 +24,6 @@ #include "exynos_drm_drv.h" #include "exynos_drm_fb.h" #include "exynos_drm_fbdev.h" -#include "exynos_drm_iommu.h" #include "exynos_drm_crtc.h" static int check_fb_gem_memory_type(struct drm_device *drm_dev, diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 132dd52d0ac7..bd7e53064097 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -23,7 +23,6 @@ #include "exynos_drm_drv.h" #include "exynos_drm_fb.h" #include "exynos_drm_fbdev.h" -#include "exynos_drm_iommu.h" #define MAX_CONNECTOR 4 #define PREFERRED_BPP 32 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 68bfe2cd76d6..90dfea0aec4d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -25,7 +25,6 @@ #include #include "regs-fimc.h" #include "exynos_drm_drv.h" -#include "exynos_drm_iommu.h" #include "exynos_drm_ipp.h" /* @@ -1149,7 +1148,7 @@ static void fimc_unbind(struct device *dev, struct device *master, struct exynos_drm_ipp *ipp = &ctx->ipp; exynos_drm_ipp_unregister(drm_dev, ipp); - drm_iommu_detach_device(drm_dev, dev); + exynos_drm_unregister_dma(drm_dev, dev); } static const struct component_ops fimc_component_ops = { diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 5b3d51460294..e3d6a8584715 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -32,7 +32,6 @@ #include "exynos_drm_fb.h" #include "exynos_drm_crtc.h" #include "exynos_drm_plane.h" -#include "exynos_drm_iommu.h" /* * FIMD stands for Fully Interactive Mobile Display and @@ -1021,7 +1020,7 @@ static void fimd_unbind(struct device *dev, struct device *master, fimd_disable(ctx->crtc); - drm_iommu_detach_device(ctx->drm_dev, ctx->dev); + exynos_drm_unregister_dma(ctx->drm_dev, ctx->dev); if (ctx->encoder) exynos_dpi_remove(ctx->encoder); diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index 86624ec20cde..24c536d6d9cf 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -25,7 +25,6 @@ #include "exynos_drm_drv.h" #include "exynos_drm_g2d.h" #include "exynos_drm_gem.h" -#include "exynos_drm_iommu.h" #define G2D_HW_MAJOR_VER 4 #define G2D_HW_MINOR_VER 1 @@ -1430,7 +1429,7 @@ static void g2d_unbind(struct device *dev, struct device *master, void *data) priv->g2d_dev = NULL; cancel_work_sync(&g2d->runqueue_work); - drm_iommu_detach_device(g2d->drm_dev, dev); + exynos_drm_unregister_dma(g2d->drm_dev, dev); } static const struct component_ops g2d_component_ops = { diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 34ace85feb68..df66c383a877 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -19,7 +19,6 @@ #include "exynos_drm_drv.h" #include "exynos_drm_gem.h" -#include "exynos_drm_iommu.h" static int exynos_drm_alloc_buf(struct exynos_drm_gem *exynos_gem) { diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index b1e312c01195..d3cf696b9057 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -24,7 +24,6 @@ #include #include "regs-gsc.h" #include "exynos_drm_drv.h" -#include "exynos_drm_iommu.h" #include "exynos_drm_ipp.h" /* @@ -1184,7 +1183,7 @@ static void gsc_unbind(struct device *dev, struct device *master, struct exynos_drm_ipp *ipp = &ctx->ipp; exynos_drm_ipp_unregister(drm_dev, ipp); - drm_iommu_detach_device(drm_dev, dev); + exynos_drm_unregister_dma(drm_dev, dev); } static const struct component_ops gsc_component_ops = { diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.h b/drivers/gpu/drm/exynos/exynos_drm_iommu.h index 84f4e6d23bc4..95648b0c8327 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_iommu.h +++ b/drivers/gpu/drm/exynos/exynos_drm_iommu.h @@ -118,13 +118,6 @@ int drm_iommu_attach_device(struct drm_device *drm_dev, void drm_iommu_detach_device(struct drm_device *dev_dev, struct device *subdrv_dev); -static inline bool is_drm_iommu_supported(struct drm_device *drm_dev) -{ - struct exynos_drm_private *priv = drm_dev->dev_private; - - return priv->mapping ? true : false; -} - #else static inline int drm_create_iommu_mapping(struct drm_device *drm_dev) @@ -147,10 +140,5 @@ static inline void drm_iommu_detach_device(struct drm_device *drm_dev, { } -static inline bool is_drm_iommu_supported(struct drm_device *drm_dev) -{ - return false; -} - #endif #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 7d4b5a136a18..8d67b2a54be3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -23,7 +23,6 @@ #include #include "regs-rotator.h" #include "exynos_drm_drv.h" -#include "exynos_drm_iommu.h" #include "exynos_drm_ipp.h" /* @@ -263,7 +262,7 @@ static void rotator_unbind(struct device *dev, struct device *master, struct exynos_drm_ipp *ipp = &rot->ipp; exynos_drm_ipp_unregister(drm_dev, ipp); - drm_iommu_detach_device(rot->drm_dev, rot->dev); + exynos_drm_unregister_dma(rot->drm_dev, rot->dev); } static const struct component_ops rotator_component_ops = { diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c index 40fe1abbdcb1..67b8a8986cd7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c +++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c @@ -23,7 +23,6 @@ #include "regs-scaler.h" #include "exynos_drm_fb.h" #include "exynos_drm_drv.h" -#include "exynos_drm_iommu.h" #include "exynos_drm_ipp.h" #define scaler_read(offset) readl(scaler->regs + (offset)) @@ -476,7 +475,7 @@ static void scaler_unbind(struct device *dev, struct device *master, struct exynos_drm_ipp *ipp = &scaler->ipp; exynos_drm_ipp_unregister(drm_dev, ipp); - drm_iommu_detach_device(scaler->drm_dev, scaler->dev); + exynos_drm_unregister_dma(scaler->drm_dev, scaler->dev); } static const struct component_ops scaler_component_ops = { diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 5baf7c39d901..1df2de62f718 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -40,7 +40,6 @@ #include "exynos_drm_crtc.h" #include "exynos_drm_fb.h" #include "exynos_drm_plane.h" -#include "exynos_drm_iommu.h" #define MIXER_WIN_NR 3 #define VP_DEFAULT_WIN 2 @@ -861,7 +860,7 @@ static int mixer_initialize(struct mixer_context *mixer_ctx, static void mixer_ctx_remove(struct mixer_context *mixer_ctx) { - drm_iommu_detach_device(mixer_ctx->drm_dev, mixer_ctx->dev); + exynos_drm_unregister_dma(mixer_ctx->drm_dev, mixer_ctx->dev); } static int mixer_enable_vblank(struct exynos_drm_crtc *crtc)