Commit c12e2617 authored by Eunchul Kim's avatar Eunchul Kim Committed by Inki Dae

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: default avatarEunchul Kim <chulspro.kim@samsung.com>
Signed-off-by: default avatarJinyoung Jeon <jy0.jeon@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
parent cb471f14
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "exynos_drm_drv.h" #include "exynos_drm_drv.h"
#include "exynos_drm_gem.h" #include "exynos_drm_gem.h"
#include "exynos_drm_ipp.h" #include "exynos_drm_ipp.h"
#include "exynos_drm_iommu.h"
/* /*
* IPP is stand for Image Post Processing and * 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,10 +1772,24 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
ippdrv->event_workq = ctx->event_workq; ippdrv->event_workq = ctx->event_workq;
ippdrv->sched_event = ipp_sched_event; ippdrv->sched_event = ipp_sched_event;
INIT_LIST_HEAD(&ippdrv->cmd_list); INIT_LIST_HEAD(&ippdrv->cmd_list);
if (is_drm_iommu_supported(drm_dev)) {
ret = drm_iommu_attach_device(drm_dev, ippdrv->dev);
if (ret) {
DRM_ERROR("failed to activate iommu\n");
goto err_iommu;
}
}
} }
return 0; return 0;
err_iommu:
/* get ipp driver entry */
list_for_each_entry_reverse(ippdrv, &exynos_drm_ippdrv_list, drv_list)
if (is_drm_iommu_supported(drm_dev))
drm_iommu_detach_device(drm_dev, ippdrv->dev);
err_idr: err_idr:
idr_remove_all(&ctx->ipp_idr); idr_remove_all(&ctx->ipp_idr);
idr_remove_all(&ctx->prop_idr); idr_remove_all(&ctx->prop_idr);
...@@ -1791,6 +1806,9 @@ static void ipp_subdrv_remove(struct drm_device *drm_dev, struct device *dev) ...@@ -1791,6 +1806,9 @@ static void ipp_subdrv_remove(struct drm_device *drm_dev, struct device *dev)
/* get ipp driver entry */ /* get ipp driver entry */
list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) { list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) {
if (is_drm_iommu_supported(drm_dev))
drm_iommu_detach_device(drm_dev, ippdrv->dev);
ippdrv->drm_dev = NULL; ippdrv->drm_dev = NULL;
exynos_drm_ippdrv_unregister(ippdrv); exynos_drm_ippdrv_unregister(ippdrv);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment