summaryrefslogtreecommitdiff
path: root/title.tex
blob: 92ecc4cf3d2a67ccd34f4fa0d5f7a278546cfd81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
\begin{titlepage}
\thispagestyle{fancy}

\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lr}
	\includegraphics[height=0.55in]{images/oasis.png}\\
	\hline
\end{tabular*}

\oasistitle{\virtioversion}
\oasisstagelabel{\virtiodraftstagename\virtiodraftstageextratitle}
\vspace{0.05in}
\oasisstagelabel{\virtioworkingdraftdate}

\oasisspecificationuris{Specification URIs}

\begin{oasistitlesection}{This version}
\virtiourltex{ }(Authoritative)\newline
\virtiourlpdf\newline
\virtiourlhtml
\end{oasistitlesection}

\begin{oasistitlesection}{Previous version}
\url{http://docs.oasis-open.org/virtio/virtio/v1.0/cs03/tex/}
{}(Authoritative)\newline
\url{http://docs.oasis-open.org/virtio/virtio/v1.0/cs03/virtio-v1.0-cs03.pdf}\newline
\url{http://docs.oasis-open.org/virtio/virtio/v1.0/cs03/virtio-v1.0-cs03.html}
\end{oasistitlesection}

\begin{oasistitlesection}{Latest version}
\virtiourllatestpdf\newline
\virtiourllatesthtml
\end{oasistitlesection}

\begin{oasistitlesection}{Technical Committee}
\href{https://www.oasis-open.org/committees/virtio/}{OASIS Virtual I/O Device (VIRTIO) TC}
\end{oasistitlesection}

\begin{oasistitlesection}{Chairs}
Michael S. Tsirkin (\href{mailto:mst@redhat.com}{mst@redhat.com}), \href{http://www.redhat.com/}{Red Hat}\newline
\end{oasistitlesection}

\begin{oasistitlesection}{Editors}
Michael S. Tsirkin (\href{mailto:mst@redhat.com}{mst@redhat.com}), \href{http://www.redhat.com/}{Red Hat}\newline
Cornelia Huck (\href{mailto:cohuck@redhat.com}{cohuck@redhat.com}), \href{http://www.redhat.com/}{Red Hat}\newline
Pawel Moll (\href{mailto:pawel.moll@arm.com}{pawel.moll@arm.com}), \href{http://www.arm.com/}{ARM}
\end{oasistitlesection}


\begin{oasistitlesection}{Additional artifacts}
This prose specification is one component of a Work Product that also includes:
\begin{itemize*}
	\item Example Driver Listing: \newline
	\virtiourllistings
\end{itemize*}
\end{oasistitlesection}
\vspace{-0.2in}

\begin{oasistitlesection}{Related work}
This specification replaces or supersedes:
\begin{itemize*}
	\item Virtio PCI Card Specification Version 0.9.5:\newline
	\url{http://ozlabs.org/~rusty/virtio-spec/virtio-0.9.5.pdf}
\end{itemize*}
% This specification is related to:
% \begin{itemize*}
%        \item Related specifications (list)
% \end{itemize*}
\end{oasistitlesection}
\vspace{-0.2in}

% \begin{oasistitlesection}{Declared XML namespaces}
% \vspace{-0.1in}
% \begin{itemize*}
% 	\item namespaces which are declared, not just referenced or used (list)
% \end{itemize*}
% \end{oasistitlesection}
\vfill\newpage

\begin{oasistitlesection}{Abstract}
\input{abstract.tex}
\end{oasistitlesection}

\begin{oasistitlesection}{Status}
This document was last revised or approved by the Virtual I/O Device
(VIRTIO) TC on the above date. The level of approval is also listed above. Check the ``Latest version'' location noted above for possible later revisions of this document.
Any other numbered Versions and other
technical work produced by the Technical Committee (TC) are
listed at
\url{https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio#technical}.

Technical Committee members should send comments on this
specification to the Technical Committee’s email list. Others
should send comments to the Technical Committee by using the
``\href{https://www.oasis-open.org/committees/comments/form.php?wg_abbrev=virtio}{Send
A Comment}'' button on the Technical Committee’s web page at
\url{https://www.oasis-open.org/committees/virtio/}.

For information on whether any patents have been disclosed that
may be essential to implementing this specification, and any
offers of patent licensing terms, please refer to the
Intellectual Property Rights section of the Technical Committee
web page (\url{https://www.oasis-open.org/committees/virtio/ipr.php}).
\end{oasistitlesection}


\begin{oasistitlesection}{Citation format}
When referencing this specification the following citation format should be used:\newline

\textbf{[VIRTIO-v\virtiorev]}\newline
\textit{\virtioversion}. Edited by Rusty Russell, Michael S.
Tsirkin, Cornelia Huck, and Pawel Moll. \virtioworkingdraftdate.
\virtiodraftoasisstagename \virtiodraftstageextra . \virtiourlhtml .
Latest version: \virtiourllatesthtml .
\end{oasistitlesection}

\vfill\newpage

\oasisnoticelabel{Notices}

Copyright © OASIS Open 2015. All Rights Reserved.

All capitalized terms in the following text have the meanings assigned
to them in the OASIS Intellectual Property Rights Policy (the "OASIS
IPR Policy"). The full \href{https://www.oasis-open.org/policies-guidelines/ipr}{Policy} may be found at the OASIS website.

This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published,
and distributed, in whole or in part, without restriction of any kind,
provided that the above copyright notice and this section are included
on all such copies and derivative works. However, this document itself
may not be modified in any way, including by removing the copyright
notice or references to OASIS, except as needed for the purpose of
developing any document or deliverable produced by an OASIS Technical
Committee (in which case the rules applicable to copyrights, as set
forth in the OASIS IPR Policy, must be followed) or as required to
translate it into languages other than English.

The limited permissions granted above are perpetual and will not be
revoked by OASIS or its successors or assigns.

This document and the information contained herein is provided on an
"AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY
IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
PURPOSE.

OASIS requests that any OASIS Party or any other party that believes
it has patent claims that would necessarily be infringed by
implementations of this OASIS Committee Specification or OASIS
Standard, to notify OASIS TC Administrator and provide an indication
of its willingness to grant patent licenses to such patent claims in a
manner consistent with the IPR Mode of the OASIS Technical Committee
that produced this specification.

OASIS invites any party to contact the OASIS TC Administrator if it is
aware of a claim of ownership of any patent claims that would
necessarily be infringed by implementations of this specification by a
patent holder that is not willing to provide a license to such patent
claims in a manner consistent with the IPR Mode of the OASIS Technical
Committee that produced this specification. OASIS may include such
claims on its website, but disclaims any obligation to do so.

OASIS takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to pertain
to the implementation or use of the technology described in this
document or the extent to which any license under such rights might or
might not be available; neither does it represent that it has made any
effort to identify any such rights. Information on OASIS' procedures
with respect to rights in any document or deliverable produced by an
OASIS Technical Committee can be found on the OASIS website. Copies of
claims of rights made available for publication and any assurances of
licenses to be made available, or the result of an attempt made to
obtain a general license or permission for the use of such proprietary
rights by implementers or users of this OASIS Committee Specification
or OASIS Standard, can be obtained from the OASIS TC Administrator.
OASIS makes no representation that any information or list of
intellectual property rights will at any time be complete, or that any
claims in such list are, in fact, Essential Claims.

The name "OASIS" is a trademark of \href{https://www.oasis-open.org/}{OASIS}, the owner and developer of
this specification, and should be used only to refer to the
organization and its official outputs. OASIS welcomes reference to,
and implementation and use of, specifications, while reserving the
right to enforce its marks against misleading uses. Please see
\url{https://www.oasis-open.org/policies-guidelines/trademark} for above guidance.
\\\\

\end{titlepage}
lass="hl opt">} /* * Get information to gem region allocated. * * @dev: exynos drm device object. * @handle: gem handle to request gem info. * @size: size to gem object and returned by kernel side. * @flags: gem flags to gem object and returned by kernel side. * * with this function call, you can get flags and size to gem handle * through bo object. * * if true, return 0 else negative. */ int exynos_bo_get_info(struct exynos_device *dev, uint32_t handle, size_t *size, uint32_t *flags) { int ret; struct drm_exynos_gem_info req = { .handle = handle, }; ret = drmIoctl(dev->fd, DRM_IOCTL_EXYNOS_GEM_GET, &req); if (ret < 0) { fprintf(stderr, "failed to get gem object information[%s].\n", strerror(errno)); return ret; } *size = req.size; *flags = req.flags; return 0; } /* * Destroy a exynos buffer object. * * @bo: a exynos buffer object to be destroyed. */ void exynos_bo_destroy(struct exynos_bo *bo) { if (!bo) return; if (bo->vaddr) munmap(bo->vaddr, bo->size); if (bo->handle) { struct drm_gem_close req = { .handle = bo->handle, }; drmIoctl(bo->dev->fd, DRM_IOCTL_GEM_CLOSE, &req); } free(bo); } /* * Get a exynos buffer object from a gem global object name. * * @dev: a exynos device object. * @name: a gem global object name exported by another process. * * this interface is used to get a exynos buffer object from a gem * global object name sent by another process for buffer sharing. * * if true, return a exynos buffer object else NULL. * */ struct exynos_bo * exynos_bo_from_name(struct exynos_device *dev, uint32_t name) { struct exynos_bo *bo; struct drm_gem_open req = { .name = name, }; bo = calloc(sizeof(*bo), 1); if (!bo) { fprintf(stderr, "failed to allocate bo[%s].\n", strerror(errno)); return NULL; } if (drmIoctl(dev->fd, DRM_IOCTL_GEM_OPEN, &req)) { fprintf(stderr, "failed to open gem object[%s].\n", strerror(errno)); goto err_free_bo; } bo->dev = dev; bo->name = name; bo->handle = req.handle; return bo; err_free_bo: free(bo); return NULL; } /* * Get a gem global object name from a gem object handle. * * @bo: a exynos buffer object including gem handle. * @name: a gem global object name to be got by kernel driver. * * this interface is used to get a gem global object name from a gem object * handle to a buffer that wants to share it with another process. * * if true, return 0 else negative. */ int exynos_bo_get_name(struct exynos_bo *bo, uint32_t *name) { if (!bo->name) { struct drm_gem_flink req = { .handle = bo->handle, }; int ret; ret = drmIoctl(bo->dev->fd, DRM_IOCTL_GEM_FLINK, &req); if (ret) { fprintf(stderr, "failed to get gem global name[%s].\n", strerror(errno)); return ret; } bo->name = req.name; } *name = bo->name; return 0; } uint32_t exynos_bo_handle(struct exynos_bo *bo) { return bo->handle; } /* * Mmap a buffer to user space. * * @bo: a exynos buffer object including a gem object handle to be mmapped * to user space. * * if true, user pointer mmaped else NULL. */ void *exynos_bo_map(struct exynos_bo *bo) { if (!bo->vaddr) { struct exynos_device *dev = bo->dev; struct drm_exynos_gem_mmap req = { .handle = bo->handle, .size = bo->size, }; int ret; ret = drmIoctl(dev->fd, DRM_IOCTL_EXYNOS_GEM_MMAP, &req); if (ret) { fprintf(stderr, "failed to mmap[%s].\n", strerror(errno)); return NULL; } bo->vaddr = req.mapped; } return bo->vaddr; } /* * Export gem object to dmabuf as file descriptor. * * @dev: a exynos device object. * @handle: gem handle to be exported into dmabuf as file descriptor. * @fd: file descriptor to dmabuf exported from gem handle and * returned by kernel side. * * if true, return 0 else negative. */ int exynos_prime_handle_to_fd(struct exynos_device *dev, uint32_t handle, int *fd) { int ret; struct drm_prime_handle req = { .handle = handle, }; ret = drmIoctl(dev->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &req); if (ret) { fprintf(stderr, "failed to mmap[%s].\n", strerror(errno)); return ret; } *fd = req.fd; return 0; } /* * Import file descriptor into gem handle. * * @dev: a exynos device object. * @fd: file descriptor exported into dmabuf. * @handle: gem handle to gem object imported from file descriptor * and returned by kernel side. * * if true, return 0 else negative. */ int exynos_prime_fd_to_handle(struct exynos_device *dev, int fd, uint32_t *handle) { int ret; struct drm_prime_handle req = { .fd = fd, }; ret = drmIoctl(dev->fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &req); if (ret) { fprintf(stderr, "failed to mmap[%s].\n", strerror(errno)); return ret; } *handle = req.handle; return 0; } /* * Request Wireless Display connection or disconnection. * * @dev: a exynos device object. * @connect: indicate whether connectoin or disconnection request. * @ext: indicate whether edid data includes extentions data or not. * @edid: a pointer to edid data from Wireless Display device. * * this interface is used to request Virtual Display driver connection or * disconnection. for this, user should get a edid data from the Wireless * Display device and then send that data to kernel driver with connection * request * * if true, return 0 else negative. */ int exynos_vidi_connection(struct exynos_device *dev, uint32_t connect, uint32_t ext, void *edid) { struct drm_exynos_vidi_connection req = { .connection = connect, .extensions = ext, .edid = edid, }; int ret; ret = drmIoctl(dev->fd, DRM_IOCTL_EXYNOS_VIDI_CONNECTION, &req); if (ret) { fprintf(stderr, "failed to request vidi connection[%s].\n", strerror(errno)); return ret; } return 0; }