Home
last modified time | relevance | path

Searched full:dmabuf (Results 1 – 25 of 113) sorted by relevance

12345

/linux/drivers/dma-buf/
H A Ddma-buf.c40 * 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 …]
/linux/kernel/bpf/
H A Ddmabuf_iter.c16 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 Di915_gem_dmabuf.c22 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 Dmock_dmabuf.c13 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/infiniband/core/
H A Dumem_dmabuf.c24 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 Duverbs_std_types_dmabuf.c15 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 Dmbochs.c815 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 Dhid-elan.c80 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/Documentation/iio/
H A Diio_dmabuf_api.rst4 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 Ddmabuf-cache.c34 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 Ddmabuf.rst10 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 Dvidioc-expbuf.rst13 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 Dvidioc-reqbufs.rst35 :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 Ddmabuf_iter.c30 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 Ddma-buf.h85 * 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/xe/
H A Dxe_dma_buf.c25 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 Dtee_heap.c90 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/Documentation/usb/
H A Dfunctionfs.rst75 DMABUF interface
78 FunctionFS additionally supports a DMABUF based interface, where the
79 userspace can attach DMABUF objects (externally created) to an endpoint,
82 A userspace application can then use this interface to share DMABUF
90 Attach the DMABUF object, identified by its file descriptor, to the
95 Detach the given DMABUF object, identified by its file descriptor,
101 Enqueue the previously attached DMABUF to the transfer queue.
102 The argument is a structure that packs the DMABUF's file descriptor,
104 the size of the DMABUF), and a 'flags' field which is unused
/linux/net/core/
H A Ddevmem.c79 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/Documentation/userspace-api/media/dvb/
H A Ddmx-expbuf.rst13 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/include/uapi/linux/iio/
H A Dbuffer.h15 * 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 Domap_gem_dmabuf.c17 * 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 Dnetdev.yaml200 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 …]
/linux/drivers/iommu/iommufd/
H A Dpages.c1085 static int pfn_reader_dmabuf_init(struct pfn_reader_dmabuf *dmabuf, in pfn_reader_dmabuf_init() argument
1088 /* Callers must not get here if the dmabuf was already revoked */ in pfn_reader_dmabuf_init()
1092 dmabuf->phys = pages->dmabuf.phys; in pfn_reader_dmabuf_init()
1093 dmabuf->start_offset = pages->dmabuf.start; in pfn_reader_dmabuf_init()
1097 static int pfn_reader_fill_dmabuf(struct pfn_reader_dmabuf *dmabuf, in pfn_reader_fill_dmabuf() argument
1102 unsigned long start = dmabuf->start_offset + start_index * PAGE_SIZE; in pfn_reader_fill_dmabuf()
1107 * If the dmabuf has been sliced on a sub page offset then the common in pfn_reader_fill_dmabuf()
1110 batch_add_pfn_num(batch, PHYS_PFN(dmabuf->phys.paddr + start), in pfn_reader_fill_dmabuf()
1135 struct pfn_reader_dmabuf dmabuf; member
1205 return pfn_reader_fill_dmabuf(&pfns->dmabuf, &pfns->batch, in pfn_reader_fill_span()
[all …]
/linux/drivers/media/common/videobuf2/
H A Dvideobuf2-dma-contig.c42 /* DMABUF related */
85 * dmabuf->ops misconfiguration.
104 if (!dma_buf_vmap_unlocked(buf->db_attach->dmabuf, &map)) in vb2_dc_vaddr()
128 /* This takes care of DMABUF and user-enforced cache sync hint */ in vb2_dc_prepare()
148 /* This takes care of DMABUF and user-enforced cache sync hint */ in vb2_dc_finish()
310 /* DMABUF ops for exporters */
522 /* dmabuf keeps reference to vb2 buffer */ in vb2_dc_get_dmabuf()
688 /* callbacks for DMABUF buffers */
703 pr_err("dmabuf buffer is already pinned\n"); in vb2_dc_map_dmabuf()
710 pr_err("Error getting dmabuf scatterlist\n"); in vb2_dc_map_dmabuf()
[all …]

12345