€•Œ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”Œ8/translations/zh_CN/userspace-api/dma-buf-alloc-exchange”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ8/translations/zh_TW/userspace-api/dma-buf-alloc-exchange”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ8/translations/it_IT/userspace-api/dma-buf-alloc-exchange”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ8/translations/ja_JP/userspace-api/dma-buf-alloc-exchange”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ8/translations/ko_KR/userspace-api/dma-buf-alloc-exchange”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ8/translations/pt_BR/userspace-api/dma-buf-alloc-exchange”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ8/translations/sp_SP/userspace-api/dma-buf-alloc-exchange”Œ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³ŒR/var/lib/git/docbuild/linux/Documentation/userspace-api/dma-buf-alloc-exchange.rst”h´Kubh¶)�”}”(hŒ"Copyright 2021-2023 Collabora Ltd.”h]”hŒ"Copyright 2021-2023 Collabora Ltd.”…”�”}”hhÈsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1hµhhh²hh³hÇh´KubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒExchanging pixel buffers”h]”hŒExchanging pixel buffers”…”�”}”(hhÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhhØh²hh³hÇh´KubhŒ paragraph”“”)�”}”(hXeAs originally designed, the Linux graphics subsystem had extremely limited support for sharing pixel-buffer allocations between processes, devices, and subsystems. Modern systems require extensive integration between all three classes; this document details how applications and kernel subsystems should approach this sharing for two-dimensional image data.”h]”hXeAs originally designed, the Linux graphics subsystem had extremely limited support for sharing pixel-buffer allocations between processes, devices, and subsystems. Modern systems require extensive integration between all three classes; this document details how applications and kernel subsystems should approach this sharing for two-dimensional image data.”…”�”}”(hhíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KhhØh²hubhì)�”}”(hŒêIt is written with reference to the DRM subsystem for GPU and display devices, V4L2 for media devices, and also to Vulkan, EGL and Wayland, for userspace support, however any other subsystems should also follow this design and advice.”h]”hŒêIt is written with reference to the DRM subsystem for GPU and display devices, V4L2 for media devices, and also to Vulkan, EGL and Wayland, for userspace support, however any other subsystems should also follow this design and advice.”…”�”}”(hhûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KhhØh²hubh×)�”}”(hhh]”(hÜ)�”}”(hŒGlossary of terms”h]”hŒGlossary of terms”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj h²hh³hÇh´KubhŒglossary”“”)�”}”(hhh]”hŒdefinition_list”“”)�”}”(hhh]”(hŒdefinition_list_item”“”)�”}”(hhh]”(hŒterm”“”)�”}”(hŒimage:”h]”(hŒimage:”…”�”}”(hj+h²hh³Nh´NubhŒindex”“”)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œentries”]”(Œsingle”Œimage:”Œ term-image”Œmain”Nt”auh1j3h³hÇh´Khj+ubeh}”(h]”jBah ]”h"]”h$]”h&]”uh1j)h³hÇh´Khj&ubhŒ definition”“”)�”}”(hhh]”hì)�”}”(hŒ¹Conceptually a two-dimensional array of pixels. The pixels may be stored in one or more memory buffers. Has width and height in pixels, pixel format and modifier (implicit or explicit).”h]”hŒ¹Conceptually a two-dimensional array of pixels. The pixels may be stored in one or more memory buffers. Has width and height in pixels, pixel format and modifier (implicit or explicit).”…”�”}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KhjMubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhj&ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$hj!ubj%)�”}”(hhh]”(j*)�”}”(hŒrow:”h]”(hŒrow:”…”�”}”(hjmh²hh³Nh´Nubj4)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”j>]”(j@Œrow:”Œterm-row”jCNt”auh1j3h³hÇh´Khjmubeh}”(h]”j€ah ]”h"]”h$]”h&]”uh1j)h³hÇh´KhjjubjL)�”}”(hhh]”hì)�”}”(hŒPA span along a single y-axis value, e.g. from co-ordinates (0,100) to (200,100).”h]”hŒPA span along a single y-axis value, e.g. from co-ordinates (0,100) to (200,100).”…”�”}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Khjˆubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhjjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$hj!ubj%)�”}”(hhh]”(j*)�”}”(hŒ scanline:”h]”(hŒ scanline:”…”�”}”(hj¨h²hh³Nh´Nubj4)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”j>]”(j@Œ scanline:”Œ term-scanline”jCNt”auh1j3h³hÇh´K hj¨ubeh}”(h]”j»ah ]”h"]”h$]”h&]”uh1j)h³hÇh´K hj¥ubjL)�”}”(hhh]”hì)�”}”(hŒSynonym for row.”h]”hŒSynonym for row.”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K"hjÃubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhj¥ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$hj!ubj%)�”}”(hhh]”(j*)�”}”(hŒcolumn:”h]”(hŒcolumn:”…”�”}”(hjãh²hh³Nh´Nubj4)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”j>]”(j@Œcolumn:”Œ term-column”jCNt”auh1j3h³hÇh´K#hjãubeh}”(h]”jöah ]”h"]”h$]”h&]”uh1j)h³hÇh´K#hjàubjL)�”}”(hhh]”hì)�”}”(hŒPA span along a single x-axis value, e.g. from co-ordinates (100,0) to (100,100).”h]”hŒPA span along a single x-axis value, e.g. from co-ordinates (100,0) to (100,100).”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K%hjþubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhjàubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$hj!ubj%)�”}”(hhh]”(j*)�”}”(hŒmemory buffer:”h]”(hŒmemory buffer:”…”�”}”(hjh²hh³Nh´Nubj4)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”j>]”(j@Œmemory buffer:”Œterm-memory-buffer”jCNt”auh1j3h³hÇh´K'hjubeh}”(h]”j1ah ]”h"]”h$]”h&]”uh1j)h³hÇh´K'hjubjL)�”}”(hhh]”hì)�”}”(hŒ–A piece of memory for storing (parts of) pixel data. Has stride and size in bytes and at least one handle in some API. May contain one or more planes.”h]”hŒ–A piece of memory for storing (parts of) pixel data. Has stride and size in bytes and at least one handle in some API. May contain one or more planes.”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K)hj9ubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$hj!ubj%)�”}”(hhh]”(j*)�”}”(hŒplane:”h]”(hŒplane:”…”�”}”(hjYh²hh³Nh´Nubj4)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”j>]”(j@Œplane:”Œ term-plane”jCNt”auh1j3h³hÇh´K,hjYubeh}”(h]”jlah ]”h"]”h$]”h&]”uh1j)h³hÇh´K,hjVubjL)�”}”(hhh]”hì)�”}”(hŒTA two-dimensional array of some or all of an image's color and alpha channel values.”h]”hŒVA two-dimensional array of some or all of an image’s color and alpha channel values.”…”�”}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K.hjtubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhjVubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$hj!ubj%)�”}”(hhh]”(j*)�”}”(hŒpixel:”h]”(hŒpixel:”…”�”}”(hj”h²hh³Nh´Nubj4)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”j>]”(j@Œpixel:”Œ term-pixel”jCNt”auh1j3h³hÇh´K0hj”ubeh}”(h]”j§ah ]”h"]”h$]”h&]”uh1j)h³hÇh´K0hj‘ubjL)�”}”(hhh]”hì)�”}”(hŒ»A picture element. Has a single color value which is defined by one or more color channels values, e.g. R, G and B, or Y, Cb and Cr. May also have an alpha value as an additional channel.”h]”hŒ»A picture element. Has a single color value which is defined by one or more color channels values, e.g. R, G and B, or Y, Cb and Cr. May also have an alpha value as an additional channel.”…”�”}”(hj²h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K2hj¯ubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhj‘ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$hj!ubj%)�”}”(hhh]”(j*)�”}”(hŒ pixel data:”h]”(hŒ pixel data:”…”�”}”(hjÏh²hh³Nh´Nubj4)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”j>]”(j@Œ pixel data:”Œterm-pixel-data”jCNt”auh1j3h³hÇh´K5hjÏubeh}”(h]”jâah ]”h"]”h$]”h&]”uh1j)h³hÇh´K5hjÌubjL)�”}”(hhh]”hì)�”}”(hŒÏBytes or bits that represent some or all of the color/alpha channel values of a pixel or an image. The data for one pixel may be spread over several planes or memory buffers depending on format and modifier.”h]”hŒÏBytes or bits that represent some or all of the color/alpha channel values of a pixel or an image. The data for one pixel may be spread over several planes or memory buffers depending on format and modifier.”…”�”}”(hjíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K7hjêubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhjÌubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$hj!ubj%)�”}”(hhh]”(j*)�”}”(hŒ color value:”h]”(hŒ color value:”…”�”}”(hj h²hh³Nh´Nubj4)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”j>]”(j@Œ color value:”Œterm-color-value”jCNt”auh1j3h³hÇh´K:hj ubeh}”(h]”jah ]”h"]”h$]”h&]”uh1j)h³hÇh´K:hjubjL)�”}”(hhh]”hì)�”}”(hŒ]A tuple of numbers, representing a color. Each element in the tuple is a color channel value.”h]”hŒ]A tuple of numbers, representing a color. Each element in the tuple is a color channel value.”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K]”(j@Œcolor channel:”Œterm-color-channel”jCNt”auh1j3h³hÇh´K>hjEubeh}”(h]”jXah ]”h"]”h$]”h&]”uh1j)h³hÇh´K>hjBubjL)�”}”(hhh]”hì)�”}”(hŒ—One of the dimensions in a color model. For example, RGB model has channels R, G, and B. Alpha channel is sometimes counted as a color channel as well.”h]”hŒ—One of the dimensions in a color model. For example, RGB model has channels R, G, and B. Alpha channel is sometimes counted as a color channel as well.”…”�”}”(hjch²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K@hj`ubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhjBubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$hj!ubj%)�”}”(hhh]”(j*)�”}”(hŒ pixel format:”h]”(hŒ pixel format:”…”�”}”(hj€h²hh³Nh´Nubj4)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”j>]”(j@Œ pixel format:”Œterm-pixel-format”jCNt”auh1j3h³hÇh´KChj€ubeh}”(h]”j“ah ]”h"]”h$]”h&]”uh1j)h³hÇh´KChj}ubjL)�”}”(hhh]”hì)�”}”(hŒNA description of how pixel data represents the pixel's color and alpha values.”h]”hŒPA description of how pixel data represents the pixel’s color and alpha values.”…”�”}”(hjžh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KEhj›ubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhj}ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$hj!ubj%)�”}”(hhh]”(j*)�”}”(hŒ modifier:”h]”(hŒ modifier:”…”�”}”(hj»h²hh³Nh´Nubj4)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”j>]”(j@Œ modifier:”Œ term-modifier”jCNt”auh1j3h³hÇh´KGhj»ubeh}”(h]”jÎah ]”h"]”h$]”h&]”uh1j)h³hÇh´KGhj¸ubjL)�”}”(hhh]”hì)�”}”(hŒ>A description of how pixel data is laid out in memory buffers.”h]”hŒ>A description of how pixel data is laid out in memory buffers.”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KIhjÖubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhj¸ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$hj!ubj%)�”}”(hhh]”(j*)�”}”(hŒalpha:”h]”(hŒalpha:”…”�”}”(hjöh²hh³Nh´Nubj4)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”j>]”(j@Œalpha:”Œ term-alpha”jCNt”auh1j3h³hÇh´KJhjöubeh}”(h]”j ah ]”h"]”h$]”h&]”uh1j)h³hÇh´KJhjóubjL)�”}”(hhh]”hì)�”}”(hŒ\A value that denotes the color coverage in a pixel. Sometimes used for translucency instead.”h]”hŒ\A value that denotes the color coverage in a pixel. Sometimes used for translucency instead.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KLhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhjóubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$hj!ubj%)�”}”(hhh]”(j*)�”}”(hŒstride:”h]”(hŒstride:”…”�”}”(hj1h²hh³Nh´Nubj4)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”j>]”(j@Œstride:”Œ term-stride”jCNt”auh1j3h³hÇh´KNhj1ubeh}”(h]”jDah ]”h"]”h$]”h&]”uh1j)h³hÇh´KNhj.ubjL)�”}”(hhh]”hì)�”}”(hX“A value that denotes the relationship between pixel-location co-ordinates and byte-offset values. Typically used as the byte offset between two pixels at the start of vertically-consecutive tiling blocks. For linear layouts, the byte offset between two vertically-adjacent pixels. For non-linear formats the stride must be computed in a consistent way, which usually is done as-if the layout was linear.”h]”hX“A value that denotes the relationship between pixel-location co-ordinates and byte-offset values. Typically used as the byte offset between two pixels at the start of vertically-consecutive tiling blocks. For linear layouts, the byte offset between two vertically-adjacent pixels. For non-linear formats the stride must be computed in a consistent way, which usually is done as-if the layout was linear.”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KPhjLubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhj.ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$hj!ubj%)�”}”(hhh]”(j*)�”}”(hŒpitch:”h]”(hŒpitch:”…”�”}”(hjlh²hh³Nh´Nubj4)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”j>]”(j@Œpitch:”Œ term-pitch”jCNt”auh1j3h³hÇh´KVhjlubeh}”(h]”jah ]”h"]”h$]”h&]”uh1j)h³hÇh´KVhjiubjL)�”}”(hhh]”hì)�”}”(hŒSynonym for stride.”h]”hŒSynonym for stride.”…”�”}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KXhj‡ubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhjiubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$hj!ubeh}”(h]”h ]”jah"]”h$]”h&]”uh1jhjh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œsorted”‰uh1jh²hhj h³hÇh´Nubeh}”(h]”Œglossary-of-terms”ah ]”h"]”Œglossary of terms”ah$]”h&]”uh1hÖhhØh²hh³hÇh´Kubh×)�”}”(hhh]”(hÜ)�”}”(hŒFormats and modifiers”h]”hŒFormats and modifiers”…”�”}”(hj¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj¹h²hh³hÇh´K\ubhì)�”}”(hXŽEach buffer must have an underlying format. This format describes the color values provided for each pixel. Although each subsystem has its own format descriptions (e.g. V4L2 and fbdev), the ``DRM_FORMAT_*`` tokens should be reused wherever possible, as they are the standard descriptions used for interchange. These tokens are described in the ``drm_fourcc.h`` file, which is a part of DRM's uAPI.”h]”(hŒ¿Each buffer must have an underlying format. This format describes the color values provided for each pixel. Although each subsystem has its own format descriptions (e.g. V4L2 and fbdev), the ”…”�”}”(hjÊh²hh³Nh´NubhŒliteral”“”)�”}”(hŒ``DRM_FORMAT_*``”h]”hŒ DRM_FORMAT_*”…”�”}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjÊubhŒŠ tokens should be reused wherever possible, as they are the standard descriptions used for interchange. These tokens are described in the ”…”�”}”(hjÊh²hh³Nh´NubjÓ)�”}”(hŒ``drm_fourcc.h``”h]”hŒ drm_fourcc.h”…”�”}”(hjæh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjÊubhŒ' file, which is a part of DRM’s uAPI.”…”�”}”(hjÊh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K^hj¹h²hubhì)�”}”(hX…Each ``DRM_FORMAT_*`` token describes the translation between a pixel co-ordinate in an image, and the color values for that pixel contained within its memory buffers. The number and type of color channels are described: whether they are RGB or YUV, integer or floating-point, the size of each channel and their locations within the pixel memory, and the relationship between color planes.”h]”(hŒEach ”…”�”}”(hjþh²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_*``”h]”hŒ DRM_FORMAT_*”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjþubhXp token describes the translation between a pixel co-ordinate in an image, and the color values for that pixel contained within its memory buffers. The number and type of color channels are described: whether they are RGB or YUV, integer or floating-point, the size of each channel and their locations within the pixel memory, and the relationship between color planes.”…”�”}”(hjþh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kehj¹h²hubhì)�”}”(hXÎFor example, ``DRM_FORMAT_ARGB8888`` describes a format in which each pixel has a single 32-bit value in memory. Alpha, red, green, and blue, color channels are available at 8-bit precision per channel, ordered respectively from most to least significant bits in little-endian storage. ``DRM_FORMAT_*`` is not affected by either CPU or device endianness; the byte pattern in memory is always as described in the format definition, which is usually little-endian.”h]”(hŒ For example, ”…”�”}”(hjh²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_ARGB8888``”h]”hŒDRM_FORMAT_ARGB8888”…”�”}”(hj&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjubhŒú describes a format in which each pixel has a single 32-bit value in memory. Alpha, red, green, and blue, color channels are available at 8-bit precision per channel, ordered respectively from most to least significant bits in little-endian storage. ”…”�”}”(hjh²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_*``”h]”hŒ DRM_FORMAT_*”…”�”}”(hj8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjubhŒ  is not affected by either CPU or device endianness; the byte pattern in memory is always as described in the format definition, which is usually little-endian.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Klhj¹h²hubhì)�”}”(hXAs a more complex example, ``DRM_FORMAT_NV12`` describes a format in which luma and chroma YUV samples are stored in separate planes, where the chroma plane is stored at half the resolution in both dimensions (i.e. one U/V chroma sample is stored for each 2x2 pixel grouping).”h]”(hŒAs a more complex example, ”…”�”}”(hjPh²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_NV12``”h]”hŒDRM_FORMAT_NV12”…”�”}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjPubhŒæ describes a format in which luma and chroma YUV samples are stored in separate planes, where the chroma plane is stored at half the resolution in both dimensions (i.e. one U/V chroma sample is stored for each 2x2 pixel grouping).”…”�”}”(hjPh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kshj¹h²hubhì)�”}”(hX“Format modifiers describe a translation mechanism between these per-pixel memory samples, and the actual memory storage for the buffer. The most straightforward modifier is ``DRM_FORMAT_MOD_LINEAR``, describing a scheme in which each plane is laid out row-sequentially, from the top-left to the bottom-right corner. This is considered the baseline interchange format, and most convenient for CPU access.”h]”(hŒ­Format modifiers describe a translation mechanism between these per-pixel memory samples, and the actual memory storage for the buffer. The most straightforward modifier is ”…”�”}”(hjph²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_MOD_LINEAR``”h]”hŒDRM_FORMAT_MOD_LINEAR”…”�”}”(hjxh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjpubhŒÍ, describing a scheme in which each plane is laid out row-sequentially, from the top-left to the bottom-right corner. This is considered the baseline interchange format, and most convenient for CPU access.”…”�”}”(hjph²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kxhj¹h²hubhì)�”}”(hX®Modern hardware employs much more sophisticated access mechanisms, typically making use of tiled access and possibly also compression. For example, the ``DRM_FORMAT_MOD_VIVANTE_TILED`` modifier describes memory storage where pixels are stored in 4x4 blocks arranged in row-major ordering, i.e. the first tile in a plane stores pixels (0,0) to (3,3) inclusive, and the second tile in a plane stores pixels (4,0) to (7,3) inclusive.”h]”(hŒ˜Modern hardware employs much more sophisticated access mechanisms, typically making use of tiled access and possibly also compression. For example, the ”…”�”}”(hj�h²hh³Nh´NubjÓ)�”}”(hŒ ``DRM_FORMAT_MOD_VIVANTE_TILED``”h]”hŒDRM_FORMAT_MOD_VIVANTE_TILED”…”�”}”(hj˜h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhj�ubhŒö modifier describes memory storage where pixels are stored in 4x4 blocks arranged in row-major ordering, i.e. the first tile in a plane stores pixels (0,0) to (3,3) inclusive, and the second tile in a plane stores pixels (4,0) to (7,3) inclusive.”…”�”}”(hj�h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Khj¹h²hubhì)�”}”(hXOSome modifiers may modify the number of planes required for an image; for example, the ``I915_FORMAT_MOD_Y_TILED_CCS`` modifier adds a second plane to RGB formats in which it stores data about the status of every tile, notably including whether the tile is fully populated with pixel data, or can be expanded from a single solid color.”h]”(hŒWSome modifiers may modify the number of planes required for an image; for example, the ”…”�”}”(hj°h²hh³Nh´NubjÓ)�”}”(hŒ``I915_FORMAT_MOD_Y_TILED_CCS``”h]”hŒI915_FORMAT_MOD_Y_TILED_CCS”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhj°ubhŒÙ modifier adds a second plane to RGB formats in which it stores data about the status of every tile, notably including whether the tile is fully populated with pixel data, or can be expanded from a single solid color.”…”�”}”(hj°h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K†hj¹h²hubhì)�”}”(hX1These extended layouts are highly vendor-specific, and even specific to particular generations or configurations of devices per-vendor. For this reason, support of modifiers must be explicitly enumerated and negotiated by all users in order to ensure a compatible and optimal pipeline, as discussed below.”h]”hX1These extended layouts are highly vendor-specific, and even specific to particular generations or configurations of devices per-vendor. For this reason, support of modifiers must be explicitly enumerated and negotiated by all users in order to ensure a compatible and optimal pipeline, as discussed below.”…”�”}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KŒhj¹h²hubeh}”(h]”Œformats-and-modifiers”ah ]”h"]”Œformats and modifiers”ah$]”h&]”uh1hÖhhØh²hh³hÇh´K\ubh×)�”}”(hhh]”(hÜ)�”}”(hŒDimensions and size”h]”hŒDimensions and size”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjæh²hh³hÇh´K“ubhì)�”}”(hX´Each pixel buffer must be accompanied by logical pixel dimensions. This refers to the number of unique samples which can be extracted from, or stored to, the underlying memory storage. For example, even though a 1920x1080 ``DRM_FORMAT_NV12`` buffer has a luma plane containing 1920x1080 samples for the Y component, and 960x540 samples for the U and V components, the overall buffer is still described as having dimensions of 1920x1080.”h]”(hŒÞEach pixel buffer must be accompanied by logical pixel dimensions. This refers to the number of unique samples which can be extracted from, or stored to, the underlying memory storage. For example, even though a 1920x1080 ”…”�”}”(hj÷h²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_NV12``”h]”hŒDRM_FORMAT_NV12”…”�”}”(hjÿh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhj÷ubhŒÃ buffer has a luma plane containing 1920x1080 samples for the Y component, and 960x540 samples for the U and V components, the overall buffer is still described as having dimensions of 1920x1080.”…”�”}”(hj÷h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K•hjæh²hubhì)�”}”(hŒËThe in-memory storage of a buffer is not guaranteed to begin immediately at the base address of the underlying memory, nor is it guaranteed that the memory storage is tightly clipped to either dimension.”h]”hŒËThe in-memory storage of a buffer is not guaranteed to begin immediately at the base address of the underlying memory, nor is it guaranteed that the memory storage is tightly clipped to either dimension.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kœhjæh²hubhì)�”}”(hXEach plane must therefore be described with an ``offset`` in bytes, which will be added to the base address of the memory storage before performing any per-pixel calculations. This may be used to combine multiple planes into a single memory buffer; for example, ``DRM_FORMAT_NV12`` may be stored in a single memory buffer where the luma plane's storage begins immediately at the start of the buffer with an offset of 0, and the chroma plane's storage follows within the same buffer beginning from the byte offset for that plane.”h]”(hŒ/Each plane must therefore be described with an ”…”�”}”(hj%h²hh³Nh´NubjÓ)�”}”(hŒ ``offset``”h]”hŒoffset”…”�”}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhj%ubhŒÍ in bytes, which will be added to the base address of the memory storage before performing any per-pixel calculations. This may be used to combine multiple planes into a single memory buffer; for example, ”…”�”}”(hj%h²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_NV12``”h]”hŒDRM_FORMAT_NV12”…”�”}”(hj?h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhj%ubhŒû may be stored in a single memory buffer where the luma plane’s storage begins immediately at the start of the buffer with an offset of 0, and the chroma plane’s storage follows within the same buffer beginning from the byte offset for that plane.”…”�”}”(hj%h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K hjæh²hubhì)�”}”(hX÷Each plane must also have a ``stride`` in bytes, expressing the offset in memory between two contiguous row. For example, a ``DRM_FORMAT_MOD_LINEAR`` buffer with dimensions of 1000x1000 may have been allocated as if it were 1024x1000, in order to allow for aligned access patterns. In this case, the buffer will still be described with a width of 1000, however the stride will be ``1024 * bpp``, indicating that there are 24 pixels at the positive extreme of the x axis whose values are not significant.”h]”(hŒEach plane must also have a ”…”�”}”(hjWh²hh³Nh´NubjÓ)�”}”(hŒ ``stride``”h]”hŒstride”…”�”}”(hj_h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjWubhŒV in bytes, expressing the offset in memory between two contiguous row. For example, a ”…”�”}”(hjWh²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_MOD_LINEAR``”h]”hŒDRM_FORMAT_MOD_LINEAR”…”�”}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjWubhŒç buffer with dimensions of 1000x1000 may have been allocated as if it were 1024x1000, in order to allow for aligned access patterns. In this case, the buffer will still be described with a width of 1000, however the stride will be ”…”�”}”(hjWh²hh³Nh´NubjÓ)�”}”(hŒ``1024 * bpp``”h]”hŒ 1024 * bpp”…”�”}”(hjƒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjWubhŒm, indicating that there are 24 pixels at the positive extreme of the x axis whose values are not significant.”…”�”}”(hjWh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K¨hjæh²hubhì)�”}”(hX¹Buffers may also be padded further in the y dimension, simply by allocating a larger area than would ordinarily be required. For example, many media decoders are not able to natively output buffers of height 1080, but instead require an effective height of 1088 pixels. In this case, the buffer continues to be described as having a height of 1080, with the memory allocation for each buffer being increased to account for the extra padding.”h]”hX¹Buffers may also be padded further in the y dimension, simply by allocating a larger area than would ordinarily be required. For example, many media decoders are not able to natively output buffers of height 1080, but instead require an effective height of 1088 pixels. In this case, the buffer continues to be described as having a height of 1080, with the memory allocation for each buffer being increased to account for the extra padding.”…”�”}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K°hjæh²hubeh}”(h]”Œdimensions-and-size”ah ]”h"]”Œdimensions and size”ah$]”h&]”uh1hÖhhØh²hh³hÇh´K“ubh×)�”}”(hhh]”(hÜ)�”}”(hŒ Enumeration”h]”hŒ Enumeration”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj±h²hh³hÇh´K¹ubhì)�”}”(hXýEvery user of pixel buffers must be able to enumerate a set of supported formats and modifiers, described together. Within KMS, this is achieved with the ``IN_FORMATS`` property on each DRM plane, listing the supported DRM formats, and the modifiers supported for each format. In userspace, this is supported through the `EGL_EXT_image_dma_buf_import_modifiers`_ extension entrypoints for EGL, the `VK_EXT_image_drm_format_modifier`_ extension for Vulkan, and the `zwp_linux_dmabuf_v1`_ extension for Wayland.”h]”(hŒšEvery user of pixel buffers must be able to enumerate a set of supported formats and modifiers, described together. Within KMS, this is achieved with the ”…”�”}”(hjÂh²hh³Nh´NubjÓ)�”}”(hŒ``IN_FORMATS``”h]”hŒ IN_FORMATS”…”�”}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjÂubhŒ™ property on each DRM plane, listing the supported DRM formats, and the modifiers supported for each format. In userspace, this is supported through the ”…”�”}”(hjÂh²hh³Nh´NubhŒ reference”“”)�”}”(hŒ)`EGL_EXT_image_dma_buf_import_modifiers`_”h]”hŒ&EGL_EXT_image_dma_buf_import_modifiers”…”�”}”(hjÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ&EGL_EXT_image_dma_buf_import_modifiers”Œrefuri”ŒZhttps://registry.khronos.org/EGL/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt”uh1jÜhjÂŒresolved”KubhŒ$ extension entrypoints for EGL, the ”…”�”}”(hjÂh²hh³Nh´NubjÝ)�”}”(hŒ#`VK_EXT_image_drm_format_modifier`_”h]”hŒ VK_EXT_image_drm_format_modifier”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ VK_EXT_image_drm_format_modifier”jîŒghttps://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_image_drm_format_modifier.html”uh1jÜhjÂjðKubhŒ extension for Vulkan, and the ”…”�”}”(hjÂh²hh³Nh´NubjÝ)�”}”(hŒ`zwp_linux_dmabuf_v1`_”h]”hŒzwp_linux_dmabuf_v1”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œzwp_linux_dmabuf_v1”jîŒwhttps://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml”uh1jÜhjÂjðKubhŒ extension for Wayland.”…”�”}”(hjÂh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K»hj±h²hubhì)�”}”(hŒ_Each of these interfaces allows users to query a set of supported format+modifier combinations.”h]”hŒ_Each of these interfaces allows users to query a set of supported format+modifier combinations.”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÃhj±h²hubeh}”(h]”Œ enumeration”ah ]”h"]”Œ enumeration”ah$]”h&]”uh1hÖhhØh²hh³hÇh´K¹ubh×)�”}”(hhh]”(hÜ)�”}”(hŒ Negotiation”h]”hŒ Negotiation”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj;h²hh³hÇh´KÈubhì)�”}”(hX It is the responsibility of userspace to negotiate an acceptable format+modifier combination for its usage. This is performed through a simple intersection of lists. For example, if a user wants to use Vulkan to render an image to be displayed on a KMS plane, it must:”h]”hX It is the responsibility of userspace to negotiate an acceptable format+modifier combination for its usage. This is performed through a simple intersection of lists. For example, if a user wants to use Vulkan to render an image to be displayed on a KMS plane, it must:”…”�”}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÊhj;h²hubhŒ block_quote”“”)�”}”(hXÙ- query KMS for the ``IN_FORMATS`` property for the given plane - query Vulkan for the supported formats for its physical device, making sure to pass the ``VkImageUsageFlagBits`` and ``VkImageCreateFlagBits`` corresponding to the intended rendering use - intersect these formats to determine the most appropriate one - for this format, intersect the lists of supported modifiers for both KMS and Vulkan, to obtain a final list of acceptable modifiers for that format ”h]”hŒ bullet_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hŒ=query KMS for the ``IN_FORMATS`` property for the given plane”h]”hì)�”}”(hjih]”(hŒquery KMS for the ”…”�”}”(hjkh²hh³Nh´NubjÓ)�”}”(hŒ``IN_FORMATS``”h]”hŒ IN_FORMATS”…”�”}”(hjrh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjkubhŒ property for the given plane”…”�”}”(hjkh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÏhjgubah}”(h]”h ]”h"]”h$]”h&]”uh1jehjbubjf)�”}”(hŒºquery Vulkan for the supported formats for its physical device, making sure to pass the ``VkImageUsageFlagBits`` and ``VkImageCreateFlagBits`` corresponding to the intended rendering use”h]”hì)�”}”(hŒºquery Vulkan for the supported formats for its physical device, making sure to pass the ``VkImageUsageFlagBits`` and ``VkImageCreateFlagBits`` corresponding to the intended rendering use”h]”(hŒXquery Vulkan for the supported formats for its physical device, making sure to pass the ”…”�”}”(hj”h²hh³Nh´NubjÓ)�”}”(hŒ``VkImageUsageFlagBits``”h]”hŒVkImageUsageFlagBits”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhj”ubhŒ and ”…”�”}”(hj”h²hh³Nh´NubjÓ)�”}”(hŒ``VkImageCreateFlagBits``”h]”hŒVkImageCreateFlagBits”…”�”}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhj”ubhŒ, corresponding to the intended rendering use”…”�”}”(hj”h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÐhj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1jehjbubjf)�”}”(hŒ=intersect these formats to determine the most appropriate one”h]”hì)�”}”(hjÎh]”hŒ=intersect these formats to determine the most appropriate one”…”�”}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÓhjÌubah}”(h]”h ]”h"]”h$]”h&]”uh1jehjbubjf)�”}”(hŒ”for this format, intersect the lists of supported modifiers for both KMS and Vulkan, to obtain a final list of acceptable modifiers for that format ”h]”hì)�”}”(hŒ“for this format, intersect the lists of supported modifiers for both KMS and Vulkan, to obtain a final list of acceptable modifiers for that format”h]”hŒ“for this format, intersect the lists of supported modifiers for both KMS and Vulkan, to obtain a final list of acceptable modifiers for that format”…”�”}”(hjçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÔhjãubah}”(h]”h ]”h"]”h$]”h&]”uh1jehjbubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1j`h³hÇh´KÏhj\ubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´KÏhj;h²hubhì)�”}”(hXThis intersection must be performed for all usages. For example, if the user also wishes to encode the image to a video stream, it must query the media API it intends to use for encoding for the set of modifiers it supports, and additionally intersect against this list.”h]”hXThis intersection must be performed for all usages. For example, if the user also wishes to encode the image to a video stream, it must query the media API it intends to use for encoding for the set of modifiers it supports, and additionally intersect against this list.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K×hj;h²hubhì)�”}”(hXIf the intersection of all lists is an empty list, it is not possible to share buffers in this way, and an alternate strategy must be considered (e.g. using CPU access routines to copy data between the different uses, with the corresponding performance cost).”h]”hXIf the intersection of all lists is an empty list, it is not possible to share buffers in this way, and an alternate strategy must be considered (e.g. using CPU access routines to copy data between the different uses, with the corresponding performance cost).”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÜhj;h²hubhì)�”}”(hŒFThe resulting modifier list is unsorted; the order is not significant.”h]”hŒFThe resulting modifier list is unsorted; the order is not significant.”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Káhj;h²hubeh}”(h]”Œ negotiation”ah ]”h"]”Œ negotiation”ah$]”h&]”uh1hÖhhØh²hh³hÇh´KÈubh×)�”}”(hhh]”(hÜ)�”}”(hŒ Allocation”h]”hŒ Allocation”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj;h²hh³hÇh´Kåubhì)�”}”(hXGOnce userspace has determined an appropriate format, and corresponding list of acceptable modifiers, it must allocate the buffer. As there is no universal buffer-allocation interface available at either kernel or userspace level, the client makes an arbitrary choice of allocation interface such as Vulkan, GBM, or a media API.”h]”hXGOnce userspace has determined an appropriate format, and corresponding list of acceptable modifiers, it must allocate the buffer. As there is no universal buffer-allocation interface available at either kernel or userspace level, the client makes an arbitrary choice of allocation interface such as Vulkan, GBM, or a media API.”…”�”}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kçhj;h²hubhì)�”}”(hXEach allocation request must take, at a minimum: the pixel format, a list of acceptable modifiers, and the buffer's width and height. Each API may extend this set of properties in different ways, such as allowing allocation in more than two dimensions, intended usage patterns, etc.”h]”hXEach allocation request must take, at a minimum: the pixel format, a list of acceptable modifiers, and the buffer’s width and height. Each API may extend this set of properties in different ways, such as allowing allocation in more than two dimensions, intended usage patterns, etc.”…”�”}”(hjZh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kíhj;h²hubhì)�”}”(hXThe component which allocates the buffer will make an arbitrary choice of what it considers the 'best' modifier within the acceptable list for the requested allocation, any padding required, and further properties of the underlying memory buffers such as whether they are stored in system or device-specific memory, whether or not they are physically contiguous, and their cache mode. These properties of the memory buffer are not visible to userspace, however the ``dma-heaps`` API is an effort to address this.”h]”(hXÕThe component which allocates the buffer will make an arbitrary choice of what it considers the ‘best’ modifier within the acceptable list for the requested allocation, any padding required, and further properties of the underlying memory buffers such as whether they are stored in system or device-specific memory, whether or not they are physically contiguous, and their cache mode. These properties of the memory buffer are not visible to userspace, however the ”…”�”}”(hjhh²hh³Nh´NubjÓ)�”}”(hŒ ``dma-heaps``”h]”hŒ dma-heaps”…”�”}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjhubhŒ" API is an effort to address this.”…”�”}”(hjhh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kòhj;h²hubhì)�”}”(hXuAfter allocation, the client must query the allocator to determine the actual modifier selected for the buffer, as well as the per-plane offset and stride. Allocators are not permitted to vary the format in use, to select a modifier not provided within the acceptable list, nor to vary the pixel dimensions other than the padding expressed through offset, stride, and size.”h]”hXuAfter allocation, the client must query the allocator to determine the actual modifier selected for the buffer, as well as the per-plane offset and stride. Allocators are not permitted to vary the format in use, to select a modifier not provided within the acceptable list, nor to vary the pixel dimensions other than the padding expressed through offset, stride, and size.”…”�”}”(hjˆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kúhj;h²hubhì)�”}”(hŒÉCommunicating additional constraints, such as alignment of stride or offset, placement within a particular memory area, etc, is out of scope of dma-buf, and is not solved by format and modifier tokens.”h]”hŒÉCommunicating additional constraints, such as alignment of stride or offset, placement within a particular memory area, etc, is out of scope of dma-buf, and is not solved by format and modifier tokens.”…”�”}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mhj;h²hubeh}”(h]”Œ allocation”ah ]”h"]”Œ allocation”ah$]”h&]”uh1hÖhhØh²hh³hÇh´Kåubh×)�”}”(hhh]”(hÜ)�”}”(hŒImport”h]”hŒImport”…”�”}”(hj¯h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj¬h²hh³hÇh´Mubhì)�”}”(hŒºTo use a buffer within a different context, device, or subsystem, the user passes these parameters (format, modifier, width, height, and per-plane offset and stride) to an importing API.”h]”hŒºTo use a buffer within a different context, device, or subsystem, the user passes these parameters (format, modifier, width, height, and per-plane offset and stride) to an importing API.”…”�”}”(hj½h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mhj¬h²hubhì)�”}”(hX Each memory buffer is referred to by a buffer handle, which may be unique or duplicated within an image. For example, a ``DRM_FORMAT_NV12`` buffer may have the luma and chroma buffers combined into a single memory buffer by use of the per-plane offset parameters, or they may be completely separate allocations in memory. For this reason, each import and allocation API must provide a separate handle for each plane.”h]”(hŒxEach memory buffer is referred to by a buffer handle, which may be unique or duplicated within an image. For example, a ”…”�”}”(hjËh²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_NV12``”h]”hŒDRM_FORMAT_NV12”…”�”}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjËubhX buffer may have the luma and chroma buffers combined into a single memory buffer by use of the per-plane offset parameters, or they may be completely separate allocations in memory. For this reason, each import and allocation API must provide a separate handle for each plane.”…”�”}”(hjËh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M hj¬h²hubhì)�”}”(hŒäEach kernel subsystem has its own types and interfaces for buffer management. DRM uses GEM buffer objects (BOs), V4L2 has its own references, etc. These types are not portable between contexts, processes, devices, or subsystems.”h]”hŒäEach kernel subsystem has its own types and interfaces for buffer management. DRM uses GEM buffer objects (BOs), V4L2 has its own references, etc. These types are not portable between contexts, processes, devices, or subsystems.”…”�”}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mhj¬h²hubhì)�”}”(hXdTo address this, ``dma-buf`` handles are used as the universal interchange for buffers. Subsystem-specific operations are used to export native buffer handles to a ``dma-buf`` file descriptor, and to import those file descriptors into a native buffer handle. dma-buf file descriptors can be transferred between contexts, processes, devices, and subsystems.”h]”(hŒTo address this, ”…”�”}”(hjùh²hh³Nh´NubjÓ)�”}”(hŒ ``dma-buf``”h]”hŒdma-buf”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjùubhŒˆ handles are used as the universal interchange for buffers. Subsystem-specific operations are used to export native buffer handles to a ”…”�”}”(hjùh²hh³Nh´NubjÓ)�”}”(hŒ ``dma-buf``”h]”hŒdma-buf”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjùubhŒµ file descriptor, and to import those file descriptors into a native buffer handle. dma-buf file descriptors can be transferred between contexts, processes, devices, and subsystems.”…”�”}”(hjùh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mhj¬h²hubhì)�”}”(hXÑFor example, a Wayland media player may use V4L2 to decode a video frame into a ``DRM_FORMAT_NV12`` buffer. This will result in two memory planes (luma and chroma) being dequeued by the user from V4L2. These planes are then exported to one dma-buf file descriptor per plane, these descriptors are then sent along with the metadata (format, modifier, width, height, per-plane offset and stride) to the Wayland server. The Wayland server will then import these file descriptors as an EGLImage for use through EGL/OpenGL (ES), a VkImage for use through Vulkan, or a KMS framebuffer object; each of these import operations will take the same metadata and convert the dma-buf file descriptors into their native buffer handles.”h]”(hŒPFor example, a Wayland media player may use V4L2 to decode a video frame into a ”…”�”}”(hj+ h²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_NV12``”h]”hŒDRM_FORMAT_NV12”…”�”}”(hj3 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhj+ ubhXn buffer. This will result in two memory planes (luma and chroma) being dequeued by the user from V4L2. These planes are then exported to one dma-buf file descriptor per plane, these descriptors are then sent along with the metadata (format, modifier, width, height, per-plane offset and stride) to the Wayland server. The Wayland server will then import these file descriptors as an EGLImage for use through EGL/OpenGL (ES), a VkImage for use through Vulkan, or a KMS framebuffer object; each of these import operations will take the same metadata and convert the dma-buf file descriptors into their native buffer handles.”…”�”}”(hj+ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mhj¬h²hubhì)�”}”(hŒËHaving a non-empty intersection of supported modifiers does not guarantee that import will succeed into all consumers; they may have constraints beyond those implied by modifiers which must be satisfied.”h]”hŒËHaving a non-empty intersection of supported modifiers does not guarantee that import will succeed into all consumers; they may have constraints beyond those implied by modifiers which must be satisfied.”…”�”}”(hjK h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M(hj¬h²hubeh}”(h]”Œimport”ah ]”h"]”Œimport”ah$]”h&]”uh1hÖhhØh²hh³hÇh´Mubh×)�”}”(hhh]”(hÜ)�”}”(hŒImplicit modifiers”h]”hŒImplicit modifiers”…”�”}”(hjd h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhja h²hh³hÇh´M.ubhì)�”}”(hXThe concept of modifiers post-dates all of the subsystems mentioned above. As such, it has been retrofitted into all of these APIs, and in order to ensure backwards compatibility, support is needed for drivers and userspace which do not (yet) support modifiers.”h]”hXThe concept of modifiers post-dates all of the subsystems mentioned above. As such, it has been retrofitted into all of these APIs, and in order to ensure backwards compatibility, support is needed for drivers and userspace which do not (yet) support modifiers.”…”�”}”(hjr h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M0hja h²hubhì)�”}”(hX<As an example, GBM is used to allocate buffers to be shared between EGL for rendering and KMS for display. It has two entrypoints for allocating buffers: ``gbm_bo_create`` which only takes the format, width, height, and a usage token, and ``gbm_bo_create_with_modifiers`` which extends this with a list of modifiers.”h]”(hŒšAs an example, GBM is used to allocate buffers to be shared between EGL for rendering and KMS for display. It has two entrypoints for allocating buffers: ”…”�”}”(hj€ h²hh³Nh´NubjÓ)�”}”(hŒ``gbm_bo_create``”h]”hŒ gbm_bo_create”…”�”}”(hjˆ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhj€ ubhŒD which only takes the format, width, height, and a usage token, and ”…”�”}”(hj€ h²hh³Nh´NubjÓ)�”}”(hŒ ``gbm_bo_create_with_modifiers``”h]”hŒgbm_bo_create_with_modifiers”…”�”}”(hjš h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhj€ ubhŒ- which extends this with a list of modifiers.”…”�”}”(hj€ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M5hja h²hubhì)�”}”(hX‡In the latter case, the allocation is as discussed above, being provided with a list of acceptable modifiers that the implementation can choose from (or fail if it is not possible to allocate within those constraints). In the former case where modifiers are not provided, the GBM implementation must make its own choice as to what is likely to be the 'best' layout. Such a choice is entirely implementation-specific: some will internally use tiled layouts which are not CPU-accessible if the implementation decides that is a good idea through whatever heuristic. It is the implementation's responsibility to ensure that this choice is appropriate.”h]”hX�In the latter case, the allocation is as discussed above, being provided with a list of acceptable modifiers that the implementation can choose from (or fail if it is not possible to allocate within those constraints). In the former case where modifiers are not provided, the GBM implementation must make its own choice as to what is likely to be the ‘best’ layout. Such a choice is entirely implementation-specific: some will internally use tiled layouts which are not CPU-accessible if the implementation decides that is a good idea through whatever heuristic. It is the implementation’s responsibility to ensure that this choice is appropriate.”…”�”}”(hj² h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M:hja h²hubhì)�”}”(hX4To support this case where the layout is not known because there is no awareness of modifiers, a special ``DRM_FORMAT_MOD_INVALID`` token has been defined. This pseudo-modifier declares that the layout is not known, and that the driver should use its own logic to determine what the underlying layout may be.”h]”(hŒiTo support this case where the layout is not known because there is no awareness of modifiers, a special ”…”�”}”(hjÀ h²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_MOD_INVALID``”h]”hŒDRM_FORMAT_MOD_INVALID”…”�”}”(hjÈ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjÀ ubhŒ± token has been defined. This pseudo-modifier declares that the layout is not known, and that the driver should use its own logic to determine what the underlying layout may be.”…”�”}”(hjÀ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´MDhja h²hubhŒnote”“”)�”}”(hXµ``DRM_FORMAT_MOD_INVALID`` is a non-zero value. The modifier value zero is ``DRM_FORMAT_MOD_LINEAR``, which is an explicit guarantee that the image has the linear layout. Care and attention should be taken to ensure that zero as a default value is not mixed up with either no modifier or the linear modifier. Also note that in some APIs the invalid modifier value is specified with an out-of-band flag, like in ``DRM_IOCTL_MODE_ADDFB2``.”h]”hì)�”}”(hXµ``DRM_FORMAT_MOD_INVALID`` is a non-zero value. The modifier value zero is ``DRM_FORMAT_MOD_LINEAR``, which is an explicit guarantee that the image has the linear layout. Care and attention should be taken to ensure that zero as a default value is not mixed up with either no modifier or the linear modifier. Also note that in some APIs the invalid modifier value is specified with an out-of-band flag, like in ``DRM_IOCTL_MODE_ADDFB2``.”h]”(jÓ)�”}”(hŒ``DRM_FORMAT_MOD_INVALID``”h]”hŒDRM_FORMAT_MOD_INVALID”…”�”}”(hjê h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjæ ubhŒ1 is a non-zero value. The modifier value zero is ”…”�”}”(hjæ h²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_MOD_LINEAR``”h]”hŒDRM_FORMAT_MOD_LINEAR”…”�”}”(hjü h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjæ ubhX7, which is an explicit guarantee that the image has the linear layout. Care and attention should be taken to ensure that zero as a default value is not mixed up with either no modifier or the linear modifier. Also note that in some APIs the invalid modifier value is specified with an out-of-band flag, like in ”…”�”}”(hjæ h²hh³Nh´NubjÓ)�”}”(hŒ``DRM_IOCTL_MODE_ADDFB2``”h]”hŒDRM_IOCTL_MODE_ADDFB2”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjæ ubhŒ.”…”�”}”(hjæ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´MKhjâ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jà hja h²hh³hÇh´Nubj )�”}”(hhh]”j%)�”}”(hXPThere are four cases where this token may be used: - during enumeration, an interface may return ``DRM_FORMAT_MOD_INVALID``, either as the sole member of a modifier list to declare that explicit modifiers are not supported, or as part of a larger list to declare that implicit modifiers may be used - during allocation, a user may supply ``DRM_FORMAT_MOD_INVALID``, either as the sole member of a modifier list (equivalent to not supplying a modifier list at all) to declare that explicit modifiers are not supported and must not be used, or as part of a larger list to declare that an allocation using implicit modifiers is acceptable - in a post-allocation query, an implementation may return ``DRM_FORMAT_MOD_INVALID`` as the modifier of the allocated buffer to declare that the underlying layout is implementation-defined and that an explicit modifier description is not available; per the above rules, this may only be returned when the user has included ``DRM_FORMAT_MOD_INVALID`` as part of the list of acceptable modifiers, or not provided a list - when importing a buffer, the user may supply ``DRM_FORMAT_MOD_INVALID`` as the buffer modifier (or not supply a modifier) to indicate that the modifier is unknown for whatever reason; this is only acceptable when the buffer has not been allocated with an explicit modifier ”h]”(j*)�”}”(hŒ2There are four cases where this token may be used:”h]”hŒ2There are four cases where this token may be used:”…”�”}”(hj3 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j)h³hÇh´Mehj/ ubjL)�”}”(hhh]”ja)�”}”(hhh]”(jf)�”}”(hŒõduring enumeration, an interface may return ``DRM_FORMAT_MOD_INVALID``, either as the sole member of a modifier list to declare that explicit modifiers are not supported, or as part of a larger list to declare that implicit modifiers may be used”h]”hì)�”}”(hŒõduring enumeration, an interface may return ``DRM_FORMAT_MOD_INVALID``, either as the sole member of a modifier list to declare that explicit modifiers are not supported, or as part of a larger list to declare that implicit modifiers may be used”h]”(hŒ,during enumeration, an interface may return ”…”�”}”(hjK h²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_MOD_INVALID``”h]”hŒDRM_FORMAT_MOD_INVALID”…”�”}”(hjS h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjK ubhŒ¯, either as the sole member of a modifier list to declare that explicit modifiers are not supported, or as part of a larger list to declare that implicit modifiers may be used”…”�”}”(hjK h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´MShjG ubah}”(h]”h ]”h"]”h$]”h&]”uh1jehjD ubjf)�”}”(hXNduring allocation, a user may supply ``DRM_FORMAT_MOD_INVALID``, either as the sole member of a modifier list (equivalent to not supplying a modifier list at all) to declare that explicit modifiers are not supported and must not be used, or as part of a larger list to declare that an allocation using implicit modifiers is acceptable”h]”hì)�”}”(hXNduring allocation, a user may supply ``DRM_FORMAT_MOD_INVALID``, either as the sole member of a modifier list (equivalent to not supplying a modifier list at all) to declare that explicit modifiers are not supported and must not be used, or as part of a larger list to declare that an allocation using implicit modifiers is acceptable”h]”(hŒ%during allocation, a user may supply ”…”�”}”(hju h²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_MOD_INVALID``”h]”hŒDRM_FORMAT_MOD_INVALID”…”�”}”(hj} h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhju ubhX, either as the sole member of a modifier list (equivalent to not supplying a modifier list at all) to declare that explicit modifiers are not supported and must not be used, or as part of a larger list to declare that an allocation using implicit modifiers is acceptable”…”�”}”(hju h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´MWhjq ubah}”(h]”h ]”h"]”h$]”h&]”uh1jehjD ubjf)�”}”(hX in a post-allocation query, an implementation may return ``DRM_FORMAT_MOD_INVALID`` as the modifier of the allocated buffer to declare that the underlying layout is implementation-defined and that an explicit modifier description is not available; per the above rules, this may only be returned when the user has included ``DRM_FORMAT_MOD_INVALID`` as part of the list of acceptable modifiers, or not provided a list”h]”hì)�”}”(hX in a post-allocation query, an implementation may return ``DRM_FORMAT_MOD_INVALID`` as the modifier of the allocated buffer to declare that the underlying layout is implementation-defined and that an explicit modifier description is not available; per the above rules, this may only be returned when the user has included ``DRM_FORMAT_MOD_INVALID`` as part of the list of acceptable modifiers, or not provided a list”h]”(hŒ9in a post-allocation query, an implementation may return ”…”�”}”(hjŸ h²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_MOD_INVALID``”h]”hŒDRM_FORMAT_MOD_INVALID”…”�”}”(hj§ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjŸ ubhŒï as the modifier of the allocated buffer to declare that the underlying layout is implementation-defined and that an explicit modifier description is not available; per the above rules, this may only be returned when the user has included ”…”�”}”(hjŸ h²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_MOD_INVALID``”h]”hŒDRM_FORMAT_MOD_INVALID”…”�”}”(hj¹ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjŸ ubhŒD as part of the list of acceptable modifiers, or not provided a list”…”�”}”(hjŸ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M\hj› ubah}”(h]”h ]”h"]”h$]”h&]”uh1jehjD ubjf)�”}”(hXwhen importing a buffer, the user may supply ``DRM_FORMAT_MOD_INVALID`` as the buffer modifier (or not supply a modifier) to indicate that the modifier is unknown for whatever reason; this is only acceptable when the buffer has not been allocated with an explicit modifier ”h]”hì)�”}”(hXwhen importing a buffer, the user may supply ``DRM_FORMAT_MOD_INVALID`` as the buffer modifier (or not supply a modifier) to indicate that the modifier is unknown for whatever reason; this is only acceptable when the buffer has not been allocated with an explicit modifier”h]”(hŒ-when importing a buffer, the user may supply ”…”�”}”(hjÛ h²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_MOD_INVALID``”h]”hŒDRM_FORMAT_MOD_INVALID”…”�”}”(hjã h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjÛ ubhŒÉ as the buffer modifier (or not supply a modifier) to indicate that the modifier is unknown for whatever reason; this is only acceptable when the buffer has not been allocated with an explicit modifier”…”�”}”(hjÛ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mbhj× ubah}”(h]”h ]”h"]”h$]”h&]”uh1jehjD ubeh}”(h]”h ]”h"]”h$]”h&]”jjuh1j`h³hÇh´MShjA ubah}”(h]”h ]”h"]”h$]”h&]”uh1jKhj/ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j$h³hÇh´Mehj, ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhja h²hh³Nh´Nubhì)�”}”(hXTIt follows from this that for any single buffer, the complete chain of operations formed by the producer and all the consumers must be either fully implicit or fully explicit. For example, if a user wishes to allocate a buffer for use between GPU, display, and media, but the media API does not support modifiers, then the user **must not** allocate the buffer with explicit modifiers and attempt to import the buffer into the media API with no modifier, but either perform the allocation using implicit modifiers, or allocate the buffer for media use separately and copy between the two buffers.”h]”(hXHIt follows from this that for any single buffer, the complete chain of operations formed by the producer and all the consumers must be either fully implicit or fully explicit. For example, if a user wishes to allocate a buffer for use between GPU, display, and media, but the media API does not support modifiers, then the user ”…”�”}”(hj h²hh³Nh´NubhŒstrong”“”)�”}”(hŒ **must not**”h]”hŒmust not”…”�”}”(hj# h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j! hj ubhX allocate the buffer with explicit modifiers and attempt to import the buffer into the media API with no modifier, but either perform the allocation using implicit modifiers, or allocate the buffer for media use separately and copy between the two buffers.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mghja h²hubhì)�”}”(hXSAs one exception to the above, allocations may be 'upgraded' from implicit to explicit modifiers. For example, if the buffer is allocated with ``gbm_bo_create`` (taking no modifiers), the user may then query the modifier with ``gbm_bo_get_modifier`` and then use this modifier as an explicit modifier token if a valid modifier is returned.”h]”(hŒ“As one exception to the above, allocations may be ‘upgraded’ from implicit to explicit modifiers. For example, if the buffer is allocated with ”…”�”}”(hj; h²hh³Nh´NubjÓ)�”}”(hŒ``gbm_bo_create``”h]”hŒ gbm_bo_create”…”�”}”(hjC h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhj; ubhŒB (taking no modifiers), the user may then query the modifier with ”…”�”}”(hj; h²hh³Nh´NubjÓ)�”}”(hŒ``gbm_bo_get_modifier``”h]”hŒgbm_bo_get_modifier”…”�”}”(hjU h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhj; ubhŒZ and then use this modifier as an explicit modifier token if a valid modifier is returned.”…”�”}”(hj; h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mphja h²hubhì)�”}”(hX¤When allocating buffers for exchange between different users and modifiers are not available, implementations are strongly encouraged to use ``DRM_FORMAT_MOD_LINEAR`` for their allocation, as this is the universal baseline for exchange. However, it is not guaranteed that this will result in the correct interpretation of buffer content, as implicit modifier operation may still be subject to driver-specific heuristics.”h]”(hŒ�When allocating buffers for exchange between different users and modifiers are not available, implementations are strongly encouraged to use ”…”�”}”(hjm h²hh³Nh´NubjÓ)�”}”(hŒ``DRM_FORMAT_MOD_LINEAR``”h]”hŒDRM_FORMAT_MOD_LINEAR”…”�”}”(hju h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjm ubhŒþ for their allocation, as this is the universal baseline for exchange. However, it is not guaranteed that this will result in the correct interpretation of buffer content, as implicit modifier operation may still be subject to driver-specific heuristics.”…”�”}”(hjm h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Mvhja h²hubhì)�”}”(hXwAny new users - userspace programs and protocols, kernel subsystems, etc - wishing to exchange buffers must offer interoperability through dma-buf file descriptors for memory planes, DRM format tokens to describe the format, DRM format modifiers to describe the layout in memory, at least width and height for dimensions, and at least offset and stride for each memory plane.”h]”hXwAny new users - userspace programs and protocols, kernel subsystems, etc - wishing to exchange buffers must offer interoperability through dma-buf file descriptors for memory planes, DRM format tokens to describe the format, DRM format modifiers to describe the layout in memory, at least width and height for dimensions, and at least offset and stride for each memory plane.”…”�”}”(hj� h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´M}hja h²hubhŒtarget”“”)�”}”(hŒ�.. _zwp_linux_dmabuf_v1: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml”h]”h}”(h]”Œzwp-linux-dmabuf-v1”ah ]”h"]”Œzwp_linux_dmabuf_v1”ah$]”h&]”jîjuh1j› h´Mƒhja h²hh³hÇŒ referenced”Kubjœ )�”}”(hŒ�.. _VK_EXT_image_drm_format_modifier: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_image_drm_format_modifier.html”h]”h}”(h]”Œ vk-ext-image-drm-format-modifier”ah ]”h"]”Œ vk_ext_image_drm_format_modifier”ah$]”h&]”jîjuh1j› h´M„hja h²hh³hÇj© Kubjœ )�”}”(hŒ†.. _EGL_EXT_image_dma_buf_import_modifiers: https://registry.khronos.org/EGL/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt”h]”h}”(h]”Œ&egl-ext-image-dma-buf-import-modifiers”a• h ]”h"]”Œ&egl_ext_image_dma_buf_import_modifiers”ah$]”h&]”jîjïuh1j› h´M…hja h²hh³hÇj© Kubeh}”(h]”Œimplicit-modifiers”ah ]”h"]”Œimplicit modifiers”ah$]”h&]”uh1hÖhhØh²hh³hÇh´M.ubeh}”(h]”Œexchanging-pixel-buffers”ah ]”h"]”Œexchanging pixel buffers”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”jõ Œ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”}”(Œ&egl_ext_image_dma_buf_import_modifiers”]”jÞaŒ vk_ext_image_drm_format_modifier”]”jõaŒzwp_linux_dmabuf_v1”]”j auŒrefids”}”Œnameids”}”(jÏ jÌ j¶j³jãjàj®j«j8j5j8j5j©j¦j^ j[ jÇ jÄ j¦ j£ j³ j° j¿ j¼ uŒ nametypes”}”(jÏ ‰j¶‰jã‰j®‰j8‰j8‰j©‰j^ ‰jÇ ‰j¦ ˆj³ ˆj¿ ˆuh}”(jÌ hØj³j jBj+j€jmj»j¨jöjãj1jjljYj§j”jâjÏjj jXjEj“j€jÎj»j jöjDj1jjljàj¹j«jæj5j±j5j;j¦j;j[ j¬jÄ ja j£ j� j° jª j¼ j¶ uŒ 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.