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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
|
/*
* vigs_drm.h
*/
/*
* Copyright (c) 2013 Samsung Electronics Co., Ltd.
* Authors:
* Stanislav Vorobiov <s.vorobiov@samsung.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _VIGS_DRM_H_
#define _VIGS_DRM_H_
/*
* Bump this whenever driver interface changes.
*/
#define DRM_VIGS_DRIVER_VERSION 14
/*
* Surface access flags.
*/
#define DRM_VIGS_SAF_READ 1
#define DRM_VIGS_SAF_WRITE 2
#define DRM_VIGS_SAF_MASK 3
/*
* Number of DP framebuffers.
*/
#define DRM_VIGS_NUM_DP_FB_BUF 4
/*
* DP memory types.
*/
#define DRM_VIGS_DP_FB_Y 2
#define DRM_VIGS_DP_FB_C 3
struct drm_vigs_get_protocol_version
{
uint32_t version;
};
struct drm_vigs_create_surface
{
uint32_t width;
uint32_t height;
uint32_t stride;
uint32_t format;
int scanout;
uint32_t handle;
uint32_t size;
uint32_t id;
};
struct drm_vigs_create_execbuffer
{
uint32_t size;
uint32_t handle;
};
struct drm_vigs_gem_map
{
uint32_t handle;
int track_access;
unsigned long address;
};
struct drm_vigs_gem_wait
{
uint32_t handle;
};
struct drm_vigs_surface_info
{
uint32_t handle;
uint32_t width;
uint32_t height;
uint32_t stride;
uint32_t format;
int scanout;
uint32_t size;
uint32_t id;
};
struct drm_vigs_exec
{
uint32_t handle;
};
struct drm_vigs_surface_set_gpu_dirty
{
uint32_t handle;
};
struct drm_vigs_surface_start_access
{
unsigned long address;
uint32_t saf;
};
struct drm_vigs_surface_end_access
{
unsigned long address;
int sync;
};
struct drm_vigs_surface_convert
{
uint32_t src_handle;
uint32_t src_format;
uint32_t dst_handle;
uint32_t dst_format;
int y_invert;
};
struct drm_vigs_create_fence
{
int send;
uint32_t handle;
uint32_t seq;
};
struct drm_vigs_fence_wait
{
uint32_t handle;
};
struct drm_vigs_fence_signaled
{
uint32_t handle;
int signaled;
};
struct drm_vigs_fence_unref
{
uint32_t handle;
};
struct drm_vigs_plane_set_zpos
{
uint32_t plane_id;
int zpos;
};
struct drm_vigs_plane_set_transform
{
uint32_t plane_id;
int hflip;
int vflip;
int rotation;
};
struct drm_vigs_dp_create_surface
{
uint32_t dp_plane;
uint32_t dp_fb_buf;
uint32_t dp_mem_flag;
uint32_t width;
uint32_t height;
uint32_t stride;
uint32_t format;
uint32_t handle;
uint32_t size;
uint32_t id;
};
struct drm_vigs_dp_open_surface
{
uint32_t dp_plane;
uint32_t dp_fb_buf;
uint32_t dp_mem_flag;
uint32_t handle;
};
#define DRM_VIGS_GET_PROTOCOL_VERSION 0x00
#define DRM_VIGS_CREATE_SURFACE 0x01
#define DRM_VIGS_CREATE_EXECBUFFER 0x02
#define DRM_VIGS_GEM_MAP 0x03
#define DRM_VIGS_GEM_WAIT 0x04
#define DRM_VIGS_SURFACE_INFO 0x05
#define DRM_VIGS_EXEC 0x06
#define DRM_VIGS_SURFACE_SET_GPU_DIRTY 0x07
#define DRM_VIGS_SURFACE_START_ACCESS 0x08
#define DRM_VIGS_SURFACE_END_ACCESS 0x09
#define DRM_VIGS_CREATE_FENCE 0x0A
#define DRM_VIGS_FENCE_WAIT 0x0B
#define DRM_VIGS_FENCE_SIGNALED 0x0C
#define DRM_VIGS_FENCE_UNREF 0x0D
#define DRM_VIGS_PLANE_SET_ZPOS 0x0E
#define DRM_VIGS_PLANE_SET_TRANSFORM 0x0F
#define DRM_VIGS_DP_CREATE_SURFACE 0x20
#define DRM_VIGS_DP_OPEN_SURFACE 0x21
#define DRM_VIGS_SURFACE_CONVERT 0x22
#define DRM_IOCTL_VIGS_GET_PROTOCOL_VERSION DRM_IOR(DRM_COMMAND_BASE + \
DRM_VIGS_GET_PROTOCOL_VERSION, struct drm_vigs_get_protocol_version)
#define DRM_IOCTL_VIGS_CREATE_SURFACE DRM_IOWR(DRM_COMMAND_BASE + \
DRM_VIGS_CREATE_SURFACE, struct drm_vigs_create_surface)
#define DRM_IOCTL_VIGS_CREATE_EXECBUFFER DRM_IOWR(DRM_COMMAND_BASE + \
DRM_VIGS_CREATE_EXECBUFFER, struct drm_vigs_create_execbuffer)
#define DRM_IOCTL_VIGS_GEM_MAP DRM_IOWR(DRM_COMMAND_BASE + \
DRM_VIGS_GEM_MAP, struct drm_vigs_gem_map)
#define DRM_IOCTL_VIGS_GEM_WAIT DRM_IOW(DRM_COMMAND_BASE + \
DRM_VIGS_GEM_WAIT, struct drm_vigs_gem_wait)
#define DRM_IOCTL_VIGS_SURFACE_INFO DRM_IOWR(DRM_COMMAND_BASE + \
DRM_VIGS_SURFACE_INFO, struct drm_vigs_surface_info)
#define DRM_IOCTL_VIGS_EXEC DRM_IOW(DRM_COMMAND_BASE + \
DRM_VIGS_EXEC, struct drm_vigs_exec)
#define DRM_IOCTL_VIGS_SURFACE_SET_GPU_DIRTY DRM_IOW(DRM_COMMAND_BASE + \
DRM_VIGS_SURFACE_SET_GPU_DIRTY, struct drm_vigs_surface_set_gpu_dirty)
#define DRM_IOCTL_VIGS_SURFACE_START_ACCESS DRM_IOW(DRM_COMMAND_BASE + \
DRM_VIGS_SURFACE_START_ACCESS, struct drm_vigs_surface_start_access)
#define DRM_IOCTL_VIGS_SURFACE_END_ACCESS DRM_IOW(DRM_COMMAND_BASE + \
DRM_VIGS_SURFACE_END_ACCESS, struct drm_vigs_surface_end_access)
#define DRM_IOCTL_VIGS_SURFACE_CONVERT DRM_IOW(DRM_COMMAND_BASE + \
DRM_VIGS_SURFACE_CONVERT, struct drm_vigs_surface_convert)
#define DRM_IOCTL_VIGS_CREATE_FENCE DRM_IOWR(DRM_COMMAND_BASE + \
DRM_VIGS_CREATE_FENCE, struct drm_vigs_create_fence)
#define DRM_IOCTL_VIGS_FENCE_WAIT DRM_IOW(DRM_COMMAND_BASE + \
DRM_VIGS_FENCE_WAIT, struct drm_vigs_fence_wait)
#define DRM_IOCTL_VIGS_FENCE_SIGNALED DRM_IOWR(DRM_COMMAND_BASE + \
DRM_VIGS_FENCE_SIGNALED, struct drm_vigs_fence_signaled)
#define DRM_IOCTL_VIGS_FENCE_UNREF DRM_IOW(DRM_COMMAND_BASE + \
DRM_VIGS_FENCE_UNREF, struct drm_vigs_fence_unref)
#define DRM_IOCTL_VIGS_PLANE_SET_ZPOS DRM_IOW(DRM_COMMAND_BASE + \
DRM_VIGS_PLANE_SET_ZPOS, struct drm_vigs_plane_set_zpos)
#define DRM_IOCTL_VIGS_PLANE_SET_TRANSFORM DRM_IOW(DRM_COMMAND_BASE + \
DRM_VIGS_PLANE_SET_TRANSFORM, struct drm_vigs_plane_set_transform)
#define DRM_IOCTL_VIGS_DP_CREATE_SURFACE DRM_IOWR(DRM_COMMAND_BASE + \
DRM_VIGS_DP_CREATE_SURFACE, struct drm_vigs_dp_create_surface)
#define DRM_IOCTL_VIGS_DP_OPEN_SURFACE DRM_IOWR(DRM_COMMAND_BASE + \
DRM_VIGS_DP_OPEN_SURFACE, struct drm_vigs_dp_open_surface)
#endif
|