€•ý/Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ&/translations/zh_CN/iio/iio_dmabuf_api”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/zh_TW/iio/iio_dmabuf_api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/it_IT/iio/iio_dmabuf_api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/ja_JP/iio/iio_dmabuf_api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/ko_KR/iio/iio_dmabuf_api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/pt_BR/iio/iio_dmabuf_api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/sp_SP/iio/iio_dmabuf_api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³Œ@/var/lib/git/docbuild/linux/Documentation/iio/iio_dmabuf_api.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ#High-speed DMABUF interface for IIO”h]”hŒ#High-speed DMABUF interface for IIO”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ 1. Overview”h]”hŒ 1. Overview”…””}”(hhàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÝh²hh³hÇh´KubhŒ paragraph”“”)”}”(hŒŸThe Industrial I/O subsystem supports access to buffers through a file-based interface, with read() and write() access calls through the IIO device's dev node.”h]”hŒ¡The Industrial I/O subsystem supports access to buffers through a file-based interface, with read() and write() access calls through the IIO device’s dev node.”…””}”(hhðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K hhÝh²hubhï)”}”(hŒµIt additionally supports a DMABUF based interface, where the userspace can attach DMABUF objects (externally created) to an IIO buffer, and subsequently use them for data transfers.”h]”hŒµIt additionally supports a DMABUF based interface, where the userspace can attach DMABUF objects (externally created) to an IIO buffer, and subsequently use them for data transfers.”…””}”(hhþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KhhÝh²hubhï)”}”(hŒÈA userspace application can then use this interface to share DMABUF objects between several interfaces, allowing it to transfer data in a zero-copy fashion, for instance between IIO and the USB stack.”h]”hŒÈA userspace application can then use this interface to share DMABUF objects between several interfaces, allowing it to transfer data in a zero-copy fashion, for instance between IIO and the USB stack.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KhhÝh²hubhï)”}”(hX The userspace application can also memory-map the DMABUF objects, and access the sample data directly. The advantage of doing this vs. the read() interface is that it avoids an extra copy of the data between the kernel and userspace. This is particularly useful for high-speed devices which produce several megabytes or even gigabytes of data per second. It does however increase the userspace-kernelspace synchronization overhead, as the DMA_BUF_SYNC_START and DMA_BUF_SYNC_END IOCTLs have to be used for data integrity.”h]”hX The userspace application can also memory-map the DMABUF objects, and access the sample data directly. The advantage of doing this vs. the read() interface is that it avoids an extra copy of the data between the kernel and userspace. This is particularly useful for high-speed devices which produce several megabytes or even gigabytes of data per second. It does however increase the userspace-kernelspace synchronization overhead, as the DMA_BUF_SYNC_START and DMA_BUF_SYNC_END IOCTLs have to be used for data integrity.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KhhÝh²hubeh}”(h]”Œoverview”ah ]”h"]”Œ 1. overview”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ 2. User API”h]”hŒ 2. User API”…””}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj0h²hh³hÇh´K ubhï)”}”(hŒÊAs part of this interface, three new IOCTLs have been added. These three IOCTLs have to be performed on the IIO buffer's file descriptor, which can be obtained using the IIO_BUFFER_GET_FD_IOCTL() ioctl.”h]”hŒÌAs part of this interface, three new IOCTLs have been added. These three IOCTLs have to be performed on the IIO buffer’s file descriptor, which can be obtained using the IIO_BUFFER_GET_FD_IOCTL() ioctl.”…””}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K"hj0h²hubhŒ block_quote”“”)”}”(hX``IIO_BUFFER_DMABUF_ATTACH_IOCTL(int fd)`` Attach the DMABUF object, identified by its file descriptor, to the IIO buffer. Returns zero on success, and a negative errno value on error. ``IIO_BUFFER_DMABUF_DETACH_IOCTL(int fd)`` Detach the given DMABUF object, identified by its file descriptor, from the IIO buffer. Returns zero on success, and a negative errno value on error. Note that closing the IIO buffer's file descriptor will automatically detach all previously attached DMABUF objects. ``IIO_BUFFER_DMABUF_ENQUEUE_IOCTL(struct iio_dmabuf *iio_dmabuf)`` Enqueue a previously attached DMABUF object to the buffer queue. Enqueued DMABUFs will be read from (if output buffer) or written to (if input buffer) as long as the buffer is enabled.”h]”hŒdefinition_list”“”)”}”(hhh]”(hŒdefinition_list_item”“”)”}”(hŒ¹``IIO_BUFFER_DMABUF_ATTACH_IOCTL(int fd)`` Attach the DMABUF object, identified by its file descriptor, to the IIO buffer. Returns zero on success, and a negative errno value on error. ”h]”(hŒterm”“”)”}”(hŒ*``IIO_BUFFER_DMABUF_ATTACH_IOCTL(int fd)``”h]”hŒliteral”“”)”}”(hjdh]”hŒ&IIO_BUFFER_DMABUF_ATTACH_IOCTL(int fd)”…””}”(hjhh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jfhjbubah}”(h]”h ]”h"]”h$]”h&]”uh1j`h³hÇh´K)hj\ubhŒ definition”“”)”}”(hhh]”hï)”}”(hŒAttach the DMABUF object, identified by its file descriptor, to the IIO buffer. Returns zero on success, and a negative errno value on error.”h]”hŒAttach the DMABUF object, identified by its file descriptor, to the IIO buffer. Returns zero on success, and a negative errno value on error.”…””}”(hj€h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K'hj}ubah}”(h]”h ]”h"]”h$]”h&]”uh1j{hj\ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´K)hjWubj[)”}”(hX7``IIO_BUFFER_DMABUF_DETACH_IOCTL(int fd)`` Detach the given DMABUF object, identified by its file descriptor, from the IIO buffer. Returns zero on success, and a negative errno value on error. Note that closing the IIO buffer's file descriptor will automatically detach all previously attached DMABUF objects. ”h]”(ja)”}”(hŒ*``IIO_BUFFER_DMABUF_DETACH_IOCTL(int fd)``”h]”jg)”}”(hj h]”hŒ&IIO_BUFFER_DMABUF_DETACH_IOCTL(int fd)”…””}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jfhjžubah}”(h]”h ]”h"]”h$]”h&]”uh1j`h³hÇh´K1hjšubj|)”}”(hhh]”(hï)”}”(hŒ•Detach the given DMABUF object, identified by its file descriptor, from the IIO buffer. Returns zero on success, and a negative errno value on error.”h]”hŒ•Detach the given DMABUF object, identified by its file descriptor, from the IIO buffer. Returns zero on success, and a negative errno value on error.”…””}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K,hjµubhï)”}”(hŒtNote that closing the IIO buffer's file descriptor will automatically detach all previously attached DMABUF objects.”h]”hŒvNote that closing the IIO buffer’s file descriptor will automatically detach all previously attached DMABUF objects.”…””}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K0hjµubeh}”(h]”h ]”h"]”h$]”h&]”uh1j{hjšubeh}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´K1hjWubj[)”}”(hŒû``IIO_BUFFER_DMABUF_ENQUEUE_IOCTL(struct iio_dmabuf *iio_dmabuf)`` Enqueue a previously attached DMABUF object to the buffer queue. Enqueued DMABUFs will be read from (if output buffer) or written to (if input buffer) as long as the buffer is enabled.”h]”(ja)”}”(hŒB``IIO_BUFFER_DMABUF_ENQUEUE_IOCTL(struct iio_dmabuf *iio_dmabuf)``”h]”jg)”}”(hjæh]”hŒ>IIO_BUFFER_DMABUF_ENQUEUE_IOCTL(struct iio_dmabuf *iio_dmabuf)”…””}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jfhjäubah}”(h]”h ]”h"]”h$]”h&]”uh1j`h³hÇh´K5hjàubj|)”}”(hhh]”hï)”}”(hŒ¸Enqueue a previously attached DMABUF object to the buffer queue. Enqueued DMABUFs will be read from (if output buffer) or written to (if input buffer) as long as the buffer is enabled.”h]”hŒ¸Enqueue a previously attached DMABUF object to the buffer queue. Enqueued DMABUFs will be read from (if output buffer) or written to (if input buffer) as long as the buffer is enabled.”…””}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K4hjûubah}”(h]”h ]”h"]”h$]”h&]”uh1j{hjàubeh}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´K5hjWubeh}”(h]”h ]”h"]”h$]”h&]”uh1jUhjQubah}”(h]”h ]”h"]”h$]”h&]”uh1jOh³hÇh´K&hj0h²hubeh}”(h]”Œuser-api”ah ]”h"]”Œ 2. user api”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K ubeh}”(h]”Œ#high-speed-dmabuf-interface-for-iio”ah ]”h"]”Œ#high-speed dmabuf interface for iio”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jWŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j1j.j-j*j)j&uŒ nametypes”}”(j1‰j-‰j)‰uh}”(j.hÊj*hÝj&j0uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.