3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
5 * Inki Dae <inki.dae@samsung.com>
6 * Joonyoung Shim <jy0922.shim@samsung.com>
7 * Seung-Woo Kim <sw0312.kim@samsung.com>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
15 #ifndef _UAPI_EXYNOS_DRM_H_
16 #define _UAPI_EXYNOS_DRM_H_
20 #if defined(__cplusplus)
25 * User-desired buffer creation information structure.
27 * @size: user-desired memory allocation size.
28 * - this size value would be page-aligned internally.
29 * @flags: user request for setting memory type or cache attributes.
30 * @handle: returned a handle to created gem object.
31 * - this handle will be set by gem module of kernel side.
33 struct drm_exynos_gem_create
{
40 * A structure for getting a fake-offset that can be used with mmap.
42 * @handle: handle of gem object.
43 * @reserved: just padding to be 64-bit aligned.
44 * @offset: a fake-offset of gem object.
46 struct drm_exynos_gem_map
{
53 * A structure to gem information.
55 * @handle: a handle to gem object created.
56 * @flags: flag value including memory type and cache attribute and
57 * this value would be set by driver.
58 * @size: size to memory region allocated by gem and this size would
61 struct drm_exynos_gem_info
{
68 * A structure for user connection request of virtual display.
70 * @connection: indicate whether doing connetion or not by user.
71 * @extensions: if this value is 1 then the vidi driver would need additional
73 * @edid: the edid data pointer from user side.
75 struct drm_exynos_vidi_connection
{
81 /* memory type definitions. */
82 enum e_drm_exynos_gem_mem_type
{
83 /* Physically Continuous memory and used as default. */
84 EXYNOS_BO_CONTIG
= 0 << 0,
85 /* Physically Non-Continuous memory. */
86 EXYNOS_BO_NONCONTIG
= 1 << 0,
87 /* non-cachable mapping and used as default. */
88 EXYNOS_BO_NONCACHABLE
= 0 << 1,
89 /* cachable mapping. */
90 EXYNOS_BO_CACHABLE
= 1 << 1,
91 /* write-combine mapping. */
92 EXYNOS_BO_WC
= 1 << 2,
93 EXYNOS_BO_MASK
= EXYNOS_BO_NONCONTIG
| EXYNOS_BO_CACHABLE
|
97 struct drm_exynos_g2d_get_ver
{
102 struct drm_exynos_g2d_cmd
{
107 enum drm_exynos_g2d_buf_type
{
108 G2D_BUF_USERPTR
= 1 << 31,
111 enum drm_exynos_g2d_event_type
{
114 G2D_EVENT_STOP
, /* not yet */
117 struct drm_exynos_g2d_userptr
{
118 unsigned long userptr
;
122 struct drm_exynos_g2d_set_cmdlist
{
133 struct drm_exynos_g2d_exec
{
137 enum drm_exynos_ops_id
{
143 struct drm_exynos_sz
{
148 struct drm_exynos_pos
{
155 enum drm_exynos_flip
{
156 EXYNOS_DRM_FLIP_NONE
= (0 << 0),
157 EXYNOS_DRM_FLIP_VERTICAL
= (1 << 0),
158 EXYNOS_DRM_FLIP_HORIZONTAL
= (1 << 1),
159 EXYNOS_DRM_FLIP_BOTH
= EXYNOS_DRM_FLIP_VERTICAL
|
160 EXYNOS_DRM_FLIP_HORIZONTAL
,
163 enum drm_exynos_degree
{
165 EXYNOS_DRM_DEGREE_90
,
166 EXYNOS_DRM_DEGREE_180
,
167 EXYNOS_DRM_DEGREE_270
,
170 enum drm_exynos_planer
{
172 EXYNOS_DRM_PLANAR_CB
,
173 EXYNOS_DRM_PLANAR_CR
,
174 EXYNOS_DRM_PLANAR_MAX
,
178 * A structure for ipp supported property list.
180 * @version: version of this structure.
181 * @ipp_id: id of ipp driver.
182 * @count: count of ipp driver.
183 * @writeback: flag of writeback supporting.
184 * @flip: flag of flip supporting.
185 * @degree: flag of degree information.
186 * @csc: flag of csc supporting.
187 * @crop: flag of crop supporting.
188 * @scale: flag of scale supporting.
189 * @refresh_min: min hz of refresh.
190 * @refresh_max: max hz of refresh.
191 * @crop_min: crop min resolution.
192 * @crop_max: crop max resolution.
193 * @scale_min: scale min resolution.
194 * @scale_max: scale max resolution.
196 struct drm_exynos_ipp_prop_list
{
209 struct drm_exynos_sz crop_min
;
210 struct drm_exynos_sz crop_max
;
211 struct drm_exynos_sz scale_min
;
212 struct drm_exynos_sz scale_max
;
216 * A structure for ipp config.
218 * @ops_id: property of operation directions.
219 * @flip: property of mirror, flip.
220 * @degree: property of rotation degree.
221 * @fmt: property of image format.
222 * @sz: property of image size.
223 * @pos: property of image position(src-cropped,dst-scaler).
225 struct drm_exynos_ipp_config
{
230 struct drm_exynos_sz sz
;
231 struct drm_exynos_pos pos
;
234 enum drm_exynos_ipp_cmd
{
243 * A structure for ipp property.
245 * @config: source, destination config.
246 * @cmd: definition of command.
247 * @ipp_id: id of ipp driver.
248 * @prop_id: id of property.
249 * @refresh_rate: refresh rate.
251 struct drm_exynos_ipp_property
{
252 struct drm_exynos_ipp_config config
[EXYNOS_DRM_OPS_MAX
];
259 enum drm_exynos_ipp_buf_type
{
265 * A structure for ipp buffer operations.
267 * @ops_id: operation directions.
268 * @buf_type: definition of buffer.
269 * @prop_id: id of property.
270 * @buf_id: id of buffer.
271 * @handle: Y, Cb, Cr each planar handle.
272 * @user_data: user data.
274 struct drm_exynos_ipp_queue_buf
{
279 __u32 handle
[EXYNOS_DRM_PLANAR_MAX
];
284 enum drm_exynos_ipp_ctrl
{
293 * A structure for ipp start/stop operations.
295 * @prop_id: id of property.
296 * @ctrl: definition of control.
298 struct drm_exynos_ipp_cmd_ctrl
{
303 #define DRM_EXYNOS_GEM_CREATE 0x00
304 #define DRM_EXYNOS_GEM_MAP 0x01
305 /* Reserved 0x03 ~ 0x05 for exynos specific gem ioctl */
306 #define DRM_EXYNOS_GEM_GET 0x04
307 #define DRM_EXYNOS_VIDI_CONNECTION 0x07
310 #define DRM_EXYNOS_G2D_GET_VER 0x20
311 #define DRM_EXYNOS_G2D_SET_CMDLIST 0x21
312 #define DRM_EXYNOS_G2D_EXEC 0x22
314 /* IPP - Image Post Processing */
315 #define DRM_EXYNOS_IPP_GET_PROPERTY 0x30
316 #define DRM_EXYNOS_IPP_SET_PROPERTY 0x31
317 #define DRM_EXYNOS_IPP_QUEUE_BUF 0x32
318 #define DRM_EXYNOS_IPP_CMD_CTRL 0x33
320 #define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
321 DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create)
322 #define DRM_IOCTL_EXYNOS_GEM_MAP DRM_IOWR(DRM_COMMAND_BASE + \
323 DRM_EXYNOS_GEM_MAP, struct drm_exynos_gem_map)
324 #define DRM_IOCTL_EXYNOS_GEM_GET DRM_IOWR(DRM_COMMAND_BASE + \
325 DRM_EXYNOS_GEM_GET, struct drm_exynos_gem_info)
327 #define DRM_IOCTL_EXYNOS_VIDI_CONNECTION DRM_IOWR(DRM_COMMAND_BASE + \
328 DRM_EXYNOS_VIDI_CONNECTION, struct drm_exynos_vidi_connection)
330 #define DRM_IOCTL_EXYNOS_G2D_GET_VER DRM_IOWR(DRM_COMMAND_BASE + \
331 DRM_EXYNOS_G2D_GET_VER, struct drm_exynos_g2d_get_ver)
332 #define DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST DRM_IOWR(DRM_COMMAND_BASE + \
333 DRM_EXYNOS_G2D_SET_CMDLIST, struct drm_exynos_g2d_set_cmdlist)
334 #define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \
335 DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec)
337 #define DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \
338 DRM_EXYNOS_IPP_GET_PROPERTY, struct drm_exynos_ipp_prop_list)
339 #define DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \
340 DRM_EXYNOS_IPP_SET_PROPERTY, struct drm_exynos_ipp_property)
341 #define DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF DRM_IOWR(DRM_COMMAND_BASE + \
342 DRM_EXYNOS_IPP_QUEUE_BUF, struct drm_exynos_ipp_queue_buf)
343 #define DRM_IOCTL_EXYNOS_IPP_CMD_CTRL DRM_IOWR(DRM_COMMAND_BASE + \
344 DRM_EXYNOS_IPP_CMD_CTRL, struct drm_exynos_ipp_cmd_ctrl)
346 /* EXYNOS specific events */
347 #define DRM_EXYNOS_G2D_EVENT 0x80000000
348 #define DRM_EXYNOS_IPP_EVENT 0x80000001
350 struct drm_exynos_g2d_event
{
351 struct drm_event base
;
359 struct drm_exynos_ipp_event
{
360 struct drm_event base
;
366 __u32 buf_id
[EXYNOS_DRM_OPS_MAX
];
369 #if defined(__cplusplus)
373 #endif /* _UAPI_EXYNOS_DRM_H_ */