Lines Matching full:attach
26 struct dma_buf_attachment *attach) in xe_dma_buf_attach() argument
28 struct drm_gem_object *obj = attach->dmabuf->priv; in xe_dma_buf_attach()
30 if (attach->peer2peer && in xe_dma_buf_attach()
31 pci_p2pdma_distance(to_pci_dev(obj->dev->dev), attach->dev, false) < 0) in xe_dma_buf_attach()
32 attach->peer2peer = false; in xe_dma_buf_attach()
34 if (!attach->peer2peer && !xe_bo_can_migrate(gem_to_xe_bo(obj), XE_PL_TT)) in xe_dma_buf_attach()
42 struct dma_buf_attachment *attach) in xe_dma_buf_detach() argument
44 struct drm_gem_object *obj = attach->dmabuf->priv; in xe_dma_buf_detach()
49 static int xe_dma_buf_pin(struct dma_buf_attachment *attach) in xe_dma_buf_pin() argument
51 struct dma_buf *dmabuf = attach->dmabuf; in xe_dma_buf_pin()
59 list_for_each_entry(attach, &dmabuf->attachments, node) { in xe_dma_buf_pin()
60 if (!attach->peer2peer) { in xe_dma_buf_pin()
89 static void xe_dma_buf_unpin(struct dma_buf_attachment *attach) in xe_dma_buf_unpin() argument
91 struct drm_gem_object *obj = attach->dmabuf->priv; in xe_dma_buf_unpin()
97 static struct sg_table *xe_dma_buf_map(struct dma_buf_attachment *attach, in xe_dma_buf_map() argument
100 struct dma_buf *dma_buf = attach->dmabuf; in xe_dma_buf_map()
107 if (!attach->peer2peer && !xe_bo_can_migrate(bo, XE_PL_TT)) in xe_dma_buf_map()
111 if (!attach->peer2peer) in xe_dma_buf_map()
127 if (dma_map_sgtable(attach->dev, sgt, dir, in xe_dma_buf_map()
136 bo->ttm.base.size, attach->dev, in xe_dma_buf_map()
153 static void xe_dma_buf_unmap(struct dma_buf_attachment *attach, in xe_dma_buf_unmap() argument
158 dma_unmap_sgtable(attach->dev, sgt, dir, 0); in xe_dma_buf_unmap()
162 xe_ttm_vram_mgr_free_sgt(attach->dev, dir, sgt); in xe_dma_buf_unmap()
209 .attach = xe_dma_buf_attach,
318 static void xe_dma_buf_move_notify(struct dma_buf_attachment *attach) in xe_dma_buf_move_notify() argument
320 struct drm_gem_object *obj = attach->importer_priv; in xe_dma_buf_move_notify()
352 struct dma_buf_attachment *attach; in xe_gem_prime_import() local
369 * This needs to happen before the attach, since it will create a new in xe_gem_prime_import()
385 attach = dma_buf_dynamic_attach(dma_buf, dev->dev, attach_ops, obj); in xe_gem_prime_import()
386 if (IS_ERR(attach)) { in xe_gem_prime_import()
388 return ERR_CAST(attach); in xe_gem_prime_import()
392 obj->import_attach = attach; in xe_gem_prime_import()