\hypertarget{page_linux_dmabuf_unstable_v1_page_ifaces_linux_dmabuf_unstable_v1}{}\section{Interfaces}\label{page_linux_dmabuf_unstable_v1_page_ifaces_linux_dmabuf_unstable_v1}

\begin{DoxyItemize}
\item \hyperlink{page_iface_zwp_linux_dmabuf_v1}{zwp\+\_\+linux\+\_\+dmabuf\+\_\+v1} -\/ factory for creating dmabuf-\/based wl\+\_\+buffers
\item \hyperlink{page_iface_zwp_linux_buffer_params_v1}{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1} -\/ parameters for creating a dmabuf-\/based wl\+\_\+buffer 
\end{DoxyItemize}\hypertarget{page_linux_dmabuf_unstable_v1_page_copyright_linux_dmabuf_unstable_v1}{}\section{Copyright}\label{page_linux_dmabuf_unstable_v1_page_copyright_linux_dmabuf_unstable_v1}

\begin{DoxyPre}\end{DoxyPre}



\begin{DoxyPre}Copyright © 2014, 2015 Collabora, Ltd.\end{DoxyPre}



\begin{DoxyPre}Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the name of
the copyright holders not be used in advertising or publicity
pertaining to distribution of the software without specific,
written prior permission.  The copyright holders make no
representations about the suitability of this software for any
purpose.  It is provided "as is" without express or implied
warranty.\end{DoxyPre}



\begin{DoxyPre}THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
\end{DoxyPre}
 \hypertarget{page_iface_zwp_linux_dmabuf_v1}{}\section{zwp\+\_\+linux\+\_\+dmabuf\+\_\+v1}\label{page_iface_zwp_linux_dmabuf_v1}
\hypertarget{page_iface_zwp_linux_dmabuf_v1_page_iface_zwp_linux_dmabuf_v1_desc}{}\subsection{Description}\label{page_iface_zwp_linux_dmabuf_v1_page_iface_zwp_linux_dmabuf_v1_desc}
Following the interfaces from\+: \href{https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt}{\tt https\+://www.\+khronos.\+org/registry/egl/extensions/\+E\+X\+T/\+E\+G\+L\+\_\+\+E\+X\+T\+\_\+image\+\_\+dma\+\_\+buf\+\_\+import.\+txt} and the Linux D\+RM sub-\/system\textquotesingle{}s Add\+Fb2 ioctl.

This interface offers a way to create generic dmabuf-\/based wl\+\_\+buffers. Immediately after a client binds to this interface, the set of supported formats is sent with \textquotesingle{}format\textquotesingle{} events.

The following are required from clients\+:


\begin{DoxyItemize}
\item Clients must ensure that either all data in the dma-\/buf is coherent for all subsequent read access or that coherency is correctly handled by the underlying kernel-\/side dma-\/buf implementation.
\item Don\textquotesingle{}t make any more attachments after sending the buffer to the compositor. Making more attachments later increases the risk of the compositor not being able to use (re-\/import) an existing dmabuf-\/based wl\+\_\+buffer.
\end{DoxyItemize}

The underlying graphics stack must ensure the following\+:


\begin{DoxyItemize}
\item The dmabuf file descriptors relayed to the server will stay valid for the whole lifetime of the wl\+\_\+buffer. This means the server may at any time use those fds to import the dmabuf into any kernel sub-\/system that might accept it.
\end{DoxyItemize}

To create a wl\+\_\+buffer from one or more dmabufs, a client creates a zwp\+\_\+linux\+\_\+dmabuf\+\_\+params\+\_\+v1 object with zwp\+\_\+linux\+\_\+dmabuf\+\_\+v1.\+create\+\_\+params request. All planes required by the intended format are added with the \textquotesingle{}add\textquotesingle{} request. Finally, \textquotesingle{}create\textquotesingle{} request is issued. The server will reply with either \textquotesingle{}created\textquotesingle{} event which provides the final wl\+\_\+buffer or \textquotesingle{}failed\textquotesingle{} event saying that it cannot use the dmabufs provided.

Warning! The protocol described in this file is experimental and backward incompatible changes may be made. Backward compatible changes may be added together with the corresponding interface version bump. Backward incompatible changes are done by bumping the version number in the protocol and interface names and resetting the interface version. Once the protocol is to be declared stable, the \textquotesingle{}z\textquotesingle{} prefix and the version number in the protocol and interface names are removed and the interface version number is reset. \hypertarget{page_iface_zwp_linux_dmabuf_v1_page_iface_zwp_linux_dmabuf_v1_api}{}\subsection{A\+PI}\label{page_iface_zwp_linux_dmabuf_v1_page_iface_zwp_linux_dmabuf_v1_api}
See \hyperlink{group__iface__zwp__linux__dmabuf__v1}{The zwp\+\_\+linux\+\_\+dmabuf\+\_\+v1 interface}. \hypertarget{page_iface_zwp_linux_buffer_params_v1}{}\section{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1}\label{page_iface_zwp_linux_buffer_params_v1}
\hypertarget{page_iface_zwp_linux_buffer_params_v1_page_iface_zwp_linux_buffer_params_v1_desc}{}\subsection{Description}\label{page_iface_zwp_linux_buffer_params_v1_page_iface_zwp_linux_buffer_params_v1_desc}
This temporary object is a collection of dmabufs and other parameters that together form a single logical buffer. The temporary object may eventually create one wl\+\_\+buffer unless cancelled by destroying it before requesting \textquotesingle{}create\textquotesingle{}.

Single-\/planar formats only require one dmabuf, however multi-\/planar formats may require more than one dmabuf. For all formats, \textquotesingle{}add\textquotesingle{} request must be called once per plane (even if the underlying dmabuf fd is identical).

You must use consecutive plane indices (\textquotesingle{}plane\+\_\+idx\textquotesingle{} argument for \textquotesingle{}add\textquotesingle{}) from zero to the number of planes used by the drm\+\_\+fourcc format code. All planes required by the format must be given exactly once, but can be given in any order. Each plane index can be set only once. \hypertarget{page_iface_zwp_linux_buffer_params_v1_page_iface_zwp_linux_buffer_params_v1_api}{}\subsection{A\+PI}\label{page_iface_zwp_linux_buffer_params_v1_page_iface_zwp_linux_buffer_params_v1_api}
See \hyperlink{group__iface__zwp__linux__buffer__params__v1}{The zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1 interface}. 