Lines Matching refs:cd
133 struct host1x_memory_context *cd = &cdl->devs[i]; in host1x_memory_context_alloc() local
135 if (cd->dev.iommu->iommu_dev != dev->iommu->iommu_dev) in host1x_memory_context_alloc()
138 if (cd->owner == pid) { in host1x_memory_context_alloc()
139 refcount_inc(&cd->ref); in host1x_memory_context_alloc()
141 return cd; in host1x_memory_context_alloc()
142 } else if (!cd->owner && !free) { in host1x_memory_context_alloc()
143 free = cd; in host1x_memory_context_alloc()
161 void host1x_memory_context_get(struct host1x_memory_context *cd) in host1x_memory_context_get() argument
163 refcount_inc(&cd->ref); in host1x_memory_context_get()
167 void host1x_memory_context_put(struct host1x_memory_context *cd) in host1x_memory_context_put() argument
169 struct host1x_memory_context_list *cdl = &cd->host->context_list; in host1x_memory_context_put()
171 if (refcount_dec_and_mutex_lock(&cd->ref, &cdl->lock)) { in host1x_memory_context_put()
172 put_pid(cd->owner); in host1x_memory_context_put()
173 cd->owner = NULL; in host1x_memory_context_put()