Lines Matching refs:dr
58 static void free_dr(struct drmres *dr) in free_dr() argument
60 kfree_const(dr->node.name); in free_dr()
61 kfree(dr); in free_dr()
66 struct drmres *dr, *tmp; in drm_managed_release() local
69 list_for_each_entry_safe(dr, tmp, &dev->managed.resources, node.entry) { in drm_managed_release()
71 dr, dr->node.name, dr->node.size); in drm_managed_release()
73 if (dr->node.release) in drm_managed_release()
74 dr->node.release(dev, dr->node.size ? *(void **)&dr->data : NULL); in drm_managed_release()
76 list_del(&dr->node.entry); in drm_managed_release()
77 free_dr(dr); in drm_managed_release()
90 struct drmres *dr; in alloc_dr() local
93 if (unlikely(check_add_overflow(sizeof(*dr), size, &tot_size))) in alloc_dr()
96 dr = kmalloc_node_track_caller(tot_size, gfp, nid); in alloc_dr()
97 if (unlikely(!dr)) in alloc_dr()
100 memset(dr, 0, offsetof(struct drmres, data)); in alloc_dr()
102 INIT_LIST_HEAD(&dr->node.entry); in alloc_dr()
103 dr->node.release = release; in alloc_dr()
104 dr->node.size = size; in alloc_dr()
106 return dr; in alloc_dr()
109 static void del_dr(struct drm_device *dev, struct drmres *dr) in del_dr() argument
111 list_del_init(&dr->node.entry); in del_dr()
114 dr, dr->node.name, (unsigned long) dr->node.size); in del_dr()
117 static void add_dr(struct drm_device *dev, struct drmres *dr) in add_dr() argument
122 list_add(&dr->node.entry, &dev->managed.resources); in add_dr()
126 dr, dr->node.name, (unsigned long) dr->node.size); in add_dr()
141 struct drmres *dr; in __drmm_add_action() local
144 dr = alloc_dr(action, data ? sizeof(void*) : 0, in __drmm_add_action()
147 if (!dr) { in __drmm_add_action()
153 dr->node.name = kstrdup_const(name, GFP_KERNEL); in __drmm_add_action()
155 void_ptr = (void **)&dr->data; in __drmm_add_action()
159 add_dr(dev, dr); in __drmm_add_action()
191 struct drmres *dr; in drmm_kmalloc() local
193 dr = alloc_dr(NULL, size, gfp, dev_to_node(dev->dev)); in drmm_kmalloc()
194 if (!dr) { in drmm_kmalloc()
199 dr->node.name = kstrdup_const("kmalloc", GFP_KERNEL); in drmm_kmalloc()
201 add_dr(dev, dr); in drmm_kmalloc()
203 return dr->data; in drmm_kmalloc()
244 struct drmres *dr_match = NULL, *dr; in drmm_kfree() local
251 list_for_each_entry(dr, &dev->managed.resources, node.entry) { in drmm_kfree()
252 if (dr->data == data) { in drmm_kfree()
253 dr_match = dr; in drmm_kfree()