dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Inki Dae <daeinki@gmail.com>
To: airlied@linux.ie, dri-devel@lists.freedesktop.org
Cc: kyungmin.park@samsung.com, sw0312.kim@samsung.com
Subject: [PATCH 2/3] drm/exynos: add iommu support to fimd driver
Date: Sat, 20 Oct 2012 09:18:50 -0700	[thread overview]
Message-ID: <1350749931-9232-3-git-send-email-daeinki@gmail.com> (raw)
In-Reply-To: <1350749931-9232-1-git-send-email-daeinki@gmail.com>

From: Inki Dae <inki.dae@samsung.com>

The iommu will be enabled when fimd sub driver is probed and
will be disabled when removed.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 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,
-- 
1.8.0.rc3.16.g8ead1bf

  parent reply	other threads:[~2012-10-20 16:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-20 16:18 [PATCH 0/3] drm/exynos: add iommu support for -next Inki Dae
2012-10-20 16:18 ` [PATCH 1/3] drm/exynos: add iommu support for exynos drm framework Inki Dae
2012-10-22  7:22   ` [PATCH v2] " Inki Dae
2012-10-22  9:56     ` [PATCH] " Inki Dae
2012-11-05  4:57       ` [PATCH v4] " Inki Dae
2012-10-20 16:18 ` Inki Dae [this message]
2012-10-20 16:18 ` [PATCH 3/3] drm/exynos: add iommu support for hdmi driver Inki Dae
2012-12-04  5:56   ` [PATCH v2] " Inki Dae

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1350749931-9232-3-git-send-email-daeinki@gmail.com \
    --to=daeinki@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kyungmin.park@samsung.com \
    --cc=sw0312.kim@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).