\hypertarget{structzwp__linux__buffer__params__v1__interface}{}\section{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface Struct Reference}
\label{structzwp__linux__buffer__params__v1__interface}\index{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface@{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface}}
\subsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
void($\ast$ \mbox{\hyperlink{structzwp__linux__buffer__params__v1__interface_acb80719df0105d754d052d47b7ad852a}{destroy}} )(struct wl\+\_\+client $\ast$client, struct wl\+\_\+resource $\ast$resource)
\begin{DoxyCompactList}\small\item\em delete this object, used or not \end{DoxyCompactList}\item 
void($\ast$ \mbox{\hyperlink{structzwp__linux__buffer__params__v1__interface_ab2f321d3fa41d2e66b5b172b85b5f929}{add}} )(struct wl\+\_\+client $\ast$client, struct wl\+\_\+resource $\ast$resource, int32\+\_\+t fd, uint32\+\_\+t plane\+\_\+idx, uint32\+\_\+t offset, uint32\+\_\+t stride, uint32\+\_\+t modifier\+\_\+hi, uint32\+\_\+t modifier\+\_\+lo)
\begin{DoxyCompactList}\small\item\em add a dmabuf to the temporary set \end{DoxyCompactList}\item 
void($\ast$ \mbox{\hyperlink{structzwp__linux__buffer__params__v1__interface_acd347c10d696fc14710a2599c57c18d4}{create}} )(struct wl\+\_\+client $\ast$client, struct wl\+\_\+resource $\ast$resource, int32\+\_\+t width, int32\+\_\+t height, uint32\+\_\+t format, uint32\+\_\+t flags)
\begin{DoxyCompactList}\small\item\em create a wl\+\_\+buffer from the given dmabufs \end{DoxyCompactList}\item 
void($\ast$ \mbox{\hyperlink{structzwp__linux__buffer__params__v1__interface_a190f7ce24aa46cbc32e4179196addc7a}{create\+\_\+immed}} )(struct wl\+\_\+client $\ast$client, struct wl\+\_\+resource $\ast$resource, uint32\+\_\+t buffer\+\_\+id, int32\+\_\+t width, int32\+\_\+t height, uint32\+\_\+t format, uint32\+\_\+t flags)
\begin{DoxyCompactList}\small\item\em immediately create a wl\+\_\+buffer from the given dmabufs \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Field Documentation}
\mbox{\Hypertarget{structzwp__linux__buffer__params__v1__interface_acb80719df0105d754d052d47b7ad852a}\label{structzwp__linux__buffer__params__v1__interface_acb80719df0105d754d052d47b7ad852a}} 
\index{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface@{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface}!destroy@{destroy}}
\index{destroy@{destroy}!zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface@{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface}}
\subsubsection{\texorpdfstring{destroy}{destroy}}
{\footnotesize\ttfamily void($\ast$ zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface\+::destroy) (struct wl\+\_\+client $\ast$client, struct wl\+\_\+resource $\ast$resource)}



delete this object, used or not 

Cleans up the temporary data sent to the server for dmabuf-\/based wl\+\_\+buffer creation. \mbox{\Hypertarget{structzwp__linux__buffer__params__v1__interface_ab2f321d3fa41d2e66b5b172b85b5f929}\label{structzwp__linux__buffer__params__v1__interface_ab2f321d3fa41d2e66b5b172b85b5f929}} 
\index{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface@{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface}!add@{add}}
\index{add@{add}!zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface@{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface}}
\subsubsection{\texorpdfstring{add}{add}}
{\footnotesize\ttfamily void($\ast$ zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface\+::add) (struct wl\+\_\+client $\ast$client, struct wl\+\_\+resource $\ast$resource, int32\+\_\+t fd, uint32\+\_\+t plane\+\_\+idx, uint32\+\_\+t offset, uint32\+\_\+t stride, uint32\+\_\+t modifier\+\_\+hi, uint32\+\_\+t modifier\+\_\+lo)}



add a dmabuf to the temporary set 

This request adds one dmabuf to the set in this zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1.

The 64-\/bit unsigned value combined from modifier\+\_\+hi and modifier\+\_\+lo is the dmabuf layout modifier. D\+RM Add\+F\+B2 ioctl calls this the fb modifier, which is defined in drm\+\_\+mode.\+h of Linux U\+A\+PI. This is an opaque token. Drivers use this token to express tiling, compression, etc. driver-\/specific modifications to the base format defined by the D\+RM fourcc code.

This request raises the P\+L\+A\+N\+E\+\_\+\+I\+DX error if plane\+\_\+idx is too large. The error P\+L\+A\+N\+E\+\_\+\+S\+ET is raised if attempting to set a plane that was already set. 
\begin{DoxyParams}{Parameters}
{\em fd} & dmabuf fd \\
\hline
{\em plane\+\_\+idx} & plane index \\
\hline
{\em offset} & offset in bytes \\
\hline
{\em stride} & stride in bytes \\
\hline
{\em modifier\+\_\+hi} & high 32 bits of layout modifier \\
\hline
{\em modifier\+\_\+lo} & low 32 bits of layout modifier \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{structzwp__linux__buffer__params__v1__interface_acd347c10d696fc14710a2599c57c18d4}\label{structzwp__linux__buffer__params__v1__interface_acd347c10d696fc14710a2599c57c18d4}} 
\index{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface@{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface}!create@{create}}
\index{create@{create}!zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface@{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface}}
\subsubsection{\texorpdfstring{create}{create}}
{\footnotesize\ttfamily void($\ast$ zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface\+::create) (struct wl\+\_\+client $\ast$client, struct wl\+\_\+resource $\ast$resource, int32\+\_\+t width, int32\+\_\+t height, uint32\+\_\+t format, uint32\+\_\+t flags)}



create a wl\+\_\+buffer from the given dmabufs 

This asks for creation of a wl\+\_\+buffer from the added dmabuf buffers. The wl\+\_\+buffer is not created immediately but returned via the \textquotesingle{}created\textquotesingle{} event if the dmabuf sharing succeeds. The sharing may fail at runtime for reasons a client cannot predict, in which case the \textquotesingle{}failed\textquotesingle{} event is triggered.

The \textquotesingle{}format\textquotesingle{} argument is a D\+R\+M\+\_\+\+F\+O\+R\+M\+AT code, as defined by the libdrm\textquotesingle{}s drm\+\_\+fourcc.\+h. The Linux kernel\textquotesingle{}s D\+RM sub-\/system is the authoritative source on how the format codes should work.

The \textquotesingle{}flags\textquotesingle{} is a bitfield of the flags defined in enum \char`\"{}flags\char`\"{}. \textquotesingle{}y\+\_\+invert\textquotesingle{} means the that the image needs to be y-\/flipped.

Flag \textquotesingle{}interlaced\textquotesingle{} means that the frame in the buffer is not progressive as usual, but interlaced. An interlaced buffer as supported here must always contain both top and bottom fields. The top field always begins on the first pixel row. The temporal ordering between the two fields is top field first, unless \textquotesingle{}bottom\+\_\+first\textquotesingle{} is specified. It is undefined whether \textquotesingle{}bottom\+\_\+first\textquotesingle{} is ignored if \textquotesingle{}interlaced\textquotesingle{} is not set.

This protocol does not convey any information about field rate, duration, or timing, other than the relative ordering between the two fields in one buffer. A compositor may have to estimate the intended field rate from the incoming buffer rate. It is undefined whether the time of receiving wl\+\_\+surface.\+commit with a new buffer attached, applying the wl\+\_\+surface state, wl\+\_\+surface.\+frame callback trigger, presentation, or any other point in the compositor cycle is used to measure the frame or field times. There is no support for detecting missed or late frames/fields/buffers either, and there is no support whatsoever for cooperating with interlaced compositor output.

The composited image quality resulting from the use of interlaced buffers is explicitly undefined. A compositor may use elaborate hardware features or software to deinterlace and create progressive output frames from a sequence of interlaced input buffers, or it may produce substandard image quality. However, compositors that cannot guarantee reasonable image quality in all cases are recommended to just reject all interlaced buffers.

Any argument errors, including non-\/positive width or height, mismatch between the number of planes and the format, bad format, bad offset or stride, may be indicated by fatal protocol errors\+: I\+N\+C\+O\+M\+P\+L\+E\+TE, I\+N\+V\+A\+L\+I\+D\+\_\+\+F\+O\+R\+M\+AT, I\+N\+V\+A\+L\+I\+D\+\_\+\+D\+I\+M\+E\+N\+S\+I\+O\+NS, O\+U\+T\+\_\+\+O\+F\+\_\+\+B\+O\+U\+N\+DS.

Dmabuf import errors in the server that are not obvious client bugs are returned via the \textquotesingle{}failed\textquotesingle{} event as non-\/fatal. This allows attempting dmabuf sharing and falling back in the client if it fails.

This request can be sent only once in the object\textquotesingle{}s lifetime, after which the only legal request is destroy. This object should be destroyed after issuing a \textquotesingle{}create\textquotesingle{} request. Attempting to use this object after issuing \textquotesingle{}create\textquotesingle{} raises A\+L\+R\+E\+A\+D\+Y\+\_\+\+U\+S\+ED protocol error.

It is not mandatory to issue \textquotesingle{}create\textquotesingle{}. If a client wants to cancel the buffer creation, it can just destroy this object. 
\begin{DoxyParams}{Parameters}
{\em width} & base plane width in pixels \\
\hline
{\em height} & base plane height in pixels \\
\hline
{\em format} & D\+R\+M\+\_\+\+F\+O\+R\+M\+AT code \\
\hline
{\em flags} & see enum flags \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{structzwp__linux__buffer__params__v1__interface_a190f7ce24aa46cbc32e4179196addc7a}\label{structzwp__linux__buffer__params__v1__interface_a190f7ce24aa46cbc32e4179196addc7a}} 
\index{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface@{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface}!create\+\_\+immed@{create\+\_\+immed}}
\index{create\+\_\+immed@{create\+\_\+immed}!zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface@{zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface}}
\subsubsection{\texorpdfstring{create\+\_\+immed}{create\_immed}}
{\footnotesize\ttfamily void($\ast$ zwp\+\_\+linux\+\_\+buffer\+\_\+params\+\_\+v1\+\_\+interface\+::create\+\_\+immed) (struct wl\+\_\+client $\ast$client, struct wl\+\_\+resource $\ast$resource, uint32\+\_\+t buffer\+\_\+id, int32\+\_\+t width, int32\+\_\+t height, uint32\+\_\+t format, uint32\+\_\+t flags)}



immediately create a wl\+\_\+buffer from the given dmabufs 

This asks for immediate creation of a wl\+\_\+buffer by importing the added dmabufs.

In case of import success, no event is sent from the server, and the wl\+\_\+buffer is ready to be used by the client.

Upon import failure, either of the following may happen, as seen fit by the implementation\+: -\/ the client is terminated with one of the following fatal protocol errors\+: -\/ I\+N\+C\+O\+M\+P\+L\+E\+TE, I\+N\+V\+A\+L\+I\+D\+\_\+\+F\+O\+R\+M\+AT, I\+N\+V\+A\+L\+I\+D\+\_\+\+D\+I\+M\+E\+N\+S\+I\+O\+NS, O\+U\+T\+\_\+\+O\+F\+\_\+\+B\+O\+U\+N\+DS, in case of argument errors such as mismatch between the number of planes and the format, bad format, non-\/positive width or height, or bad offset or stride. -\/ I\+N\+V\+A\+L\+I\+D\+\_\+\+W\+L\+\_\+\+B\+U\+F\+F\+ER, in case the cause for failure is unknown or plaform specific. -\/ the server creates an invalid wl\+\_\+buffer, marks it as failed and sends a \textquotesingle{}failed\textquotesingle{} event to the client. The result of using this invalid wl\+\_\+buffer as an argument in any request by the client is defined by the compositor implementation.

This takes the same arguments as a \textquotesingle{}create\textquotesingle{} request, and obeys the same restrictions. 
\begin{DoxyParams}{Parameters}
{\em buffer\+\_\+id} & id for the newly created wl\+\_\+buffer \\
\hline
{\em width} & base plane width in pixels \\
\hline
{\em height} & base plane height in pixels \\
\hline
{\em format} & D\+R\+M\+\_\+\+F\+O\+R\+M\+AT code \\
\hline
{\em flags} & see enum flags \\
\hline
\end{DoxyParams}
\begin{DoxySince}{Since}
2 
\end{DoxySince}
