Lines Matching defs:tags
34 struct nvkm_tags *tags = *ptags;
35 if (tags) {
36 mutex_lock(&fb->tags.mutex);
37 if (refcount_dec_and_test(&tags->refcount)) {
38 nvkm_mm_free(&fb->tags.mm, &tags->mn);
39 kfree(memory->tags);
40 memory->tags = NULL;
42 mutex_unlock(&fb->tags.mutex);
53 struct nvkm_tags *tags;
55 mutex_lock(&fb->tags.mutex);
56 if ((tags = memory->tags)) {
61 if (tags->mn && tags->mn->length != nr) {
62 mutex_unlock(&fb->tags.mutex);
66 refcount_inc(&tags->refcount);
67 mutex_unlock(&fb->tags.mutex);
68 *ptags = tags;
72 if (!(tags = kmalloc(sizeof(*tags), GFP_KERNEL))) {
73 mutex_unlock(&fb->tags.mutex);
77 if (!nvkm_mm_head(&fb->tags.mm, 0, 1, nr, nr, 1, &tags->mn)) {
79 clr(device, tags->mn->offset, tags->mn->length);
90 tags->mn = NULL;
93 refcount_set(&tags->refcount, 1);
94 *ptags = memory->tags = tags;
95 mutex_unlock(&fb->tags.mutex);