Home
last modified time | relevance | path

Searched refs:dmabuf (Results 1 – 25 of 97) sorted by relevance

1234

/linux-6.6.21/drivers/dma-buf/
Ddma-buf.c47 struct dma_buf *dmabuf; in dmabuffs_dname() local
51 dmabuf = dentry->d_fsdata; in dmabuffs_dname()
52 spin_lock(&dmabuf->name_lock); in dmabuffs_dname()
53 if (dmabuf->name) in dmabuffs_dname()
54 ret = strlcpy(name, dmabuf->name, DMA_BUF_NAME_LEN); in dmabuffs_dname()
55 spin_unlock(&dmabuf->name_lock); in dmabuffs_dname()
63 struct dma_buf *dmabuf; in dma_buf_release() local
65 dmabuf = dentry->d_fsdata; in dma_buf_release()
66 if (unlikely(!dmabuf)) in dma_buf_release()
69 BUG_ON(dmabuf->vmapping_counter); in dma_buf_release()
[all …]
Ddma-buf-sysfs-stats.c55 ssize_t (*show)(struct dma_buf *dmabuf,
66 struct dma_buf *dmabuf; in dma_buf_stats_attribute_show() local
70 dmabuf = sysfs_entry->dmabuf; in dma_buf_stats_attribute_show()
72 if (!dmabuf || !attribute->show) in dma_buf_stats_attribute_show()
75 return attribute->show(dmabuf, attribute, buf); in dma_buf_stats_attribute_show()
82 static ssize_t exporter_name_show(struct dma_buf *dmabuf, in exporter_name_show() argument
86 return sysfs_emit(buf, "%s\n", dmabuf->exp_name); in exporter_name_show()
89 static ssize_t size_show(struct dma_buf *dmabuf, in size_show() argument
93 return sysfs_emit(buf, "%zu\n", dmabuf->size); in size_show()
121 void dma_buf_stats_teardown(struct dma_buf *dmabuf) in dma_buf_stats_teardown() argument
[all …]
Ddma-buf-sysfs-stats.h16 int dma_buf_stats_setup(struct dma_buf *dmabuf, struct file *file);
18 void dma_buf_stats_teardown(struct dma_buf *dmabuf);
28 static inline int dma_buf_stats_setup(struct dma_buf *dmabuf, struct file *file) in dma_buf_stats_setup() argument
33 static inline void dma_buf_stats_teardown(struct dma_buf *dmabuf) {} in dma_buf_stats_teardown() argument
Ddma-heap.c56 struct dma_buf *dmabuf; in dma_heap_buffer_alloc() local
67 dmabuf = heap->ops->allocate(heap, len, fd_flags, heap_flags); in dma_heap_buffer_alloc()
68 if (IS_ERR(dmabuf)) in dma_heap_buffer_alloc()
69 return PTR_ERR(dmabuf); in dma_heap_buffer_alloc()
71 fd = dma_buf_fd(dmabuf, fd_flags); in dma_heap_buffer_alloc()
73 dma_buf_put(dmabuf); in dma_heap_buffer_alloc()
/linux-6.6.21/drivers/gpu/drm/i915/gem/selftests/
Di915_gem_dmabuf.c21 struct dma_buf *dmabuf; in igt_dmabuf_export() local
27 dmabuf = i915_gem_prime_export(&obj->base, 0); in igt_dmabuf_export()
29 if (IS_ERR(dmabuf)) { in igt_dmabuf_export()
31 (int)PTR_ERR(dmabuf)); in igt_dmabuf_export()
32 return PTR_ERR(dmabuf); in igt_dmabuf_export()
35 dma_buf_put(dmabuf); in igt_dmabuf_export()
44 struct dma_buf *dmabuf; in igt_dmabuf_import_self() local
51 dmabuf = i915_gem_prime_export(&obj->base, 0); in igt_dmabuf_import_self()
52 if (IS_ERR(dmabuf)) { in igt_dmabuf_import_self()
54 (int)PTR_ERR(dmabuf)); in igt_dmabuf_import_self()
[all …]
Dmock_dmabuf.c12 struct mock_dmabuf *mock = to_mock(attachment->dmabuf); in mock_map_dma_buf()
102 struct dma_buf *dmabuf; in mock_dmabuf() local
122 dmabuf = dma_buf_export(&exp_info); in mock_dmabuf()
123 if (IS_ERR(dmabuf)) in mock_dmabuf()
126 return dmabuf; in mock_dmabuf()
/linux-6.6.21/drivers/hid/
Dhid-elan.c80 unsigned char *dmabuf, unsigned char param) in elan_get_device_param() argument
84 dmabuf[0] = ELAN_FEATURE_REPORT; in elan_get_device_param()
85 dmabuf[1] = 0x05; in elan_get_device_param()
86 dmabuf[2] = 0x03; in elan_get_device_param()
87 dmabuf[3] = param; in elan_get_device_param()
88 dmabuf[4] = 0x01; in elan_get_device_param()
90 ret = hid_hw_raw_request(hdev, ELAN_FEATURE_REPORT, dmabuf, in elan_get_device_param()
98 ret = hid_hw_raw_request(hdev, ELAN_FEATURE_REPORT, dmabuf, in elan_get_device_param()
121 unsigned char *dmabuf; in elan_get_device_params() local
124 dmabuf = kmalloc(ELAN_FEATURE_SIZE, GFP_KERNEL); in elan_get_device_params()
[all …]
/linux-6.6.21/include/linux/
Ddma-buf.h286 int (*vmap)(struct dma_buf *dmabuf, struct iosys_map *map);
287 void (*vunmap)(struct dma_buf *dmabuf, struct iosys_map *map);
446 struct dma_buf *dmabuf; member
509 struct dma_buf *dmabuf; member
563 static inline void get_dma_buf(struct dma_buf *dmabuf) in get_dma_buf() argument
565 get_file(dmabuf->file); in get_dma_buf()
576 static inline bool dma_buf_is_dynamic(struct dma_buf *dmabuf) in dma_buf_is_dynamic() argument
578 return !!dmabuf->ops->pin; in dma_buf_is_dynamic()
595 struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
598 dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev,
[all …]
/linux-6.6.21/samples/vfio-mdev/
Dmbochs.c817 struct mbochs_dmabuf *dmabuf = vma->vm_private_data; in mbochs_dmabuf_vm_fault() local
819 if (WARN_ON(vmf->pgoff >= dmabuf->pagecount)) in mbochs_dmabuf_vm_fault()
822 vmf->page = dmabuf->pages[vmf->pgoff]; in mbochs_dmabuf_vm_fault()
833 struct mbochs_dmabuf *dmabuf = buf->priv; in mbochs_mmap_dmabuf() local
834 struct device *dev = mdev_dev(dmabuf->mdev_state->mdev); in mbochs_mmap_dmabuf()
836 dev_dbg(dev, "%s: %d\n", __func__, dmabuf->id); in mbochs_mmap_dmabuf()
842 vma->vm_private_data = dmabuf; in mbochs_mmap_dmabuf()
846 static void mbochs_print_dmabuf(struct mbochs_dmabuf *dmabuf, in mbochs_print_dmabuf() argument
849 struct device *dev = mdev_dev(dmabuf->mdev_state->mdev); in mbochs_print_dmabuf()
850 u32 fourcc = dmabuf->mode.drm_format; in mbochs_print_dmabuf()
[all …]
/linux-6.6.21/drivers/infiniband/core/
Dumem_dmabuf.c24 dma_resv_assert_held(umem_dmabuf->attach->dmabuf->resv); in ib_umem_dmabuf_map_pages()
72 ret = dma_resv_wait_timeout(umem_dmabuf->attach->dmabuf->resv, in ib_umem_dmabuf_map_pages()
85 dma_resv_assert_held(umem_dmabuf->attach->dmabuf->resv); in ib_umem_dmabuf_unmap_pages()
118 struct dma_buf *dmabuf; in ib_umem_dmabuf_get() local
130 dmabuf = dma_buf_get(fd); in ib_umem_dmabuf_get()
131 if (IS_ERR(dmabuf)) in ib_umem_dmabuf_get()
132 return ERR_CAST(dmabuf); in ib_umem_dmabuf_get()
134 if (dmabuf->size < end) in ib_umem_dmabuf_get()
154 dmabuf, in ib_umem_dmabuf_get()
168 dma_buf_put(dmabuf); in ib_umem_dmabuf_get()
[all …]
/linux-6.6.21/drivers/dma-buf/heaps/
Dcma_heap.c50 static int cma_heap_attach(struct dma_buf *dmabuf, in cma_heap_attach() argument
53 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_attach()
83 static void cma_heap_detach(struct dma_buf *dmabuf, in cma_heap_detach() argument
86 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_detach()
121 static int cma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, in cma_heap_dma_buf_begin_cpu_access() argument
124 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_dma_buf_begin_cpu_access()
142 static int cma_heap_dma_buf_end_cpu_access(struct dma_buf *dmabuf, in cma_heap_dma_buf_end_cpu_access() argument
145 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_dma_buf_end_cpu_access()
181 static int cma_heap_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma) in cma_heap_mmap() argument
183 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_mmap()
[all …]
Dsystem_heap.c82 static int system_heap_attach(struct dma_buf *dmabuf, in system_heap_attach() argument
85 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_attach()
113 static void system_heap_detach(struct dma_buf *dmabuf, in system_heap_detach() argument
116 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_detach()
153 static int system_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, in system_heap_dma_buf_begin_cpu_access() argument
156 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_dma_buf_begin_cpu_access()
174 static int system_heap_dma_buf_end_cpu_access(struct dma_buf *dmabuf, in system_heap_dma_buf_end_cpu_access() argument
177 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_dma_buf_end_cpu_access()
195 static int system_heap_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma) in system_heap_mmap() argument
197 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_mmap()
[all …]
/linux-6.6.21/drivers/gpu/drm/
Ddrm_prime.c382 struct dma_buf *dmabuf; in export_and_register_object() local
386 dmabuf = ERR_PTR(-ENOENT); in export_and_register_object()
387 return dmabuf; in export_and_register_object()
391 dmabuf = obj->funcs->export(obj, flags); in export_and_register_object()
393 dmabuf = drm_gem_prime_export(obj, flags); in export_and_register_object()
394 if (IS_ERR(dmabuf)) { in export_and_register_object()
398 return dmabuf; in export_and_register_object()
406 obj->dma_buf = dmabuf; in export_and_register_object()
409 return dmabuf; in export_and_register_object()
432 struct dma_buf *dmabuf; in drm_gem_prime_handle_to_fd() local
[all …]
Ddrm_gem_dma_helper.c233 dma_buf_vunmap_unlocked(gem_obj->import_attach->dmabuf, &map); in drm_gem_dma_free()
469 if (drm_prime_get_contiguous_size(sgt) < attach->dmabuf->size) in drm_gem_dma_prime_import_sg_table()
473 dma_obj = __drm_gem_dma_create(dev, attach->dmabuf->size, true); in drm_gem_dma_prime_import_sg_table()
481 attach->dmabuf->size); in drm_gem_dma_prime_import_sg_table()
583 ret = dma_buf_vmap_unlocked(attach->dmabuf, &map); in drm_gem_dma_prime_import_sg_table_vmap()
591 dma_buf_vunmap_unlocked(attach->dmabuf, &map); in drm_gem_dma_prime_import_sg_table_vmap()
/linux-6.6.21/drivers/media/platform/nvidia/tegra-vde/
Ddmabuf-cache.c34 struct dma_buf *dmabuf = entry->a->dmabuf; in tegra_vde_release_entry() local
42 dma_buf_detach(dmabuf, entry->a); in tegra_vde_release_entry()
43 dma_buf_put(dmabuf); in tegra_vde_release_entry()
64 struct dma_buf *dmabuf, in tegra_vde_dmabuf_cache_map() argument
79 if (entry->a->dmabuf != dmabuf) in tegra_vde_dmabuf_cache_map()
88 dma_buf_put(dmabuf); in tegra_vde_dmabuf_cache_map()
98 attachment = dma_buf_attach(dmabuf, dev); in tegra_vde_dmabuf_cache_map()
125 err = tegra_vde_iommu_map(vde, sgt, &iova, dmabuf->size); in tegra_vde_dmabuf_cache_map()
157 dma_buf_detach(dmabuf, attachment); in tegra_vde_dmabuf_cache_map()
/linux-6.6.21/drivers/comedi/drivers/
Daddi_apci_3120.c150 struct apci3120_dmabuf dmabuf[2]; member
172 struct apci3120_dmabuf *dmabuf) in apci3120_init_dma() argument
189 apci3120_addon_write(dev, dmabuf->hw, AMCC_OP_REG_AMWAR); in apci3120_init_dma()
192 apci3120_addon_write(dev, dmabuf->use_size, AMCC_OP_REG_AMWTC); in apci3120_init_dma()
208 struct apci3120_dmabuf *dmabuf0 = &devpriv->dmabuf[0]; in apci3120_setup_dma()
209 struct apci3120_dmabuf *dmabuf1 = &devpriv->dmabuf[1]; in apci3120_setup_dma()
430 struct apci3120_dmabuf *dmabuf; in apci3120_interrupt_dma() local
434 dmabuf = &devpriv->dmabuf[devpriv->cur_dmabuf]; in apci3120_interrupt_dma()
436 nbytes = dmabuf->use_size - inl(devpriv->amcc + AMCC_OP_REG_MWTC); in apci3120_interrupt_dma()
438 if (nbytes < dmabuf->use_size) in apci3120_interrupt_dma()
[all …]
Dadl_pci9118.c227 struct pci9118_dmabuf dmabuf[2]; member
246 struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[buf]; in pci9118_amcc_setup_dma() local
249 outl(dmabuf->hw, devpriv->iobase_a + AMCC_OP_REG_MWAR); in pci9118_amcc_setup_dma()
250 outl(dmabuf->use_size, devpriv->iobase_a + AMCC_OP_REG_MWTC); in pci9118_amcc_setup_dma()
393 struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[next_buf]; in pci9118_ai_mode4_switch() local
398 comedi_8254_load(dev->pacer, 0, dmabuf->hw >> 1, in pci9118_ai_mode4_switch()
640 struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[devpriv->dma_actbuf]; in pci9118_ai_get_dma() local
641 unsigned int n_all = comedi_bytes_to_samples(s, dmabuf->use_size); in pci9118_ai_get_dma()
658 pci9118_ai_dma_xfer(dev, s, dmabuf->virt, n_all); in pci9118_ai_get_dma()
803 struct pci9118_dmabuf *dmabuf0 = &devpriv->dmabuf[0]; in pci9118_ai_setup_dma()
[all …]
/linux-6.6.21/Documentation/ABI/testing/
Dsysfs-kernel-dmabuf-buffers1 What: /sys/kernel/dmabuf/buffers
5 Description: The /sys/kernel/dmabuf/buffers directory contains a
7 /sys/kernel/dmabuf/buffers/<inode_number> will contain the
12 What: /sys/kernel/dmabuf/buffers/<inode_number>/exporter_name
19 What: /sys/kernel/dmabuf/buffers/<inode_number>/size
/linux-6.6.21/drivers/scsi/lpfc/
Dlpfc_bsg.c893 struct lpfc_dmabuf *dmabuf = NULL; in lpfc_bsg_ct_unsol_event() local
983 dmabuf = bdeBuf1; in lpfc_bsg_ct_unsol_event()
986 dmabuf = bdeBuf2; in lpfc_bsg_ct_unsol_event()
996 dmabuf = lpfc_sli_ringpostbuf_get(phba, in lpfc_bsg_ct_unsol_event()
999 if (!dmabuf) { in lpfc_bsg_ct_unsol_event()
1014 dmabuf->virt, size); in lpfc_bsg_ct_unsol_event()
1020 dmabuf); in lpfc_bsg_ct_unsol_event()
1028 *)dmabuf); in lpfc_bsg_ct_unsol_event()
1037 dmabuf); in lpfc_bsg_ct_unsol_event()
1133 lpfc_bsg_ct_unsol_abort(struct lpfc_hba *phba, struct hbq_dmabuf *dmabuf) in lpfc_bsg_ct_unsol_abort() argument
[all …]
Dlpfc_sli.c78 struct hbq_dmabuf *dmabuf);
2387 struct lpfc_dmabuf *dmabuf, *next_dmabuf; in lpfc_sli_hbqbuf_free_all() local
2396 list_for_each_entry_safe(dmabuf, next_dmabuf, in lpfc_sli_hbqbuf_free_all()
2398 hbq_buf = container_of(dmabuf, struct hbq_dmabuf, dbuf); in lpfc_sli_hbqbuf_free_all()
4515 struct hbq_dmabuf *dmabuf; in lpfc_sli_handle_slow_ring_event_s4() local
4544 dmabuf = container_of(cq_event, struct hbq_dmabuf, in lpfc_sli_handle_slow_ring_event_s4()
4546 lpfc_sli4_handle_received_buffer(phba, dmabuf); in lpfc_sli_handle_slow_ring_event_s4()
5880 struct lpfc_dmabuf *dmabuf; in lpfc_sli4_read_rev() local
5883 dmabuf = kzalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); in lpfc_sli4_read_rev()
5884 if (!dmabuf) in lpfc_sli4_read_rev()
[all …]
/linux-6.6.21/drivers/gpu/drm/amd/amdgpu/
Damdgpu_dma_buf.c54 static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf, in amdgpu_dma_buf_attach() argument
57 struct drm_gem_object *obj = dmabuf->priv; in amdgpu_dma_buf_attach()
84 static void amdgpu_dma_buf_detach(struct dma_buf *dmabuf, in amdgpu_dma_buf_detach() argument
87 struct drm_gem_object *obj = dmabuf->priv; in amdgpu_dma_buf_detach()
104 struct drm_gem_object *obj = attach->dmabuf->priv; in amdgpu_dma_buf_pin()
120 struct drm_gem_object *obj = attach->dmabuf->priv; in amdgpu_dma_buf_unpin()
142 struct dma_buf *dma_buf = attach->dmabuf; in amdgpu_dma_buf_map()
486 struct dma_buf *dma_buf = obj->import_attach->dmabuf; in amdgpu_dmabuf_is_xgmi_accessible()
/linux-6.6.21/sound/ppc/
Dbeep.c213 void *dmabuf; in snd_pmac_attach_beep() local
219 dmabuf = dma_alloc_coherent(&chip->pdev->dev, BEEP_BUFLEN * 4, in snd_pmac_attach_beep()
222 if (! dmabuf || ! input_dev) in snd_pmac_attach_beep()
240 beep->buf = dmabuf; in snd_pmac_attach_beep()
259 if (dmabuf) in snd_pmac_attach_beep()
261 dmabuf, beep->addr); in snd_pmac_attach_beep()
/linux-6.6.21/drivers/xen/
Dgntdev-dmabuf.c30 struct dma_buf *dmabuf; member
262 struct gntdev_dmabuf *gntdev_dmabuf = attach->dmabuf->priv; in dmabuf_exp_ops_map_dma_buf()
385 gntdev_dmabuf->dmabuf = dma_buf_export(&exp_info); in dmabuf_exp_from_pages()
386 if (IS_ERR(gntdev_dmabuf->dmabuf)) { in dmabuf_exp_from_pages()
387 ret = PTR_ERR(gntdev_dmabuf->dmabuf); in dmabuf_exp_from_pages()
388 gntdev_dmabuf->dmabuf = NULL; in dmabuf_exp_from_pages()
392 ret = dma_buf_fd(gntdev_dmabuf->dmabuf, O_CLOEXEC); in dmabuf_exp_from_pages()
408 if (gntdev_dmabuf->dmabuf) in dmabuf_exp_from_pages()
409 dma_buf_put(gntdev_dmabuf->dmabuf); in dmabuf_exp_from_pages()
613 if (attach->dmabuf->size != gntdev_dmabuf->nr_pages << PAGE_SHIFT) { in dmabuf_imp_to_refs()
[all …]
/linux-6.6.21/drivers/gpu/drm/etnaviv/
Detnaviv_gem_prime.c68 dma_buf_vunmap_unlocked(etnaviv_obj->base.import_attach->dmabuf, &map); in etnaviv_gem_prime_release()
85 ret = dma_buf_vmap(etnaviv_obj->base.import_attach->dmabuf, &map); in etnaviv_gem_prime_vmap_impl()
116 size_t size = PAGE_ALIGN(attach->dmabuf->size); in etnaviv_gem_prime_import_sg_table()
/linux-6.6.21/drivers/gpu/drm/i915/gem/
Di915_gem_dmabuf.c31 struct drm_i915_gem_object *obj = dma_buf_to_obj(attach->dmabuf); in i915_gem_map_dma_buf()
167 static int i915_gem_dmabuf_attach(struct dma_buf *dmabuf, in i915_gem_dmabuf_attach() argument
170 struct drm_i915_gem_object *obj = dma_buf_to_obj(dmabuf); in i915_gem_dmabuf_attach()
196 static void i915_gem_dmabuf_detach(struct dma_buf *dmabuf, in i915_gem_dmabuf_detach() argument
199 struct drm_i915_gem_object *obj = dma_buf_to_obj(dmabuf); in i915_gem_dmabuf_detach()

1234