• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/dev/drm2/ttm/

Lines Matching defs:tfile

118 	struct ttm_object_file *tfile;
124 ttm_object_file_ref(struct ttm_object_file *tfile)
126 refcount_acquire(&tfile->refcount);
127 return tfile;
130 static void ttm_object_file_destroy(struct ttm_object_file *tfile)
133 free(tfile, M_TTM_OBJ_FILE);
139 struct ttm_object_file *tfile = *p_tfile;
142 if (refcount_release(&tfile->refcount))
143 ttm_object_file_destroy(tfile);
147 int ttm_base_object_init(struct ttm_object_file *tfile,
155 struct ttm_object_device *tdev = tfile->tdev;
159 base->tfile = ttm_object_file_ref(tfile);
173 ret = ttm_ref_object_add(tfile, base, TTM_REF_USAGE, NULL);
190 struct ttm_object_device *tdev = base->tfile->tdev;
201 ttm_object_file_unref(&base->tfile);
210 struct ttm_object_device *tdev = base->tfile->tdev;
225 struct ttm_base_object *ttm_base_object_lookup(struct ttm_object_file *tfile,
228 struct ttm_object_device *tdev = tfile->tdev;
245 if (tfile != base->tfile && !base->shareable) {
257 int ttm_ref_object_add(struct ttm_object_file *tfile,
261 struct drm_open_hash *ht = &tfile->ref_hash[ref_type];
264 struct ttm_mem_global *mem_glob = tfile->tdev->mem_glob;
271 rw_rlock(&tfile->lock);
277 rw_runlock(&tfile->lock);
281 rw_runlock(&tfile->lock);
294 ref->tfile = tfile;
298 rw_wlock(&tfile->lock);
302 list_add_tail(&ref->head, &tfile->ref_list);
304 rw_wunlock(&tfile->lock);
310 rw_wunlock(&tfile->lock);
323 struct ttm_object_file *tfile = ref->tfile;
325 struct ttm_mem_global *mem_glob = tfile->tdev->mem_glob;
327 ht = &tfile->ref_hash[ref->ref_type];
330 rw_wunlock(&tfile->lock);
338 rw_wlock(&tfile->lock);
341 int ttm_ref_object_base_unref(struct ttm_object_file *tfile,
344 struct drm_open_hash *ht = &tfile->ref_hash[ref_type];
349 rw_wlock(&tfile->lock);
352 rw_wunlock(&tfile->lock);
358 rw_wunlock(&tfile->lock);
367 struct ttm_object_file *tfile = *p_tfile;
370 rw_wlock(&tfile->lock);
377 while (!list_empty(&tfile->ref_list)) {
378 list = tfile->ref_list.next;
384 drm_ht_remove(&tfile->ref_hash[i]);
386 rw_wunlock(&tfile->lock);
387 ttm_object_file_unref(&tfile);
393 struct ttm_object_file *tfile;
398 tfile = malloc(sizeof(*tfile), M_TTM_OBJ_FILE, M_WAITOK);
399 rw_init(&tfile->lock, "ttmfo");
400 tfile->tdev = tdev;
401 refcount_init(&tfile->refcount, 1);
402 INIT_LIST_HEAD(&tfile->ref_list);
405 ret = drm_ht_create(&tfile->ref_hash[i], hash_order);
412 return tfile;
415 drm_ht_remove(&tfile->ref_hash[i]);
417 free(tfile, M_TTM_OBJ_FILE);