Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef __AMDGPU_DRM_H__ |
| 20 | #define __AMDGPU_DRM_H__ |
| 21 | #include "drm.h" |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 22 | #ifdef __cplusplus |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 23 | #endif |
| 24 | #define DRM_AMDGPU_GEM_CREATE 0x00 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 25 | #define DRM_AMDGPU_GEM_MMAP 0x01 |
| 26 | #define DRM_AMDGPU_CTX 0x02 |
| 27 | #define DRM_AMDGPU_BO_LIST 0x03 |
| 28 | #define DRM_AMDGPU_CS 0x04 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 29 | #define DRM_AMDGPU_INFO 0x05 |
| 30 | #define DRM_AMDGPU_GEM_METADATA 0x06 |
| 31 | #define DRM_AMDGPU_GEM_WAIT_IDLE 0x07 |
| 32 | #define DRM_AMDGPU_GEM_VA 0x08 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 33 | #define DRM_AMDGPU_WAIT_CS 0x09 |
| 34 | #define DRM_AMDGPU_GEM_OP 0x10 |
| 35 | #define DRM_AMDGPU_GEM_USERPTR 0x11 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 36 | #define DRM_AMDGPU_WAIT_FENCES 0x12 |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 37 | #define DRM_AMDGPU_VM 0x13 |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame^] | 38 | #define DRM_AMDGPU_FENCE_TO_HANDLE 0x14 |
| 39 | #define DRM_AMDGPU_SCHED 0x15 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 40 | #define DRM_IOCTL_AMDGPU_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_CREATE, union drm_amdgpu_gem_create) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 41 | #define DRM_IOCTL_AMDGPU_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_MMAP, union drm_amdgpu_gem_mmap) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 42 | #define DRM_IOCTL_AMDGPU_CTX DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_CTX, union drm_amdgpu_ctx) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 43 | #define DRM_IOCTL_AMDGPU_BO_LIST DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_BO_LIST, union drm_amdgpu_bo_list) |
| 44 | #define DRM_IOCTL_AMDGPU_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_CS, union drm_amdgpu_cs) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 45 | #define DRM_IOCTL_AMDGPU_INFO DRM_IOW(DRM_COMMAND_BASE + DRM_AMDGPU_INFO, struct drm_amdgpu_info) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 46 | #define DRM_IOCTL_AMDGPU_GEM_METADATA DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_METADATA, struct drm_amdgpu_gem_metadata) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 47 | #define DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_WAIT_IDLE, union drm_amdgpu_gem_wait_idle) |
| 48 | #define DRM_IOCTL_AMDGPU_GEM_VA DRM_IOW(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_VA, struct drm_amdgpu_gem_va) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 49 | #define DRM_IOCTL_AMDGPU_WAIT_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_WAIT_CS, union drm_amdgpu_wait_cs) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 50 | #define DRM_IOCTL_AMDGPU_GEM_OP DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_OP, struct drm_amdgpu_gem_op) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 51 | #define DRM_IOCTL_AMDGPU_GEM_USERPTR DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_USERPTR, struct drm_amdgpu_gem_userptr) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 52 | #define DRM_IOCTL_AMDGPU_WAIT_FENCES DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_WAIT_FENCES, union drm_amdgpu_wait_fences) |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 53 | #define DRM_IOCTL_AMDGPU_VM DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_VM, union drm_amdgpu_vm) |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame^] | 54 | #define DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_FENCE_TO_HANDLE, union drm_amdgpu_fence_to_handle) |
| 55 | #define DRM_IOCTL_AMDGPU_SCHED DRM_IOW(DRM_COMMAND_BASE + DRM_AMDGPU_SCHED, union drm_amdgpu_sched) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 56 | #define AMDGPU_GEM_DOMAIN_CPU 0x1 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 57 | #define AMDGPU_GEM_DOMAIN_GTT 0x2 |
| 58 | #define AMDGPU_GEM_DOMAIN_VRAM 0x4 |
| 59 | #define AMDGPU_GEM_DOMAIN_GDS 0x8 |
| 60 | #define AMDGPU_GEM_DOMAIN_GWS 0x10 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 61 | #define AMDGPU_GEM_DOMAIN_OA 0x20 |
| 62 | #define AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED (1 << 0) |
| 63 | #define AMDGPU_GEM_CREATE_NO_CPU_ACCESS (1 << 1) |
| 64 | #define AMDGPU_GEM_CREATE_CPU_GTT_USWC (1 << 2) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 65 | #define AMDGPU_GEM_CREATE_VRAM_CLEARED (1 << 3) |
| 66 | #define AMDGPU_GEM_CREATE_SHADOW (1 << 4) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 67 | #define AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS (1 << 5) |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame^] | 68 | #define AMDGPU_GEM_CREATE_VM_ALWAYS_VALID (1 << 6) |
| 69 | #define AMDGPU_GEM_CREATE_EXPLICIT_SYNC (1 << 7) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 70 | struct drm_amdgpu_gem_create_in { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 71 | __u64 bo_size; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 72 | __u64 alignment; |
| 73 | __u64 domains; |
| 74 | __u64 domain_flags; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 75 | }; |
| 76 | struct drm_amdgpu_gem_create_out { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 77 | __u32 handle; |
| 78 | __u32 _pad; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 79 | }; |
| 80 | union drm_amdgpu_gem_create { |
| 81 | struct drm_amdgpu_gem_create_in in; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 82 | struct drm_amdgpu_gem_create_out out; |
| 83 | }; |
| 84 | #define AMDGPU_BO_LIST_OP_CREATE 0 |
| 85 | #define AMDGPU_BO_LIST_OP_DESTROY 1 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 86 | #define AMDGPU_BO_LIST_OP_UPDATE 2 |
| 87 | struct drm_amdgpu_bo_list_in { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 88 | __u32 operation; |
| 89 | __u32 list_handle; |
| 90 | __u32 bo_number; |
| 91 | __u32 bo_info_size; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 92 | __u64 bo_info_ptr; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 93 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 94 | struct drm_amdgpu_bo_list_entry { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 95 | __u32 bo_handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 96 | __u32 bo_priority; |
| 97 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 98 | struct drm_amdgpu_bo_list_out { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 99 | __u32 list_handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 100 | __u32 _pad; |
| 101 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 102 | union drm_amdgpu_bo_list { |
| 103 | struct drm_amdgpu_bo_list_in in; |
| 104 | struct drm_amdgpu_bo_list_out out; |
| 105 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 106 | #define AMDGPU_CTX_OP_ALLOC_CTX 1 |
| 107 | #define AMDGPU_CTX_OP_FREE_CTX 2 |
| 108 | #define AMDGPU_CTX_OP_QUERY_STATE 3 |
| 109 | #define AMDGPU_CTX_NO_RESET 0 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 110 | #define AMDGPU_CTX_GUILTY_RESET 1 |
| 111 | #define AMDGPU_CTX_INNOCENT_RESET 2 |
| 112 | #define AMDGPU_CTX_UNKNOWN_RESET 3 |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame^] | 113 | #define AMDGPU_CTX_PRIORITY_UNSET - 2048 |
| 114 | #define AMDGPU_CTX_PRIORITY_VERY_LOW - 1023 |
| 115 | #define AMDGPU_CTX_PRIORITY_LOW - 512 |
| 116 | #define AMDGPU_CTX_PRIORITY_NORMAL 0 |
| 117 | #define AMDGPU_CTX_PRIORITY_HIGH 512 |
| 118 | #define AMDGPU_CTX_PRIORITY_VERY_HIGH 1023 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 119 | struct drm_amdgpu_ctx_in { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 120 | __u32 op; |
| 121 | __u32 flags; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 122 | __u32 ctx_id; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame^] | 123 | __s32 priority; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 124 | }; |
| 125 | union drm_amdgpu_ctx_out { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 126 | struct { |
| 127 | __u32 ctx_id; |
| 128 | __u32 _pad; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 129 | } alloc; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 130 | struct { |
| 131 | __u64 flags; |
| 132 | __u32 hangs; |
| 133 | __u32 reset_status; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 134 | } state; |
| 135 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 136 | union drm_amdgpu_ctx { |
| 137 | struct drm_amdgpu_ctx_in in; |
| 138 | union drm_amdgpu_ctx_out out; |
| 139 | }; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 140 | #define AMDGPU_VM_OP_RESERVE_VMID 1 |
| 141 | #define AMDGPU_VM_OP_UNRESERVE_VMID 2 |
| 142 | struct drm_amdgpu_vm_in { |
| 143 | __u32 op; |
| 144 | __u32 flags; |
| 145 | }; |
| 146 | struct drm_amdgpu_vm_out { |
| 147 | __u64 flags; |
| 148 | }; |
| 149 | union drm_amdgpu_vm { |
| 150 | struct drm_amdgpu_vm_in in; |
| 151 | struct drm_amdgpu_vm_out out; |
| 152 | }; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame^] | 153 | #define AMDGPU_SCHED_OP_PROCESS_PRIORITY_OVERRIDE 1 |
| 154 | struct drm_amdgpu_sched_in { |
| 155 | __u32 op; |
| 156 | __u32 fd; |
| 157 | __s32 priority; |
| 158 | __u32 flags; |
| 159 | }; |
| 160 | union drm_amdgpu_sched { |
| 161 | struct drm_amdgpu_sched_in in; |
| 162 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 163 | #define AMDGPU_GEM_USERPTR_READONLY (1 << 0) |
| 164 | #define AMDGPU_GEM_USERPTR_ANONONLY (1 << 1) |
| 165 | #define AMDGPU_GEM_USERPTR_VALIDATE (1 << 2) |
| 166 | #define AMDGPU_GEM_USERPTR_REGISTER (1 << 3) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 167 | struct drm_amdgpu_gem_userptr { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 168 | __u64 addr; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 169 | __u64 size; |
| 170 | __u32 flags; |
| 171 | __u32 handle; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 172 | }; |
| 173 | #define AMDGPU_TILING_ARRAY_MODE_SHIFT 0 |
| 174 | #define AMDGPU_TILING_ARRAY_MODE_MASK 0xf |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 175 | #define AMDGPU_TILING_PIPE_CONFIG_SHIFT 4 |
| 176 | #define AMDGPU_TILING_PIPE_CONFIG_MASK 0x1f |
| 177 | #define AMDGPU_TILING_TILE_SPLIT_SHIFT 9 |
| 178 | #define AMDGPU_TILING_TILE_SPLIT_MASK 0x7 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 179 | #define AMDGPU_TILING_MICRO_TILE_MODE_SHIFT 12 |
| 180 | #define AMDGPU_TILING_MICRO_TILE_MODE_MASK 0x7 |
| 181 | #define AMDGPU_TILING_BANK_WIDTH_SHIFT 15 |
| 182 | #define AMDGPU_TILING_BANK_WIDTH_MASK 0x3 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 183 | #define AMDGPU_TILING_BANK_HEIGHT_SHIFT 17 |
| 184 | #define AMDGPU_TILING_BANK_HEIGHT_MASK 0x3 |
| 185 | #define AMDGPU_TILING_MACRO_TILE_ASPECT_SHIFT 19 |
| 186 | #define AMDGPU_TILING_MACRO_TILE_ASPECT_MASK 0x3 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 187 | #define AMDGPU_TILING_NUM_BANKS_SHIFT 21 |
| 188 | #define AMDGPU_TILING_NUM_BANKS_MASK 0x3 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 189 | #define AMDGPU_TILING_SWIZZLE_MODE_SHIFT 0 |
| 190 | #define AMDGPU_TILING_SWIZZLE_MODE_MASK 0x1f |
| 191 | #define AMDGPU_TILING_SET(field,value) (((__u64) (value) & AMDGPU_TILING_ ##field ##_MASK) << AMDGPU_TILING_ ##field ##_SHIFT) |
| 192 | #define AMDGPU_TILING_GET(value,field) (((__u64) (value) >> AMDGPU_TILING_ ##field ##_SHIFT) & AMDGPU_TILING_ ##field ##_MASK) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 193 | #define AMDGPU_GEM_METADATA_OP_SET_METADATA 1 |
| 194 | #define AMDGPU_GEM_METADATA_OP_GET_METADATA 2 |
| 195 | struct drm_amdgpu_gem_metadata { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 196 | __u32 handle; |
| 197 | __u32 op; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 198 | struct { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 199 | __u64 flags; |
| 200 | __u64 tiling_info; |
| 201 | __u32 data_size_bytes; |
| 202 | __u32 data[64]; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 203 | } data; |
| 204 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 205 | struct drm_amdgpu_gem_mmap_in { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 206 | __u32 handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 207 | __u32 _pad; |
| 208 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 209 | struct drm_amdgpu_gem_mmap_out { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 210 | __u64 addr_ptr; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 211 | }; |
| 212 | union drm_amdgpu_gem_mmap { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 213 | struct drm_amdgpu_gem_mmap_in in; |
| 214 | struct drm_amdgpu_gem_mmap_out out; |
| 215 | }; |
| 216 | struct drm_amdgpu_gem_wait_idle_in { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 217 | __u32 handle; |
| 218 | __u32 flags; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 219 | __u64 timeout; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 220 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 221 | struct drm_amdgpu_gem_wait_idle_out { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 222 | __u32 status; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 223 | __u32 domain; |
| 224 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 225 | union drm_amdgpu_gem_wait_idle { |
| 226 | struct drm_amdgpu_gem_wait_idle_in in; |
| 227 | struct drm_amdgpu_gem_wait_idle_out out; |
| 228 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 229 | struct drm_amdgpu_wait_cs_in { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 230 | __u64 handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 231 | __u64 timeout; |
| 232 | __u32 ip_type; |
| 233 | __u32 ip_instance; |
| 234 | __u32 ring; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 235 | __u32 ctx_id; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 236 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 237 | struct drm_amdgpu_wait_cs_out { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 238 | __u64 status; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 239 | }; |
| 240 | union drm_amdgpu_wait_cs { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 241 | struct drm_amdgpu_wait_cs_in in; |
| 242 | struct drm_amdgpu_wait_cs_out out; |
| 243 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 244 | struct drm_amdgpu_fence { |
| 245 | __u32 ctx_id; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 246 | __u32 ip_type; |
| 247 | __u32 ip_instance; |
| 248 | __u32 ring; |
| 249 | __u64 seq_no; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 250 | }; |
| 251 | struct drm_amdgpu_wait_fences_in { |
| 252 | __u64 fences; |
| 253 | __u32 fence_count; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 254 | __u32 wait_all; |
| 255 | __u64 timeout_ns; |
| 256 | }; |
| 257 | struct drm_amdgpu_wait_fences_out { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 258 | __u32 status; |
| 259 | __u32 first_signaled; |
| 260 | }; |
| 261 | union drm_amdgpu_wait_fences { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 262 | struct drm_amdgpu_wait_fences_in in; |
| 263 | struct drm_amdgpu_wait_fences_out out; |
| 264 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 265 | #define AMDGPU_GEM_OP_GET_GEM_CREATE_INFO 0 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 266 | #define AMDGPU_GEM_OP_SET_PLACEMENT 1 |
| 267 | struct drm_amdgpu_gem_op { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 268 | __u32 handle; |
| 269 | __u32 op; |
| 270 | __u64 value; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 271 | }; |
| 272 | #define AMDGPU_VA_OP_MAP 1 |
| 273 | #define AMDGPU_VA_OP_UNMAP 2 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 274 | #define AMDGPU_VA_OP_CLEAR 3 |
| 275 | #define AMDGPU_VA_OP_REPLACE 4 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 276 | #define AMDGPU_VM_DELAY_UPDATE (1 << 0) |
| 277 | #define AMDGPU_VM_PAGE_READABLE (1 << 1) |
| 278 | #define AMDGPU_VM_PAGE_WRITEABLE (1 << 2) |
| 279 | #define AMDGPU_VM_PAGE_EXECUTABLE (1 << 3) |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 280 | #define AMDGPU_VM_PAGE_PRT (1 << 4) |
| 281 | #define AMDGPU_VM_MTYPE_MASK (0xf << 5) |
| 282 | #define AMDGPU_VM_MTYPE_DEFAULT (0 << 5) |
| 283 | #define AMDGPU_VM_MTYPE_NC (1 << 5) |
| 284 | #define AMDGPU_VM_MTYPE_WC (2 << 5) |
| 285 | #define AMDGPU_VM_MTYPE_CC (3 << 5) |
| 286 | #define AMDGPU_VM_MTYPE_UC (4 << 5) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 287 | struct drm_amdgpu_gem_va { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 288 | __u32 handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 289 | __u32 _pad; |
| 290 | __u32 operation; |
| 291 | __u32 flags; |
| 292 | __u64 va_address; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 293 | __u64 offset_in_bo; |
| 294 | __u64 map_size; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 295 | }; |
| 296 | #define AMDGPU_HW_IP_GFX 0 |
| 297 | #define AMDGPU_HW_IP_COMPUTE 1 |
| 298 | #define AMDGPU_HW_IP_DMA 2 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 299 | #define AMDGPU_HW_IP_UVD 3 |
| 300 | #define AMDGPU_HW_IP_VCE 4 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 301 | #define AMDGPU_HW_IP_UVD_ENC 5 |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 302 | #define AMDGPU_HW_IP_VCN_DEC 6 |
| 303 | #define AMDGPU_HW_IP_VCN_ENC 7 |
| 304 | #define AMDGPU_HW_IP_NUM 8 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 305 | #define AMDGPU_HW_IP_INSTANCE_MAX_COUNT 1 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 306 | #define AMDGPU_CHUNK_ID_IB 0x01 |
| 307 | #define AMDGPU_CHUNK_ID_FENCE 0x02 |
| 308 | #define AMDGPU_CHUNK_ID_DEPENDENCIES 0x03 |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 309 | #define AMDGPU_CHUNK_ID_SYNCOBJ_IN 0x04 |
| 310 | #define AMDGPU_CHUNK_ID_SYNCOBJ_OUT 0x05 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 311 | struct drm_amdgpu_cs_chunk { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 312 | __u32 chunk_id; |
| 313 | __u32 length_dw; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 314 | __u64 chunk_data; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 315 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 316 | struct drm_amdgpu_cs_in { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 317 | __u32 ctx_id; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 318 | __u32 bo_list_handle; |
| 319 | __u32 num_chunks; |
| 320 | __u32 _pad; |
| 321 | __u64 chunks; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 322 | }; |
| 323 | struct drm_amdgpu_cs_out { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 324 | __u64 handle; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 325 | }; |
| 326 | union drm_amdgpu_cs { |
| 327 | struct drm_amdgpu_cs_in in; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 328 | struct drm_amdgpu_cs_out out; |
| 329 | }; |
| 330 | #define AMDGPU_IB_FLAG_CE (1 << 0) |
| 331 | #define AMDGPU_IB_FLAG_PREAMBLE (1 << 1) |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 332 | #define AMDGPU_IB_FLAG_PREEMPT (1 << 2) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 333 | struct drm_amdgpu_cs_chunk_ib { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 334 | __u32 _pad; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 335 | __u32 flags; |
| 336 | __u64 va_start; |
| 337 | __u32 ib_bytes; |
| 338 | __u32 ip_type; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 339 | __u32 ip_instance; |
| 340 | __u32 ring; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 341 | }; |
| 342 | struct drm_amdgpu_cs_chunk_dep { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 343 | __u32 ip_type; |
| 344 | __u32 ip_instance; |
| 345 | __u32 ring; |
| 346 | __u32 ctx_id; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 347 | __u64 handle; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 348 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 349 | struct drm_amdgpu_cs_chunk_fence { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 350 | __u32 handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 351 | __u32 offset; |
| 352 | }; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 353 | struct drm_amdgpu_cs_chunk_sem { |
| 354 | __u32 handle; |
| 355 | }; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame^] | 356 | #define AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ 0 |
| 357 | #define AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ_FD 1 |
| 358 | #define AMDGPU_FENCE_TO_HANDLE_GET_SYNC_FILE_FD 2 |
| 359 | union drm_amdgpu_fence_to_handle { |
| 360 | struct { |
| 361 | struct drm_amdgpu_fence fence; |
| 362 | __u32 what; |
| 363 | __u32 pad; |
| 364 | } in; |
| 365 | struct { |
| 366 | __u32 handle; |
| 367 | } out; |
| 368 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 369 | struct drm_amdgpu_cs_chunk_data { |
| 370 | union { |
| 371 | struct drm_amdgpu_cs_chunk_ib ib_data; |
| 372 | struct drm_amdgpu_cs_chunk_fence fence_data; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 373 | }; |
| 374 | }; |
| 375 | #define AMDGPU_IDS_FLAGS_FUSION 0x1 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 376 | #define AMDGPU_IDS_FLAGS_PREEMPTION 0x2 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 377 | #define AMDGPU_INFO_ACCEL_WORKING 0x00 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 378 | #define AMDGPU_INFO_CRTC_FROM_ID 0x01 |
| 379 | #define AMDGPU_INFO_HW_IP_INFO 0x02 |
| 380 | #define AMDGPU_INFO_HW_IP_COUNT 0x03 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 381 | #define AMDGPU_INFO_TIMESTAMP 0x05 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 382 | #define AMDGPU_INFO_FW_VERSION 0x0e |
| 383 | #define AMDGPU_INFO_FW_VCE 0x1 |
| 384 | #define AMDGPU_INFO_FW_UVD 0x2 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 385 | #define AMDGPU_INFO_FW_GMC 0x03 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 386 | #define AMDGPU_INFO_FW_GFX_ME 0x04 |
| 387 | #define AMDGPU_INFO_FW_GFX_PFP 0x05 |
| 388 | #define AMDGPU_INFO_FW_GFX_CE 0x06 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 389 | #define AMDGPU_INFO_FW_GFX_RLC 0x07 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 390 | #define AMDGPU_INFO_FW_GFX_MEC 0x08 |
| 391 | #define AMDGPU_INFO_FW_SMC 0x0a |
| 392 | #define AMDGPU_INFO_FW_SDMA 0x0b |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 393 | #define AMDGPU_INFO_FW_SOS 0x0c |
| 394 | #define AMDGPU_INFO_FW_ASD 0x0d |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 395 | #define AMDGPU_INFO_NUM_BYTES_MOVED 0x0f |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 396 | #define AMDGPU_INFO_VRAM_USAGE 0x10 |
| 397 | #define AMDGPU_INFO_GTT_USAGE 0x11 |
| 398 | #define AMDGPU_INFO_GDS_CONFIG 0x13 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 399 | #define AMDGPU_INFO_VRAM_GTT 0x14 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 400 | #define AMDGPU_INFO_READ_MMR_REG 0x15 |
| 401 | #define AMDGPU_INFO_DEV_INFO 0x16 |
| 402 | #define AMDGPU_INFO_VIS_VRAM_USAGE 0x17 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 403 | #define AMDGPU_INFO_NUM_EVICTIONS 0x18 |
| 404 | #define AMDGPU_INFO_MEMORY 0x19 |
| 405 | #define AMDGPU_INFO_VCE_CLOCK_TABLE 0x1A |
| 406 | #define AMDGPU_INFO_VBIOS 0x1B |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 407 | #define AMDGPU_INFO_VBIOS_SIZE 0x1 |
| 408 | #define AMDGPU_INFO_VBIOS_IMAGE 0x2 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 409 | #define AMDGPU_INFO_NUM_HANDLES 0x1C |
| 410 | #define AMDGPU_INFO_SENSOR 0x1D |
| 411 | #define AMDGPU_INFO_SENSOR_GFX_SCLK 0x1 |
| 412 | #define AMDGPU_INFO_SENSOR_GFX_MCLK 0x2 |
| 413 | #define AMDGPU_INFO_SENSOR_GPU_TEMP 0x3 |
| 414 | #define AMDGPU_INFO_SENSOR_GPU_LOAD 0x4 |
| 415 | #define AMDGPU_INFO_SENSOR_GPU_AVG_POWER 0x5 |
| 416 | #define AMDGPU_INFO_SENSOR_VDDNB 0x6 |
| 417 | #define AMDGPU_INFO_SENSOR_VDDGFX 0x7 |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 418 | #define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame^] | 419 | #define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 420 | #define AMDGPU_INFO_MMR_SE_INDEX_SHIFT 0 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 421 | #define AMDGPU_INFO_MMR_SE_INDEX_MASK 0xff |
| 422 | #define AMDGPU_INFO_MMR_SH_INDEX_SHIFT 8 |
| 423 | #define AMDGPU_INFO_MMR_SH_INDEX_MASK 0xff |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 424 | struct drm_amdgpu_query_fw { |
| 425 | __u32 fw_type; |
| 426 | __u32 ip_instance; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 427 | __u32 index; |
| 428 | __u32 _pad; |
| 429 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 430 | struct drm_amdgpu_info { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 431 | __u64 return_pointer; |
| 432 | __u32 return_size; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 433 | __u32 query; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 434 | union { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 435 | struct { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 436 | __u32 id; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 437 | __u32 _pad; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 438 | } mode_crtc; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 439 | struct { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 440 | __u32 type; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 441 | __u32 ip_instance; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 442 | } query_hw_ip; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 443 | struct { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 444 | __u32 dword_offset; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 445 | __u32 count; |
| 446 | __u32 instance; |
| 447 | __u32 flags; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 448 | } read_mmr_reg; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 449 | struct drm_amdgpu_query_fw query_fw; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 450 | struct { |
| 451 | __u32 type; |
| 452 | __u32 offset; |
| 453 | } vbios_info; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 454 | struct { |
| 455 | __u32 type; |
| 456 | } sensor_info; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 457 | }; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 458 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 459 | struct drm_amdgpu_info_gds { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 460 | __u32 gds_gfx_partition_size; |
| 461 | __u32 compute_partition_size; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 462 | __u32 gds_total_size; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 463 | __u32 gws_per_gfx_partition; |
| 464 | __u32 gws_per_compute_partition; |
| 465 | __u32 oa_per_gfx_partition; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 466 | __u32 oa_per_compute_partition; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 467 | __u32 _pad; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 468 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 469 | struct drm_amdgpu_info_vram_gtt { |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 470 | __u64 vram_size; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 471 | __u64 vram_cpu_accessible_size; |
| 472 | __u64 gtt_size; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 473 | }; |
| 474 | struct drm_amdgpu_heap_info { |
| 475 | __u64 total_heap_size; |
| 476 | __u64 usable_heap_size; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 477 | __u64 heap_usage; |
| 478 | __u64 max_allocation; |
| 479 | }; |
| 480 | struct drm_amdgpu_memory_info { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 481 | struct drm_amdgpu_heap_info vram; |
| 482 | struct drm_amdgpu_heap_info cpu_accessible_vram; |
| 483 | struct drm_amdgpu_heap_info gtt; |
| 484 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 485 | struct drm_amdgpu_info_firmware { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 486 | __u32 ver; |
| 487 | __u32 feature; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 488 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 489 | #define AMDGPU_VRAM_TYPE_UNKNOWN 0 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 490 | #define AMDGPU_VRAM_TYPE_GDDR1 1 |
| 491 | #define AMDGPU_VRAM_TYPE_DDR2 2 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 492 | #define AMDGPU_VRAM_TYPE_GDDR3 3 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 493 | #define AMDGPU_VRAM_TYPE_GDDR4 4 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 494 | #define AMDGPU_VRAM_TYPE_GDDR5 5 |
| 495 | #define AMDGPU_VRAM_TYPE_HBM 6 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 496 | #define AMDGPU_VRAM_TYPE_DDR3 7 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 497 | struct drm_amdgpu_info_device { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 498 | __u32 device_id; |
| 499 | __u32 chip_rev; |
| 500 | __u32 external_rev; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 501 | __u32 pci_rev; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 502 | __u32 family; |
| 503 | __u32 num_shader_engines; |
| 504 | __u32 num_shader_arrays_per_engine; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 505 | __u32 gpu_counter_freq; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 506 | __u64 max_engine_clock; |
| 507 | __u64 max_memory_clock; |
| 508 | __u32 cu_active_number; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 509 | __u32 cu_ao_mask; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 510 | __u32 cu_bitmap[4][4]; |
| 511 | __u32 enabled_rb_pipes_mask; |
| 512 | __u32 num_rb_pipes; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 513 | __u32 num_hw_gfx_contexts; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 514 | __u32 _pad; |
| 515 | __u64 ids_flags; |
| 516 | __u64 virtual_address_offset; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 517 | __u64 virtual_address_max; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 518 | __u32 virtual_address_alignment; |
| 519 | __u32 pte_fragment_size; |
| 520 | __u32 gart_page_size; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 521 | __u32 ce_ram_size; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 522 | __u32 vram_type; |
| 523 | __u32 vram_bit_width; |
| 524 | __u32 vce_harvest_config; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 525 | __u32 gc_double_offchip_lds_buf; |
| 526 | __u64 prim_buf_gpu_addr; |
| 527 | __u64 pos_buf_gpu_addr; |
| 528 | __u64 cntl_sb_buf_gpu_addr; |
| 529 | __u64 param_buf_gpu_addr; |
| 530 | __u32 prim_buf_size; |
| 531 | __u32 pos_buf_size; |
| 532 | __u32 cntl_sb_buf_size; |
| 533 | __u32 param_buf_size; |
| 534 | __u32 wave_front_size; |
| 535 | __u32 num_shader_visible_vgprs; |
| 536 | __u32 num_cu_per_sh; |
| 537 | __u32 num_tcc_blocks; |
| 538 | __u32 gs_vgt_table_depth; |
| 539 | __u32 gs_prim_buffer_depth; |
| 540 | __u32 max_gs_waves_per_vgt; |
| 541 | __u32 _pad1; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 542 | __u32 cu_ao_bitmap[4][4]; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 543 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 544 | struct drm_amdgpu_info_hw_ip { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 545 | __u32 hw_ip_version_major; |
| 546 | __u32 hw_ip_version_minor; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 547 | __u64 capabilities_flags; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 548 | __u32 ib_start_alignment; |
| 549 | __u32 ib_size_alignment; |
| 550 | __u32 available_rings; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 551 | __u32 _pad; |
| 552 | }; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 553 | struct drm_amdgpu_info_num_handles { |
| 554 | __u32 uvd_max_handles; |
| 555 | __u32 uvd_used_handles; |
| 556 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 557 | #define AMDGPU_VCE_CLOCK_TABLE_ENTRIES 6 |
| 558 | struct drm_amdgpu_info_vce_clock_table_entry { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 559 | __u32 sclk; |
| 560 | __u32 mclk; |
| 561 | __u32 eclk; |
| 562 | __u32 pad; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 563 | }; |
| 564 | struct drm_amdgpu_info_vce_clock_table { |
| 565 | struct drm_amdgpu_info_vce_clock_table_entry entries[AMDGPU_VCE_CLOCK_TABLE_ENTRIES]; |
| 566 | __u32 num_valid_entries; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 567 | __u32 pad; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 568 | }; |
| 569 | #define AMDGPU_FAMILY_UNKNOWN 0 |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 570 | #define AMDGPU_FAMILY_SI 110 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 571 | #define AMDGPU_FAMILY_CI 120 |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 572 | #define AMDGPU_FAMILY_KV 125 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 573 | #define AMDGPU_FAMILY_VI 130 |
| 574 | #define AMDGPU_FAMILY_CZ 135 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 575 | #define AMDGPU_FAMILY_AI 141 |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 576 | #define AMDGPU_FAMILY_RV 142 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 577 | #ifdef __cplusplus |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 578 | #endif |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 579 | #endif |