diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2011-10-25 16:33:37 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2011-12-21 18:33:22 -0500 |
commit | 94e895321bade1bafbcb2af1ef1e79b01e018012 (patch) | |
tree | 8e725dcbd475037225e352d5e388f9b3ed8d71e3 | |
parent | 6de8a748881f1cd9d795454da2b6db616d5ca3d7 (diff) |
drm/sman: kill user_hash_tab
No longer used.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/drm_sman.c | 36 | ||||
-rw-r--r-- | include/drm/drm_sman.h | 5 |
2 files changed, 2 insertions, 39 deletions
diff --git a/drivers/gpu/drm/drm_sman.c b/drivers/gpu/drm/drm_sman.c index af4728477a90..a8ff350e50b8 100644 --- a/drivers/gpu/drm/drm_sman.c +++ b/drivers/gpu/drm/drm_sman.c | |||
@@ -47,7 +47,6 @@ struct drm_owner_item { | |||
47 | 47 | ||
48 | void drm_sman_takedown(struct drm_sman * sman) | 48 | void drm_sman_takedown(struct drm_sman * sman) |
49 | { | 49 | { |
50 | drm_ht_remove(&sman->user_hash_tab); | ||
51 | kfree(sman->mm); | 50 | kfree(sman->mm); |
52 | } | 51 | } |
53 | 52 | ||
@@ -62,16 +61,11 @@ drm_sman_init(struct drm_sman * sman, unsigned int num_managers, | |||
62 | sman->mm = kcalloc(num_managers, sizeof(*sman->mm), GFP_KERNEL); | 61 | sman->mm = kcalloc(num_managers, sizeof(*sman->mm), GFP_KERNEL); |
63 | if (!sman->mm) { | 62 | if (!sman->mm) { |
64 | ret = -ENOMEM; | 63 | ret = -ENOMEM; |
65 | goto out; | 64 | return ret; |
66 | } | 65 | } |
67 | sman->num_managers = num_managers; | 66 | sman->num_managers = num_managers; |
68 | ret = drm_ht_create(&sman->user_hash_tab, user_order); | ||
69 | if (!ret) | ||
70 | goto out; | ||
71 | 67 | ||
72 | kfree(sman->mm); | 68 | return 0; |
73 | out: | ||
74 | return ret; | ||
75 | } | 69 | } |
76 | 70 | ||
77 | EXPORT_SYMBOL(drm_sman_init); | 71 | EXPORT_SYMBOL(drm_sman_init); |
@@ -180,15 +174,8 @@ struct drm_memblock_item *drm_sman_alloc(struct drm_sman *sman, unsigned int man | |||
180 | memblock->mm = sman_mm; | 174 | memblock->mm = sman_mm; |
181 | memblock->sman = sman; | 175 | memblock->sman = sman; |
182 | 176 | ||
183 | if (drm_ht_just_insert_please | ||
184 | (&sman->user_hash_tab, &memblock->user_hash, | ||
185 | (unsigned long)memblock, 32, 0, 0)) | ||
186 | goto out1; | ||
187 | |||
188 | return memblock; | 177 | return memblock; |
189 | 178 | ||
190 | out1: | ||
191 | kfree(memblock); | ||
192 | out: | 179 | out: |
193 | sman_mm->free(sman_mm->private, tmp); | 180 | sman_mm->free(sman_mm->private, tmp); |
194 | 181 | ||
@@ -199,31 +186,12 @@ EXPORT_SYMBOL(drm_sman_alloc); | |||
199 | 186 | ||
200 | void drm_sman_free(struct drm_memblock_item *item) | 187 | void drm_sman_free(struct drm_memblock_item *item) |
201 | { | 188 | { |
202 | struct drm_sman *sman = item->sman; | ||
203 | |||
204 | list_del(&item->owner_list); | 189 | list_del(&item->owner_list); |
205 | drm_ht_remove_item(&sman->user_hash_tab, &item->user_hash); | ||
206 | item->mm->free(item->mm->private, item->mm_info); | 190 | item->mm->free(item->mm->private, item->mm_info); |
207 | kfree(item); | 191 | kfree(item); |
208 | } | 192 | } |
209 | EXPORT_SYMBOL(drm_sman_free); | 193 | EXPORT_SYMBOL(drm_sman_free); |
210 | 194 | ||
211 | int drm_sman_free_key(struct drm_sman *sman, unsigned int key) | ||
212 | { | ||
213 | struct drm_hash_item *hash_item; | ||
214 | struct drm_memblock_item *memblock_item; | ||
215 | |||
216 | if (drm_ht_find_item(&sman->user_hash_tab, key, &hash_item)) | ||
217 | return -EINVAL; | ||
218 | |||
219 | memblock_item = drm_hash_entry(hash_item, struct drm_memblock_item, | ||
220 | user_hash); | ||
221 | drm_sman_free(memblock_item); | ||
222 | return 0; | ||
223 | } | ||
224 | |||
225 | EXPORT_SYMBOL(drm_sman_free_key); | ||
226 | |||
227 | void drm_sman_cleanup(struct drm_sman *sman) | 195 | void drm_sman_cleanup(struct drm_sman *sman) |
228 | { | 196 | { |
229 | unsigned int i; | 197 | unsigned int i; |
diff --git a/include/drm/drm_sman.h b/include/drm/drm_sman.h index 34ae5ca05a40..031e52189295 100644 --- a/include/drm/drm_sman.h +++ b/include/drm/drm_sman.h | |||
@@ -87,7 +87,6 @@ struct drm_memblock_item { | |||
87 | struct drm_sman { | 87 | struct drm_sman { |
88 | struct drm_sman_mm *mm; | 88 | struct drm_sman_mm *mm; |
89 | int num_managers; | 89 | int num_managers; |
90 | struct drm_open_hash user_hash_tab; | ||
91 | }; | 90 | }; |
92 | 91 | ||
93 | /* | 92 | /* |
@@ -139,11 +138,7 @@ extern struct drm_memblock_item *drm_sman_alloc(struct drm_sman * sman, | |||
139 | unsigned long size, | 138 | unsigned long size, |
140 | unsigned alignment, | 139 | unsigned alignment, |
141 | unsigned long owner); | 140 | unsigned long owner); |
142 | /* | ||
143 | * Free a memory block identified by its user hash key. | ||
144 | */ | ||
145 | 141 | ||
146 | extern int drm_sman_free_key(struct drm_sman * sman, unsigned int key); | ||
147 | extern void drm_sman_free(struct drm_memblock_item *item); | 142 | extern void drm_sman_free(struct drm_memblock_item *item); |
148 | 143 | ||
149 | /* | 144 | /* |