Lines Matching refs:cdl

23 	struct host1x_memory_context_list *cdl = &host1x->context_list;  in host1x_memory_context_list_init()  local
29 cdl->devs = NULL; in host1x_memory_context_list_init()
30 cdl->len = 0; in host1x_memory_context_list_init()
31 mutex_init(&cdl->lock); in host1x_memory_context_list_init()
37 cdl->len = err / 4; in host1x_memory_context_list_init()
38 cdl->devs = kcalloc(cdl->len, sizeof(*cdl->devs), GFP_KERNEL); in host1x_memory_context_list_init()
39 if (!cdl->devs) in host1x_memory_context_list_init()
42 for (i = 0; i < cdl->len; i++) { in host1x_memory_context_list_init()
43 ctx = &cdl->devs[i]; in host1x_memory_context_list_init()
99 device_unregister(&cdl->devs[i].dev); in host1x_memory_context_list_init()
101 kfree(cdl->devs); in host1x_memory_context_list_init()
102 cdl->devs = NULL; in host1x_memory_context_list_init()
103 cdl->len = 0; in host1x_memory_context_list_init()
108 void host1x_memory_context_list_free(struct host1x_memory_context_list *cdl) in host1x_memory_context_list_free() argument
112 for (i = 0; i < cdl->len; i++) in host1x_memory_context_list_free()
113 device_unregister(&cdl->devs[i].dev); in host1x_memory_context_list_free()
115 kfree(cdl->devs); in host1x_memory_context_list_free()
116 cdl->len = 0; in host1x_memory_context_list_free()
123 struct host1x_memory_context_list *cdl = &host1x->context_list; in host1x_memory_context_alloc() local
127 if (!cdl->len) in host1x_memory_context_alloc()
130 mutex_lock(&cdl->lock); in host1x_memory_context_alloc()
132 for (i = 0; i < cdl->len; i++) { in host1x_memory_context_alloc()
133 struct host1x_memory_context *cd = &cdl->devs[i]; in host1x_memory_context_alloc()
140 mutex_unlock(&cdl->lock); in host1x_memory_context_alloc()
148 mutex_unlock(&cdl->lock); in host1x_memory_context_alloc()
155 mutex_unlock(&cdl->lock); in host1x_memory_context_alloc()
169 struct host1x_memory_context_list *cdl = &cd->host->context_list; in host1x_memory_context_put() local
171 if (refcount_dec_and_mutex_lock(&cd->ref, &cdl->lock)) { in host1x_memory_context_put()
174 mutex_unlock(&cdl->lock); in host1x_memory_context_put()