1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef _UAPI_TEGRA_DRM_H_ 7 #define _UAPI_TEGRA_DRM_H_ 8 #include "drm.h" 9 #if defined(__cplusplus) 10 extern "C" { 11 #endif 12 #define DRM_TEGRA_GEM_CREATE_TILED (1 << 0) 13 #define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1) 14 struct drm_tegra_gem_create { 15 16 __u64 size; 17 18 __u32 flags; 19 20 __u32 handle; 21 }; 22 struct drm_tegra_gem_mmap { 23 24 __u32 handle; 25 26 __u32 pad; 27 28 __u64 offset; 29 }; 30 struct drm_tegra_syncpt_read { 31 32 __u32 id; 33 34 __u32 value; 35 }; 36 struct drm_tegra_syncpt_incr { 37 38 __u32 id; 39 40 __u32 pad; 41 }; 42 struct drm_tegra_syncpt_wait { 43 44 __u32 id; 45 46 __u32 thresh; 47 48 __u32 timeout; 49 50 __u32 value; 51 }; 52 #define DRM_TEGRA_NO_TIMEOUT (0xffffffff) 53 struct drm_tegra_open_channel { 54 55 __u32 client; 56 57 __u32 pad; 58 59 __u64 context; 60 }; 61 struct drm_tegra_close_channel { 62 63 __u64 context; 64 }; 65 struct drm_tegra_get_syncpt { 66 67 __u64 context; 68 69 __u32 index; 70 71 __u32 id; 72 }; 73 struct drm_tegra_get_syncpt_base { 74 75 __u64 context; 76 77 __u32 syncpt; 78 79 __u32 id; 80 }; 81 struct drm_tegra_syncpt { 82 83 __u32 id; 84 85 __u32 incrs; 86 }; 87 struct drm_tegra_cmdbuf { 88 89 __u32 handle; 90 91 __u32 offset; 92 93 __u32 words; 94 95 __u32 pad; 96 }; 97 struct drm_tegra_reloc { 98 struct { 99 100 __u32 handle; 101 102 __u32 offset; 103 } cmdbuf; 104 struct { 105 106 __u32 handle; 107 108 __u32 offset; 109 } target; 110 111 __u32 shift; 112 113 __u32 pad; 114 }; 115 struct drm_tegra_waitchk { 116 117 __u32 handle; 118 119 __u32 offset; 120 121 __u32 syncpt; 122 123 __u32 thresh; 124 }; 125 struct drm_tegra_submit { 126 127 __u64 context; 128 129 __u32 num_syncpts; 130 131 __u32 num_cmdbufs; 132 133 __u32 num_relocs; 134 135 __u32 num_waitchks; 136 137 __u32 waitchk_mask; 138 139 __u32 timeout; 140 141 __u64 syncpts; 142 143 __u64 cmdbufs; 144 145 __u64 relocs; 146 147 __u64 waitchks; 148 149 __u32 fence; 150 151 __u32 reserved[5]; 152 }; 153 #define DRM_TEGRA_GEM_TILING_MODE_PITCH 0 154 #define DRM_TEGRA_GEM_TILING_MODE_TILED 1 155 #define DRM_TEGRA_GEM_TILING_MODE_BLOCK 2 156 struct drm_tegra_gem_set_tiling { 157 158 __u32 handle; 159 160 __u32 mode; 161 162 __u32 value; 163 164 __u32 pad; 165 }; 166 struct drm_tegra_gem_get_tiling { 167 168 __u32 handle; 169 170 __u32 mode; 171 172 __u32 value; 173 174 __u32 pad; 175 }; 176 #define DRM_TEGRA_GEM_BOTTOM_UP (1 << 0) 177 #define DRM_TEGRA_GEM_FLAGS (DRM_TEGRA_GEM_BOTTOM_UP) 178 struct drm_tegra_gem_set_flags { 179 180 __u32 handle; 181 182 __u32 flags; 183 }; 184 struct drm_tegra_gem_get_flags { 185 186 __u32 handle; 187 188 __u32 flags; 189 }; 190 #define DRM_TEGRA_GEM_CREATE 0x00 191 #define DRM_TEGRA_GEM_MMAP 0x01 192 #define DRM_TEGRA_SYNCPT_READ 0x02 193 #define DRM_TEGRA_SYNCPT_INCR 0x03 194 #define DRM_TEGRA_SYNCPT_WAIT 0x04 195 #define DRM_TEGRA_OPEN_CHANNEL 0x05 196 #define DRM_TEGRA_CLOSE_CHANNEL 0x06 197 #define DRM_TEGRA_GET_SYNCPT 0x07 198 #define DRM_TEGRA_SUBMIT 0x08 199 #define DRM_TEGRA_GET_SYNCPT_BASE 0x09 200 #define DRM_TEGRA_GEM_SET_TILING 0x0a 201 #define DRM_TEGRA_GEM_GET_TILING 0x0b 202 #define DRM_TEGRA_GEM_SET_FLAGS 0x0c 203 #define DRM_TEGRA_GEM_GET_FLAGS 0x0d 204 #define DRM_IOCTL_TEGRA_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_CREATE, struct drm_tegra_gem_create) 205 #define DRM_IOCTL_TEGRA_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_MMAP, struct drm_tegra_gem_mmap) 206 #define DRM_IOCTL_TEGRA_SYNCPT_READ DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_READ, struct drm_tegra_syncpt_read) 207 #define DRM_IOCTL_TEGRA_SYNCPT_INCR DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_INCR, struct drm_tegra_syncpt_incr) 208 #define DRM_IOCTL_TEGRA_SYNCPT_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_WAIT, struct drm_tegra_syncpt_wait) 209 #define DRM_IOCTL_TEGRA_OPEN_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_OPEN_CHANNEL, struct drm_tegra_open_channel) 210 #define DRM_IOCTL_TEGRA_CLOSE_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_CLOSE_CHANNEL, struct drm_tegra_close_channel) 211 #define DRM_IOCTL_TEGRA_GET_SYNCPT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT, struct drm_tegra_get_syncpt) 212 #define DRM_IOCTL_TEGRA_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SUBMIT, struct drm_tegra_submit) 213 #define DRM_IOCTL_TEGRA_GET_SYNCPT_BASE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT_BASE, struct drm_tegra_get_syncpt_base) 214 #define DRM_IOCTL_TEGRA_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_TILING, struct drm_tegra_gem_set_tiling) 215 #define DRM_IOCTL_TEGRA_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_TILING, struct drm_tegra_gem_get_tiling) 216 #define DRM_IOCTL_TEGRA_GEM_SET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_FLAGS, struct drm_tegra_gem_set_flags) 217 #define DRM_IOCTL_TEGRA_GEM_GET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_FLAGS, struct drm_tegra_gem_get_flags) 218 #if defined(__cplusplus) 219 } 220 #endif 221 #endif 222