Linux Audio

Check our new training course

Buildroot integration, development and maintenance

Need a Buildroot system for your embedded project?
Loading...
v6.2
 1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
 2
 3#ifndef _TTM_RANGE_MANAGER_H_
 4#define _TTM_RANGE_MANAGER_H_
 5
 6#include <drm/ttm/ttm_resource.h>
 7#include <drm/ttm/ttm_device.h>
 8#include <drm/drm_mm.h>
 9
10/**
11 * struct ttm_range_mgr_node
12 *
13 * @base: base clase we extend
14 * @mm_nodes: MM nodes, usually 1
15 *
16 * Extending the ttm_resource object to manage an address space allocation with
17 * one or more drm_mm_nodes.
18 */
19struct ttm_range_mgr_node {
20	struct ttm_resource base;
21	struct drm_mm_node mm_nodes[];
22};
23
24/**
25 * to_ttm_range_mgr_node
26 *
27 * @res: the resource to upcast
28 *
29 * Upcast the ttm_resource object into a ttm_range_mgr_node object.
30 */
31static inline struct ttm_range_mgr_node *
32to_ttm_range_mgr_node(struct ttm_resource *res)
33{
34	return container_of(res, struct ttm_range_mgr_node, base);
35}
36
37int ttm_range_man_init_nocheck(struct ttm_device *bdev,
38		       unsigned type, bool use_tt,
39		       unsigned long p_size);
40int ttm_range_man_fini_nocheck(struct ttm_device *bdev,
41		       unsigned type);
42static __always_inline int ttm_range_man_init(struct ttm_device *bdev,
43		       unsigned int type, bool use_tt,
44		       unsigned long p_size)
45{
46	BUILD_BUG_ON(__builtin_constant_p(type) && type >= TTM_NUM_MEM_TYPES);
47	return ttm_range_man_init_nocheck(bdev, type, use_tt, p_size);
48}
49
50static __always_inline int ttm_range_man_fini(struct ttm_device *bdev,
51		       unsigned int type)
52{
53	BUILD_BUG_ON(__builtin_constant_p(type) && type >= TTM_NUM_MEM_TYPES);
54	return ttm_range_man_fini_nocheck(bdev, type);
55}
56#endif
v5.14.15
 1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
 2
 3#ifndef _TTM_RANGE_MANAGER_H_
 4#define _TTM_RANGE_MANAGER_H_
 5
 6#include <drm/ttm/ttm_resource.h>
 
 7#include <drm/drm_mm.h>
 8
 9/**
10 * struct ttm_range_mgr_node
11 *
12 * @base: base clase we extend
13 * @mm_nodes: MM nodes, usually 1
14 *
15 * Extending the ttm_resource object to manage an address space allocation with
16 * one or more drm_mm_nodes.
17 */
18struct ttm_range_mgr_node {
19	struct ttm_resource base;
20	struct drm_mm_node mm_nodes[];
21};
22
23/**
24 * to_ttm_range_mgr_node
25 *
26 * @res: the resource to upcast
27 *
28 * Upcast the ttm_resource object into a ttm_range_mgr_node object.
29 */
30static inline struct ttm_range_mgr_node *
31to_ttm_range_mgr_node(struct ttm_resource *res)
32{
33	return container_of(res, struct ttm_range_mgr_node, base);
34}
35
36int ttm_range_man_init(struct ttm_device *bdev,
37		       unsigned type, bool use_tt,
38		       unsigned long p_size);
39int ttm_range_man_fini(struct ttm_device *bdev,
40		       unsigned type);
 
 
 
 
 
 
 
41
 
 
 
 
 
 
42#endif