| /linux-6.15/drivers/dma-buf/ |
| H A D | dma-buf.c | 102 dmabuf->ops->release(dmabuf); in dma_buf_release() 165 return dmabuf->ops->mmap(dmabuf, vma); in dma_buf_mmap_internal() 261 if (!dmabuf || !dmabuf->resv) in dma_buf_poll() 673 dmabuf->cb_in.poll = dmabuf->cb_out.poll = &dmabuf->poll; in dma_buf_export() 719 if (!dmabuf || !dmabuf->file) in dma_buf_fd() 770 if (WARN_ON(!dmabuf || !dmabuf->file)) in dma_buf_put() 923 attach->dmabuf = dmabuf; in dma_buf_dynamic_attach() 1019 if (WARN_ON(!dmabuf || !attach || dmabuf != attach->dmabuf)) in dma_buf_detach() 1036 dmabuf->ops->detach(dmabuf, attach); in dma_buf_detach() 1500 return dmabuf->ops->mmap(dmabuf, vma); in dma_buf_mmap() [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() 93 return sysfs_emit(buf, "%zu\n", dmabuf->size); in size_show() 125 sysfs_entry = dmabuf->sysfs_entry; in dma_buf_stats_teardown() 176 if (!dmabuf->exp_name) { in dma_buf_stats_setup() 186 sysfs_entry->dmabuf = dmabuf; in dma_buf_stats_setup() 188 dmabuf->sysfs_entry = sysfs_entry; in dma_buf_stats_setup() [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
|
| H A D | dma-heap.c | 55 struct dma_buf *dmabuf; in dma_heap_buffer_alloc() local 66 dmabuf = heap->ops->allocate(heap, len, fd_flags, heap_flags); in dma_heap_buffer_alloc() 67 if (IS_ERR(dmabuf)) in dma_heap_buffer_alloc() 68 return PTR_ERR(dmabuf); in dma_heap_buffer_alloc() 70 fd = dma_buf_fd(dmabuf, fd_flags); in dma_heap_buffer_alloc() 72 dma_buf_put(dmabuf); in dma_heap_buffer_alloc()
|
| /linux-6.15/drivers/gpu/drm/i915/gem/selftests/ |
| H A D | i915_gem_dmabuf.c | 22 struct dma_buf *dmabuf; in igt_dmabuf_export() local 30 if (IS_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 53 if (IS_ERR(dmabuf)) { in igt_dmabuf_import_self() 56 err = PTR_ERR(dmabuf); in igt_dmabuf_import_self() 87 dma_buf_put(dmabuf); in igt_dmabuf_import_self() 116 if (IS_ERR(dmabuf)) { in igt_dmabuf_import_same_driver_lmem() 140 dma_buf_put(dmabuf); in igt_dmabuf_import_same_driver_lmem() [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-6.15/drivers/hid/ |
| H A D | hid-elan.c | 85 dmabuf[1] = 0x05; in elan_get_device_param() 86 dmabuf[2] = 0x03; in elan_get_device_param() 88 dmabuf[4] = 0x01; in elan_get_device_param() 125 if (!dmabuf) in elan_get_device_params() 132 drvdata->max_x = (dmabuf[4] << 8) | dmabuf[3]; in elan_get_device_params() 138 drvdata->max_y = (dmabuf[4] << 8) | dmabuf[3]; in elan_get_device_params() 148 kfree(dmabuf); in elan_get_device_params() 395 if (!dmabuf) in elan_start_multitouch() 401 kfree(dmabuf); in elan_start_multitouch() 422 if (!dmabuf) in elan_mute_led_set_brigtness() [all …]
|
| /linux-6.15/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() 606 void dma_buf_detach(struct dma_buf *dmabuf, 613 int dma_buf_fd(struct dma_buf *dmabuf, int flags); [all …]
|
| /linux-6.15/samples/vfio-mdev/ |
| H A D | mbochs.c | 861 dmabuf->mode.width, dmabuf->mode.height, dmabuf->mode.stride, in mbochs_print_dmabuf() 862 dmabuf->mode.offset, dmabuf->mode.size, dmabuf->pagecount); in mbochs_print_dmabuf() 868 struct mbochs_dmabuf *dmabuf = at->dmabuf->priv; in mbochs_map_dmabuf() local 897 struct mbochs_dmabuf *dmabuf = at->dmabuf->priv; in mbochs_unmap_dmabuf() local 922 kfree(dmabuf); in mbochs_release_dmabuf() 942 if (!dmabuf) in mbochs_dmabuf_alloc() 965 return dmabuf; in mbochs_dmabuf_alloc() 972 kfree(dmabuf); in mbochs_dmabuf_alloc() 1140 if (!dmabuf) in mbochs_query_gfx_plane() 1142 if (!dmabuf) { in mbochs_query_gfx_plane() [all …]
|
| /linux-6.15/drivers/infiniband/core/ |
| H A D | umem_dmabuf.c | 123 struct dma_buf *dmabuf; in ib_umem_dmabuf_get_with_dma_device() local 135 dmabuf = dma_buf_get(fd); in ib_umem_dmabuf_get_with_dma_device() 136 if (IS_ERR(dmabuf)) in ib_umem_dmabuf_get_with_dma_device() 137 return ERR_CAST(dmabuf); in ib_umem_dmabuf_get_with_dma_device() 139 if (dmabuf->size < end) in ib_umem_dmabuf_get_with_dma_device() 159 dmabuf, in ib_umem_dmabuf_get_with_dma_device() 173 dma_buf_put(dmabuf); in ib_umem_dmabuf_get_with_dma_device() 250 struct dma_buf *dmabuf = umem_dmabuf->attach->dmabuf; in ib_umem_dmabuf_revoke() local 262 dma_resv_unlock(dmabuf->resv); in ib_umem_dmabuf_revoke() 268 struct dma_buf *dmabuf = umem_dmabuf->attach->dmabuf; in ib_umem_dmabuf_release() local [all …]
|
| /linux-6.15/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() 86 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_detach() 124 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_dma_buf_begin_cpu_access() 145 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_dma_buf_end_cpu_access() 180 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_mmap() 287 struct dma_buf *dmabuf; in cma_heap_allocate() local 348 dmabuf = dma_buf_export(&exp_info); in cma_heap_allocate() 349 if (IS_ERR(dmabuf)) { in cma_heap_allocate() 350 ret = PTR_ERR(dmabuf); in cma_heap_allocate() [all …]
|
| H A D | system_heap.c | 85 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_attach() 116 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_detach() 156 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_dma_buf_begin_cpu_access() 177 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_dma_buf_end_cpu_access() 197 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_mmap() 245 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_vmap() 343 struct dma_buf *dmabuf; in system_heap_allocate() local 398 dmabuf = dma_buf_export(&exp_info); in system_heap_allocate() 399 if (IS_ERR(dmabuf)) { in system_heap_allocate() 400 ret = PTR_ERR(dmabuf); in system_heap_allocate() [all …]
|
| /linux-6.15/drivers/gpu/drm/ |
| H A D | drm_prime.c | 387 return dmabuf; 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() 450 if (dmabuf) { in drm_gem_prime_handle_to_dmabuf() 451 get_dma_buf(dmabuf); in drm_gem_prime_handle_to_dmabuf() 464 if (IS_ERR(dmabuf)) { in drm_gem_prime_handle_to_dmabuf() 483 dma_buf_put(dmabuf); in drm_gem_prime_handle_to_dmabuf() 490 return dmabuf; in drm_gem_prime_handle_to_dmabuf() [all …]
|
| /linux-6.15/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-6.15/drivers/gpu/drm/virtio/ |
| H A D | virtgpu_prime.c | 52 struct drm_gem_object *obj = attach->dmabuf->priv; in virtgpu_gem_map_dma_buf() 65 struct drm_gem_object *obj = attach->dmabuf->priv; in virtgpu_gem_unmap_dma_buf() 156 dma_resv_assert_held(attach->dmabuf->resv); in virtgpu_dma_buf_import_sgt() 191 dma_resv_assert_held(attach->dmabuf->resv); in virtgpu_dma_buf_unmap() 211 struct dma_buf *dmabuf = attach->dmabuf; in virtgpu_dma_buf_free_obj() local 213 dma_resv_lock(dmabuf->resv, NULL); in virtgpu_dma_buf_free_obj() 215 dma_resv_unlock(dmabuf->resv); in virtgpu_dma_buf_free_obj() 217 dma_buf_detach(dmabuf, attach); in virtgpu_dma_buf_free_obj() 218 dma_buf_put(dmabuf); in virtgpu_dma_buf_free_obj() 235 struct dma_resv *resv = attach->dmabuf->resv; in virtgpu_dma_buf_init_obj() [all …]
|
| /linux-6.15/drivers/comedi/drivers/ |
| H A D | addi_apci_3120.c | 430 struct apci3120_dmabuf *dmabuf; in apci3120_interrupt_dma() local 434 dmabuf = &devpriv->dmabuf[devpriv->cur_dmabuf]; in apci3120_interrupt_dma() 438 if (nbytes < dmabuf->use_size) in apci3120_interrupt_dma() 461 dmabuf = &devpriv->dmabuf[devpriv->cur_dmabuf]; in apci3120_interrupt_dma() 914 dmabuf = &devpriv->dmabuf[i]; in apci3120_dma_alloc() 918 &dmabuf->hw, in apci3120_dma_alloc() 920 if (dmabuf->virt) in apci3120_dma_alloc() 923 if (!dmabuf->virt) in apci3120_dma_alloc() 944 dmabuf = &devpriv->dmabuf[i]; in apci3120_dma_free() 945 if (dmabuf->virt) { in apci3120_dma_free() [all …]
|
| H A D | adl_pci9118.c | 246 struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[buf]; in pci9118_amcc_setup_dma() local 393 struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[next_buf]; in pci9118_ai_mode4_switch() local 640 struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[devpriv->dma_actbuf]; in pci9118_ai_get_dma() local 1053 struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[0]; in pci9118_ai_cmd() local 1467 dmabuf = &devpriv->dmabuf[i]; in pci9118_alloc_dma() 1469 dmabuf->virt = in pci9118_alloc_dma() 1472 if (dmabuf->virt) in pci9118_alloc_dma() 1475 if (!dmabuf->virt) in pci9118_alloc_dma() 1496 dmabuf = &devpriv->dmabuf[i]; in pci9118_free_dma() 1497 if (dmabuf->virt) { in pci9118_free_dma() [all …]
|
| /linux-6.15/drivers/gpu/drm/xe/tests/ |
| H A D | xe_dma_buf.c | 30 struct xe_bo *imported, struct dma_buf *dmabuf) in check_residency() argument 67 swap(exported->ttm.base.dma_buf, dmabuf); in check_residency() 69 swap(exported->ttm.base.dma_buf, dmabuf); in check_residency() 113 struct dma_buf *dmabuf; in xe_test_dmabuf_import_same_driver() local 136 dmabuf = xe_gem_prime_export(&bo->ttm.base, 0); in xe_test_dmabuf_import_same_driver() 137 if (IS_ERR(dmabuf)) { in xe_test_dmabuf_import_same_driver() 139 PTR_ERR(dmabuf)); in xe_test_dmabuf_import_same_driver() 143 import = xe_gem_prime_import(&xe->drm, dmabuf); in xe_test_dmabuf_import_same_driver() 173 check_residency(test, bo, import_bo, dmabuf); in xe_test_dmabuf_import_same_driver() 189 dma_buf_put(dmabuf); in xe_test_dmabuf_import_same_driver()
|
| /linux-6.15/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-6.15/net/core/ |
| H A D | devmem.c | 71 dma_buf_detach(binding->dmabuf, binding->attachment); in __net_devmem_dmabuf_binding_free() 72 dma_buf_put(binding->dmabuf); in __net_devmem_dmabuf_binding_free() 175 struct dma_buf *dmabuf; in net_devmem_bind_dmabuf() local 180 dmabuf = dma_buf_get(dmabuf_fd); in net_devmem_bind_dmabuf() 181 if (IS_ERR(dmabuf)) in net_devmem_bind_dmabuf() 182 return ERR_CAST(dmabuf); in net_devmem_bind_dmabuf() 205 binding->dmabuf = dmabuf; in net_devmem_bind_dmabuf() 207 binding->attachment = dma_buf_attach(binding->dmabuf, dev->dev.parent); in net_devmem_bind_dmabuf() 289 dma_buf_detach(dmabuf, binding->attachment); in net_devmem_bind_dmabuf() 295 dma_buf_put(dmabuf); in net_devmem_bind_dmabuf()
|
| /linux-6.15/drivers/scsi/lpfc/ |
| H A D | lpfc_bsg.c | 2632 if (dmabuf) { in lpfcdiag_loop_get_xri() 2633 dmabuf->virt = lpfc_mbuf_alloc(phba, 0, &dmabuf->phys); in lpfcdiag_loop_get_xri() 2710 if (dmabuf) { in lpfcdiag_loop_get_xri() 2712 lpfc_mbuf_free(phba, dmabuf->virt, dmabuf->phys); in lpfcdiag_loop_get_xri() 2738 if (!dmabuf) in lpfc_bsg_dma_page_alloc() 2752 return dmabuf; in lpfc_bsg_dma_page_alloc() 2768 if (!dmabuf) in lpfc_bsg_dma_page_free() 2773 dmabuf->virt, dmabuf->phys); in lpfc_bsg_dma_page_free() 2774 kfree(dmabuf); in lpfc_bsg_dma_page_free() 4615 dmabuf); in lpfc_bsg_write_ebuf_set() [all …]
|
| /linux-6.15/drivers/gpu/drm/amd/amdgpu/ |
| H A D | amdgpu_dma_buf.c | 77 static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf, in amdgpu_dma_buf_attach() argument 81 struct drm_gem_object *obj = dmabuf->priv; in amdgpu_dma_buf_attach() 103 struct dma_buf *dmabuf = attach->dmabuf; in amdgpu_dma_buf_pin() local 104 struct amdgpu_bo *bo = gem_to_amdgpu_bo(dmabuf->priv); in amdgpu_dma_buf_pin() 107 dma_resv_assert_held(dmabuf->resv); in amdgpu_dma_buf_pin() 120 list_for_each_entry(attach, &dmabuf->attachments, node) in amdgpu_dma_buf_pin() 143 struct drm_gem_object *obj = attach->dmabuf->priv; in amdgpu_dma_buf_unpin() 165 struct dma_buf *dma_buf = attach->dmabuf; in amdgpu_dma_buf_map() 517 struct dma_buf *dma_buf = obj->import_attach->dmabuf; in amdgpu_dmabuf_is_xgmi_accessible()
|
| /linux-6.15/drivers/iio/ |
| H A D | industrialio-buffer.c | 1564 struct dma_buf *dmabuf = attach->dmabuf; in iio_buffer_dmabuf_release() local 1573 dma_buf_put(dmabuf); in iio_buffer_dmabuf_release() 1639 && priv->attach->dmabuf == dmabuf) { in iio_buffer_find_attachment() 1723 && each->attach->dmabuf == dmabuf) { in iio_buffer_attach_dmabuf() 1749 dma_buf_put(dmabuf); in iio_buffer_attach_dmabuf() 1769 if (IS_ERR(dmabuf)) in iio_buffer_detach_dmabuf() 1776 && priv->attach->dmabuf == dmabuf) { in iio_buffer_detach_dmabuf() 1786 dma_buf_put(dmabuf); in iio_buffer_detach_dmabuf() 1840 if (IS_ERR(dmabuf)) in iio_buffer_enqueue_dmabuf() 1920 dma_buf_put(dmabuf); in iio_buffer_enqueue_dmabuf() [all …]
|
| /linux-6.15/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 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 169 /* Frag landed in dmabuf. 171 * dmabuf_cmsg->dmabuf_id is the dmabuf the 175 * the dmabuf where the frag starts. [all …]
|
| /linux-6.15/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()
|