Lines Matching defs:attach

52  * @attach: attachment
58 static struct amdgpu_device *dma_buf_attach_adev(struct dma_buf_attachment *attach)
60 if (attach->importer_ops == &amdgpu_dma_buf_attach_ops) {
61 struct drm_gem_object *obj = attach->importer_priv;
71 * amdgpu_dma_buf_attach - &dma_buf_ops.attach implementation
73 * @dmabuf: DMA-buf where we attach to
74 * @attach: attachment to add
79 struct dma_buf_attachment *attach)
81 struct amdgpu_device *attach_adev = dma_buf_attach_adev(attach);
97 attach->peer2peer = false;
100 pci_p2pdma_distance(adev->pdev, attach->dev, false) < 0)
101 attach->peer2peer = false;
117 * @attach: attachment to pin down
121 static int amdgpu_dma_buf_pin(struct dma_buf_attachment *attach)
123 struct dma_buf *dmabuf = attach->dmabuf;
137 list_for_each_entry(attach, &dmabuf->attachments, node)
138 if (!attach->peer2peer)
153 * @attach: attachment to unpin
157 static void amdgpu_dma_buf_unpin(struct dma_buf_attachment *attach)
159 struct drm_gem_object *obj = attach->dmabuf->priv;
167 * @attach: DMA-buf attachment
178 static struct sg_table *amdgpu_dma_buf_map(struct dma_buf_attachment *attach,
181 struct dma_buf *dma_buf = attach->dmabuf;
194 attach->peer2peer) {
212 if (dma_map_sgtable(attach->dev, sgt, dir,
220 dma_buf_attach_adev(attach), bo)))
224 bo->tbo.base.size, attach->dev,
232 attach->dev, dir, &sgt);
251 * @attach: DMA-buf attachment
258 static void amdgpu_dma_buf_unmap(struct dma_buf_attachment *attach,
262 struct drm_gem_object *obj = attach->dmabuf->priv;
267 amdgpu_ttm_mmio_remap_free_sgt(attach->dev, dir, sgt);
272 dma_unmap_sgtable(attach->dev, sgt, dir, 0);
276 amdgpu_vram_mgr_free_sgt(attach->dev, dir, sgt);
352 .attach = amdgpu_dma_buf_attach,
455 * amdgpu_dma_buf_move_notify - &attach.invalidate_mappings implementation
457 * @attach: the DMA-buf attachment
463 amdgpu_dma_buf_move_notify(struct dma_buf_attachment *attach)
465 struct drm_gem_object *obj = attach->importer_priv;
549 struct dma_buf_attachment *attach;
568 attach = dma_buf_dynamic_attach(dma_buf, dev->dev,
570 if (IS_ERR(attach)) {
572 return ERR_CAST(attach);
576 obj->import_attach = attach;