• Home
  • Raw
  • Download

Lines Matching refs:channel

42 	struct host1x *host = dev_get_drvdata(job->channel->dev->parent);  in host1x_job_submit()
47 struct host1x_channel *host1x_channel_get(struct host1x_channel *channel) in host1x_channel_get() argument
51 mutex_lock(&channel->reflock); in host1x_channel_get()
53 if (channel->refcount == 0) in host1x_channel_get()
54 err = host1x_cdma_init(&channel->cdma); in host1x_channel_get()
57 channel->refcount++; in host1x_channel_get()
59 mutex_unlock(&channel->reflock); in host1x_channel_get()
61 return err ? NULL : channel; in host1x_channel_get()
64 void host1x_channel_put(struct host1x_channel *channel) in host1x_channel_put() argument
66 mutex_lock(&channel->reflock); in host1x_channel_put()
68 if (channel->refcount == 1) { in host1x_channel_put()
69 struct host1x *host = dev_get_drvdata(channel->dev->parent); in host1x_channel_put()
71 host1x_hw_cdma_stop(host, &channel->cdma); in host1x_channel_put()
72 host1x_cdma_deinit(&channel->cdma); in host1x_channel_put()
75 channel->refcount--; in host1x_channel_put()
77 mutex_unlock(&channel->reflock); in host1x_channel_put()
84 struct host1x_channel *channel = NULL; in host1x_channel_request() local
93 channel = kzalloc(sizeof(*channel), GFP_KERNEL); in host1x_channel_request()
94 if (!channel) in host1x_channel_request()
97 err = host1x_hw_channel_init(host, channel, index); in host1x_channel_request()
102 channel->dev = dev; in host1x_channel_request()
105 list_add_tail(&channel->list, &host->chlist.list); in host1x_channel_request()
110 return channel; in host1x_channel_request()
114 kfree(channel); in host1x_channel_request()
119 void host1x_channel_free(struct host1x_channel *channel) in host1x_channel_free() argument
121 struct host1x *host = dev_get_drvdata(channel->dev->parent); in host1x_channel_free()
123 host->allocated_channels &= ~BIT(channel->id); in host1x_channel_free()
124 list_del(&channel->list); in host1x_channel_free()
125 kfree(channel); in host1x_channel_free()