• Home
  • Raw
  • Download

Lines Matching refs:vc4

24 static void vc4_bo_stats_dump(struct vc4_dev *vc4)  in vc4_bo_stats_dump()  argument
27 vc4->bo_stats.num_allocated); in vc4_bo_stats_dump()
29 vc4->bo_stats.size_allocated / 1024); in vc4_bo_stats_dump()
31 vc4->bo_stats.num_allocated - vc4->bo_stats.num_cached); in vc4_bo_stats_dump()
33 (vc4->bo_stats.size_allocated - in vc4_bo_stats_dump()
34 vc4->bo_stats.size_cached) / 1024); in vc4_bo_stats_dump()
36 vc4->bo_stats.num_cached); in vc4_bo_stats_dump()
38 vc4->bo_stats.size_cached / 1024); in vc4_bo_stats_dump()
46 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_bo_stats_debugfs() local
50 mutex_lock(&vc4->bo_lock); in vc4_bo_stats_debugfs()
51 stats = vc4->bo_stats; in vc4_bo_stats_debugfs()
52 mutex_unlock(&vc4->bo_lock); in vc4_bo_stats_debugfs()
80 struct vc4_dev *vc4 = to_vc4_dev(obj->dev); in vc4_bo_destroy() local
89 vc4->bo_stats.num_allocated--; in vc4_bo_destroy()
90 vc4->bo_stats.size_allocated -= obj->size; in vc4_bo_destroy()
98 struct vc4_dev *vc4 = to_vc4_dev(obj->dev); in vc4_bo_remove_from_cache() local
100 vc4->bo_stats.num_cached--; in vc4_bo_remove_from_cache()
101 vc4->bo_stats.size_cached -= obj->size; in vc4_bo_remove_from_cache()
110 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_get_cache_list_for_size() local
113 if (vc4->bo_cache.size_list_size <= page_index) { in vc4_get_cache_list_for_size()
114 uint32_t new_size = max(vc4->bo_cache.size_list_size * 2, in vc4_get_cache_list_for_size()
127 for (i = 0; i < vc4->bo_cache.size_list_size; i++) { in vc4_get_cache_list_for_size()
129 &vc4->bo_cache.size_list[i]; in vc4_get_cache_list_for_size()
137 for (i = vc4->bo_cache.size_list_size; i < new_size; i++) in vc4_get_cache_list_for_size()
140 kfree(vc4->bo_cache.size_list); in vc4_get_cache_list_for_size()
141 vc4->bo_cache.size_list = new_list; in vc4_get_cache_list_for_size()
142 vc4->bo_cache.size_list_size = new_size; in vc4_get_cache_list_for_size()
145 return &vc4->bo_cache.size_list[page_index]; in vc4_get_cache_list_for_size()
150 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_bo_cache_purge() local
152 mutex_lock(&vc4->bo_lock); in vc4_bo_cache_purge()
153 while (!list_empty(&vc4->bo_cache.time_list)) { in vc4_bo_cache_purge()
154 struct vc4_bo *bo = list_last_entry(&vc4->bo_cache.time_list, in vc4_bo_cache_purge()
159 mutex_unlock(&vc4->bo_lock); in vc4_bo_cache_purge()
165 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_bo_get_from_cache() local
171 mutex_lock(&vc4->bo_lock); in vc4_bo_get_from_cache()
172 if (page_index >= vc4->bo_cache.size_list_size) in vc4_bo_get_from_cache()
175 if (list_empty(&vc4->bo_cache.size_list[page_index])) in vc4_bo_get_from_cache()
178 bo = list_first_entry(&vc4->bo_cache.size_list[page_index], in vc4_bo_get_from_cache()
184 mutex_unlock(&vc4->bo_lock); in vc4_bo_get_from_cache()
196 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_create_object() local
203 mutex_lock(&vc4->bo_lock); in vc4_create_object()
204 vc4->bo_stats.num_allocated++; in vc4_create_object()
205 vc4->bo_stats.size_allocated += size; in vc4_create_object()
206 mutex_unlock(&vc4->bo_lock); in vc4_create_object()
215 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_bo_create() local
240 vc4_bo_stats_dump(vc4); in vc4_bo_create()
275 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_bo_cache_free_old() local
278 while (!list_empty(&vc4->bo_cache.time_list)) { in vc4_bo_cache_free_old()
279 struct vc4_bo *bo = list_last_entry(&vc4->bo_cache.time_list, in vc4_bo_cache_free_old()
282 mod_timer(&vc4->bo_cache.time_timer, in vc4_bo_cache_free_old()
299 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_free_object() local
303 mutex_lock(&vc4->bo_lock); in vc4_free_object()
340 list_add(&bo->unref_head, &vc4->bo_cache.time_list); in vc4_free_object()
342 vc4->bo_stats.num_cached++; in vc4_free_object()
343 vc4->bo_stats.size_cached += gem_bo->size; in vc4_free_object()
348 mutex_unlock(&vc4->bo_lock); in vc4_free_object()
353 struct vc4_dev *vc4 = in vc4_bo_cache_time_work() local
355 struct drm_device *dev = vc4->dev; in vc4_bo_cache_time_work()
357 mutex_lock(&vc4->bo_lock); in vc4_bo_cache_time_work()
359 mutex_unlock(&vc4->bo_lock); in vc4_bo_cache_time_work()
365 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_bo_cache_time_timer() local
367 schedule_work(&vc4->bo_cache.time_work); in vc4_bo_cache_time_timer()
540 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_bo_cache_init() local
542 mutex_init(&vc4->bo_lock); in vc4_bo_cache_init()
544 INIT_LIST_HEAD(&vc4->bo_cache.time_list); in vc4_bo_cache_init()
546 INIT_WORK(&vc4->bo_cache.time_work, vc4_bo_cache_time_work); in vc4_bo_cache_init()
547 setup_timer(&vc4->bo_cache.time_timer, in vc4_bo_cache_init()
554 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_bo_cache_destroy() local
556 del_timer(&vc4->bo_cache.time_timer); in vc4_bo_cache_destroy()
557 cancel_work_sync(&vc4->bo_cache.time_work); in vc4_bo_cache_destroy()
561 if (vc4->bo_stats.num_allocated) { in vc4_bo_cache_destroy()
563 vc4_bo_stats_dump(vc4); in vc4_bo_cache_destroy()