summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/rockchip/rockchip_drm_gem.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_gem.h
parent13f62f54d174d3417c3caaafedf5e22a0a03e442 (diff)
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_gem.h')
-rw-r--r--drivers/gpu/drm/rockchip/rockchip_drm_gem.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.h b/drivers/gpu/drm/rockchip/rockchip_drm_gem.h
index 18b3488db4ec..3f6ea4d18a5c 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.h
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.h
@@ -23,7 +23,15 @@ struct rockchip_gem_object {
void *kvaddr;
dma_addr_t dma_addr;
+ /* Used when IOMMU is disabled */
unsigned long dma_attrs;
+
+ /* Used when IOMMU is enabled */
+ struct drm_mm_node mm;
+ unsigned long num_pages;
+ struct page **pages;
+ struct sg_table *sgt;
+ size_t size;
};
struct sg_table *rockchip_gem_prime_get_sg_table(struct drm_gem_object *obj);