Lines Matching full:sa
50 static void drm_suballoc_remove_locked(struct drm_suballoc *sa);
95 struct drm_suballoc *sa, *tmp; in drm_suballoc_manager_fini() local
106 list_for_each_entry_safe(sa, tmp, &sa_manager->olist, olist) { in drm_suballoc_manager_fini()
107 drm_suballoc_remove_locked(sa); in drm_suballoc_manager_fini()
114 static void drm_suballoc_remove_locked(struct drm_suballoc *sa) in drm_suballoc_remove_locked() argument
116 struct drm_suballoc_manager *sa_manager = sa->manager; in drm_suballoc_remove_locked()
118 if (sa_manager->hole == &sa->olist) in drm_suballoc_remove_locked()
119 sa_manager->hole = sa->olist.prev; in drm_suballoc_remove_locked()
121 list_del_init(&sa->olist); in drm_suballoc_remove_locked()
122 list_del_init(&sa->flist); in drm_suballoc_remove_locked()
123 dma_fence_put(sa->fence); in drm_suballoc_remove_locked()
124 kfree(sa); in drm_suballoc_remove_locked()
129 struct drm_suballoc *sa, *tmp; in drm_suballoc_try_free() local
134 sa = list_entry(sa_manager->hole->next, struct drm_suballoc, olist); in drm_suballoc_try_free()
135 list_for_each_entry_safe_from(sa, tmp, &sa_manager->olist, olist) { in drm_suballoc_try_free()
136 if (!sa->fence || !dma_fence_is_signaled(sa->fence)) in drm_suballoc_try_free()
139 drm_suballoc_remove_locked(sa); in drm_suballoc_try_free()
163 struct drm_suballoc *sa, in drm_suballoc_try_alloc() argument
175 sa->manager = sa_manager; in drm_suballoc_try_alloc()
176 sa->soffset = soffset; in drm_suballoc_try_alloc()
177 sa->eoffset = soffset + size; in drm_suballoc_try_alloc()
178 list_add(&sa->olist, sa_manager->hole); in drm_suballoc_try_alloc()
179 INIT_LIST_HEAD(&sa->flist); in drm_suballoc_try_alloc()
180 sa_manager->hole = &sa->olist; in drm_suballoc_try_alloc()
242 /* go over all fence list and try to find the closest sa in drm_suballoc_next_hole()
246 struct drm_suballoc *sa; in drm_suballoc_next_hole() local
253 sa = list_first_entry(&sa_manager->flist[i], in drm_suballoc_next_hole()
256 if (!dma_fence_is_signaled(sa->fence)) { in drm_suballoc_next_hole()
257 fences[i] = sa->fence; in drm_suballoc_next_hole()
265 tmp = sa->soffset; in drm_suballoc_next_hole()
272 /* this sa bo is the closest one */ in drm_suballoc_next_hole()
275 best_bo = sa; in drm_suballoc_next_hole()
320 struct drm_suballoc *sa; in drm_suballoc_new() local
330 sa = kmalloc(sizeof(*sa), gfp); in drm_suballoc_new()
331 if (!sa) in drm_suballoc_new()
333 sa->manager = sa_manager; in drm_suballoc_new()
334 sa->fence = NULL; in drm_suballoc_new()
335 INIT_LIST_HEAD(&sa->olist); in drm_suballoc_new()
336 INIT_LIST_HEAD(&sa->flist); in drm_suballoc_new()
346 if (drm_suballoc_try_alloc(sa_manager, sa, in drm_suballoc_new()
349 return sa; in drm_suballoc_new()
386 kfree(sa); in drm_suballoc_new()