summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_memory.c
diff options
context:
space:
mode:
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..3c54044214db 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;
+ resource_size_t 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);