1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
3 #ifndef _TTM_RANGE_MANAGER_H_
4 #define _TTM_RANGE_MANAGER_H_
6 #include <drm/ttm/ttm_resource.h>
7 #include <drm/drm_mm.h>
10 * struct ttm_range_mgr_node
12 * @base: base clase we extend
13 * @mm_nodes: MM nodes, usually 1
15 * Extending the ttm_resource object to manage an address space allocation with
16 * one or more drm_mm_nodes.
18 struct ttm_range_mgr_node {
19 struct ttm_resource base;
20 struct drm_mm_node mm_nodes[];
24 * to_ttm_range_mgr_node
26 * @res: the resource to upcast
28 * Upcast the ttm_resource object into a ttm_range_mgr_node object.
30 static inline struct ttm_range_mgr_node *
31 to_ttm_range_mgr_node(struct ttm_resource *res)
33 return container_of(res, struct ttm_range_mgr_node, base);
36 int ttm_range_man_init(struct ttm_device *bdev,
37 unsigned type, bool use_tt,
38 unsigned long p_size);
39 int ttm_range_man_fini(struct ttm_device *bdev,