diff options
Diffstat (limited to 'drivers/gpu/drm/cirrus/cirrus_ttm.c')
-rw-r--r-- | drivers/gpu/drm/cirrus/cirrus_ttm.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/drivers/gpu/drm/cirrus/cirrus_ttm.c b/drivers/gpu/drm/cirrus/cirrus_ttm.c index f21953243790..e075810b4bd4 100644 --- a/drivers/gpu/drm/cirrus/cirrus_ttm.c +++ b/drivers/gpu/drm/cirrus/cirrus_ttm.c | |||
@@ -36,63 +36,6 @@ cirrus_bdev(struct ttm_bo_device *bd) | |||
36 | return container_of(bd, struct cirrus_device, ttm.bdev); | 36 | return container_of(bd, struct cirrus_device, ttm.bdev); |
37 | } | 37 | } |
38 | 38 | ||
39 | static int | ||
40 | cirrus_ttm_mem_global_init(struct drm_global_reference *ref) | ||
41 | { | ||
42 | return ttm_mem_global_init(ref->object); | ||
43 | } | ||
44 | |||
45 | static void | ||
46 | cirrus_ttm_mem_global_release(struct drm_global_reference *ref) | ||
47 | { | ||
48 | ttm_mem_global_release(ref->object); | ||
49 | } | ||
50 | |||
51 | static int cirrus_ttm_global_init(struct cirrus_device *cirrus) | ||
52 | { | ||
53 | struct drm_global_reference *global_ref; | ||
54 | int r; | ||
55 | |||
56 | global_ref = &cirrus->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 = &cirrus_ttm_mem_global_init; | ||
60 | global_ref->release = &cirrus_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 | cirrus->ttm.bo_global_ref.mem_glob = | ||
69 | cirrus->ttm.mem_global_ref.object; | ||
70 | global_ref = &cirrus->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(&cirrus->ttm.mem_global_ref); | ||
79 | return r; | ||
80 | } | ||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | static void | ||
85 | cirrus_ttm_global_release(struct cirrus_device *cirrus) | ||
86 | { | ||
87 | if (cirrus->ttm.mem_global_ref.release == NULL) | ||
88 | return; | ||
89 | |||
90 | drm_global_item_unref(&cirrus->ttm.bo_global_ref.ref); | ||
91 | drm_global_item_unref(&cirrus->ttm.mem_global_ref); | ||
92 | cirrus->ttm.mem_global_ref.release = NULL; | ||
93 | } | ||
94 | |||
95 | |||
96 | static void cirrus_bo_ttm_destroy(struct ttm_buffer_object *tbo) | 39 | static void cirrus_bo_ttm_destroy(struct ttm_buffer_object *tbo) |
97 | { | 40 | { |
98 | struct cirrus_bo *bo; | 41 | struct cirrus_bo *bo; |
@@ -232,12 +175,7 @@ int cirrus_mm_init(struct cirrus_device *cirrus) | |||
232 | struct drm_device *dev = cirrus->dev; | 175 | struct drm_device *dev = cirrus->dev; |
233 | struct ttm_bo_device *bdev = &cirrus->ttm.bdev; | 176 | struct ttm_bo_device *bdev = &cirrus->ttm.bdev; |
234 | 177 | ||
235 | ret = cirrus_ttm_global_init(cirrus); | ||
236 | if (ret) | ||
237 | return ret; | ||
238 | |||
239 | ret = ttm_bo_device_init(&cirrus->ttm.bdev, | 178 | ret = ttm_bo_device_init(&cirrus->ttm.bdev, |
240 | cirrus->ttm.bo_global_ref.ref.object, | ||
241 | &cirrus_bo_driver, | 179 | &cirrus_bo_driver, |
242 | dev->anon_inode->i_mapping, | 180 | dev->anon_inode->i_mapping, |
243 | DRM_FILE_PAGE_OFFSET, | 181 | DRM_FILE_PAGE_OFFSET, |
@@ -273,8 +211,6 @@ void cirrus_mm_fini(struct cirrus_device *cirrus) | |||
273 | 211 | ||
274 | ttm_bo_device_release(&cirrus->ttm.bdev); | 212 | ttm_bo_device_release(&cirrus->ttm.bdev); |
275 | 213 | ||
276 | cirrus_ttm_global_release(cirrus); | ||
277 | |||
278 | arch_phys_wc_del(cirrus->fb_mtrr); | 214 | arch_phys_wc_del(cirrus->fb_mtrr); |
279 | cirrus->fb_mtrr = 0; | 215 | cirrus->fb_mtrr = 0; |
280 | arch_io_free_memtype_wc(pci_resource_start(dev->pdev, 0), | 216 | arch_io_free_memtype_wc(pci_resource_start(dev->pdev, 0), |