Lines Matching refs:attach

47  * amdgpu_dma_buf_attach - &dma_buf_ops.attach implementation
49 * @dmabuf: DMA-buf where we attach to
50 * @attach: attachment to add
55 struct dma_buf_attachment *attach)
61 if (pci_p2pdma_distance(adev->pdev, attach->dev, false) < 0)
62 attach->peer2peer = false;
72 * @attach: attachment to pin down
76 static int amdgpu_dma_buf_pin(struct dma_buf_attachment *attach)
78 struct dma_buf *dmabuf = attach->dmabuf;
89 list_for_each_entry(attach, &dmabuf->attachments, node)
90 if (!attach->peer2peer)
102 * @attach: attachment to unpin
106 static void amdgpu_dma_buf_unpin(struct dma_buf_attachment *attach)
108 struct drm_gem_object *obj = attach->dmabuf->priv;
116 * @attach: DMA-buf attachment
127 static struct sg_table *amdgpu_dma_buf_map(struct dma_buf_attachment *attach,
130 struct dma_buf *dma_buf = attach->dmabuf;
143 attach->peer2peer) {
161 if (dma_map_sgtable(attach->dev, sgt, dir,
168 bo->tbo.base.size, attach->dev,
187 * @attach: DMA-buf attachment
194 static void amdgpu_dma_buf_unmap(struct dma_buf_attachment *attach,
199 dma_unmap_sgtable(attach->dev, sgt, dir, 0);
203 amdgpu_vram_mgr_free_sgt(attach->dev, dir, sgt);
249 .attach = amdgpu_dma_buf_attach,
340 * amdgpu_dma_buf_move_notify - &attach.move_notify implementation
342 * @attach: the DMA-buf attachment
348 amdgpu_dma_buf_move_notify(struct dma_buf_attachment *attach)
350 struct drm_gem_object *obj = attach->importer_priv;
427 struct dma_buf_attachment *attach;
446 attach = dma_buf_dynamic_attach(dma_buf, dev->dev,
448 if (IS_ERR(attach)) {
450 return ERR_CAST(attach);
454 obj->import_attach = attach;