1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
4 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
6 * Inki Dae <inki.dae@samsung.com>
7 * Joonyoung Shim <jy0922.shim@samsung.com>
8 * Seung-Woo Kim <sw0312.kim@samsung.com>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
16 #ifndef _UAPI_EXYNOS_DRM_H_
17 #define _UAPI_EXYNOS_DRM_H_
21 #if defined(__cplusplus)
26 * User-desired buffer creation information structure.
28 * @size: user-desired memory allocation size.
29 * - this size value would be page-aligned internally.
30 * @flags: user request for setting memory type or cache attributes.
31 * @handle: returned a handle to created gem object.
32 * - this handle will be set by gem module of kernel side.
34 struct drm_exynos_gem_create
{
41 * A structure for getting a fake-offset that can be used with mmap.
43 * @handle: handle of gem object.
44 * @reserved: just padding to be 64-bit aligned.
45 * @offset: a fake-offset of gem object.
47 struct drm_exynos_gem_map
{
54 * A structure to gem information.
56 * @handle: a handle to gem object created.
57 * @flags: flag value including memory type and cache attribute and
58 * this value would be set by driver.
59 * @size: size to memory region allocated by gem and this size would
62 struct drm_exynos_gem_info
{
69 * A structure for user connection request of virtual display.
71 * @connection: indicate whether doing connetion or not by user.
72 * @extensions: if this value is 1 then the vidi driver would need additional
74 * @edid: the edid data pointer from user side.
76 struct drm_exynos_vidi_connection
{
82 /* memory type definitions. */
83 enum e_drm_exynos_gem_mem_type
{
84 /* Physically Continuous memory and used as default. */
85 EXYNOS_BO_CONTIG
= 0 << 0,
86 /* Physically Non-Continuous memory. */
87 EXYNOS_BO_NONCONTIG
= 1 << 0,
88 /* non-cachable mapping and used as default. */
89 EXYNOS_BO_NONCACHABLE
= 0 << 1,
90 /* cachable mapping. */
91 EXYNOS_BO_CACHABLE
= 1 << 1,
92 /* write-combine mapping. */
93 EXYNOS_BO_WC
= 1 << 2,
94 EXYNOS_BO_MASK
= EXYNOS_BO_NONCONTIG
| EXYNOS_BO_CACHABLE
|
98 struct drm_exynos_g2d_get_ver
{
103 struct drm_exynos_g2d_cmd
{
108 enum drm_exynos_g2d_buf_type
{
109 G2D_BUF_USERPTR
= 1 << 31,
112 enum drm_exynos_g2d_event_type
{
115 G2D_EVENT_STOP
, /* not yet */
118 struct drm_exynos_g2d_userptr
{
119 unsigned long userptr
;
123 struct drm_exynos_g2d_set_cmdlist
{
134 struct drm_exynos_g2d_exec
{
138 #define DRM_EXYNOS_GEM_CREATE 0x00
139 #define DRM_EXYNOS_GEM_MAP 0x01
140 /* Reserved 0x03 ~ 0x05 for exynos specific gem ioctl */
141 #define DRM_EXYNOS_GEM_GET 0x04
142 #define DRM_EXYNOS_VIDI_CONNECTION 0x07
145 #define DRM_EXYNOS_G2D_GET_VER 0x20
146 #define DRM_EXYNOS_G2D_SET_CMDLIST 0x21
147 #define DRM_EXYNOS_G2D_EXEC 0x22
149 /* Reserved 0x30 ~ 0x33 for obsolete Exynos IPP ioctls */
151 #define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
152 DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create)
153 #define DRM_IOCTL_EXYNOS_GEM_MAP DRM_IOWR(DRM_COMMAND_BASE + \
154 DRM_EXYNOS_GEM_MAP, struct drm_exynos_gem_map)
155 #define DRM_IOCTL_EXYNOS_GEM_GET DRM_IOWR(DRM_COMMAND_BASE + \
156 DRM_EXYNOS_GEM_GET, struct drm_exynos_gem_info)
158 #define DRM_IOCTL_EXYNOS_VIDI_CONNECTION DRM_IOWR(DRM_COMMAND_BASE + \
159 DRM_EXYNOS_VIDI_CONNECTION, struct drm_exynos_vidi_connection)
161 #define DRM_IOCTL_EXYNOS_G2D_GET_VER DRM_IOWR(DRM_COMMAND_BASE + \
162 DRM_EXYNOS_G2D_GET_VER, struct drm_exynos_g2d_get_ver)
163 #define DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST DRM_IOWR(DRM_COMMAND_BASE + \
164 DRM_EXYNOS_G2D_SET_CMDLIST, struct drm_exynos_g2d_set_cmdlist)
165 #define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \
166 DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec)
168 /* EXYNOS specific events */
169 #define DRM_EXYNOS_G2D_EVENT 0x80000000
171 struct drm_exynos_g2d_event
{
172 struct drm_event base
;
180 #if defined(__cplusplus)
184 #endif /* _UAPI_EXYNOS_DRM_H_ */