Lines Matching full:attach
46 * amdgpu_dma_buf_attach - &dma_buf_ops.attach implementation
48 * @dmabuf: DMA-buf where we attach to
49 * @attach: attachment to add
54 struct dma_buf_attachment *attach) in amdgpu_dma_buf_attach() argument
60 if (pci_p2pdma_distance(adev->pdev, attach->dev, false) < 0) in amdgpu_dma_buf_attach()
61 attach->peer2peer = false; in amdgpu_dma_buf_attach()
69 * @attach: attachment to pin down
73 static int amdgpu_dma_buf_pin(struct dma_buf_attachment *attach) in amdgpu_dma_buf_pin() argument
75 struct drm_gem_object *obj = attach->dmabuf->priv; in amdgpu_dma_buf_pin()
85 * @attach: attachment to unpin
89 static void amdgpu_dma_buf_unpin(struct dma_buf_attachment *attach) in amdgpu_dma_buf_unpin() argument
91 struct drm_gem_object *obj = attach->dmabuf->priv; in amdgpu_dma_buf_unpin()
99 * @attach: DMA-buf attachment
110 static struct sg_table *amdgpu_dma_buf_map(struct dma_buf_attachment *attach, in amdgpu_dma_buf_map() argument
113 struct dma_buf *dma_buf = attach->dmabuf; in amdgpu_dma_buf_map()
126 attach->peer2peer) { in amdgpu_dma_buf_map()
147 if (dma_map_sgtable(attach->dev, sgt, dir, in amdgpu_dma_buf_map()
154 bo->tbo.base.size, attach->dev, in amdgpu_dma_buf_map()
173 * @attach: DMA-buf attachment
180 static void amdgpu_dma_buf_unmap(struct dma_buf_attachment *attach, in amdgpu_dma_buf_unmap() argument
185 dma_unmap_sgtable(attach->dev, sgt, dir, 0); in amdgpu_dma_buf_unmap()
189 amdgpu_vram_mgr_free_sgt(attach->dev, dir, sgt); in amdgpu_dma_buf_unmap()
235 .attach = amdgpu_dma_buf_attach,
326 * amdgpu_dma_buf_move_notify - &attach.move_notify implementation
328 * @attach: the DMA-buf attachment
334 amdgpu_dma_buf_move_notify(struct dma_buf_attachment *attach) in amdgpu_dma_buf_move_notify() argument
336 struct drm_gem_object *obj = attach->importer_priv; in amdgpu_dma_buf_move_notify()
413 struct dma_buf_attachment *attach; in amdgpu_gem_prime_import() local
432 attach = dma_buf_dynamic_attach(dma_buf, dev->dev, in amdgpu_gem_prime_import()
434 if (IS_ERR(attach)) { in amdgpu_gem_prime_import()
436 return ERR_CAST(attach); in amdgpu_gem_prime_import()
440 obj->import_attach = attach; in amdgpu_gem_prime_import()