packaging: add freedreno package
[platform/upstream/libdrm.git] / include / drm / vigs_drm.h
1 /*
2  * vigs_drm.h
3  */
4
5 /*
6  * Copyright (c) 2013 Samsung Electronics Co., Ltd.
7  * Authors:
8  * Stanislav Vorobiov <s.vorobiov@samsung.com>
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining a
11  * copy of this software and associated documentation files (the "Software"),
12  * to deal in the Software without restriction, including without limitation
13  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  * and/or sell copies of the Software, and to permit persons to whom the
15  * Software is furnished to do so, subject to the following conditions:
16  *
17  * The above copyright notice and this permission notice (including the next
18  * paragraph) shall be included in all copies or substantial portions of the
19  * Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
24  * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27  * OTHER DEALINGS IN THE SOFTWARE.
28  */
29
30 #ifndef _VIGS_DRM_H_
31 #define _VIGS_DRM_H_
32
33 /*
34  * Bump this whenever driver interface changes.
35  */
36 #define DRM_VIGS_DRIVER_VERSION 14
37
38 /*
39  * Surface access flags.
40  */
41 #define DRM_VIGS_SAF_READ 1
42 #define DRM_VIGS_SAF_WRITE 2
43 #define DRM_VIGS_SAF_MASK 3
44
45 /*
46  * Number of DP framebuffers.
47  */
48 #define DRM_VIGS_NUM_DP_FB_BUF 4
49
50 /*
51  * DP memory types.
52  */
53 #define DRM_VIGS_DP_FB_Y 2
54 #define DRM_VIGS_DP_FB_C 3
55
56 struct drm_vigs_get_protocol_version
57 {
58     uint32_t version;
59 };
60
61 struct drm_vigs_create_surface
62 {
63     uint32_t width;
64     uint32_t height;
65     uint32_t stride;
66     uint32_t format;
67     int scanout;
68     uint32_t handle;
69     uint32_t size;
70     uint32_t id;
71 };
72
73 struct drm_vigs_create_execbuffer
74 {
75     uint32_t size;
76     uint32_t handle;
77 };
78
79 struct drm_vigs_gem_map
80 {
81     uint32_t handle;
82     int track_access;
83     unsigned long address;
84 };
85
86 struct drm_vigs_gem_wait
87 {
88     uint32_t handle;
89 };
90
91 struct drm_vigs_surface_info
92 {
93     uint32_t handle;
94     uint32_t width;
95     uint32_t height;
96     uint32_t stride;
97     uint32_t format;
98     int scanout;
99     uint32_t size;
100     uint32_t id;
101 };
102
103 struct drm_vigs_exec
104 {
105     uint32_t handle;
106 };
107
108 struct drm_vigs_surface_set_gpu_dirty
109 {
110     uint32_t handle;
111 };
112
113 struct drm_vigs_surface_start_access
114 {
115     unsigned long address;
116     uint32_t saf;
117 };
118
119 struct drm_vigs_surface_end_access
120 {
121     unsigned long address;
122     int sync;
123 };
124
125 struct drm_vigs_surface_convert
126 {
127     uint32_t src_handle;
128     uint32_t src_format;
129     uint32_t dst_handle;
130     uint32_t dst_format;
131     int y_invert;
132 };
133
134 struct drm_vigs_create_fence
135 {
136     int send;
137     uint32_t handle;
138     uint32_t seq;
139 };
140
141 struct drm_vigs_fence_wait
142 {
143     uint32_t handle;
144 };
145
146 struct drm_vigs_fence_signaled
147 {
148     uint32_t handle;
149     int signaled;
150 };
151
152 struct drm_vigs_fence_unref
153 {
154     uint32_t handle;
155 };
156
157 struct drm_vigs_plane_set_zpos
158 {
159     uint32_t plane_id;
160     int zpos;
161 };
162
163 struct drm_vigs_plane_set_transform
164 {
165     uint32_t plane_id;
166     int hflip;
167     int vflip;
168     int rotation;
169 };
170
171 struct drm_vigs_dp_create_surface
172 {
173     uint32_t dp_plane;
174     uint32_t dp_fb_buf;
175     uint32_t dp_mem_flag;
176     uint32_t width;
177     uint32_t height;
178     uint32_t stride;
179     uint32_t format;
180     uint32_t handle;
181     uint32_t size;
182     uint32_t id;
183 };
184
185 struct drm_vigs_dp_open_surface
186 {
187     uint32_t dp_plane;
188     uint32_t dp_fb_buf;
189     uint32_t dp_mem_flag;
190     uint32_t handle;
191 };
192
193 #define DRM_VIGS_GET_PROTOCOL_VERSION 0x00
194 #define DRM_VIGS_CREATE_SURFACE 0x01
195 #define DRM_VIGS_CREATE_EXECBUFFER 0x02
196 #define DRM_VIGS_GEM_MAP 0x03
197 #define DRM_VIGS_GEM_WAIT 0x04
198 #define DRM_VIGS_SURFACE_INFO 0x05
199 #define DRM_VIGS_EXEC 0x06
200 #define DRM_VIGS_SURFACE_SET_GPU_DIRTY 0x07
201 #define DRM_VIGS_SURFACE_START_ACCESS 0x08
202 #define DRM_VIGS_SURFACE_END_ACCESS 0x09
203 #define DRM_VIGS_CREATE_FENCE 0x0A
204 #define DRM_VIGS_FENCE_WAIT 0x0B
205 #define DRM_VIGS_FENCE_SIGNALED 0x0C
206 #define DRM_VIGS_FENCE_UNREF 0x0D
207 #define DRM_VIGS_PLANE_SET_ZPOS 0x0E
208 #define DRM_VIGS_PLANE_SET_TRANSFORM 0x0F
209
210 #define DRM_VIGS_DP_CREATE_SURFACE 0x20
211 #define DRM_VIGS_DP_OPEN_SURFACE 0x21
212
213 #define DRM_VIGS_SURFACE_CONVERT 0x22
214
215 #define DRM_IOCTL_VIGS_GET_PROTOCOL_VERSION DRM_IOR(DRM_COMMAND_BASE + \
216             DRM_VIGS_GET_PROTOCOL_VERSION, struct drm_vigs_get_protocol_version)
217 #define DRM_IOCTL_VIGS_CREATE_SURFACE DRM_IOWR(DRM_COMMAND_BASE + \
218             DRM_VIGS_CREATE_SURFACE, struct drm_vigs_create_surface)
219 #define DRM_IOCTL_VIGS_CREATE_EXECBUFFER DRM_IOWR(DRM_COMMAND_BASE + \
220             DRM_VIGS_CREATE_EXECBUFFER, struct drm_vigs_create_execbuffer)
221 #define DRM_IOCTL_VIGS_GEM_MAP DRM_IOWR(DRM_COMMAND_BASE + \
222             DRM_VIGS_GEM_MAP, struct drm_vigs_gem_map)
223 #define DRM_IOCTL_VIGS_GEM_WAIT DRM_IOW(DRM_COMMAND_BASE + \
224             DRM_VIGS_GEM_WAIT, struct drm_vigs_gem_wait)
225 #define DRM_IOCTL_VIGS_SURFACE_INFO DRM_IOWR(DRM_COMMAND_BASE + \
226             DRM_VIGS_SURFACE_INFO, struct drm_vigs_surface_info)
227 #define DRM_IOCTL_VIGS_EXEC DRM_IOW(DRM_COMMAND_BASE + \
228             DRM_VIGS_EXEC, struct drm_vigs_exec)
229 #define DRM_IOCTL_VIGS_SURFACE_SET_GPU_DIRTY DRM_IOW(DRM_COMMAND_BASE + \
230             DRM_VIGS_SURFACE_SET_GPU_DIRTY, struct drm_vigs_surface_set_gpu_dirty)
231 #define DRM_IOCTL_VIGS_SURFACE_START_ACCESS DRM_IOW(DRM_COMMAND_BASE + \
232             DRM_VIGS_SURFACE_START_ACCESS, struct drm_vigs_surface_start_access)
233 #define DRM_IOCTL_VIGS_SURFACE_END_ACCESS DRM_IOW(DRM_COMMAND_BASE + \
234             DRM_VIGS_SURFACE_END_ACCESS, struct drm_vigs_surface_end_access)
235 #define DRM_IOCTL_VIGS_SURFACE_CONVERT DRM_IOW(DRM_COMMAND_BASE + \
236             DRM_VIGS_SURFACE_CONVERT, struct drm_vigs_surface_convert)
237 #define DRM_IOCTL_VIGS_CREATE_FENCE DRM_IOWR(DRM_COMMAND_BASE + \
238             DRM_VIGS_CREATE_FENCE, struct drm_vigs_create_fence)
239 #define DRM_IOCTL_VIGS_FENCE_WAIT DRM_IOW(DRM_COMMAND_BASE + \
240             DRM_VIGS_FENCE_WAIT, struct drm_vigs_fence_wait)
241 #define DRM_IOCTL_VIGS_FENCE_SIGNALED DRM_IOWR(DRM_COMMAND_BASE + \
242             DRM_VIGS_FENCE_SIGNALED, struct drm_vigs_fence_signaled)
243 #define DRM_IOCTL_VIGS_FENCE_UNREF DRM_IOW(DRM_COMMAND_BASE + \
244             DRM_VIGS_FENCE_UNREF, struct drm_vigs_fence_unref)
245 #define DRM_IOCTL_VIGS_PLANE_SET_ZPOS DRM_IOW(DRM_COMMAND_BASE + \
246             DRM_VIGS_PLANE_SET_ZPOS, struct drm_vigs_plane_set_zpos)
247 #define DRM_IOCTL_VIGS_PLANE_SET_TRANSFORM DRM_IOW(DRM_COMMAND_BASE + \
248             DRM_VIGS_PLANE_SET_TRANSFORM, struct drm_vigs_plane_set_transform)
249
250 #define DRM_IOCTL_VIGS_DP_CREATE_SURFACE DRM_IOWR(DRM_COMMAND_BASE + \
251             DRM_VIGS_DP_CREATE_SURFACE, struct drm_vigs_dp_create_surface)
252 #define DRM_IOCTL_VIGS_DP_OPEN_SURFACE DRM_IOWR(DRM_COMMAND_BASE + \
253             DRM_VIGS_DP_OPEN_SURFACE, struct drm_vigs_dp_open_surface)
254
255 #endif