€•(/Œ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Œ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.”…””}”(hhø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”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjhž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.”…””}”(hj-hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K"hjhž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”“”)”}”(hjPh]”hŒ&IIO_BUFFER_DMABUF_ATTACH_IOCTL(int fd)”…””}”(hjThžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jRhjNubah}”(h]”h ]”h"]”h$]”h&]”uh1jLhŸh³h K)hjHubhŒ 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.”…””}”(hjlhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K'hjiubah}”(h]”h ]”h"]”h$]”h&]”uh1jghjHubeh}”(h]”h ]”h"]”h$]”h&]”uh1jFhŸh³h K)hjCubjG)”}”(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]”(jM)”}”(hŒ*``IIO_BUFFER_DMABUF_DETACH_IOCTL(int fd)``”h]”jS)”}”(hjŒh]”hŒ&IIO_BUFFER_DMABUF_DETACH_IOCTL(int fd)”…””}”(hjŽhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jRhjŠubah}”(h]”h ]”h"]”h$]”h&]”uh1jLhŸh³h K1hj†ubjh)”}”(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&]”uh1jghj†ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jFhŸh³h K1hjCubjG)”}”(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]”(jM)”}”(hŒB``IIO_BUFFER_DMABUF_ENQUEUE_IOCTL(struct iio_dmabuf *iio_dmabuf)``”h]”jS)”}”(hjÒh]”hŒ>IIO_BUFFER_DMABUF_ENQUEUE_IOCTL(struct iio_dmabuf *iio_dmabuf)”…””}”(hjÔhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jRhjÐubah}”(h]”h ]”h"]”h$]”h&]”uh1jLhŸh³h K5hjÌubjh)”}”(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&]”uh1jghjÌubeh}”(h]”h ]”h"]”h$]”h&]”uh1jFhŸh³h K5hjCubeh}”(h]”h ]”h"]”h$]”h&]”uh1jAhj=ubah}”(h]”h ]”h"]”h$]”h&]”uh1j;hŸh³h K&hjhž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”jCŒ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”}”(jjjjjjuŒ nametypes”}”(j‰j‰j‰uh}”(jh¶jhÉjjuŒ 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.