From patchwork Wed Jul 11 09:40:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathyush K X-Patchwork-Id: 1181571 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 F0EBDDF25A for ; Wed, 11 Jul 2012 10:34:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DA5FFA0E12 for ; Wed, 11 Jul 2012 03:34:00 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org 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) X-AuditID: cbfee61b-b7f566d000005c8a-b2-4ffd46ce9887 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 74.21.23690.EC64DFF4; 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) From: Prathyush K To: dri-devel@lists.freedesktop.org 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> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1341999603-28316-1-git-send-email-prathyush.k@samsung.com> References: <1341999603-28316-1-git-send-email-prathyush.k@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJMWRmVeSWpSXmKPExsVy+t9jAd1zbn/9DT5PErO48vU9mwOjx/3u 40wBjFFcNimpOZllqUX6dglcGT27XrAUXOKs6F16j62BcS5HFyMnh4SAicTfjadZIWwxiQv3 1rOB2EICixglOrqSuhi5gOzVTBKN3VOZQBJsAtoSv+bcBWsQEVCW+DtxFSOIzSyQKXHl6xYw W1jAS+LRlS9gNSwCqhKtDUvZQWxeAXeJW92djBDLFCRalx0Ci3MKeEhsnfuBEWKxu8T9bSvZ JzDyLmBkWMUomlqQXFCclJ5rpFecmFtcmpeul5yfu4kR7PNn0jsYVzVYHGIU4GBU4uHVMPjr L8SaWFZcmXuIUYKDWUmE96sjUIg3JbGyKrUoP76oNCe1+BCjNAeLkjivifdXfyGB9MSS1OzU 1ILUIpgsEwenVAOjjs/hPWe859meTbSvms3srRRncmHyf07z/8bv7nvOtejK/69VHHs4x+0p dyWfzou05bdkDar3M/mzHNb2Pv8h6KRy3s+gJl9v113xcVdULzuekOJiXbquWm2aXrKzSvth g5NMwq9D5P/9Mym7v/LeBbmn3vu4Mtxk7U6uf6+9cNan20wJ5i+VWIozEg21mIuKEwF/4ESH 9QEAAA== X-TM-AS-MML: No X-Mailman-Approved-At: Wed, 11 Jul 2012 03:27:42 -0700 Cc: inki.dae@samsung.com, subash.ramaswamy@linaro.org, m.szyprowski@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 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);