diff options
Diffstat (limited to 'drivers/gpu/drm/ast/ast_ttm.c')
-rw-r--r-- | drivers/gpu/drm/ast/ast_ttm.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/drivers/gpu/drm/ast/ast_ttm.c b/drivers/gpu/drm/ast/ast_ttm.c index fe354ebf374d..c168d62fe8f9 100644 --- a/drivers/gpu/drm/ast/ast_ttm.c +++ b/drivers/gpu/drm/ast/ast_ttm.c | |||
@@ -36,63 +36,6 @@ ast_bdev(struct ttm_bo_device *bd) | |||
36 | return container_of(bd, struct ast_private, ttm.bdev); | 36 | return container_of(bd, struct ast_private, ttm.bdev); |
37 | } | 37 | } |
38 | 38 | ||
39 | static int | ||
40 | ast_ttm_mem_global_init(struct drm_global_reference *ref) | ||
41 | { | ||
42 | return ttm_mem_global_init(ref->object); | ||
43 | } | ||
44 | |||
45 | static void | ||
46 | ast_ttm_mem_global_release(struct drm_global_reference *ref) | ||
47 | { | ||
48 | ttm_mem_global_release(ref->object); | ||
49 | } | ||
50 | |||
51 | static int ast_ttm_global_init(struct ast_private *ast) | ||
52 | { | ||
53 | struct drm_global_reference *global_ref; | ||
54 | int r; | ||
55 | |||
56 | global_ref = &ast->ttm.mem_global_ref; | ||
57 | global_ref->global_type = DRM_GLOBAL_TTM_MEM; | ||
58 | global_ref->size = sizeof(struct ttm_mem_global); | ||
59 | global_ref->init = &ast_ttm_mem_global_init; | ||
60 | global_ref->release = &ast_ttm_mem_global_release; | ||
61 | r = drm_global_item_ref(global_ref); | ||
62 | if (r != 0) { | ||
63 | DRM_ERROR("Failed setting up TTM memory accounting " | ||
64 | "subsystem.\n"); | ||
65 | return r; | ||
66 | } | ||
67 | |||
68 | ast->ttm.bo_global_ref.mem_glob = | ||
69 | ast->ttm.mem_global_ref.object; | ||
70 | global_ref = &ast->ttm.bo_global_ref.ref; | ||
71 | global_ref->global_type = DRM_GLOBAL_TTM_BO; | ||
72 | global_ref->size = sizeof(struct ttm_bo_global); | ||
73 | global_ref->init = &ttm_bo_global_init; | ||
74 | global_ref->release = &ttm_bo_global_release; | ||
75 | r = drm_global_item_ref(global_ref); | ||
76 | if (r != 0) { | ||
77 | DRM_ERROR("Failed setting up TTM BO subsystem.\n"); | ||
78 | drm_global_item_unref(&ast->ttm.mem_global_ref); | ||
79 | return r; | ||
80 | } | ||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | static void | ||
85 | ast_ttm_global_release(struct ast_private *ast) | ||
86 | { | ||
87 | if (ast->ttm.mem_global_ref.release == NULL) | ||
88 | return; | ||
89 | |||
90 | drm_global_item_unref(&ast->ttm.bo_global_ref.ref); | ||
91 | drm_global_item_unref(&ast->ttm.mem_global_ref); | ||
92 | ast->ttm.mem_global_ref.release = NULL; | ||
93 | } | ||
94 | |||
95 | |||
96 | static void ast_bo_ttm_destroy(struct ttm_buffer_object *tbo) | 39 | static void ast_bo_ttm_destroy(struct ttm_buffer_object *tbo) |
97 | { | 40 | { |
98 | struct ast_bo *bo; | 41 | struct ast_bo *bo; |
@@ -232,12 +175,7 @@ int ast_mm_init(struct ast_private *ast) | |||
232 | struct drm_device *dev = ast->dev; | 175 | struct drm_device *dev = ast->dev; |
233 | struct ttm_bo_device *bdev = &ast->ttm.bdev; | 176 | struct ttm_bo_device *bdev = &ast->ttm.bdev; |
234 | 177 | ||
235 | ret = ast_ttm_global_init(ast); | ||
236 | if (ret) | ||
237 | return ret; | ||
238 | |||
239 | ret = ttm_bo_device_init(&ast->ttm.bdev, | 178 | ret = ttm_bo_device_init(&ast->ttm.bdev, |
240 | ast->ttm.bo_global_ref.ref.object, | ||
241 | &ast_bo_driver, | 179 | &ast_bo_driver, |
242 | dev->anon_inode->i_mapping, | 180 | dev->anon_inode->i_mapping, |
243 | DRM_FILE_PAGE_OFFSET, | 181 | DRM_FILE_PAGE_OFFSET, |
@@ -268,8 +206,6 @@ void ast_mm_fini(struct ast_private *ast) | |||
268 | 206 | ||
269 | ttm_bo_device_release(&ast->ttm.bdev); | 207 | ttm_bo_device_release(&ast->ttm.bdev); |
270 | 208 | ||
271 | ast_ttm_global_release(ast); | ||
272 | |||
273 | arch_phys_wc_del(ast->fb_mtrr); | 209 | arch_phys_wc_del(ast->fb_mtrr); |
274 | arch_io_free_memtype_wc(pci_resource_start(dev->pdev, 0), | 210 | arch_io_free_memtype_wc(pci_resource_start(dev->pdev, 0), |
275 | pci_resource_len(dev->pdev, 0)); | 211 | pci_resource_len(dev->pdev, 0)); |