Home
last modified time | relevance | path

Searched refs:dma_buf (Results 1 – 25 of 126) sorted by relevance

123456

/linux/drivers/gpu/drm/
H A Ddrm_prime.c90 struct dma_buf *dma_buf; member
98 struct dma_buf *dma_buf, uint32_t handle) in drm_prime_add_buf_handle() argument
107 get_dma_buf(dma_buf); in drm_prime_add_buf_handle()
108 member->dma_buf = dma_buf; in drm_prime_add_buf_handle()
118 if (dma_buf > pos->dma_buf) in drm_prime_add_buf_handle()
144 static struct dma_buf *drm_prime_lookup_buf_by_handle(struct drm_prime_file_private *prime_fpriv, in drm_prime_lookup_buf_by_handle()
155 return member->dma_buf; in drm_prime_lookup_buf_by_handle()
166 struct dma_buf *dma_buf, in drm_prime_lookup_buf_handle() argument
176 if (member->dma_buf == dma_buf) { in drm_prime_lookup_buf_handle()
179 } else if (member->dma_buf < dma_buf) { in drm_prime_lookup_buf_handle()
[all …]
/linux/drivers/gpu/drm/i915/gem/
H A Di915_gem_dmabuf.c22 static struct drm_i915_gem_object *dma_buf_to_obj(struct dma_buf *buf)
69 static int i915_gem_dmabuf_vmap(struct dma_buf *dma_buf, in i915_gem_dmabuf_vmap() argument
72 struct drm_i915_gem_object *obj = dma_buf_to_obj(dma_buf); in i915_gem_dmabuf_vmap()
84 static void i915_gem_dmabuf_vunmap(struct dma_buf *dma_buf, in i915_gem_dmabuf_vunmap() argument
87 struct drm_i915_gem_object *obj = dma_buf_to_obj(dma_buf); in i915_gem_dmabuf_vunmap()
93 static int i915_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma) in i915_gem_dmabuf_mmap() argument
95 struct drm_i915_gem_object *obj = dma_buf_to_obj(dma_buf); in i915_gem_dmabuf_mmap()
117 static int i915_gem_begin_cpu_access(struct dma_buf *dma_buf, enum dma_data_direction direction) in i915_gem_begin_cpu_access() argument
119 struct drm_i915_gem_object *obj = dma_buf_to_obj(dma_buf); in i915_gem_begin_cpu_access()
142 static int i915_gem_end_cpu_access(struct dma_buf *dma_buf, enum dma_data_direction direction) in i915_gem_end_cpu_access() argument
[all …]
H A Di915_gem_dmabuf.h11 struct dma_buf;
14 struct dma_buf *dma_buf);
16 struct dma_buf *i915_gem_prime_export(struct drm_gem_object *gem_obj, int flags);
/linux/drivers/virtio/
H A Dvirtio_dma_buf.c20 struct dma_buf *virtio_dma_buf_export in virtio_dma_buf_export()
42 int virtio_dma_buf_attach(struct dma_buf *dma_buf, in virtio_dma_buf_attach() argument
47 container_of(dma_buf->ops, in virtio_dma_buf_attach()
51 ret = ops->device_attach(dma_buf, attach); in virtio_dma_buf_attach()
63 bool is_virtio_dma_buf(struct dma_buf *dma_buf) in is_virtio_dma_buf() argument
65 return dma_buf->ops->attach == &virtio_dma_buf_attach; in is_virtio_dma_buf()
76 int virtio_dma_buf_get_uuid(struct dma_buf *dma_buf, in virtio_dma_buf_get_uuid() argument
80 container_of(dma_buf->ops, in virtio_dma_buf_get_uuid()
83 if (!is_virtio_dma_buf(dma_buf)) in virtio_dma_buf_get_uuid()
86 return ops->get_uuid(dma_buf, uuid); in virtio_dma_buf_get_uuid()
/linux/include/linux/
H A Dvirtio_dma_buf.h24 int (*device_attach)(struct dma_buf *dma_buf,
26 int (*get_uuid)(struct dma_buf *dma_buf, uuid_t *uuid);
29 int virtio_dma_buf_attach(struct dma_buf *dma_buf,
32 struct dma_buf *virtio_dma_buf_export
34 bool is_virtio_dma_buf(struct dma_buf *dma_buf);
35 int virtio_dma_buf_get_uuid(struct dma_buf *dma_buf, uuid_t *uuid);
/linux/drivers/gpu/drm/amd/amdgpu/
H A Damdgpu_dma_buf.c78 static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf, in amdgpu_dma_buf_attach()
123 struct dma_buf *dmabuf = attach->dmabuf; in amdgpu_dma_buf_pin()
185 struct dma_buf *dma_buf = attach->dmabuf; in amdgpu_dma_buf_map() local
186 struct drm_gem_object *obj = dma_buf->priv; in amdgpu_dma_buf_map()
296 static int amdgpu_dma_buf_begin_cpu_access(struct dma_buf *dma_buf, in amdgpu_dma_buf_begin_cpu_access() argument
299 struct amdgpu_bo *bo = gem_to_amdgpu_bo(dma_buf->priv); in amdgpu_dma_buf_begin_cpu_access()
325 static int amdgpu_dma_buf_vmap(struct dma_buf *dma_buf, struct iosys_map *map) in amdgpu_dma_buf_vmap() argument
327 struct drm_gem_object *obj = dma_buf->priv; in amdgpu_dma_buf_vmap()
339 ret = drm_gem_dmabuf_vmap(dma_buf, map); in amdgpu_dma_buf_vmap()
346 static void amdgpu_dma_buf_vunmap(struct dma_buf *dma_buf, struct iosys_map *map) in amdgpu_dma_buf_vunmap() argument
[all …]
H A Damdgpu_dma_buf.h28 struct dma_buf *amdgpu_gem_prime_export(struct drm_gem_object *gobj,
31 struct dma_buf *dma_buf);
/linux/drivers/gpu/drm/vmwgfx/
H A Dttm_object.c96 void (*dmabuf_release)(struct dma_buf *dma_buf);
130 static void ttm_prime_dmabuf_release(struct dma_buf *dma_buf);
472 static bool __must_check get_dma_buf_unless_doomed(struct dma_buf *dmabuf) in get_dma_buf_unless_doomed()
494 BUG_ON(prime->dma_buf != NULL); in ttm_prime_refcount_release()
510 static void ttm_prime_dmabuf_release(struct dma_buf *dma_buf) in ttm_prime_dmabuf_release() argument
513 (struct ttm_prime_object *) dma_buf->priv; in ttm_prime_dmabuf_release()
518 tdev->dmabuf_release(dma_buf); in ttm_prime_dmabuf_release()
520 if (prime->dma_buf == dma_buf) in ttm_prime_dmabuf_release()
521 prime->dma_buf = NULL; in ttm_prime_dmabuf_release()
541 struct dma_buf *dma_buf; in ttm_prime_fd_to_handle() local
[all …]
/linux/drivers/accel/ivpu/
H A Divpu_gem_userptr.c43 static void ivpu_gem_userptr_dmabuf_release(struct dma_buf *dma_buf) in ivpu_gem_userptr_dmabuf_release() argument
45 struct sg_table *sgt = dma_buf->priv; in ivpu_gem_userptr_dmabuf_release()
64 static struct dma_buf *
69 struct dma_buf *dma_buf; in ivpu_create_userptr_dmabuf() local
116 dma_buf = dma_buf_export(&exp_info); in ivpu_create_userptr_dmabuf()
117 if (IS_ERR(dma_buf)) { in ivpu_create_userptr_dmabuf()
118 ret = PTR_ERR(dma_buf); in ivpu_create_userptr_dmabuf()
124 return dma_buf; in ivpu_create_userptr_dmabuf()
142 struct dma_buf *dma_buf; in ivpu_bo_create_from_userptr() local
146 dma_buf = ivpu_create_userptr_dmabuf(vdev, user_ptr, size, flags); in ivpu_bo_create_from_userptr()
[all …]
/linux/drivers/gpu/drm/omapdrm/
H A Domap_gem_dmabuf.c40 static int omap_gem_dmabuf_begin_cpu_access(struct dma_buf *buffer, in omap_gem_dmabuf_begin_cpu_access()
55 static int omap_gem_dmabuf_end_cpu_access(struct dma_buf *buffer, in omap_gem_dmabuf_end_cpu_access()
63 static int omap_gem_dmabuf_mmap(struct dma_buf *buffer, in omap_gem_dmabuf_mmap()
80 struct dma_buf *omap_gem_prime_export(struct drm_gem_object *obj, int flags) in omap_gem_prime_export()
98 struct dma_buf *dma_buf) in omap_gem_prime_import() argument
105 if (dma_buf->ops == &omap_dmabuf_ops) { in omap_gem_prime_import()
106 obj = dma_buf->priv; in omap_gem_prime_import()
117 attach = dma_buf_attach(dma_buf, dev->dev); in omap_gem_prime_import()
121 get_dma_buf(dma_buf); in omap_gem_prime_import()
129 obj = omap_gem_new_dmabuf(dev, dma_buf->size, sgt); in omap_gem_prime_import()
[all …]
/linux/drivers/gpu/drm/xe/
H A Dxe_dma_buf.c25 static int xe_dma_buf_attach(struct dma_buf *dmabuf, in xe_dma_buf_attach()
41 static void xe_dma_buf_detach(struct dma_buf *dmabuf, in xe_dma_buf_detach()
51 struct dma_buf *dmabuf = attach->dmabuf; in xe_dma_buf_pin()
104 struct dma_buf *dma_buf = attach->dmabuf; in xe_dma_buf_map() local
105 struct drm_gem_object *obj = dma_buf->priv; in xe_dma_buf_map()
170 static int xe_dma_buf_begin_cpu_access(struct dma_buf *dma_buf, in xe_dma_buf_begin_cpu_access() argument
173 struct drm_gem_object *obj = dma_buf->priv; in xe_dma_buf_begin_cpu_access()
214 struct dma_buf *xe_gem_prime_export(struct drm_gem_object *obj, int flags) in xe_gem_prime_export()
217 struct dma_buf *buf; in xe_gem_prime_export()
243 struct dma_buf *dma_buf) in xe_dma_buf_init_obj() argument
[all …]
H A Dxe_dma_buf.h11 struct dma_buf *xe_gem_prime_export(struct drm_gem_object *obj, int flags);
13 struct dma_buf *dma_buf);
/linux/drivers/gpu/drm/i915/gem/selftests/
H A Dmock_dmabuf.c54 static void mock_dmabuf_release(struct dma_buf *dma_buf) in mock_dmabuf_release() argument
56 struct mock_dmabuf *mock = to_mock(dma_buf); in mock_dmabuf_release()
65 static int mock_dmabuf_vmap(struct dma_buf *dma_buf, struct iosys_map *map) in mock_dmabuf_vmap() argument
67 struct mock_dmabuf *mock = to_mock(dma_buf); in mock_dmabuf_vmap()
78 static void mock_dmabuf_vunmap(struct dma_buf *dma_buf, struct iosys_map *map) in mock_dmabuf_vunmap() argument
80 struct mock_dmabuf *mock = to_mock(dma_buf); in mock_dmabuf_vunmap()
85 static int mock_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma) in mock_dmabuf_mmap() argument
99 static struct dma_buf *mock_dmabuf(int npages) in mock_dmabuf()
103 struct dma_buf *dmabuf; in mock_dmabuf()
/linux/drivers/scsi/lpfc/
H A Dlpfc_mem.c562 struct hbq_dmabuf *dma_buf; in lpfc_sli4_rb_alloc() local
564 dma_buf = kzalloc_obj(struct hbq_dmabuf); in lpfc_sli4_rb_alloc()
565 if (!dma_buf) in lpfc_sli4_rb_alloc()
568 dma_buf->hbuf.virt = dma_pool_alloc(phba->lpfc_hrb_pool, GFP_KERNEL, in lpfc_sli4_rb_alloc()
569 &dma_buf->hbuf.phys); in lpfc_sli4_rb_alloc()
570 if (!dma_buf->hbuf.virt) { in lpfc_sli4_rb_alloc()
571 kfree(dma_buf); in lpfc_sli4_rb_alloc()
574 dma_buf->dbuf.virt = dma_pool_alloc(phba->lpfc_drb_pool, GFP_KERNEL, in lpfc_sli4_rb_alloc()
575 &dma_buf->dbuf.phys); in lpfc_sli4_rb_alloc()
576 if (!dma_buf->dbuf.virt) { in lpfc_sli4_rb_alloc()
[all …]
/linux/drivers/dma-buf/
H A Ddma-buf.c67 static void __dma_buf_list_add(struct dma_buf *dmabuf) in __dma_buf_list_add()
74 static void __dma_buf_list_del(struct dma_buf *dmabuf) in __dma_buf_list_del()
96 struct dma_buf *dma_buf_iter_begin(void) in dma_buf_iter_begin()
98 struct dma_buf *ret = NULL, *dmabuf; in dma_buf_iter_begin()
129 struct dma_buf *dma_buf_iter_next(struct dma_buf *dmabuf) in dma_buf_iter_next()
131 struct dma_buf *ret = NULL; in dma_buf_iter_next()
152 struct dma_buf *dmabuf; in dmabuffs_dname()
168 struct dma_buf *dmabuf; in dma_buf_release()
230 struct dma_buf *dmabuf; in dma_buf_mmap_internal()
253 struct dma_buf *dmabuf; in dma_buf_llseek()
[all …]
/linux/kernel/bpf/
H A Ddmabuf_iter.c16 struct dma_buf *dmabuf;
24 struct dma_buf *dmabuf = p->dmabuf; in dmabuf_iter_seq_start()
42 struct dma_buf *dmabuf = v; in dmabuf_iter_seq_next()
51 __bpf_md_ptr(struct dma_buf *, dmabuf);
78 struct dma_buf *dmabuf = v; in dmabuf_iter_seq_stop()
135 DEFINE_BPF_ITER_FUNC(dmabuf, struct bpf_iter_meta *meta, struct dma_buf *dmabuf) in DEFINE_BPF_ITER_FUNC()
136 BTF_ID_LIST_SINGLE(bpf_dmabuf_btf_id, struct, dma_buf) in DEFINE_BPF_ITER_FUNC()
156 struct dma_buf *dmabuf;
172 __bpf_kfunc struct dma_buf *bpf_iter_dmabuf_next(struct bpf_iter_dmabuf *it) in bpf_iter_dmabuf_next()
/linux/drivers/i2c/busses/
H A Di2c-qcom-geni.c95 void **dma_buf; member
114 void *dma_buf; member
421 if (gi2c->dma_buf) { in geni_i2c_rx_msg_cleanup()
425 i2c_put_dma_safe_msg_buf(gi2c->dma_buf, cur, !gi2c->err); in geni_i2c_rx_msg_cleanup()
433 if (gi2c->dma_buf) { in geni_i2c_tx_msg_cleanup()
437 i2c_put_dma_safe_msg_buf(gi2c->dma_buf, cur, !gi2c->err); in geni_i2c_tx_msg_cleanup()
446 void *dma_buf; in geni_i2c_rx_one_msg() local
451 dma_buf = gi2c->no_dma ? NULL : i2c_get_dma_safe_msg_buf(msg, 32); in geni_i2c_rx_one_msg()
452 if (dma_buf) in geni_i2c_rx_one_msg()
460 if (dma_buf && geni_se_rx_dma_prep(se, dma_buf, len, &rx_dma)) { in geni_i2c_rx_one_msg()
[all …]
/linux/drivers/scsi/csiostor/
H A Dcsio_scsi.c206 struct csio_dma_buf *dma_buf; in csio_scsi_init_cmd_wr() local
222 dma_buf = &req->dma_buf; in csio_scsi_init_cmd_wr()
225 wr->rsp_dmalen = cpu_to_be32(dma_buf->len); in csio_scsi_init_cmd_wr()
226 wr->rsp_dmaaddr = cpu_to_be64(dma_buf->paddr); in csio_scsi_init_cmd_wr()
298 struct csio_dma_buf *dma_buf; in csio_scsi_init_ultptx_dsgl() local
329 dma_buf = (struct csio_dma_buf *)tmp; in csio_scsi_init_ultptx_dsgl()
331 sgl->addr0 = cpu_to_be64(dma_buf->paddr); in csio_scsi_init_ultptx_dsgl()
333 min(xfer_len, dma_buf->len)); in csio_scsi_init_ultptx_dsgl()
336 sge_pair->addr[1] = cpu_to_be64(dma_buf->paddr); in csio_scsi_init_ultptx_dsgl()
338 min(xfer_len, dma_buf->len)); in csio_scsi_init_ultptx_dsgl()
[all …]
/linux/drivers/accel/amdxdna/
H A Damdxdna_gem.c300 ret = dma_buf_mmap(abo->dma_buf, vma, 0); in amdxdna_insert_pages()
353 static int amdxdna_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma) in amdxdna_gem_dmabuf_mmap() argument
355 struct drm_gem_object *gobj = dma_buf->priv; in amdxdna_gem_dmabuf_mmap()
401 ret = dma_buf_vmap_unlocked(abo->dma_buf, &map); in amdxdna_gem_obj_vmap()
419 dma_buf_vunmap_unlocked(abo->dma_buf, &map); in amdxdna_gem_obj_vunmap()
424 static struct dma_buf *amdxdna_gem_prime_export(struct drm_gem_object *gobj, int flags) in amdxdna_gem_prime_export()
429 if (abo->dma_buf) { in amdxdna_gem_prime_export()
430 get_dma_buf(abo->dma_buf); in amdxdna_gem_prime_export()
431 return abo->dma_buf; in amdxdna_gem_prime_export()
446 dma_buf_detach(abo->dma_buf, abo->attach); in amdxdna_imported_obj_free()
[all …]
/linux/drivers/xen/
H A Dgntdev-dmabuf.c30 struct dma_buf *dmabuf;
220 static int dmabuf_exp_ops_attach(struct dma_buf *dma_buf, in dmabuf_exp_ops_attach() argument
234 static void dmabuf_exp_ops_detach(struct dma_buf *dma_buf, in dmabuf_exp_ops_detach() argument
326 static void dmabuf_exp_ops_release(struct dma_buf *dma_buf) in dmabuf_exp_ops_release() argument
328 struct gntdev_dmabuf *gntdev_dmabuf = dma_buf->priv; in dmabuf_exp_ops_release()
560 struct dma_buf *dma_buf; in dmabuf_imp_to_refs() local
567 dma_buf = dma_buf_get(fd); in dmabuf_imp_to_refs()
568 if (IS_ERR(dma_buf)) in dmabuf_imp_to_refs()
569 return ERR_CAST(dma_buf); in dmabuf_imp_to_refs()
580 attach = dma_buf_attach(dma_buf, dev); in dmabuf_imp_to_refs()
[all …]
/linux/drivers/gpu/drm/tegra/
H A Dgem.c79 if (obj->dma_buf) { in tegra_bo_pin()
80 struct dma_buf *buf = obj->dma_buf; in tegra_bo_pin()
187 if (obj->dma_buf) { in tegra_bo_mmap()
188 ret = dma_buf_vmap_unlocked(obj->dma_buf, &map); in tegra_bo_mmap()
211 if (obj->dma_buf) in tegra_bo_munmap()
212 return dma_buf_vunmap_unlocked(obj->dma_buf, &map); in tegra_bo_munmap()
457 struct dma_buf *buf) in tegra_bo_import()
493 bo->dma_buf = buf; in tegra_bo_import()
536 if (bo->dma_buf) in tegra_bo_free_object()
537 dma_buf_put(bo->dma_buf); in tegra_bo_free_object()
[all …]
/linux/drivers/gpu/drm/panthor/
H A Dpanthor_gem.c261 panthor_gem_prime_begin_cpu_access(struct dma_buf *dma_buf, in panthor_gem_prime_begin_cpu_access() argument
264 struct drm_gem_object *obj = dma_buf->priv; in panthor_gem_prime_begin_cpu_access()
276 list_for_each_entry(attach, &dma_buf->attachments, node) { in panthor_gem_prime_begin_cpu_access()
288 panthor_gem_prime_end_cpu_access(struct dma_buf *dma_buf, in panthor_gem_prime_end_cpu_access() argument
291 struct drm_gem_object *obj = dma_buf->priv; in panthor_gem_prime_end_cpu_access()
297 list_for_each_entry(attach, &dma_buf->attachments, node) { in panthor_gem_prime_end_cpu_access()
327 static struct dma_buf *
350 struct dma_buf *dma_buf) in panthor_gem_prime_import() argument
352 struct drm_gem_object *obj = dma_buf->priv; in panthor_gem_prime_import()
354 if (dma_buf->ops == &panthor_dma_buf_ops && obj->dev == dev) { in panthor_gem_prime_import()
[all …]
/linux/drivers/dma-buf/heaps/
H A Dcma_heap.c70 static int cma_heap_attach(struct dma_buf *dmabuf, in cma_heap_attach()
103 static void cma_heap_detach(struct dma_buf *dmabuf, in cma_heap_detach()
141 static int cma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, in cma_heap_dma_buf_begin_cpu_access()
162 static int cma_heap_dma_buf_end_cpu_access(struct dma_buf *dmabuf, in cma_heap_dma_buf_end_cpu_access()
198 static int cma_heap_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma) in cma_heap_mmap()
224 static int cma_heap_vmap(struct dma_buf *dmabuf, struct iosys_map *map) in cma_heap_vmap()
251 static void cma_heap_vunmap(struct dma_buf *dmabuf, struct iosys_map *map) in cma_heap_vunmap()
264 static void cma_heap_dma_buf_release(struct dma_buf *dmabuf) in cma_heap_dma_buf_release()
295 static struct dma_buf *cma_heap_allocate(struct dma_heap *heap, in cma_heap_allocate()
307 struct dma_buf *dmabuf; in cma_heap_allocate()
/linux/drivers/gpu/drm/panfrost/
H A Dpanfrost_gem.c302 panfrost_gem_prime_begin_cpu_access(struct dma_buf *dma_buf, in panfrost_gem_prime_begin_cpu_access() argument
305 struct drm_gem_object *obj = dma_buf->priv; in panfrost_gem_prime_begin_cpu_access()
317 list_for_each_entry(attach, &dma_buf->attachments, node) { in panfrost_gem_prime_begin_cpu_access()
329 panfrost_gem_prime_end_cpu_access(struct dma_buf *dma_buf, in panfrost_gem_prime_end_cpu_access() argument
332 struct drm_gem_object *obj = dma_buf->priv; in panfrost_gem_prime_end_cpu_access()
338 list_for_each_entry(attach, &dma_buf->attachments, node) { in panfrost_gem_prime_end_cpu_access()
368 static struct dma_buf *
387 struct dma_buf *dma_buf) in panfrost_gem_prime_import() argument
389 struct drm_gem_object *obj = dma_buf->priv; in panfrost_gem_prime_import()
391 if (dma_buf->ops == &panfrost_dma_buf_ops && obj->dev == dev) { in panfrost_gem_prime_import()
[all …]
/linux/drivers/media/common/videobuf2/
H A Dvideobuf2-vmalloc.c32 struct dma_buf *dbuf;
212 static int vb2_vmalloc_dmabuf_ops_attach(struct dma_buf *dbuf, in vb2_vmalloc_dmabuf_ops_attach()
251 static void vb2_vmalloc_dmabuf_ops_detach(struct dma_buf *dbuf, in vb2_vmalloc_dmabuf_ops_detach()
304 static void vb2_vmalloc_dmabuf_ops_release(struct dma_buf *dbuf) in vb2_vmalloc_dmabuf_ops_release()
310 static int vb2_vmalloc_dmabuf_ops_vmap(struct dma_buf *dbuf, in vb2_vmalloc_dmabuf_ops_vmap()
320 static int vb2_vmalloc_dmabuf_ops_mmap(struct dma_buf *dbuf, in vb2_vmalloc_dmabuf_ops_mmap()
336 static struct dma_buf *vb2_vmalloc_get_dmabuf(struct vb2_buffer *vb, in vb2_vmalloc_get_dmabuf()
341 struct dma_buf *dbuf; in vb2_vmalloc_get_dmabuf()
404 struct dma_buf *dbuf, in vb2_vmalloc_attach_dmabuf()

123456