/linux/drivers/dma-buf/ |
H A D | dma-buf.c | 42 static void __dma_buf_debugfs_list_add(struct dma_buf *dmabuf) in __dma_buf_debugfs_list_add() argument 45 list_add(&dmabuf->list_node, &debugfs_list); in __dma_buf_debugfs_list_add() 49 static void __dma_buf_debugfs_list_del(struct dma_buf *dmabuf) in __dma_buf_debugfs_list_del() argument 51 if (!dmabuf) in __dma_buf_debugfs_list_del() 55 list_del(&dmabuf->list_node); in __dma_buf_debugfs_list_del() 59 static void __dma_buf_debugfs_list_add(struct dma_buf *dmabuf) in __dma_buf_debugfs_list_add() argument 70 struct dma_buf *dmabuf; in dmabuffs_dname() local 74 dmabuf = dentry->d_fsdata; in dmabuffs_dname() 75 spin_lock(&dmabuf->name_lock); in dmabuffs_dname() 76 if (dmabuf->name) in dmabuffs_dname() [all …]
|
H A D | dma-buf-sysfs-stats.c | 55 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 …]
|
H A D | dma-buf-sysfs-stats.h | 16 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
|
/linux/drivers/hid/ |
H A D | hid-elan.c | 80 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/samples/vfio-mdev/ |
H A D | mbochs.c | 820 struct mbochs_dmabuf *dmabuf = vma->vm_private_data; in mbochs_dmabuf_vm_fault() local 822 if (WARN_ON(vmf->pgoff >= dmabuf->pagecount)) in mbochs_dmabuf_vm_fault() 825 vmf->page = dmabuf->pages[vmf->pgoff]; in mbochs_dmabuf_vm_fault() 836 struct mbochs_dmabuf *dmabuf = buf->priv; in mbochs_mmap_dmabuf() local 837 struct device *dev = mdev_dev(dmabuf->mdev_state->mdev); in mbochs_mmap_dmabuf() 839 dev_dbg(dev, "%s: %d\n", __func__, dmabuf->id); in mbochs_mmap_dmabuf() 845 vma->vm_private_data = dmabuf; in mbochs_mmap_dmabuf() 849 static void mbochs_print_dmabuf(struct mbochs_dmabuf *dmabuf, in mbochs_print_dmabuf() argument 852 struct device *dev = mdev_dev(dmabuf->mdev_state->mdev); in mbochs_print_dmabuf() 853 u32 fourcc = dmabuf->mode.drm_format; in mbochs_print_dmabuf() [all …]
|
/linux/include/linux/ |
H A D | dma-buf.h | 286 int (*vmap)(struct dma_buf *dmabuf, struct iosys_map *map); 287 void (*vunmap)(struct dma_buf *dmabuf, struct iosys_map *map); 451 struct dma_buf *dmabuf; member 514 struct dma_buf *dmabuf; member 568 static inline void get_dma_buf(struct dma_buf *dmabuf) in get_dma_buf() argument 570 get_file(dmabuf->file); in get_dma_buf() 581 static inline bool dma_buf_is_dynamic(struct dma_buf *dmabuf) in dma_buf_is_dynamic() argument 583 return !!dmabuf->ops->pin; in dma_buf_is_dynamic() 600 struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, 603 dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev, [all …]
|
/linux/drivers/dma-buf/heaps/ |
H A D | cma_heap.c | 50 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() 178 static int cma_heap_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma) in cma_heap_mmap() argument 180 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_mmap() [all …]
|
H A D | system_heap.c | 82 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/drivers/gpu/drm/ |
H A D | drm_prime.c | 232 * @dev: parent device for the exported dmabuf 240 * Returns the new dmabuf. 382 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() 432 struct dma_buf *dmabuf; drm_gem_prime_handle_to_fd() local [all...] |
H A D | drm_gem_dma_helper.c | 233 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/drivers/media/platform/nvidia/tegra-vde/ |
H A D | dmabuf-cache.c | 34 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/drivers/comedi/drivers/ |
H A D | addi_apci_3120.c | 150 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 …]
|
H A D | adl_pci9118.c | 227 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/drivers/scsi/lpfc/ |
H A D | lpfc_bsg.c | 893 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 …]
|
H A D | lpfc_sli.c | 78 struct hbq_dmabuf *dmabuf); 2392 struct lpfc_dmabuf *dmabuf, *next_dmabuf; in lpfc_sli_hbqbuf_free_all() local 2401 list_for_each_entry_safe(dmabuf, next_dmabuf, in lpfc_sli_hbqbuf_free_all() 2403 hbq_buf = container_of(dmabuf, struct hbq_dmabuf, dbuf); in lpfc_sli_hbqbuf_free_all() 4525 struct hbq_dmabuf *dmabuf; in lpfc_sli_handle_slow_ring_event_s4() local 4552 dmabuf = container_of(cq_event, struct hbq_dmabuf, in lpfc_sli_handle_slow_ring_event_s4() 4554 lpfc_sli4_handle_received_buffer(phba, dmabuf); in lpfc_sli_handle_slow_ring_event_s4() 5897 struct lpfc_dmabuf *dmabuf; in lpfc_sli4_read_rev() local 5900 dmabuf = kzalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); in lpfc_sli4_read_rev() 5901 if (!dmabuf) in lpfc_sli4_read_rev() [all …]
|
/linux/net/core/ |
H A D | devmem.c | 63 dma_buf_detach(binding->dmabuf, binding->attachment); in __net_devmem_dmabuf_binding_free() 64 dma_buf_put(binding->dmabuf); in __net_devmem_dmabuf_binding_free() 183 struct dma_buf *dmabuf; in net_devmem_bind_dmabuf() local 188 dmabuf = dma_buf_get(dmabuf_fd); in net_devmem_bind_dmabuf() 189 if (IS_ERR(dmabuf)) in net_devmem_bind_dmabuf() 190 return ERR_CAST(dmabuf); in net_devmem_bind_dmabuf() 211 binding->dmabuf = dmabuf; in net_devmem_bind_dmabuf() 213 binding->attachment = dma_buf_attach(binding->dmabuf, dev->dev.parent); in net_devmem_bind_dmabuf() 295 dma_buf_detach(dmabuf, binding->attachment); in net_devmem_bind_dmabuf() 301 dma_buf_put(dmabuf); in net_devmem_bind_dmabuf()
|
/linux/Documentation/ABI/testing/ |
H A D | sysfs-kernel-dmabuf-buffers | 1 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/Documentation/networking/ |
H A D | devmem.rst | 12 memory (dmabuf). The feature is currently implemented for TCP sockets. 102 The user must bind a dmabuf to any number of RX queues on a given NIC using 105 /* Bind dmabuf to NIC RX queue 15 */ 126 The netlink API returns a dmabuf_id: a unique ID that refers to this dmabuf 129 The user can unbind the dmabuf from the netdevice by closing the netlink socket 133 Note that any reasonably well-behaved dmabuf from any exporter should work with 134 devmem TCP, even if the dmabuf is not actually backed by devmem. An example of 135 this is udmabuf, which wraps user memory (non-devmem) in a dmabuf. 141 The socket must be flow steered to the dmabuf bound RX queue:: 157 Devmem data is received directly into the dmabuf bound to the NIC in 'NIC [all …]
|
/linux/drivers/gpu/drm/xe/ |
H A D | xe_dma_buf.c | 25 static int xe_dma_buf_attach(struct dma_buf *dmabuf, in xe_dma_buf_attach() argument 28 struct drm_gem_object *obj = attach->dmabuf->priv; in xe_dma_buf_attach() 41 static void xe_dma_buf_detach(struct dma_buf *dmabuf, in xe_dma_buf_detach() argument 44 struct drm_gem_object *obj = attach->dmabuf->priv; in xe_dma_buf_detach() 51 struct drm_gem_object *obj = attach->dmabuf->priv; in xe_dma_buf_pin() 83 struct drm_gem_object *obj = attach->dmabuf->priv; in xe_dma_buf_unpin() 92 struct dma_buf *dma_buf = attach->dmabuf; in xe_dma_buf_map() 148 struct dma_buf *dma_buf = attach->dmabuf; in xe_dma_buf_unmap()
|
/linux/sound/ppc/ |
H A D | beep.c | 213 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/drivers/xen/ |
H A D | gntdev-dmabuf.c | 30 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/drivers/gpu/drm/amd/amdgpu/ |
H A D | amdgpu_dma_buf.c | 53 static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf, in amdgpu_dma_buf_attach() argument 56 struct drm_gem_object *obj = dmabuf->priv; in amdgpu_dma_buf_attach() 75 struct drm_gem_object *obj = attach->dmabuf->priv; in amdgpu_dma_buf_pin() 91 struct drm_gem_object *obj = attach->dmabuf->priv; in amdgpu_dma_buf_unpin() 113 struct dma_buf *dma_buf = attach->dmabuf; in amdgpu_dma_buf_map() 460 struct dma_buf *dma_buf = obj->import_attach->dmabuf; in amdgpu_dmabuf_is_xgmi_accessible()
|
/linux/drivers/gpu/drm/i915/gem/ |
H A D | i915_gem_dmabuf.c | 31 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()
|
/linux/drivers/gpu/drm/vmwgfx/ |
H A D | vmwgfx_gem.c | 88 ret = dma_buf_vmap(obj->import_attach->dmabuf, map); in vmw_gem_vmap() 91 dma_buf_vunmap(obj->import_attach->dmabuf, map); in vmw_gem_vmap() 105 dma_buf_vunmap(obj->import_attach->dmabuf, map); in vmw_gem_vunmap() 207 .size = attach->dmabuf->size, in vmw_prime_import_sg_table() 209 .resv = attach->dmabuf->resv, in vmw_prime_import_sg_table()
|
/linux/drivers/gpu/drm/etnaviv/ |
H A D | etnaviv_gem_prime.c | 68 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()
|