| /drivers/dma-buf/ |
| A D | dma-buf.c | 160 dmabuf->ops->release(dmabuf); in dma_buf_release() 223 return dmabuf->ops->mmap(dmabuf, vma); in dma_buf_mmap_internal() 319 if (!dmabuf || !dmabuf->resv) in dma_buf_poll() 727 dmabuf->cb_in.poll = dmabuf->cb_out.poll = &dmabuf->poll; in dma_buf_export() 773 if (!dmabuf || !dmabuf->file) in dma_buf_fd() 824 if (WARN_ON(!dmabuf || !dmabuf->file)) in dma_buf_put() 967 attach->dmabuf = dmabuf; in dma_buf_dynamic_attach() 1016 if (WARN_ON(!dmabuf || !attach || dmabuf != attach->dmabuf)) in dma_buf_detach() 1024 dmabuf->ops->detach(dmabuf, attach); in dma_buf_detach() 1491 return dmabuf->ops->mmap(dmabuf, vma); in dma_buf_mmap() [all …]
|
| 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 …]
|
| 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
|
| 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()
|
| /drivers/gpu/drm/i915/gem/selftests/ |
| 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 …]
|
| 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()
|
| /drivers/hid/ |
| 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 …]
|
| /drivers/infiniband/core/ |
| 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 …]
|
| /drivers/gpu/drm/ |
| 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() 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() 458 dmabuf = obj->import_attach->dmabuf; in drm_gem_prime_handle_to_dmabuf() 459 get_dma_buf(dmabuf); in drm_gem_prime_handle_to_dmabuf() 470 if (IS_ERR(dmabuf)) { in drm_gem_prime_handle_to_dmabuf() 489 dma_buf_put(dmabuf); in drm_gem_prime_handle_to_dmabuf() [all …]
|
| 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()
|
| /drivers/dma-buf/heaps/ |
| A D | cma_heap.c | 54 static int cma_heap_attach(struct dma_buf *dmabuf, in cma_heap_attach() argument 57 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_attach() 90 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_detach() 128 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_dma_buf_begin_cpu_access() 149 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_dma_buf_end_cpu_access() 184 struct cma_heap_buffer *buffer = dmabuf->priv; in cma_heap_mmap() 291 struct dma_buf *dmabuf; in cma_heap_allocate() local 352 dmabuf = dma_buf_export(&exp_info); in cma_heap_allocate() 353 if (IS_ERR(dmabuf)) { in cma_heap_allocate() 354 ret = PTR_ERR(dmabuf); in cma_heap_allocate() [all …]
|
| A D | system_heap.c | 76 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_attach() 106 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_detach() 145 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_dma_buf_begin_cpu_access() 166 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_dma_buf_end_cpu_access() 186 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_mmap() 234 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_vmap() 332 struct dma_buf *dmabuf; in system_heap_allocate() local 387 dmabuf = dma_buf_export(&exp_info); in system_heap_allocate() 388 if (IS_ERR(dmabuf)) { in system_heap_allocate() 389 ret = PTR_ERR(dmabuf); in system_heap_allocate() [all …]
|
| /drivers/media/platform/nvidia/tegra-vde/ |
| 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()
|
| /drivers/comedi/drivers/ |
| 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 …]
|
| 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 …]
|
| /drivers/gpu/drm/virtio/ |
| 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() 155 dma_resv_assert_held(attach->dmabuf->resv); in virtgpu_dma_buf_import_sgt() 190 dma_resv_assert_held(attach->dmabuf->resv); in virtgpu_dma_buf_unmap() 210 struct dma_buf *dmabuf = attach->dmabuf; in virtgpu_dma_buf_free_obj() local 212 dma_resv_lock(dmabuf->resv, NULL); in virtgpu_dma_buf_free_obj() 214 dma_resv_unlock(dmabuf->resv); in virtgpu_dma_buf_free_obj() 216 dma_buf_detach(dmabuf, attach); in virtgpu_dma_buf_free_obj() 217 dma_buf_put(dmabuf); in virtgpu_dma_buf_free_obj() 234 struct dma_resv *resv = attach->dmabuf->resv; in virtgpu_dma_buf_init_obj() [all …]
|
| /drivers/gpu/drm/xe/tests/ |
| 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()
|
| /drivers/scsi/lpfc/ |
| 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() 2709 if (dmabuf) { in lpfcdiag_loop_get_xri() 2711 lpfc_mbuf_free(phba, dmabuf->virt, dmabuf->phys); in lpfcdiag_loop_get_xri() 2737 if (!dmabuf) in lpfc_bsg_dma_page_alloc() 2751 return dmabuf; in lpfc_bsg_dma_page_alloc() 2767 if (!dmabuf) in lpfc_bsg_dma_page_free() 2772 dmabuf->virt, dmabuf->phys); in lpfc_bsg_dma_page_free() 2773 kfree(dmabuf); in lpfc_bsg_dma_page_free() 4613 dmabuf); in lpfc_bsg_write_ebuf_set() [all …]
|
| /drivers/iio/ |
| 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 …]
|
| /drivers/gpu/drm/amd/amdgpu/ |
| 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()
|
| /drivers/gpu/drm/xe/ |
| 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()
|
| /drivers/usb/gadget/function/ |
| A D | f_fs.c | 1306 struct dma_buf *dmabuf = attach->dmabuf; in ffs_dmabuf_release() local 1314 dma_buf_put(dmabuf); in ffs_dmabuf_release() 1447 && priv->attach->dmabuf == dmabuf) { in ffs_dmabuf_find_attachment() 1477 if (IS_ERR(dmabuf)) in ffs_dmabuf_attach() 1527 dma_buf_put(dmabuf); in ffs_dmabuf_attach() 1542 if (IS_ERR(dmabuf)) in ffs_dmabuf_detach() 1549 && priv->attach->dmabuf == dmabuf) { in ffs_dmabuf_detach() 1566 dma_buf_put(dmabuf); in ffs_dmabuf_detach() 1593 if (IS_ERR(dmabuf)) in ffs_dmabuf_transfer() 1695 dma_buf_put(dmabuf); in ffs_dmabuf_transfer() [all …]
|
| /drivers/gpu/drm/vmwgfx/ |
| 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() 193 .size = attach->dmabuf->size, in vmw_prime_import_sg_table() 196 .resv = attach->dmabuf->resv, in vmw_prime_import_sg_table()
|
| /drivers/xen/ |
| 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() 388 gntdev_dmabuf->dmabuf = dma_buf_export(&exp_info); in dmabuf_exp_from_pages() 389 if (IS_ERR(gntdev_dmabuf->dmabuf)) in dmabuf_exp_from_pages() 390 return PTR_ERR(gntdev_dmabuf->dmabuf); in dmabuf_exp_from_pages() 402 fd_install(take_fd(ret), no_free_ptr(gntdev_dmabuf)->dmabuf->file); in dmabuf_exp_from_pages() 605 if (attach->dmabuf->size != gntdev_dmabuf->nr_pages << PAGE_SHIFT) { in dmabuf_imp_to_refs() 608 attach->dmabuf->size, gntdev_dmabuf->nr_pages); in dmabuf_imp_to_refs() 705 dma_buf = attach->dmabuf; in dmabuf_imp_release() 706 dma_buf_detach(attach->dmabuf, attach); in dmabuf_imp_release()
|
| /drivers/gpu/drm/i915/gem/ |
| 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()
|