summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_memory.c
diff options
context:
space:
mode:
authorChunming Zhou <david1.zhou@amd.com>2018-02-09 10:44:08 +0800
committerAlex Deucher <alexander.deucher@amd.com>2018-02-13 11:57:59 -0500
commit82626363a217d79128c447ab296777b461e9f050 (patch)
tree14ee04c19f1c95ba44bd257d6d44eacc610e0d2a /drivers/gpu/drm/drm_memory.c
parent65101d8c9108201118efa7e08f4e2c57f438deb9 (diff)
drm: add func to get max iomem address v2
it will be used to check if the driver needs swiotlb v2: Don't use inline, instead, move function to drm_memory.c (Michel Daenzer <michel@daenzer.net>) Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Monk Liu <monk.liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180209024410.1469-1-david1.zhou@amd.com
Diffstat (limited to 'drivers/gpu/drm/drm_memory.c')
-rw-r--r--drivers/gpu/drm/drm_memory.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
index fc0ebd273ef8..7ca500b8c399 100644
--- a/drivers/gpu/drm/drm_memory.c
+++ b/drivers/gpu/drm/drm_memory.c
@@ -149,3 +149,16 @@ void drm_legacy_ioremapfree(struct drm_local_map *map, struct drm_device *dev)
iounmap(map->handle);
}
EXPORT_SYMBOL(drm_legacy_ioremapfree);
+
+u64 drm_get_max_iomem(void)
+{
+ struct resource *tmp;
+ u64 max_iomem = 0;
+
+ for (tmp = iomem_resource.child; tmp; tmp = tmp->sibling) {
+ max_iomem = max(max_iomem, tmp->end);
+ }
+
+ return max_iomem;
+}
+EXPORT_SYMBOL(drm_get_max_iomem);