From: Prathyush K Subject: [PATCH 5/7] drm/exynos: attach drm device with common drm mapping Date: Wed, 11 Jul 2012 15:10:01 +0530 Message-ID: <1341999603-28316-6-git-send-email-prathyush.k@samsung.com> References: <1341999603-28316-1-git-send-email-prathyush.k@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 5AD64A0DA6 for ; Wed, 11 Jul 2012 02:26:39 -0700 (PDT) Received: from epcpsbgm2.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M6Z006Y6OUZWBD0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 11 Jul 2012 18:26:38 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M6Z007HWOV41490@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 11 Jul 2012 18:26:38 +0900 (KST) In-reply-to: <1341999603-28316-1-git-send-email-prathyush.k@samsung.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org Cc: inki.dae@samsung.com, subash.ramaswamy@linaro.org, m.szyprowski@samsung.com List-Id: dri-devel@lists.freedesktop.org This patch sets the common mapping created during drm init, to the drm device's archdata. The dma_ops of drm device is set as arm_iommu_ops. The common mapping is shared across all the drm devices which ensures that any buffer allocated with drm is accessible by drm-fimd or drm-hdmi or both. Signed-off-by: Prathyush K --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index c3ad87e..2e40ca8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -276,6 +276,15 @@ static struct drm_driver exynos_drm_driver = { static int exynos_drm_platform_probe(struct platform_device *pdev) { +#ifdef CONFIG_EXYNOS_IOMMU + struct device *dev = &pdev->dev; + + kref_get(&exynos_drm_common_mapping->kref); + dev->archdata.mapping = exynos_drm_common_mapping; + set_dma_ops(dev, &arm_iommu_ops); + + DRM_INFO("drm common mapping set to drm device.\n"); +#endif DRM_DEBUG_DRIVER("%s\n", __FILE__); exynos_drm_driver.num_ioctls = DRM_ARRAY_SIZE(exynos_ioctls); -- 1.7.0.4