Merge tag 'xtensa-20180225' of git://github.com/jcmvbkbc/linux-xtensa
[cris-mirror.git] / include / uapi / drm / exynos_drm.h
blob4a54305120e06de11a6d53db9bbd80501febd9d4
1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2 /* exynos_drm.h
4 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
5 * Authors:
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_
19 #include "drm.h"
21 #if defined(__cplusplus)
22 extern "C" {
23 #endif
25 /**
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 {
35 __u64 size;
36 __u32 flags;
37 __u32 handle;
40 /**
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 {
48 __u32 handle;
49 __u32 reserved;
50 __u64 offset;
53 /**
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
60 * be set by driver.
62 struct drm_exynos_gem_info {
63 __u32 handle;
64 __u32 flags;
65 __u64 size;
68 /**
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
73 * 128bytes edid data.
74 * @edid: the edid data pointer from user side.
76 struct drm_exynos_vidi_connection {
77 __u32 connection;
78 __u32 extensions;
79 __u64 edid;
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 |
95 EXYNOS_BO_WC
98 struct drm_exynos_g2d_get_ver {
99 __u32 major;
100 __u32 minor;
103 struct drm_exynos_g2d_cmd {
104 __u32 offset;
105 __u32 data;
108 enum drm_exynos_g2d_buf_type {
109 G2D_BUF_USERPTR = 1 << 31,
112 enum drm_exynos_g2d_event_type {
113 G2D_EVENT_NOT,
114 G2D_EVENT_NONSTOP,
115 G2D_EVENT_STOP, /* not yet */
118 struct drm_exynos_g2d_userptr {
119 unsigned long userptr;
120 unsigned long size;
123 struct drm_exynos_g2d_set_cmdlist {
124 __u64 cmd;
125 __u64 cmd_buf;
126 __u32 cmd_nr;
127 __u32 cmd_buf_nr;
129 /* for g2d event */
130 __u64 event_type;
131 __u64 user_data;
134 struct drm_exynos_g2d_exec {
135 __u64 async;
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
144 /* G2D */
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;
173 __u64 user_data;
174 __u32 tv_sec;
175 __u32 tv_usec;
176 __u32 cmdlist_no;
177 __u32 reserved;
180 #if defined(__cplusplus)
182 #endif
184 #endif /* _UAPI_EXYNOS_DRM_H_ */