| /linux/drivers/dma-buf/ |
| H A D | dma-buf.c | 40 * dmabuf->name must be accessed with holding dmabuf->name_lock. 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 101 * The list mutex does not protect a dmabuf's refcount, so it can be in dma_buf_iter_begin() 106 list_for_each_entry(dmabuf, &dmabuf_list, list_node) { in dma_buf_iter_begin() [all …]
|
| H A D | dma-heap.c | 28 * struct dma_heap - represents a dmabuf heap in the system 80 struct dma_buf *dmabuf; in dma_heap_ioctl_allocate() local 97 dmabuf = heap->ops->allocate(heap, len, heap_allocation->fd_flags, in dma_heap_ioctl_allocate() 100 if (IS_ERR(dmabuf)) in dma_heap_ioctl_allocate() 101 return dmabuf; in dma_heap_ioctl_allocate() 105 dma_buf_put(dmabuf); in dma_heap_ioctl_allocate() 111 return dmabuf; in dma_heap_ioctl_allocate() 128 struct dma_buf *dmabuf; in dma_heap_ioctl() local 165 dmabuf = dma_heap_ioctl_allocate(file, kdata); in dma_heap_ioctl() 167 if (IS_ERR(dmabuf)) { in dma_heap_ioctl() [all …]
|
| /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 …]
|
| /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/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 | 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/Documentation/iio/ |
| H A D | iio_dmabuf_api.rst | 4 High-speed DMABUF interface for IIO 14 It additionally supports a DMABUF based interface, where the userspace 15 can attach DMABUF objects (externally created) to an IIO buffer, and 18 A userspace application can then use this interface to share DMABUF 22 The userspace application can also memory-map the DMABUF objects, and 39 Attach the DMABUF object, identified by its file descriptor, to the 44 Detach the given DMABUF object, identified by its file descriptor, 49 automatically detach all previously attached DMABUF objects. 52 Enqueue a previously attached DMABUF object to the buffer queue.
|
| /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() 100 dev_err(dev, "Failed to attach dmabuf\n"); 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/Documentation/userspace-api/media/v4l/ |
| H A D | dmabuf.rst | 10 The DMABUF framework provides a generic method for sharing buffers 11 between multiple devices. Device drivers that support DMABUF can export 15 importer role), or both. This section describes the DMABUF importer role 18 Refer to :ref:`DMABUF exporting <VIDIOC_EXPBUF>` for details about 19 exporting V4L2 buffers as DMABUF file descriptors. 25 importing DMA buffers through DMABUF file descriptors is supported is 37 driver must be switched into DMABUF I/O mode by calling the 40 Example: Initiating streaming I/O with DMABUF file descriptors 54 printf("Video capturing or DMABUF streaming is not supported\\n"); 63 buffers, every plane can be associated with a different DMABUF [all …]
|
| H A D | vidioc-expbuf.rst | 13 VIDIOC_EXPBUF - Export a buffer as a DMABUF file descriptor. 36 It can be used to export a buffer as a DMABUF file at any time after 59 driver. This is a DMABUF file descriptor. The application may pass it to 60 other DMABUF-aware devices. Refer to :ref:`DMABUF importing <dmabuf>` 61 for details about importing DMABUF files into V4L2 nodes. It is 62 recommended to close a DMABUF file when it is no longer used to allow 146 - The DMABUF file descriptor associated with a buffer. Set by the 161 A queue is not in MMAP mode or DMABUF exporting is not supported or
|
| H A D | vidioc-reqbufs.rst | 35 :ref:`user pointer <userp>` or :ref:`DMABUF <dmabuf>` based I/O. 40 to setup some internal structures. Similarly, DMABUF buffers are 42 configures the driver into DMABUF I/O mode without performing any direct 62 buffers. Note that if any buffers are still mapped or exported via DMABUF, 67 orphaned and will be freed when they are unmapped or when the exported DMABUF 120 .. _V4L2-BUF-CAP-SUPPORTS-DMABUF: 148 mapped or exported via DMABUF. These orphaned buffers will be freed 149 when they are unmapped or when the exported DMABUF fds are closed.
|
| /linux/tools/testing/selftests/bpf/progs/ |
| H A D | dmabuf_iter.c | 30 SEC("iter/dmabuf") 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/include/linux/ |
| H A D | dma-buf.h | 85 * This is called with the &dmabuf.resv object locked and is mutual 109 * This is called with the dmabuf->resv object locked and is mutual 142 * This is always called with the dmabuf->resv object locked when 278 int (*vmap)(struct dma_buf *dmabuf, struct iosys_map *map); 279 void (*vunmap)(struct dma_buf *dmabuf, struct iosys_map *map); 467 * @dmabuf: buffer for this attachment. 469 * @node: list of dma_buf_attachment, protected by dma_resv lock of the dmabuf. 486 struct dma_buf *dmabuf; member 531 * @dmabuf: [in] pointer to dma_buf 534 * that either need to create additional references to the dmabuf on the [all …]
|
| /linux/drivers/gpu/drm/virtio/ |
| H A D | virtgpu_prime.c | 53 struct drm_gem_object *obj = attach->dmabuf->priv; in virtgpu_gem_map_dma_buf() 66 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() 158 ret = dma_resv_wait_timeout(attach->dmabuf->resv, in virtgpu_dma_buf_import_sgt() 189 dma_resv_assert_held(attach->dmabuf->resv); in virtgpu_dma_buf_unmap() 209 struct dma_buf *dmabuf = attach->dmabuf; in virtgpu_dma_buf_free_obj() local 211 dma_resv_lock(dmabuf->resv, NULL); in virtgpu_dma_buf_free_obj() 213 dma_resv_unlock(dmabuf->resv); in virtgpu_dma_buf_free_obj() 215 dma_buf_detach(dmabuf, attach); in virtgpu_dma_buf_free_obj() 216 dma_buf_put(dmabuf); in virtgpu_dma_buf_free_obj() [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() 196 static void xe_dma_buf_release(struct dma_buf *dmabuf) in xe_dma_buf_release() argument [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/gpu/drm/ |
| H A D | drm_prime.c | 229 * @dev: parent device for the exported dmabuf 237 * Returns the new dmabuf. 379 struct dma_buf *dmabuf; in export_and_register_object() local 383 dmabuf = ERR_PTR(-ENOENT); in export_and_register_object() 384 return dmabuf; in export_and_register_object() 388 dmabuf = obj->funcs->export(obj, flags); in export_and_register_object() 390 dmabuf = drm_gem_prime_export(obj, flags); in export_and_register_object() 391 if (IS_ERR(dmabuf)) { in export_and_register_object() 395 return dmabuf; in export_and_register_object() 403 obj->dma_buf = dmabuf; in export_and_register_object() [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() 200 struct dma_buf *dmabuf; in net_devmem_bind_dmabuf() local 210 dmabuf = dma_buf_get(dmabuf_fd); in net_devmem_bind_dmabuf() 211 if (IS_ERR(dmabuf)) in net_devmem_bind_dmabuf() 212 return ERR_CAST(dmabuf); in net_devmem_bind_dmabuf() 234 binding->dmabuf = dmabuf; in net_devmem_bind_dmabuf() 237 binding->attachment = dma_buf_attach(binding->dmabuf, dma_dev); in net_devmem_bind_dmabuf() 240 NL_SET_ERR_MSG(extack, "Failed to bind dmabuf to device"); in net_devmem_bind_dmabuf() 248 NL_SET_ERR_MSG(extack, "Failed to map dmabuf attachment"); in net_devmem_bind_dmabuf() [all …]
|
| /linux/drivers/gpu/drm/amd/amdgpu/ |
| H A D | amdgpu_dma_buf.c | 74 * @dmabuf: DMA-buf where we attach to 79 static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf, in amdgpu_dma_buf_attach() argument 83 struct drm_gem_object *obj = dmabuf->priv; in amdgpu_dma_buf_attach() 138 * @dmabuf: DMA-buf where we remove the attachment from 143 static void amdgpu_dma_buf_detach(struct dma_buf *dmabuf, in amdgpu_dma_buf_detach() argument 146 struct drm_gem_object *obj = dmabuf->priv; in amdgpu_dma_buf_detach() 163 struct dma_buf *dmabuf = attach->dmabuf; in amdgpu_dma_buf_pin() local 164 struct amdgpu_bo *bo = gem_to_amdgpu_bo(dmabuf->priv); in amdgpu_dma_buf_pin() 167 dma_resv_assert_held(dmabuf->resv); in amdgpu_dma_buf_pin() 177 list_for_each_entry(attach, &dmabuf->attachments, node) in amdgpu_dma_buf_pin() [all …]
|
| /linux/Documentation/userspace-api/media/dvb/ |
| H A D | dmx-expbuf.rst | 13 DMX_EXPBUF - Export a buffer as a DMABUF file descriptor. 37 It can be used to export a buffer as a DMABUF file at any time after 52 driver, on success. This is a DMABUF file descriptor. The application may 53 pass it to other DMABUF-aware devices. It is recommended to close a DMABUF 86 A queue is not in MMAP mode or DMABUF exporting is not supported or
|
| /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() 1015 LOG_LIBDFC, "2616 No 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() [all …]
|
| /linux/include/uapi/linux/iio/ |
| H A D | buffer.h | 15 * struct iio_dmabuf - Descriptor for a single IIO DMABUF object 16 * @fd: file descriptor of the DMABUF object 18 * @bytes_used: number of bytes used in this DMABUF for the data transfer. 19 * Should generally be set to the DMABUF's size.
|
| /linux/drivers/gpu/drm/omapdrm/ |
| H A D | omap_gem_dmabuf.c | 17 * DMABUF Export 24 struct drm_gem_object *obj = attachment->dmabuf->priv; in omap_gem_map_dma_buf() 36 struct drm_gem_object *obj = attachment->dmabuf->priv; in omap_gem_unmap_dma_buf() 94 * DMABUF Import 109 * Importing dmabuf exported from out own gem increases in omap_gem_prime_import() 110 * refcount on gem itself instead of f_count of dmabuf. in omap_gem_prime_import()
|
| /linux/Documentation/netlink/specs/ |
| H A D | netdev.yaml | 200 name: dmabuf 201 doc: ID of the dmabuf this page-pool is attached to. 344 name: dmabuf 345 doc: ID of the dmabuf attached to this queue, if any. 585 name: dmabuf 589 doc: netdev ifindex to bind the dmabuf to. 595 doc: receive queues to bind the dmabuf to. 601 doc: dmabuf file descriptor to bind. 605 doc: id of the dmabuf binding 613 dmabuf. Must be a power of two and >= PAGE_SIZE; defaults to [all …]
|