1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
2 
3 #include <drm/ttm/ttm_resource.h>
4 #include <drm/ttm/ttm_device.h>
5 #include <drm/ttm/ttm_placement.h>
6 
7 #include "ttm_module.h"
8 
9 static int ttm_sys_man_alloc(struct ttm_resource_manager *man,
10 			     struct ttm_buffer_object *bo,
11 			     const struct ttm_place *place,
12 			     struct ttm_resource *mem)
13 {
14 	return 0;
15 }
16 
17 static void ttm_sys_man_free(struct ttm_resource_manager *man,
18 			     struct ttm_resource *mem)
19 {
20 }
21 
22 static const struct ttm_resource_manager_func ttm_sys_manager_func = {
23 	.alloc = ttm_sys_man_alloc,
24 	.free = ttm_sys_man_free,
25 };
26 
27 void ttm_sys_man_init(struct ttm_device *bdev)
28 {
29 	struct ttm_resource_manager *man = &bdev->sysman;
30 
31 	/*
32 	 * Initialize the system memory buffer type.
33 	 * Other types need to be driver / IOCTL initialized.
34 	 */
35 	man->use_tt = true;
36 	man->func = &ttm_sys_manager_func;
37 
38 	ttm_resource_manager_init(man, 0);
39 	ttm_set_driver_manager(bdev, TTM_PL_SYSTEM, man);
40 	ttm_resource_manager_set_used(man, true);
41 }
42