Lines Matching defs:attach
185 struct dma_buf_attachment *attach;
188 attach = kmem_zalloc(sizeof(*attach), KM_SLEEP);
189 attach->dmabuf = dmabuf;
190 attach->dev = dmat;
191 attach->dynamic_mapping = dynamic_mapping;
194 if (dmabuf->ops->attach)
195 ret = dmabuf->ops->attach(dmabuf, attach);
200 if (attach->dynamic_mapping != dmabuf->ops->dynamic_mapping)
203 return attach;
205 fail0: kmem_free(attach, sizeof(*attach));
217 dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *attach)
222 dmabuf->ops->detach(dmabuf, attach);
225 kmem_free(attach, sizeof(*attach));
229 dma_buf_map_attachment(struct dma_buf_attachment *attach,
234 if (attach->dmabuf->ops->dynamic_mapping)
235 dma_resv_lock(attach->dmabuf->resv, NULL);
236 sg = attach->dmabuf->ops->map_dma_buf(attach, dir);
237 if (attach->dmabuf->ops->dynamic_mapping)
238 dma_resv_unlock(attach->dmabuf->resv);
244 dma_buf_unmap_attachment(struct dma_buf_attachment *attach,
248 if (attach->dmabuf->ops->dynamic_mapping)
249 dma_resv_lock(attach->dmabuf->resv, NULL);
250 attach->dmabuf->ops->unmap_dma_buf(attach, sg, dir);
251 if (attach->dmabuf->ops->dynamic_mapping)
252 dma_resv_unlock(attach->dmabuf->resv);