aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/drm/exynos_drm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi/drm/exynos_drm.h')
-rw-r--r--include/uapi/drm/exynos_drm.h227
1 files changed, 207 insertions, 20 deletions
diff --git a/include/uapi/drm/exynos_drm.h b/include/uapi/drm/exynos_drm.h
index c0494d586e23..d5844122ff32 100644
--- a/include/uapi/drm/exynos_drm.h
+++ b/include/uapi/drm/exynos_drm.h
@@ -6,24 +6,10 @@
6 * Joonyoung Shim <jy0922.shim@samsung.com> 6 * Joonyoung Shim <jy0922.shim@samsung.com>
7 * Seung-Woo Kim <sw0312.kim@samsung.com> 7 * Seung-Woo Kim <sw0312.kim@samsung.com>
8 * 8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a 9 * This program is free software; you can redistribute it and/or modify it
10 * copy of this software and associated documentation files (the "Software"), 10 * under the terms of the GNU General Public License as published by the
11 * to deal in the Software without restriction, including without limitation 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 * option) any later version.
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */ 13 */
28 14
29#ifndef _UAPI_EXYNOS_DRM_H_ 15#ifndef _UAPI_EXYNOS_DRM_H_
@@ -133,17 +119,26 @@ struct drm_exynos_g2d_cmd {
133 __u32 data; 119 __u32 data;
134}; 120};
135 121
122enum drm_exynos_g2d_buf_type {
123 G2D_BUF_USERPTR = 1 << 31,
124};
125
136enum drm_exynos_g2d_event_type { 126enum drm_exynos_g2d_event_type {
137 G2D_EVENT_NOT, 127 G2D_EVENT_NOT,
138 G2D_EVENT_NONSTOP, 128 G2D_EVENT_NONSTOP,
139 G2D_EVENT_STOP, /* not yet */ 129 G2D_EVENT_STOP, /* not yet */
140}; 130};
141 131
132struct drm_exynos_g2d_userptr {
133 unsigned long userptr;
134 unsigned long size;
135};
136
142struct drm_exynos_g2d_set_cmdlist { 137struct drm_exynos_g2d_set_cmdlist {
143 __u64 cmd; 138 __u64 cmd;
144 __u64 cmd_gem; 139 __u64 cmd_buf;
145 __u32 cmd_nr; 140 __u32 cmd_nr;
146 __u32 cmd_gem_nr; 141 __u32 cmd_buf_nr;
147 142
148 /* for g2d event */ 143 /* for g2d event */
149 __u64 event_type; 144 __u64 event_type;
@@ -154,6 +149,172 @@ struct drm_exynos_g2d_exec {
154 __u64 async; 149 __u64 async;
155}; 150};
156 151
152enum drm_exynos_ops_id {
153 EXYNOS_DRM_OPS_SRC,
154 EXYNOS_DRM_OPS_DST,
155 EXYNOS_DRM_OPS_MAX,
156};
157
158struct drm_exynos_sz {
159 __u32 hsize;
160 __u32 vsize;
161};
162
163struct drm_exynos_pos {
164 __u32 x;
165 __u32 y;
166 __u32 w;
167 __u32 h;
168};
169
170enum drm_exynos_flip {
171 EXYNOS_DRM_FLIP_NONE = (0 << 0),
172 EXYNOS_DRM_FLIP_VERTICAL = (1 << 0),
173 EXYNOS_DRM_FLIP_HORIZONTAL = (1 << 1),
174 EXYNOS_DRM_FLIP_BOTH = EXYNOS_DRM_FLIP_VERTICAL |
175 EXYNOS_DRM_FLIP_HORIZONTAL,
176};
177
178enum drm_exynos_degree {
179 EXYNOS_DRM_DEGREE_0,
180 EXYNOS_DRM_DEGREE_90,
181 EXYNOS_DRM_DEGREE_180,
182 EXYNOS_DRM_DEGREE_270,
183};
184
185enum drm_exynos_planer {
186 EXYNOS_DRM_PLANAR_Y,
187 EXYNOS_DRM_PLANAR_CB,
188 EXYNOS_DRM_PLANAR_CR,
189 EXYNOS_DRM_PLANAR_MAX,
190};
191
192/**
193 * A structure for ipp supported property list.
194 *
195 * @version: version of this structure.
196 * @ipp_id: id of ipp driver.
197 * @count: count of ipp driver.
198 * @writeback: flag of writeback supporting.
199 * @flip: flag of flip supporting.
200 * @degree: flag of degree information.
201 * @csc: flag of csc supporting.
202 * @crop: flag of crop supporting.
203 * @scale: flag of scale supporting.
204 * @refresh_min: min hz of refresh.
205 * @refresh_max: max hz of refresh.
206 * @crop_min: crop min resolution.
207 * @crop_max: crop max resolution.
208 * @scale_min: scale min resolution.
209 * @scale_max: scale max resolution.
210 */
211struct drm_exynos_ipp_prop_list {
212 __u32 version;
213 __u32 ipp_id;
214 __u32 count;
215 __u32 writeback;
216 __u32 flip;
217 __u32 degree;
218 __u32 csc;
219 __u32 crop;
220 __u32 scale;
221 __u32 refresh_min;
222 __u32 refresh_max;
223 __u32 reserved;
224 struct drm_exynos_sz crop_min;
225 struct drm_exynos_sz crop_max;
226 struct drm_exynos_sz scale_min;
227 struct drm_exynos_sz scale_max;
228};
229
230/**
231 * A structure for ipp config.
232 *
233 * @ops_id: property of operation directions.
234 * @flip: property of mirror, flip.
235 * @degree: property of rotation degree.
236 * @fmt: property of image format.
237 * @sz: property of image size.
238 * @pos: property of image position(src-cropped,dst-scaler).
239 */
240struct drm_exynos_ipp_config {
241 enum drm_exynos_ops_id ops_id;
242 enum drm_exynos_flip flip;
243 enum drm_exynos_degree degree;
244 __u32 fmt;
245 struct drm_exynos_sz sz;
246 struct drm_exynos_pos pos;
247};
248
249enum drm_exynos_ipp_cmd {
250 IPP_CMD_NONE,
251 IPP_CMD_M2M,
252 IPP_CMD_WB,
253 IPP_CMD_OUTPUT,
254 IPP_CMD_MAX,
255};
256
257/**
258 * A structure for ipp property.
259 *
260 * @config: source, destination config.
261 * @cmd: definition of command.
262 * @ipp_id: id of ipp driver.
263 * @prop_id: id of property.
264 * @refresh_rate: refresh rate.
265 */
266struct drm_exynos_ipp_property {
267 struct drm_exynos_ipp_config config[EXYNOS_DRM_OPS_MAX];
268 enum drm_exynos_ipp_cmd cmd;
269 __u32 ipp_id;
270 __u32 prop_id;
271 __u32 refresh_rate;
272};
273
274enum drm_exynos_ipp_buf_type {
275 IPP_BUF_ENQUEUE,
276 IPP_BUF_DEQUEUE,
277};
278
279/**
280 * A structure for ipp buffer operations.
281 *
282 * @ops_id: operation directions.
283 * @buf_type: definition of buffer.
284 * @prop_id: id of property.
285 * @buf_id: id of buffer.
286 * @handle: Y, Cb, Cr each planar handle.
287 * @user_data: user data.
288 */
289struct drm_exynos_ipp_queue_buf {
290 enum drm_exynos_ops_id ops_id;
291 enum drm_exynos_ipp_buf_type buf_type;
292 __u32 prop_id;
293 __u32 buf_id;
294 __u32 handle[EXYNOS_DRM_PLANAR_MAX];
295 __u32 reserved;
296 __u64 user_data;
297};
298
299enum drm_exynos_ipp_ctrl {
300 IPP_CTRL_PLAY,
301 IPP_CTRL_STOP,
302 IPP_CTRL_PAUSE,
303 IPP_CTRL_RESUME,
304 IPP_CTRL_MAX,
305};
306
307/**
308 * A structure for ipp start/stop operations.
309 *
310 * @prop_id: id of property.
311 * @ctrl: definition of control.
312 */
313struct drm_exynos_ipp_cmd_ctrl {
314 __u32 prop_id;
315 enum drm_exynos_ipp_ctrl ctrl;
316};
317
157#define DRM_EXYNOS_GEM_CREATE 0x00 318#define DRM_EXYNOS_GEM_CREATE 0x00
158#define DRM_EXYNOS_GEM_MAP_OFFSET 0x01 319#define DRM_EXYNOS_GEM_MAP_OFFSET 0x01
159#define DRM_EXYNOS_GEM_MMAP 0x02 320#define DRM_EXYNOS_GEM_MMAP 0x02
@@ -166,6 +327,12 @@ struct drm_exynos_g2d_exec {
166#define DRM_EXYNOS_G2D_SET_CMDLIST 0x21 327#define DRM_EXYNOS_G2D_SET_CMDLIST 0x21
167#define DRM_EXYNOS_G2D_EXEC 0x22 328#define DRM_EXYNOS_G2D_EXEC 0x22
168 329
330/* IPP - Image Post Processing */
331#define DRM_EXYNOS_IPP_GET_PROPERTY 0x30
332#define DRM_EXYNOS_IPP_SET_PROPERTY 0x31
333#define DRM_EXYNOS_IPP_QUEUE_BUF 0x32
334#define DRM_EXYNOS_IPP_CMD_CTRL 0x33
335
169#define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ 336#define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
170 DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create) 337 DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create)
171 338
@@ -188,8 +355,18 @@ struct drm_exynos_g2d_exec {
188#define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \ 355#define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \
189 DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec) 356 DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec)
190 357
358#define DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \
359 DRM_EXYNOS_IPP_GET_PROPERTY, struct drm_exynos_ipp_prop_list)
360#define DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \
361 DRM_EXYNOS_IPP_SET_PROPERTY, struct drm_exynos_ipp_property)
362#define DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF DRM_IOWR(DRM_COMMAND_BASE + \
363 DRM_EXYNOS_IPP_QUEUE_BUF, struct drm_exynos_ipp_queue_buf)
364#define DRM_IOCTL_EXYNOS_IPP_CMD_CTRL DRM_IOWR(DRM_COMMAND_BASE + \
365 DRM_EXYNOS_IPP_CMD_CTRL, struct drm_exynos_ipp_cmd_ctrl)
366
191/* EXYNOS specific events */ 367/* EXYNOS specific events */
192#define DRM_EXYNOS_G2D_EVENT 0x80000000 368#define DRM_EXYNOS_G2D_EVENT 0x80000000
369#define DRM_EXYNOS_IPP_EVENT 0x80000001
193 370
194struct drm_exynos_g2d_event { 371struct drm_exynos_g2d_event {
195 struct drm_event base; 372 struct drm_event base;
@@ -200,4 +377,14 @@ struct drm_exynos_g2d_event {
200 __u32 reserved; 377 __u32 reserved;
201}; 378};
202 379
380struct drm_exynos_ipp_event {
381 struct drm_event base;
382 __u64 user_data;
383 __u32 tv_sec;
384 __u32 tv_usec;
385 __u32 prop_id;
386 __u32 reserved;
387 __u32 buf_id[EXYNOS_DRM_OPS_MAX];
388};
389
203#endif /* _UAPI_EXYNOS_DRM_H_ */ 390#endif /* _UAPI_EXYNOS_DRM_H_ */