Lines Matching refs:dr

57 static void free_dr(struct drmres *dr)  in free_dr()  argument
59 kfree_const(dr->node.name); in free_dr()
60 kfree(dr); in free_dr()
65 struct drmres *dr, *tmp; in drm_managed_release() local
68 list_for_each_entry_safe(dr, tmp, &dev->managed.resources, node.entry) { in drm_managed_release()
70 dr, dr->node.name, dr->node.size); in drm_managed_release()
72 if (dr->node.release) in drm_managed_release()
73 dr->node.release(dev, dr->node.size ? *(void **)&dr->data : NULL); in drm_managed_release()
75 list_del(&dr->node.entry); in drm_managed_release()
76 free_dr(dr); in drm_managed_release()
89 struct drmres *dr; in alloc_dr() local
92 if (unlikely(check_add_overflow(sizeof(*dr), size, &tot_size))) in alloc_dr()
95 dr = kmalloc_node_track_caller(tot_size, gfp, nid); in alloc_dr()
96 if (unlikely(!dr)) in alloc_dr()
99 memset(dr, 0, offsetof(struct drmres, data)); in alloc_dr()
101 INIT_LIST_HEAD(&dr->node.entry); in alloc_dr()
102 dr->node.release = release; in alloc_dr()
103 dr->node.size = size; in alloc_dr()
105 return dr; in alloc_dr()
108 static void del_dr(struct drm_device *dev, struct drmres *dr) in del_dr() argument
110 list_del_init(&dr->node.entry); in del_dr()
113 dr, dr->node.name, (unsigned long) dr->node.size); in del_dr()
116 static void add_dr(struct drm_device *dev, struct drmres *dr) in add_dr() argument
121 list_add(&dr->node.entry, &dev->managed.resources); in add_dr()
125 dr, dr->node.name, (unsigned long) dr->node.size); in add_dr()
140 struct drmres *dr; in __drmm_add_action() local
143 dr = alloc_dr(action, data ? sizeof(void*) : 0, in __drmm_add_action()
146 if (!dr) { in __drmm_add_action()
152 dr->node.name = kstrdup_const(name, GFP_KERNEL); in __drmm_add_action()
154 void_ptr = (void **)&dr->data; in __drmm_add_action()
158 add_dr(dev, dr); in __drmm_add_action()
190 struct drmres *dr; in drmm_kmalloc() local
192 dr = alloc_dr(NULL, size, gfp, dev_to_node(dev->dev)); in drmm_kmalloc()
193 if (!dr) { in drmm_kmalloc()
198 dr->node.name = kstrdup_const("kmalloc", GFP_KERNEL); in drmm_kmalloc()
200 add_dr(dev, dr); in drmm_kmalloc()
202 return dr->data; in drmm_kmalloc()
243 struct drmres *dr_match = NULL, *dr; in drmm_kfree() local
250 list_for_each_entry(dr, &dev->managed.resources, node.entry) { in drmm_kfree()
251 if (dr->data == data) { in drmm_kfree()
252 dr_match = dr; in drmm_kfree()