diff mbox

[5/7] drm/exynos: attach drm device with common drm mapping

Message ID 1341999603-28316-6-git-send-email-prathyush.k@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Prathyush K July 11, 2012, 9:40 a.m. UTC
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 <prathyush.k@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Comments

Inki Dae July 13, 2012, 6:53 a.m. UTC | #1
> -----Original Message-----
> From: Prathyush K [mailto:prathyush.k@samsung.com]
> Sent: Wednesday, July 11, 2012 6:40 PM
> To: dri-devel@lists.freedesktop.org
> Cc: prathyush@chromium.org; m.szyprowski@samsung.com;
inki.dae@samsung.com;
> subash.ramaswamy@linaro.org
> Subject: [PATCH 5/7] drm/exynos: attach drm device with common drm mapping
> 
> 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 <prathyush.k@samsung.com>
> ---
>  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;

Ok, exynos_drm_common_mapping is shared with drivers using
dev->archdata.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
diff mbox

Patch

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);