summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
diff options
context:
space:
mode:
authorTomasz Figa <tfiga@chromium.org>2016-06-24 10:13:31 +0800
committerMark Yao <mark.yao@rock-chips.com>2017-02-15 08:52:13 +0800
commit38f993b7c59e261b8ff7deb66c96c7dff4017f7b (patch)
tree708f6e3af42cfa4ff25ecef1f81f8dde0ee9d435 /drivers/gpu/drm/rockchip/rockchip_drm_drv.h
parent13f62f54d174d3417c3caaafedf5e22a0a03e442 (diff)
downloadlinux-38f993b7c59e261b8ff7deb66c96c7dff4017f7b.tar.bz2
drm/rockchip: Do not use DMA mapping API if attached to IOMMU domain
The API is not suitable for subsystems consisting of multiple devices and requires severe hacks to use it. To mitigate this, this patch implements allocation and address space management locally by using helpers provided by DRM framework, like other DRM drivers do, e.g. Tegra. This patch should not introduce any functional changes until the driver is made to attach subdevices into an IOMMU domain with the generic IOMMU API, which will happen in following patch. Based heavily on GEM implementation of Tegra DRM driver. Signed-off-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com> Signed-off-by: Mark Yao <mark.yao@rock-chips.com> Signed-off-by: rjan Eide <orjan.eide@arm.com>
Diffstat (limited to 'drivers/gpu/drm/rockchip/rockchip_drm_drv.h')
-rw-r--r--drivers/gpu/drm/rockchip/rockchip_drm_drv.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
index fb6226cf84b7..adc39302bec5 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
@@ -30,6 +30,7 @@
struct drm_device;
struct drm_connector;
+struct iommu_domain;
/*
* Rockchip drm private crtc funcs.
@@ -60,7 +61,10 @@ struct rockchip_drm_private {
struct drm_gem_object *fbdev_bo;
const struct rockchip_crtc_funcs *crtc_funcs[ROCKCHIP_MAX_CRTC];
struct drm_atomic_state *state;
-
+ struct iommu_domain *domain;
+ /* protect drm_mm on multi-threads */
+ struct mutex mm_lock;
+ struct drm_mm mm;
struct list_head psr_list;
spinlock_t psr_list_lock;
};