| /linux/drivers/dma-buf/ |
| H A D | dma-buf.c | 51 guard(spinlock)(&dmabuf->name_lock); \ 67 static void __dma_buf_list_add(struct dma_buf *dmabuf) in __dma_buf_list_add() argument 70 list_add(&dmabuf->list_node, &dmabuf_list); in __dma_buf_list_add() 74 static void __dma_buf_list_del(struct dma_buf *dmabuf) in __dma_buf_list_del() argument 76 if (!dmabuf) in __dma_buf_list_del() 80 list_del(&dmabuf->list_node); in __dma_buf_list_del() 98 struct dma_buf *ret = NULL, *dmabuf; in dma_buf_iter_begin() local 106 list_for_each_entry(dmabuf, &dmabuf_list, list_node) { in dma_buf_iter_begin() 107 if (file_ref_get(&dmabuf->file->f_ref)) { in dma_buf_iter_begin() 108 ret = dmabuf; in dma_buf_iter_begin() [all …]
|
| H A D | dma-heap.c | 61 struct dma_buf *dmabuf; in dma_heap_buffer_alloc() local 72 dmabuf = heap->ops->allocate(heap, len, fd_flags, heap_flags); in dma_heap_buffer_alloc() 73 if (IS_ERR(dmabuf)) in dma_heap_buffer_alloc() 74 return PTR_ERR(dmabuf); in dma_heap_buffer_alloc() 76 fd = dma_buf_fd(dmabuf, fd_flags); in dma_heap_buffer_alloc() 78 dma_buf_put(dmabuf); in dma_heap_buffer_alloc()
|
| H A D | udmabuf.c | 188 return get_sg_table(at->dev, at->dmabuf, direction); in map_udmabuf() 377 struct dma_buf *dmabuf; in udmabuf_create() local 442 dmabuf = export_udmabuf(ubuf, device); in udmabuf_create() 443 if (IS_ERR(dmabuf)) { in udmabuf_create() 444 ret = PTR_ERR(dmabuf); in udmabuf_create() 453 ret = dma_buf_fd(dmabuf, flags); in udmabuf_create() 455 dma_buf_put(dmabuf); in udmabuf_create()
|
| /linux/kernel/bpf/ |
| H A D | dmabuf_iter.c | 16 struct dma_buf *dmabuf; member 24 struct dma_buf *dmabuf = p->dmabuf; in dmabuf_iter_seq_start() local 26 if (!dmabuf) in dmabuf_iter_seq_start() 33 p->dmabuf = NULL; in dmabuf_iter_seq_start() 34 return dmabuf; in dmabuf_iter_seq_start() 42 struct dma_buf *dmabuf = v; in dmabuf_iter_seq_next() local 46 return dma_buf_iter_next(dmabuf); in dmabuf_iter_seq_next() 51 __bpf_md_ptr(struct dma_buf *, dmabuf); 61 .dmabuf = v, in __dmabuf_seq_show() 78 struct dma_buf *dmabuf = v; in dmabuf_iter_seq_stop() local [all …]
|
| /linux/drivers/gpu/drm/i915/gem/selftests/ |
| H A D | i915_gem_dmabuf.c | 22 struct dma_buf *dmabuf; in igt_dmabuf_export() local 28 dmabuf = i915_gem_prime_export(&obj->base, 0); in igt_dmabuf_export() 30 if (IS_ERR(dmabuf)) { in igt_dmabuf_export() 32 (int)PTR_ERR(dmabuf)); in igt_dmabuf_export() 33 return PTR_ERR(dmabuf); in igt_dmabuf_export() 36 dma_buf_put(dmabuf); in igt_dmabuf_export() 45 struct dma_buf *dmabuf; in igt_dmabuf_import_self() local 52 dmabuf = i915_gem_prime_export(&obj->base, 0); in igt_dmabuf_import_self() 53 if (IS_ERR(dmabuf)) { in igt_dmabuf_import_self() 55 (int)PTR_ERR(dmabuf)); in igt_dmabuf_import_self() [all …]
|
| H A D | mock_dmabuf.c | 13 struct mock_dmabuf *mock = to_mock(attachment->dmabuf); in mock_map_dma_buf() 103 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/drivers/vfio/pci/ |
| H A D | vfio_pci_dmabuf.c | 13 struct dma_buf *dmabuf; member 25 static int vfio_pci_dma_buf_attach(struct dma_buf *dmabuf, in vfio_pci_dma_buf_attach() argument 28 struct vfio_pci_dma_buf *priv = dmabuf->priv; in vfio_pci_dma_buf_attach() 54 struct vfio_pci_dma_buf *priv = attachment->dmabuf->priv; in vfio_pci_dma_buf_map() 57 dma_resv_assert_held(priv->dmabuf->resv); in vfio_pci_dma_buf_map() 76 struct vfio_pci_dma_buf *priv = attachment->dmabuf->priv; in vfio_pci_dma_buf_unmap() 78 dma_resv_assert_held(priv->dmabuf->resv); in vfio_pci_dma_buf_unmap() 84 static void vfio_pci_dma_buf_release(struct dma_buf *dmabuf) in vfio_pci_dma_buf_release() argument 86 struct vfio_pci_dma_buf *priv = dmabuf->priv; in vfio_pci_dma_buf_release() 125 dma_resv_assert_held(attachment->dmabuf->resv); in vfio_pci_dma_buf_iommufd_map() [all …]
|
| /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/drivers/infiniband/core/ |
| H A D | umem_dmabuf.c | 24 dma_resv_assert_held(umem_dmabuf->attach->dmabuf->resv); in ib_umem_dmabuf_map_pages() 75 ret = dma_resv_wait_timeout(umem_dmabuf->attach->dmabuf->resv, in ib_umem_dmabuf_map_pages() 88 dma_resv_assert_held(umem_dmabuf->attach->dmabuf->resv); in ib_umem_dmabuf_unmap_pages() 123 struct dma_buf *dmabuf; in ib_umem_dmabuf_get_with_dma_device() local 132 dmabuf = dma_buf_get(fd); in ib_umem_dmabuf_get_with_dma_device() 133 if (IS_ERR(dmabuf)) in ib_umem_dmabuf_get_with_dma_device() 134 return ERR_CAST(dmabuf); in ib_umem_dmabuf_get_with_dma_device() 136 if (dmabuf->size < end) in ib_umem_dmabuf_get_with_dma_device() 156 dmabuf, in ib_umem_dmabuf_get_with_dma_device() 170 dma_buf_put(dmabuf); in ib_umem_dmabuf_get_with_dma_device() [all …]
|
| H A D | uverbs_std_types_dmabuf.c | 15 static int uverbs_dmabuf_attach(struct dma_buf *dmabuf, in uverbs_dmabuf_attach() argument 28 struct ib_uverbs_dmabuf_file *priv = attachment->dmabuf->priv; in uverbs_dmabuf_map() 31 dma_resv_assert_held(priv->dmabuf->resv); in uverbs_dmabuf_map() 50 struct ib_uverbs_dmabuf_file *priv = attachment->dmabuf->priv; in uverbs_dmabuf_unmap() 52 dma_resv_assert_held(priv->dmabuf->resv); in uverbs_dmabuf_unmap() 66 static void uverbs_dmabuf_release(struct dma_buf *dmabuf) in uverbs_dmabuf_release() argument 68 struct ib_uverbs_dmabuf_file *priv = dmabuf->priv; in uverbs_dmabuf_release() 120 uverbs_dmabuf->dmabuf = dma_buf_export(&exp_info); in UVERBS_HANDLER() 121 if (IS_ERR(uverbs_dmabuf->dmabuf)) { in UVERBS_HANDLER() 122 ret = PTR_ERR(uverbs_dmabuf->dmabuf); in UVERBS_HANDLER() [all …]
|
| /linux/samples/vfio-mdev/ |
| H A D | mbochs.c | 815 struct mbochs_dmabuf *dmabuf = vma->vm_private_data; in mbochs_dmabuf_vm_fault() local 817 if (WARN_ON(vmf->pgoff >= dmabuf->pagecount)) in mbochs_dmabuf_vm_fault() 820 vmf->page = dmabuf->pages[vmf->pgoff]; in mbochs_dmabuf_vm_fault() 831 struct mbochs_dmabuf *dmabuf = buf->priv; in mbochs_mmap_dmabuf() local 832 struct device *dev = mdev_dev(dmabuf->mdev_state->mdev); in mbochs_mmap_dmabuf() 834 dev_dbg(dev, "%s: %d\n", __func__, dmabuf->id); in mbochs_mmap_dmabuf() 840 vma->vm_private_data = dmabuf; in mbochs_mmap_dmabuf() 844 static void mbochs_print_dmabuf(struct mbochs_dmabuf *dmabuf, in mbochs_print_dmabuf() argument 847 struct device *dev = mdev_dev(dmabuf->mdev_state->mdev); in mbochs_print_dmabuf() 848 u32 fourcc = dmabuf->mode.drm_format; in mbochs_print_dmabuf() [all …]
|
| /linux/include/linux/ |
| H A D | dma-buf.h | 278 int (*vmap)(struct dma_buf *dmabuf, struct iosys_map *map); 279 void (*vunmap)(struct dma_buf *dmabuf, struct iosys_map *map); 486 struct dma_buf *dmabuf; member 538 static inline void get_dma_buf(struct dma_buf *dmabuf) in get_dma_buf() argument 540 get_file(dmabuf->file); in get_dma_buf() 551 static inline bool dma_buf_is_dynamic(struct dma_buf *dmabuf) in dma_buf_is_dynamic() argument 553 return !!dmabuf->ops->pin; in dma_buf_is_dynamic() 556 struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, 559 dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev, 562 void dma_buf_detach(struct dma_buf *dmabuf, [all …]
|
| /linux/tools/testing/selftests/bpf/progs/ |
| H A D | dmabuf_iter.c | 33 const struct dma_buf *dmabuf = ctx->dmabuf; in dmabuf_collector() local 40 if (!dmabuf) in dmabuf_collector() 43 if (BPF_CORE_READ_INTO(&inode, dmabuf, file, f_inode, i_ino) || in dmabuf_collector() 44 bpf_core_read(&size, sizeof(size), &dmabuf->size) || in dmabuf_collector() 45 bpf_core_read(&pname, sizeof(pname), &dmabuf->name) || in dmabuf_collector() 46 bpf_core_read(&exporter, sizeof(exporter), &dmabuf->exp_name)) in dmabuf_collector() 67 bpf_for_each(dmabuf, d) { in iter_dmabuf_for_each()
|
| /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/tee/ |
| H A D | tee_heap.c | 90 static int tee_heap_attach(struct dma_buf *dmabuf, in tee_heap_attach() argument 93 struct tee_heap_buffer *buf = dmabuf->priv; in tee_heap_attach() 113 static void tee_heap_detach(struct dma_buf *dmabuf, in tee_heap_detach() argument 149 static void tee_heap_buf_free(struct dma_buf *dmabuf) in tee_heap_buf_free() argument 151 struct tee_heap_buffer *buf = dmabuf->priv; in tee_heap_buf_free() 177 struct dma_buf *dmabuf; in tee_dma_heap_alloc() local 193 dmabuf = ERR_PTR(-ENOMEM); in tee_dma_heap_alloc() 201 dmabuf = ERR_PTR(rc); in tee_dma_heap_alloc() 209 dmabuf = dma_buf_export(&exp_info); in tee_dma_heap_alloc() 210 if (IS_ERR(dmabuf)) in tee_dma_heap_alloc() [all …]
|
| /linux/drivers/scsi/lpfc/ |
| H A D | lpfc_bsg.c | 907 struct lpfc_dmabuf *dmabuf = NULL; in lpfc_bsg_ct_unsol_event() local 997 dmabuf = bdeBuf1; in lpfc_bsg_ct_unsol_event() 1000 dmabuf = bdeBuf2; in lpfc_bsg_ct_unsol_event() 1010 dmabuf = lpfc_sli_ringpostbuf_get(phba, in lpfc_bsg_ct_unsol_event() 1013 if (!dmabuf) { in lpfc_bsg_ct_unsol_event() 1028 dmabuf->virt, size); in lpfc_bsg_ct_unsol_event() 1034 dmabuf); in lpfc_bsg_ct_unsol_event() 1042 *)dmabuf); in lpfc_bsg_ct_unsol_event() 1051 dmabuf); in lpfc_bsg_ct_unsol_event() 1147 lpfc_bsg_ct_unsol_abort(struct lpfc_hba *phba, struct hbq_dmabuf *dmabuf) in lpfc_bsg_ct_unsol_abort() argument [all …]
|
| /linux/net/core/ |
| H A D | devmem.c | 79 dma_buf_detach(binding->dmabuf, binding->attachment); in __net_devmem_dmabuf_binding_free() 80 dma_buf_put(binding->dmabuf); in __net_devmem_dmabuf_binding_free() 193 struct dma_buf *dmabuf; in net_devmem_bind_dmabuf() local 203 dmabuf = dma_buf_get(dmabuf_fd); in net_devmem_bind_dmabuf() 204 if (IS_ERR(dmabuf)) in net_devmem_bind_dmabuf() 205 return ERR_CAST(dmabuf); in net_devmem_bind_dmabuf() 225 binding->dmabuf = dmabuf; in net_devmem_bind_dmabuf() 228 binding->attachment = dma_buf_attach(binding->dmabuf, dma_dev); in net_devmem_bind_dmabuf() 245 dmabuf->size / PAGE_SIZE); in net_devmem_bind_dmabuf() 330 dma_buf_detach(dmabuf, binding->attachment); in net_devmem_bind_dmabuf() [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 dma_buf *dmabuf = attach->dmabuf; in xe_dma_buf_pin() local 52 struct drm_gem_object *obj = dmabuf->priv; in xe_dma_buf_pin() 59 list_for_each_entry(attach, &dmabuf->attachments, node) { in xe_dma_buf_pin() 91 struct drm_gem_object *obj = attach->dmabuf->priv; in xe_dma_buf_unpin() 100 struct dma_buf *dma_buf = attach->dmabuf; in xe_dma_buf_map()
|
| /linux/drivers/iio/ |
| H A D | industrialio-buffer.c | 1566 struct dma_buf *dmabuf = attach->dmabuf; in iio_buffer_dmabuf_release() local 1572 dma_buf_detach(attach->dmabuf, attach); in iio_buffer_dmabuf_release() 1573 dma_buf_put(dmabuf); in iio_buffer_dmabuf_release() 1615 static int iio_dma_resv_lock(struct dma_buf *dmabuf, bool nonblock) in iio_dma_resv_lock() argument 1618 return dma_resv_lock_interruptible(dmabuf->resv, NULL); in iio_dma_resv_lock() 1620 if (!dma_resv_trylock(dmabuf->resv)) in iio_dma_resv_lock() 1637 struct dma_buf *dmabuf, bool nonblock) in iio_buffer_find_attachment() argument 1648 && priv->attach->dmabuf == dmabuf) { in iio_buffer_find_attachment() 1668 struct dma_buf *dmabuf; in iio_buffer_attach_dmabuf() local 1686 dmabuf = dma_buf_get(fd); in iio_buffer_attach_dmabuf() [all …]
|
| /linux/sound/ppc/ |
| H A D | beep.c | 208 void *dmabuf; in snd_pmac_attach_beep() local 214 dmabuf = dma_alloc_coherent(&chip->pdev->dev, BEEP_BUFLEN * 4, in snd_pmac_attach_beep() 217 if (! dmabuf || ! input_dev) in snd_pmac_attach_beep() 235 beep->buf = dmabuf; in snd_pmac_attach_beep() 254 if (dmabuf) in snd_pmac_attach_beep() 256 dmabuf, beep->addr); in snd_pmac_attach_beep()
|
| /linux/drivers/gpu/drm/i915/gem/ |
| H A D | i915_gem_dmabuf.c | 30 struct drm_i915_gem_object *obj = dma_buf_to_obj(attach->dmabuf); in i915_gem_map_dma_buf() 166 static int i915_gem_dmabuf_attach(struct dma_buf *dmabuf, in i915_gem_dmabuf_attach() argument 169 struct drm_i915_gem_object *obj = dma_buf_to_obj(dmabuf); in i915_gem_dmabuf_attach() 195 static void i915_gem_dmabuf_detach(struct dma_buf *dmabuf, in i915_gem_dmabuf_detach() argument 198 struct drm_i915_gem_object *obj = dma_buf_to_obj(dmabuf); in i915_gem_dmabuf_detach()
|
| /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()
|
| /linux/drivers/xen/ |
| H A D | gntdev-dmabuf.c | 30 struct dma_buf *dmabuf; member 261 struct gntdev_dmabuf *gntdev_dmabuf = attach->dmabuf->priv; in dmabuf_exp_ops_map_dma_buf() 387 gntdev_dmabuf->dmabuf = dma_buf_export(&exp_info); in dmabuf_exp_from_pages() 388 if (IS_ERR(gntdev_dmabuf->dmabuf)) in dmabuf_exp_from_pages() 389 return PTR_ERR(gntdev_dmabuf->dmabuf); in dmabuf_exp_from_pages() 401 fd_install(take_fd(ret), no_free_ptr(gntdev_dmabuf)->dmabuf->file); in dmabuf_exp_from_pages() 603 if (attach->dmabuf->size != gntdev_dmabuf->nr_pages << PAGE_SHIFT) { in dmabuf_imp_to_refs() 606 attach->dmabuf->size, gntdev_dmabuf->nr_pages); in dmabuf_imp_to_refs() 703 dma_buf = attach->dmabuf; in dmabuf_imp_release() 704 dma_buf_detach(attach->dmabuf, attach); in dmabuf_imp_release()
|