aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_sman.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/drm/drm_sman.c')
-rw-r--r--drivers/char/drm/drm_sman.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/char/drm/drm_sman.c b/drivers/char/drm/drm_sman.c
index 5a075f070c6a..8421a93946d8 100644
--- a/drivers/char/drm/drm_sman.c
+++ b/drivers/char/drm/drm_sman.c
@@ -38,11 +38,11 @@
38 38
39#include "drm_sman.h" 39#include "drm_sman.h"
40 40
41typedef struct drm_owner_item { 41struct drm_owner_item {
42 drm_hash_item_t owner_hash; 42 struct drm_hash_item owner_hash;
43 struct list_head sman_list; 43 struct list_head sman_list;
44 struct list_head mem_blocks; 44 struct list_head mem_blocks;
45} drm_owner_item_t; 45};
46 46
47void drm_sman_takedown(struct drm_sman * sman) 47void drm_sman_takedown(struct drm_sman * sman)
48{ 48{
@@ -163,16 +163,16 @@ drm_sman_set_manager(struct drm_sman * sman, unsigned int manager,
163} 163}
164EXPORT_SYMBOL(drm_sman_set_manager); 164EXPORT_SYMBOL(drm_sman_set_manager);
165 165
166static drm_owner_item_t *drm_sman_get_owner_item(struct drm_sman * sman, 166static struct drm_owner_item *drm_sman_get_owner_item(struct drm_sman * sman,
167 unsigned long owner) 167 unsigned long owner)
168{ 168{
169 int ret; 169 int ret;
170 drm_hash_item_t *owner_hash_item; 170 struct drm_hash_item *owner_hash_item;
171 drm_owner_item_t *owner_item; 171 struct drm_owner_item *owner_item;
172 172
173 ret = drm_ht_find_item(&sman->owner_hash_tab, owner, &owner_hash_item); 173 ret = drm_ht_find_item(&sman->owner_hash_tab, owner, &owner_hash_item);
174 if (!ret) { 174 if (!ret) {
175 return drm_hash_entry(owner_hash_item, drm_owner_item_t, 175 return drm_hash_entry(owner_hash_item, struct drm_owner_item,
176 owner_hash); 176 owner_hash);
177 } 177 }
178 178
@@ -200,7 +200,7 @@ struct drm_memblock_item *drm_sman_alloc(struct drm_sman *sman, unsigned int man
200{ 200{
201 void *tmp; 201 void *tmp;
202 struct drm_sman_mm *sman_mm; 202 struct drm_sman_mm *sman_mm;
203 drm_owner_item_t *owner_item; 203 struct drm_owner_item *owner_item;
204 struct drm_memblock_item *memblock; 204 struct drm_memblock_item *memblock;
205 205
206 BUG_ON(manager >= sman->num_managers); 206 BUG_ON(manager >= sman->num_managers);
@@ -258,7 +258,7 @@ static void drm_sman_free(struct drm_memblock_item *item)
258 258
259int drm_sman_free_key(struct drm_sman *sman, unsigned int key) 259int drm_sman_free_key(struct drm_sman *sman, unsigned int key)
260{ 260{
261 drm_hash_item_t *hash_item; 261 struct drm_hash_item *hash_item;
262 struct drm_memblock_item *memblock_item; 262 struct drm_memblock_item *memblock_item;
263 263
264 if (drm_ht_find_item(&sman->user_hash_tab, key, &hash_item)) 264 if (drm_ht_find_item(&sman->user_hash_tab, key, &hash_item))
@@ -273,7 +273,7 @@ int drm_sman_free_key(struct drm_sman *sman, unsigned int key)
273EXPORT_SYMBOL(drm_sman_free_key); 273EXPORT_SYMBOL(drm_sman_free_key);
274 274
275static void drm_sman_remove_owner(struct drm_sman *sman, 275static void drm_sman_remove_owner(struct drm_sman *sman,
276 drm_owner_item_t *owner_item) 276 struct drm_owner_item *owner_item)
277{ 277{
278 list_del(&owner_item->sman_list); 278 list_del(&owner_item->sman_list);
279 drm_ht_remove_item(&sman->owner_hash_tab, &owner_item->owner_hash); 279 drm_ht_remove_item(&sman->owner_hash_tab, &owner_item->owner_hash);
@@ -283,14 +283,14 @@ static void drm_sman_remove_owner(struct drm_sman *sman,
283int drm_sman_owner_clean(struct drm_sman *sman, unsigned long owner) 283int drm_sman_owner_clean(struct drm_sman *sman, unsigned long owner)
284{ 284{
285 285
286 drm_hash_item_t *hash_item; 286 struct drm_hash_item *hash_item;
287 drm_owner_item_t *owner_item; 287 struct drm_owner_item *owner_item;
288 288
289 if (drm_ht_find_item(&sman->owner_hash_tab, owner, &hash_item)) { 289 if (drm_ht_find_item(&sman->owner_hash_tab, owner, &hash_item)) {
290 return -1; 290 return -1;
291 } 291 }
292 292
293 owner_item = drm_hash_entry(hash_item, drm_owner_item_t, owner_hash); 293 owner_item = drm_hash_entry(hash_item, struct drm_owner_item, owner_hash);
294 if (owner_item->mem_blocks.next == &owner_item->mem_blocks) { 294 if (owner_item->mem_blocks.next == &owner_item->mem_blocks) {
295 drm_sman_remove_owner(sman, owner_item); 295 drm_sman_remove_owner(sman, owner_item);
296 return -1; 296 return -1;
@@ -302,7 +302,7 @@ int drm_sman_owner_clean(struct drm_sman *sman, unsigned long owner)
302EXPORT_SYMBOL(drm_sman_owner_clean); 302EXPORT_SYMBOL(drm_sman_owner_clean);
303 303
304static void drm_sman_do_owner_cleanup(struct drm_sman *sman, 304static void drm_sman_do_owner_cleanup(struct drm_sman *sman,
305 drm_owner_item_t *owner_item) 305 struct drm_owner_item *owner_item)
306{ 306{
307 struct drm_memblock_item *entry, *next; 307 struct drm_memblock_item *entry, *next;
308 308
@@ -316,15 +316,15 @@ static void drm_sman_do_owner_cleanup(struct drm_sman *sman,
316void drm_sman_owner_cleanup(struct drm_sman *sman, unsigned long owner) 316void drm_sman_owner_cleanup(struct drm_sman *sman, unsigned long owner)
317{ 317{
318 318
319 drm_hash_item_t *hash_item; 319 struct drm_hash_item *hash_item;
320 drm_owner_item_t *owner_item; 320 struct drm_owner_item *owner_item;
321 321
322 if (drm_ht_find_item(&sman->owner_hash_tab, owner, &hash_item)) { 322 if (drm_ht_find_item(&sman->owner_hash_tab, owner, &hash_item)) {
323 323
324 return; 324 return;
325 } 325 }
326 326
327 owner_item = drm_hash_entry(hash_item, drm_owner_item_t, owner_hash); 327 owner_item = drm_hash_entry(hash_item, struct drm_owner_item, owner_hash);
328 drm_sman_do_owner_cleanup(sman, owner_item); 328 drm_sman_do_owner_cleanup(sman, owner_item);
329} 329}
330 330
@@ -332,7 +332,7 @@ EXPORT_SYMBOL(drm_sman_owner_cleanup);
332 332
333void drm_sman_cleanup(struct drm_sman *sman) 333void drm_sman_cleanup(struct drm_sman *sman)
334{ 334{
335 drm_owner_item_t *entry, *next; 335 struct drm_owner_item *entry, *next;
336 unsigned int i; 336 unsigned int i;
337 struct drm_sman_mm *sman_mm; 337 struct drm_sman_mm *sman_mm;
338 338