From patchwork Sat Oct 20 16:18:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 1621691 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 119FBDF26F for ; Sat, 20 Oct 2012 16:21:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0471A9ECDA for ; Sat, 20 Oct 2012 09:21:46 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D1459E9AF for ; Sat, 20 Oct 2012 09:19:30 -0700 (PDT) Received: by mail-pa0-f49.google.com with SMTP id bi5so1003005pad.36 for ; Sat, 20 Oct 2012 09:19:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=zEXefEM7vKG8cH2FG4jG1EdTDTlsQ/4TVdmTVnVwQRM=; b=sRPszGPP+SJFCI/DWrbWHjvmvmPdOXt1jtPcjwU0gcvd+mzunCEQtJluYUive4q3KB 63BJuiqLmej/17XUYclDZ+GcFGkJfyobN81PThtD7rbuYikFuDW77IxdtlfkJLsMgrT1 f20kmYRrRym51LHxvPlkoBopLTvZOJ3TDhkUmWQyaYZO7Tq7vRz6rR6dXpT7R07ONwdz 6bIJm4j6S/E9lTtV67/phO/fIgoetHXtRltdn9ELWHQJDI01mxO5LkoKioJg81oECdof eMuMUmu+zhjNwEbuSZoKzm9/vX6LVjDk6svpSTYvGfoYY+jGhQnC7UuMTCgBCWz+09zA iSnQ== Received: by 10.68.204.2 with SMTP id ku2mr16524176pbc.59.1350749970307; Sat, 20 Oct 2012 09:19:30 -0700 (PDT) Received: from localhost.localdomain ([222.117.162.7]) by mx.google.com with ESMTPS id tw5sm3026699pbc.48.2012.10.20.09.19.27 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 20 Oct 2012 09:19:29 -0700 (PDT) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm/exynos: add iommu support to fimd driver Date: Sat, 20 Oct 2012 09:18:50 -0700 Message-Id: <1350749931-9232-3-git-send-email-daeinki@gmail.com> X-Mailer: git-send-email 1.8.0.rc3.16.g8ead1bf In-Reply-To: <1350749931-9232-1-git-send-email-daeinki@gmail.com> References: <1350749931-9232-1-git-send-email-daeinki@gmail.com> Cc: kyungmin.park@samsung.com, sw0312.kim@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Inki Dae The iommu will be enabled when fimd sub driver is probed and will be disabled when removed. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index a328379..1f668ff 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -25,6 +25,7 @@ #include "exynos_drm_drv.h" #include "exynos_drm_fbdev.h" #include "exynos_drm_crtc.h" +#include "exynos_drm_iommu.h" /* * FIMD is stand for Fully Interactive Mobile Display and @@ -709,6 +710,10 @@ static int fimd_subdrv_probe(struct drm_device *drm_dev, struct device *dev) */ drm_dev->vblank_disable_allowed = 1; + /* attach this sub driver to iommu mapping if supported. */ + if (is_drm_iommu_supported(drm_dev)) + drm_iommu_attach_device(drm_dev, dev); + return 0; } @@ -716,7 +721,9 @@ static void fimd_subdrv_remove(struct drm_device *drm_dev, struct device *dev) { DRM_DEBUG_KMS("%s\n", __FILE__); - /* TODO. */ + /* detach this sub driver from iommu mapping if supported. */ + if (is_drm_iommu_supported(drm_dev)) + drm_iommu_detach_device(drm_dev, dev); } static int fimd_calc_clkdiv(struct fimd_context *ctx,