diff options
author | Eunchul Kim <chulspro.kim@samsung.com> | 2012-12-14 03:58:54 -0500 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2012-12-14 12:29:08 -0500 |
commit | c12e2617b25535014a766a0bc3e05134ef817b82 (patch) | |
tree | 0ced95bb0ce611706ee9706ec2a5940703164aee /drivers/gpu | |
parent | cb471f14b5eebfed22bb9f2d0f06601f171c574a (diff) |
drm/exynos: add iommu support for ipp
This patch adds iommu support for IPP subsystem framework.
For this, it adds subdrv_probe/remove callback to enable or
disable ipp iommu.
We can get or put device address to a gem handle from user
through exynos_drm_gem_get/put_dma_addr().
Signed-off-by: Eunchul Kim <chulspro.kim@samsung.com>
Signed-off-by: Jinyoung Jeon <jy0.jeon@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_ipp.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index c640935ab7d7..49eebe948ed2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "exynos_drm_drv.h" | 24 | #include "exynos_drm_drv.h" |
25 | #include "exynos_drm_gem.h" | 25 | #include "exynos_drm_gem.h" |
26 | #include "exynos_drm_ipp.h" | 26 | #include "exynos_drm_ipp.h" |
27 | #include "exynos_drm_iommu.h" | ||
27 | 28 | ||
28 | /* | 29 | /* |
29 | * IPP is stand for Image Post Processing and | 30 | * IPP is stand for Image Post Processing and |
@@ -1771,10 +1772,24 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev) | |||
1771 | ippdrv->event_workq = ctx->event_workq; | 1772 | ippdrv->event_workq = ctx->event_workq; |
1772 | ippdrv->sched_event = ipp_sched_event; | 1773 | ippdrv->sched_event = ipp_sched_event; |
1773 | INIT_LIST_HEAD(&ippdrv->cmd_list); | 1774 | INIT_LIST_HEAD(&ippdrv->cmd_list); |
1775 | |||
1776 | if (is_drm_iommu_supported(drm_dev)) { | ||
1777 | ret = drm_iommu_attach_device(drm_dev, ippdrv->dev); | ||
1778 | if (ret) { | ||
1779 | DRM_ERROR("failed to activate iommu\n"); | ||
1780 | goto err_iommu; | ||
1781 | } | ||
1782 | } | ||
1774 | } | 1783 | } |
1775 | 1784 | ||
1776 | return 0; | 1785 | return 0; |
1777 | 1786 | ||
1787 | err_iommu: | ||
1788 | /* get ipp driver entry */ | ||
1789 | list_for_each_entry_reverse(ippdrv, &exynos_drm_ippdrv_list, drv_list) | ||
1790 | if (is_drm_iommu_supported(drm_dev)) | ||
1791 | drm_iommu_detach_device(drm_dev, ippdrv->dev); | ||
1792 | |||
1778 | err_idr: | 1793 | err_idr: |
1779 | idr_remove_all(&ctx->ipp_idr); | 1794 | idr_remove_all(&ctx->ipp_idr); |
1780 | idr_remove_all(&ctx->prop_idr); | 1795 | idr_remove_all(&ctx->prop_idr); |
@@ -1791,6 +1806,9 @@ static void ipp_subdrv_remove(struct drm_device *drm_dev, struct device *dev) | |||
1791 | 1806 | ||
1792 | /* get ipp driver entry */ | 1807 | /* get ipp driver entry */ |
1793 | list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) { | 1808 | list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) { |
1809 | if (is_drm_iommu_supported(drm_dev)) | ||
1810 | drm_iommu_detach_device(drm_dev, ippdrv->dev); | ||
1811 | |||
1794 | ippdrv->drm_dev = NULL; | 1812 | ippdrv->drm_dev = NULL; |
1795 | exynos_drm_ippdrv_unregister(ippdrv); | 1813 | exynos_drm_ippdrv_unregister(ippdrv); |
1796 | } | 1814 | } |