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