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_
21 * User-desired buffer creation information structure.
23 * @size: user-desired memory allocation size.
24 * - this size value would be page-aligned internally.
25 * @flags: user request for setting memory type or cache attributes.
26 * @handle: returned a handle to created gem object.
27 * - this handle will be set by gem module of kernel side.
29 struct drm_exynos_gem_create
{
36 * A structure to gem information.
38 * @handle: a handle to gem object created.
39 * @flags: flag value including memory type and cache attribute and
40 * this value would be set by driver.
41 * @size: size to memory region allocated by gem and this size would
44 struct drm_exynos_gem_info
{
51 * A structure for user connection request of virtual display.
53 * @connection: indicate whether doing connetion or not by user.
54 * @extensions: if this value is 1 then the vidi driver would need additional
56 * @edid: the edid data pointer from user side.
58 struct drm_exynos_vidi_connection
{
59 unsigned int connection
;
60 unsigned int extensions
;
64 /* memory type definitions. */
65 enum e_drm_exynos_gem_mem_type
{
66 /* Physically Continuous memory and used as default. */
67 EXYNOS_BO_CONTIG
= 0 << 0,
68 /* Physically Non-Continuous memory. */
69 EXYNOS_BO_NONCONTIG
= 1 << 0,
70 /* non-cachable mapping and used as default. */
71 EXYNOS_BO_NONCACHABLE
= 0 << 1,
72 /* cachable mapping. */
73 EXYNOS_BO_CACHABLE
= 1 << 1,
74 /* write-combine mapping. */
75 EXYNOS_BO_WC
= 1 << 2,
76 EXYNOS_BO_MASK
= EXYNOS_BO_NONCONTIG
| EXYNOS_BO_CACHABLE
|
80 struct drm_exynos_g2d_get_ver
{
85 struct drm_exynos_g2d_cmd
{
90 enum drm_exynos_g2d_buf_type
{
91 G2D_BUF_USERPTR
= 1 << 31,
94 enum drm_exynos_g2d_event_type
{
97 G2D_EVENT_STOP
, /* not yet */
100 struct drm_exynos_g2d_userptr
{
101 unsigned long userptr
;
105 struct drm_exynos_g2d_set_cmdlist
{
116 struct drm_exynos_g2d_exec
{
120 enum drm_exynos_ops_id
{
126 struct drm_exynos_sz
{
131 struct drm_exynos_pos
{
138 enum drm_exynos_flip
{
139 EXYNOS_DRM_FLIP_NONE
= (0 << 0),
140 EXYNOS_DRM_FLIP_VERTICAL
= (1 << 0),
141 EXYNOS_DRM_FLIP_HORIZONTAL
= (1 << 1),
142 EXYNOS_DRM_FLIP_BOTH
= EXYNOS_DRM_FLIP_VERTICAL
|
143 EXYNOS_DRM_FLIP_HORIZONTAL
,
146 enum drm_exynos_degree
{
148 EXYNOS_DRM_DEGREE_90
,
149 EXYNOS_DRM_DEGREE_180
,
150 EXYNOS_DRM_DEGREE_270
,
153 enum drm_exynos_planer
{
155 EXYNOS_DRM_PLANAR_CB
,
156 EXYNOS_DRM_PLANAR_CR
,
157 EXYNOS_DRM_PLANAR_MAX
,
161 * A structure for ipp supported property list.
163 * @version: version of this structure.
164 * @ipp_id: id of ipp driver.
165 * @count: count of ipp driver.
166 * @writeback: flag of writeback supporting.
167 * @flip: flag of flip supporting.
168 * @degree: flag of degree information.
169 * @csc: flag of csc supporting.
170 * @crop: flag of crop supporting.
171 * @scale: flag of scale supporting.
172 * @refresh_min: min hz of refresh.
173 * @refresh_max: max hz of refresh.
174 * @crop_min: crop min resolution.
175 * @crop_max: crop max resolution.
176 * @scale_min: scale min resolution.
177 * @scale_max: scale max resolution.
179 struct drm_exynos_ipp_prop_list
{
192 struct drm_exynos_sz crop_min
;
193 struct drm_exynos_sz crop_max
;
194 struct drm_exynos_sz scale_min
;
195 struct drm_exynos_sz scale_max
;
199 * A structure for ipp config.
201 * @ops_id: property of operation directions.
202 * @flip: property of mirror, flip.
203 * @degree: property of rotation degree.
204 * @fmt: property of image format.
205 * @sz: property of image size.
206 * @pos: property of image position(src-cropped,dst-scaler).
208 struct drm_exynos_ipp_config
{
209 enum drm_exynos_ops_id ops_id
;
210 enum drm_exynos_flip flip
;
211 enum drm_exynos_degree degree
;
213 struct drm_exynos_sz sz
;
214 struct drm_exynos_pos pos
;
217 enum drm_exynos_ipp_cmd
{
226 * A structure for ipp property.
228 * @config: source, destination config.
229 * @cmd: definition of command.
230 * @ipp_id: id of ipp driver.
231 * @prop_id: id of property.
232 * @refresh_rate: refresh rate.
234 struct drm_exynos_ipp_property
{
235 struct drm_exynos_ipp_config config
[EXYNOS_DRM_OPS_MAX
];
236 enum drm_exynos_ipp_cmd cmd
;
242 enum drm_exynos_ipp_buf_type
{
248 * A structure for ipp buffer operations.
250 * @ops_id: operation directions.
251 * @buf_type: definition of buffer.
252 * @prop_id: id of property.
253 * @buf_id: id of buffer.
254 * @handle: Y, Cb, Cr each planar handle.
255 * @user_data: user data.
257 struct drm_exynos_ipp_queue_buf
{
258 enum drm_exynos_ops_id ops_id
;
259 enum drm_exynos_ipp_buf_type buf_type
;
262 __u32 handle
[EXYNOS_DRM_PLANAR_MAX
];
267 enum drm_exynos_ipp_ctrl
{
276 * A structure for ipp start/stop operations.
278 * @prop_id: id of property.
279 * @ctrl: definition of control.
281 struct drm_exynos_ipp_cmd_ctrl
{
283 enum drm_exynos_ipp_ctrl ctrl
;
286 #define DRM_EXYNOS_GEM_CREATE 0x00
287 /* Reserved 0x03 ~ 0x05 for exynos specific gem ioctl */
288 #define DRM_EXYNOS_GEM_GET 0x04
289 #define DRM_EXYNOS_VIDI_CONNECTION 0x07
292 #define DRM_EXYNOS_G2D_GET_VER 0x20
293 #define DRM_EXYNOS_G2D_SET_CMDLIST 0x21
294 #define DRM_EXYNOS_G2D_EXEC 0x22
296 /* IPP - Image Post Processing */
297 #define DRM_EXYNOS_IPP_GET_PROPERTY 0x30
298 #define DRM_EXYNOS_IPP_SET_PROPERTY 0x31
299 #define DRM_EXYNOS_IPP_QUEUE_BUF 0x32
300 #define DRM_EXYNOS_IPP_CMD_CTRL 0x33
302 #define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
303 DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create)
305 #define DRM_IOCTL_EXYNOS_GEM_GET DRM_IOWR(DRM_COMMAND_BASE + \
306 DRM_EXYNOS_GEM_GET, struct drm_exynos_gem_info)
308 #define DRM_IOCTL_EXYNOS_VIDI_CONNECTION DRM_IOWR(DRM_COMMAND_BASE + \
309 DRM_EXYNOS_VIDI_CONNECTION, struct drm_exynos_vidi_connection)
311 #define DRM_IOCTL_EXYNOS_G2D_GET_VER DRM_IOWR(DRM_COMMAND_BASE + \
312 DRM_EXYNOS_G2D_GET_VER, struct drm_exynos_g2d_get_ver)
313 #define DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST DRM_IOWR(DRM_COMMAND_BASE + \
314 DRM_EXYNOS_G2D_SET_CMDLIST, struct drm_exynos_g2d_set_cmdlist)
315 #define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \
316 DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec)
318 #define DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \
319 DRM_EXYNOS_IPP_GET_PROPERTY, struct drm_exynos_ipp_prop_list)
320 #define DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \
321 DRM_EXYNOS_IPP_SET_PROPERTY, struct drm_exynos_ipp_property)
322 #define DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF DRM_IOWR(DRM_COMMAND_BASE + \
323 DRM_EXYNOS_IPP_QUEUE_BUF, struct drm_exynos_ipp_queue_buf)
324 #define DRM_IOCTL_EXYNOS_IPP_CMD_CTRL DRM_IOWR(DRM_COMMAND_BASE + \
325 DRM_EXYNOS_IPP_CMD_CTRL, struct drm_exynos_ipp_cmd_ctrl)
327 /* EXYNOS specific events */
328 #define DRM_EXYNOS_G2D_EVENT 0x80000000
329 #define DRM_EXYNOS_IPP_EVENT 0x80000001
331 struct drm_exynos_g2d_event
{
332 struct drm_event base
;
340 struct drm_exynos_ipp_event
{
341 struct drm_event base
;
347 __u32 buf_id
[EXYNOS_DRM_OPS_MAX
];
350 #endif /* _UAPI_EXYNOS_DRM_H_ */