Lines Matching refs:chlist
16 int host1x_channel_list_init(struct host1x_channel_list *chlist, in host1x_channel_list_init() argument
19 chlist->channels = kcalloc(num_channels, sizeof(struct host1x_channel), in host1x_channel_list_init()
21 if (!chlist->channels) in host1x_channel_list_init()
24 chlist->allocated_channels = bitmap_zalloc(num_channels, GFP_KERNEL); in host1x_channel_list_init()
25 if (!chlist->allocated_channels) { in host1x_channel_list_init()
26 kfree(chlist->channels); in host1x_channel_list_init()
30 mutex_init(&chlist->lock); in host1x_channel_list_init()
35 void host1x_channel_list_free(struct host1x_channel_list *chlist) in host1x_channel_list_free() argument
37 bitmap_free(chlist->allocated_channels); in host1x_channel_list_free()
38 kfree(chlist->channels); in host1x_channel_list_free()
92 struct host1x_channel_list *chlist = &host->channel_list; in host1x_channel_stop_all() local
95 mutex_lock(&chlist->lock); in host1x_channel_stop_all()
97 for_each_set_bit(bit, chlist->allocated_channels, host->info->nb_channels) in host1x_channel_stop_all()
98 host1x_channel_stop(&chlist->channels[bit]); in host1x_channel_stop_all()
100 mutex_unlock(&chlist->lock); in host1x_channel_stop_all()
108 struct host1x_channel_list *chlist = &host->channel_list; in release_channel() local
113 clear_bit(channel->id, chlist->allocated_channels); in release_channel()
124 struct host1x_channel_list *chlist = &host->channel_list; in acquire_unused_channel() local
128 mutex_lock(&chlist->lock); in acquire_unused_channel()
130 index = find_first_zero_bit(chlist->allocated_channels, max_channels); in acquire_unused_channel()
132 mutex_unlock(&chlist->lock); in acquire_unused_channel()
137 chlist->channels[index].id = index; in acquire_unused_channel()
139 set_bit(index, chlist->allocated_channels); in acquire_unused_channel()
141 mutex_unlock(&chlist->lock); in acquire_unused_channel()
143 return &chlist->channels[index]; in acquire_unused_channel()
156 struct host1x_channel_list *chlist = &host->channel_list; in host1x_channel_request() local
180 clear_bit(channel->id, chlist->allocated_channels); in host1x_channel_request()