Lines Matching refs:channel
42 struct host1x *host = dev_get_drvdata(job->channel->dev->parent); in host1x_job_submit()
48 struct host1x_channel *host1x_channel_get(struct host1x_channel *channel) in host1x_channel_get() argument
52 mutex_lock(&channel->reflock); in host1x_channel_get()
54 if (channel->refcount == 0) in host1x_channel_get()
55 err = host1x_cdma_init(&channel->cdma); in host1x_channel_get()
58 channel->refcount++; in host1x_channel_get()
60 mutex_unlock(&channel->reflock); in host1x_channel_get()
62 return err ? NULL : channel; in host1x_channel_get()
66 void host1x_channel_put(struct host1x_channel *channel) in host1x_channel_put() argument
68 mutex_lock(&channel->reflock); in host1x_channel_put()
70 if (channel->refcount == 1) { in host1x_channel_put()
71 struct host1x *host = dev_get_drvdata(channel->dev->parent); in host1x_channel_put()
73 host1x_hw_cdma_stop(host, &channel->cdma); in host1x_channel_put()
74 host1x_cdma_deinit(&channel->cdma); in host1x_channel_put()
77 channel->refcount--; in host1x_channel_put()
79 mutex_unlock(&channel->reflock); in host1x_channel_put()
87 struct host1x_channel *channel = NULL; in host1x_channel_request() local
96 channel = kzalloc(sizeof(*channel), GFP_KERNEL); in host1x_channel_request()
97 if (!channel) in host1x_channel_request()
100 err = host1x_hw_channel_init(host, channel, index); in host1x_channel_request()
105 channel->dev = dev; in host1x_channel_request()
108 list_add_tail(&channel->list, &host->chlist.list); in host1x_channel_request()
113 return channel; in host1x_channel_request()
117 kfree(channel); in host1x_channel_request()
123 void host1x_channel_free(struct host1x_channel *channel) in host1x_channel_free() argument
125 struct host1x *host = dev_get_drvdata(channel->dev->parent); in host1x_channel_free()
127 host->allocated_channels &= ~BIT(channel->id); in host1x_channel_free()
128 list_del(&channel->list); in host1x_channel_free()
129 kfree(channel); in host1x_channel_free()