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()
98 device_unregister(&cdl->devs[i].dev); in host1x_memory_context_list_init()
100 kfree(cdl->devs); in host1x_memory_context_list_init()
101 cdl->devs = NULL; in host1x_memory_context_list_init()
102 cdl->len = 0; in host1x_memory_context_list_init()
107 void host1x_memory_context_list_free(struct host1x_memory_context_list *cdl) in host1x_memory_context_list_free() argument
111 for (i = 0; i < cdl->len; i++) in host1x_memory_context_list_free()
112 device_unregister(&cdl->devs[i].dev); in host1x_memory_context_list_free()
114 kfree(cdl->devs); in host1x_memory_context_list_free()
115 cdl->len = 0; in host1x_memory_context_list_free()
122 struct host1x_memory_context_list *cdl = &host1x->context_list; in host1x_memory_context_alloc() local
126 if (!cdl->len) in host1x_memory_context_alloc()
129 mutex_lock(&cdl->lock); in host1x_memory_context_alloc()
131 for (i = 0; i < cdl->len; i++) { in host1x_memory_context_alloc()
132 struct host1x_memory_context *cd = &cdl->devs[i]; in host1x_memory_context_alloc()
139 mutex_unlock(&cdl->lock); in host1x_memory_context_alloc()
147 mutex_unlock(&cdl->lock); in host1x_memory_context_alloc()
154 mutex_unlock(&cdl->lock); in host1x_memory_context_alloc()
168 struct host1x_memory_context_list *cdl = &cd->host->context_list; in host1x_memory_context_put() local
170 if (refcount_dec_and_mutex_lock(&cd->ref, &cdl->lock)) { in host1x_memory_context_put()
173 mutex_unlock(&cdl->lock); in host1x_memory_context_put()