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