Home | History | Annotate | Download | only in vmwgfx

Lines Matching refs:ref

58  * @ref_hash: Hash tables of ref objects, one per ttm_ref_type,
59 * for fast lookup of ref objects given a base object.
112 * @head: List entry for the per-file list of ref-objects.
114 * @kref: Ref count.
116 * @obj: Base object this ref object is referencing.
118 * @ref_type: Type of ref object.
123 * a particular ttm_object_file. It also carries a ref count to avoid creating
124 * multiple ref objects if a ttm_object_file references the same base
307 * ttm_ref_object_exists - Check whether a caller has a valid ref object
321 struct ttm_ref_object *ref;
328 * Verify that the ref object is really pointing to our base object.
329 * Our base object could actually be dead, and the ref object pointing
332 ref = drm_hash_entry(hash, struct ttm_ref_object, hash);
333 if (unlikely(base != ref->obj))
337 * Verify that the ref->obj pointer was actually valid!
340 if (unlikely(kref_read(&ref->kref) == 0))
357 struct ttm_ref_object *ref;
377 ref = drm_hash_entry(hash, struct ttm_ref_object, hash);
378 if (kref_get_unless_zero(&ref->kref)) {
388 ret = ttm_mem_global_alloc(mem_glob, sizeof(*ref),
392 ref = kmalloc(sizeof(*ref), GFP_KERNEL);
393 if (unlikely(ref == NULL)) {
394 ttm_mem_global_free(mem_glob, sizeof(*ref));
398 ref->hash.key = base->handle;
399 ref->obj = base;
400 ref->tfile = tfile;
401 ref->ref_type = ref_type;
402 kref_init(&ref->kref);
405 ret = drm_ht_insert_item_rcu(ht, &ref->hash);
408 list_add_tail(&ref->head, &tfile->ref_list);
419 ttm_mem_global_free(mem_glob, sizeof(*ref));
420 kfree(ref);
429 struct ttm_ref_object *ref =
431 struct ttm_base_object *base = ref->obj;
432 struct ttm_object_file *tfile = ref->tfile;
436 ht = &tfile->ref_hash[ref->ref_type];
437 (void)drm_ht_remove_item_rcu(ht, &ref->hash);
438 list_del(&ref->head);
441 if (ref->ref_type != TTM_REF_USAGE && base->ref_obj_release)
442 base->ref_obj_release(base, ref->ref_type);
444 ttm_base_object_unref(&ref->obj);
445 ttm_mem_global_free(mem_glob, sizeof(*ref));
446 kfree_rcu(ref, rcu_head);
454 struct ttm_ref_object *ref;
464 ref = drm_hash_entry(hash, struct ttm_ref_object, hash);
465 kref_put(&ref->kref, ttm_ref_object_release);
472 struct ttm_ref_object *ref;
487 ref = list_entry(list, struct ttm_ref_object, head);
488 ttm_ref_object_release(&ref->kref);