Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is auto-generated. Modifications will be lost. |
| 3 | * |
| 4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ |
| 5 | * for more information. |
| 6 | */ |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 7 | #ifndef __AMDGPU_DRM_H__ |
| 8 | #define __AMDGPU_DRM_H__ |
| 9 | #include "drm.h" |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 10 | #ifdef __cplusplus |
Christopher Ferris | 48fe0ae | 2019-01-10 15:59:33 -0800 | [diff] [blame] | 11 | extern "C" { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 12 | #endif |
| 13 | #define DRM_AMDGPU_GEM_CREATE 0x00 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 14 | #define DRM_AMDGPU_GEM_MMAP 0x01 |
| 15 | #define DRM_AMDGPU_CTX 0x02 |
| 16 | #define DRM_AMDGPU_BO_LIST 0x03 |
| 17 | #define DRM_AMDGPU_CS 0x04 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 18 | #define DRM_AMDGPU_INFO 0x05 |
| 19 | #define DRM_AMDGPU_GEM_METADATA 0x06 |
| 20 | #define DRM_AMDGPU_GEM_WAIT_IDLE 0x07 |
| 21 | #define DRM_AMDGPU_GEM_VA 0x08 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 22 | #define DRM_AMDGPU_WAIT_CS 0x09 |
| 23 | #define DRM_AMDGPU_GEM_OP 0x10 |
| 24 | #define DRM_AMDGPU_GEM_USERPTR 0x11 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 25 | #define DRM_AMDGPU_WAIT_FENCES 0x12 |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 26 | #define DRM_AMDGPU_VM 0x13 |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 27 | #define DRM_AMDGPU_FENCE_TO_HANDLE 0x14 |
| 28 | #define DRM_AMDGPU_SCHED 0x15 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 29 | #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] | 30 | #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] | 31 | #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] | 32 | #define DRM_IOCTL_AMDGPU_BO_LIST DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_BO_LIST, union drm_amdgpu_bo_list) |
| 33 | #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] | 34 | #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] | 35 | #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] | 36 | #define DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_WAIT_IDLE, union drm_amdgpu_gem_wait_idle) |
| 37 | #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] | 38 | #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] | 39 | #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] | 40 | #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] | 41 | #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] | 42 | #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] | 43 | #define DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_FENCE_TO_HANDLE, union drm_amdgpu_fence_to_handle) |
| 44 | #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] | 45 | #define AMDGPU_GEM_DOMAIN_CPU 0x1 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 46 | #define AMDGPU_GEM_DOMAIN_GTT 0x2 |
| 47 | #define AMDGPU_GEM_DOMAIN_VRAM 0x4 |
| 48 | #define AMDGPU_GEM_DOMAIN_GDS 0x8 |
| 49 | #define AMDGPU_GEM_DOMAIN_GWS 0x10 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 50 | #define AMDGPU_GEM_DOMAIN_OA 0x20 |
Christopher Ferris | 67d1e5e | 2023-10-31 13:36:37 -0700 | [diff] [blame] | 51 | #define AMDGPU_GEM_DOMAIN_DOORBELL 0x40 |
| 52 | #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 | AMDGPU_GEM_DOMAIN_DOORBELL) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 53 | #define AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED (1 << 0) |
| 54 | #define AMDGPU_GEM_CREATE_NO_CPU_ACCESS (1 << 1) |
| 55 | #define AMDGPU_GEM_CREATE_CPU_GTT_USWC (1 << 2) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 56 | #define AMDGPU_GEM_CREATE_VRAM_CLEARED (1 << 3) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 57 | #define AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS (1 << 5) |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 58 | #define AMDGPU_GEM_CREATE_VM_ALWAYS_VALID (1 << 6) |
| 59 | #define AMDGPU_GEM_CREATE_EXPLICIT_SYNC (1 << 7) |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 60 | #define AMDGPU_GEM_CREATE_CP_MQD_GFX9 (1 << 8) |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 61 | #define AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE (1 << 9) |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 62 | #define AMDGPU_GEM_CREATE_ENCRYPTED (1 << 10) |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 63 | #define AMDGPU_GEM_CREATE_PREEMPTIBLE (1 << 11) |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 64 | #define AMDGPU_GEM_CREATE_DISCARDABLE (1 << 12) |
Christopher Ferris | 8b7fdc9 | 2023-02-21 13:36:32 -0800 | [diff] [blame] | 65 | #define AMDGPU_GEM_CREATE_COHERENT (1 << 13) |
| 66 | #define AMDGPU_GEM_CREATE_UNCACHED (1 << 14) |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 67 | #define AMDGPU_GEM_CREATE_EXT_COHERENT (1 << 15) |
Christopher Ferris | 4ba5449 | 2024-09-18 16:25:22 +0000 | [diff] [blame^] | 68 | #define AMDGPU_GEM_CREATE_GFX12_DCC (1 << 16) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 69 | struct drm_amdgpu_gem_create_in { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 70 | __u64 bo_size; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 71 | __u64 alignment; |
| 72 | __u64 domains; |
| 73 | __u64 domain_flags; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 74 | }; |
| 75 | struct drm_amdgpu_gem_create_out { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 76 | __u32 handle; |
| 77 | __u32 _pad; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 78 | }; |
| 79 | union drm_amdgpu_gem_create { |
| 80 | struct drm_amdgpu_gem_create_in in; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 81 | struct drm_amdgpu_gem_create_out out; |
| 82 | }; |
| 83 | #define AMDGPU_BO_LIST_OP_CREATE 0 |
| 84 | #define AMDGPU_BO_LIST_OP_DESTROY 1 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 85 | #define AMDGPU_BO_LIST_OP_UPDATE 2 |
| 86 | struct drm_amdgpu_bo_list_in { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 87 | __u32 operation; |
| 88 | __u32 list_handle; |
| 89 | __u32 bo_number; |
| 90 | __u32 bo_info_size; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 91 | __u64 bo_info_ptr; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 92 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 93 | struct drm_amdgpu_bo_list_entry { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 94 | __u32 bo_handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 95 | __u32 bo_priority; |
| 96 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 97 | struct drm_amdgpu_bo_list_out { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 98 | __u32 list_handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 99 | __u32 _pad; |
| 100 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 101 | union drm_amdgpu_bo_list { |
| 102 | struct drm_amdgpu_bo_list_in in; |
| 103 | struct drm_amdgpu_bo_list_out out; |
| 104 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 105 | #define AMDGPU_CTX_OP_ALLOC_CTX 1 |
| 106 | #define AMDGPU_CTX_OP_FREE_CTX 2 |
| 107 | #define AMDGPU_CTX_OP_QUERY_STATE 3 |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 108 | #define AMDGPU_CTX_OP_QUERY_STATE2 4 |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 109 | #define AMDGPU_CTX_OP_GET_STABLE_PSTATE 5 |
| 110 | #define AMDGPU_CTX_OP_SET_STABLE_PSTATE 6 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 111 | #define AMDGPU_CTX_NO_RESET 0 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 112 | #define AMDGPU_CTX_GUILTY_RESET 1 |
| 113 | #define AMDGPU_CTX_INNOCENT_RESET 2 |
| 114 | #define AMDGPU_CTX_UNKNOWN_RESET 3 |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 115 | #define AMDGPU_CTX_QUERY2_FLAGS_RESET (1 << 0) |
| 116 | #define AMDGPU_CTX_QUERY2_FLAGS_VRAMLOST (1 << 1) |
| 117 | #define AMDGPU_CTX_QUERY2_FLAGS_GUILTY (1 << 2) |
Christopher Ferris | aeddbcf | 2019-07-08 12:45:46 -0700 | [diff] [blame] | 118 | #define AMDGPU_CTX_QUERY2_FLAGS_RAS_CE (1 << 3) |
| 119 | #define AMDGPU_CTX_QUERY2_FLAGS_RAS_UE (1 << 4) |
Christopher Ferris | 8666d04 | 2023-09-06 14:55:31 -0700 | [diff] [blame] | 120 | #define AMDGPU_CTX_QUERY2_FLAGS_RESET_IN_PROGRESS (1 << 5) |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 121 | #define AMDGPU_CTX_PRIORITY_UNSET - 2048 |
| 122 | #define AMDGPU_CTX_PRIORITY_VERY_LOW - 1023 |
| 123 | #define AMDGPU_CTX_PRIORITY_LOW - 512 |
| 124 | #define AMDGPU_CTX_PRIORITY_NORMAL 0 |
| 125 | #define AMDGPU_CTX_PRIORITY_HIGH 512 |
| 126 | #define AMDGPU_CTX_PRIORITY_VERY_HIGH 1023 |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 127 | #define AMDGPU_CTX_STABLE_PSTATE_FLAGS_MASK 0xf |
| 128 | #define AMDGPU_CTX_STABLE_PSTATE_NONE 0 |
| 129 | #define AMDGPU_CTX_STABLE_PSTATE_STANDARD 1 |
| 130 | #define AMDGPU_CTX_STABLE_PSTATE_MIN_SCLK 2 |
| 131 | #define AMDGPU_CTX_STABLE_PSTATE_MIN_MCLK 3 |
| 132 | #define AMDGPU_CTX_STABLE_PSTATE_PEAK 4 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 133 | struct drm_amdgpu_ctx_in { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 134 | __u32 op; |
| 135 | __u32 flags; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 136 | __u32 ctx_id; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 137 | __s32 priority; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 138 | }; |
| 139 | union drm_amdgpu_ctx_out { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 140 | struct { |
| 141 | __u32 ctx_id; |
| 142 | __u32 _pad; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 143 | } alloc; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 144 | struct { |
| 145 | __u64 flags; |
| 146 | __u32 hangs; |
| 147 | __u32 reset_status; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 148 | } state; |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 149 | struct { |
| 150 | __u32 flags; |
| 151 | __u32 _pad; |
| 152 | } pstate; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 153 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 154 | union drm_amdgpu_ctx { |
| 155 | struct drm_amdgpu_ctx_in in; |
| 156 | union drm_amdgpu_ctx_out out; |
| 157 | }; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 158 | #define AMDGPU_VM_OP_RESERVE_VMID 1 |
| 159 | #define AMDGPU_VM_OP_UNRESERVE_VMID 2 |
| 160 | struct drm_amdgpu_vm_in { |
| 161 | __u32 op; |
| 162 | __u32 flags; |
| 163 | }; |
| 164 | struct drm_amdgpu_vm_out { |
| 165 | __u64 flags; |
| 166 | }; |
| 167 | union drm_amdgpu_vm { |
| 168 | struct drm_amdgpu_vm_in in; |
| 169 | struct drm_amdgpu_vm_out out; |
| 170 | }; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 171 | #define AMDGPU_SCHED_OP_PROCESS_PRIORITY_OVERRIDE 1 |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 172 | #define AMDGPU_SCHED_OP_CONTEXT_PRIORITY_OVERRIDE 2 |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 173 | struct drm_amdgpu_sched_in { |
| 174 | __u32 op; |
| 175 | __u32 fd; |
| 176 | __s32 priority; |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 177 | __u32 ctx_id; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 178 | }; |
| 179 | union drm_amdgpu_sched { |
| 180 | struct drm_amdgpu_sched_in in; |
| 181 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 182 | #define AMDGPU_GEM_USERPTR_READONLY (1 << 0) |
| 183 | #define AMDGPU_GEM_USERPTR_ANONONLY (1 << 1) |
| 184 | #define AMDGPU_GEM_USERPTR_VALIDATE (1 << 2) |
| 185 | #define AMDGPU_GEM_USERPTR_REGISTER (1 << 3) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 186 | struct drm_amdgpu_gem_userptr { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 187 | __u64 addr; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 188 | __u64 size; |
| 189 | __u32 flags; |
| 190 | __u32 handle; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 191 | }; |
| 192 | #define AMDGPU_TILING_ARRAY_MODE_SHIFT 0 |
| 193 | #define AMDGPU_TILING_ARRAY_MODE_MASK 0xf |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 194 | #define AMDGPU_TILING_PIPE_CONFIG_SHIFT 4 |
| 195 | #define AMDGPU_TILING_PIPE_CONFIG_MASK 0x1f |
| 196 | #define AMDGPU_TILING_TILE_SPLIT_SHIFT 9 |
| 197 | #define AMDGPU_TILING_TILE_SPLIT_MASK 0x7 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 198 | #define AMDGPU_TILING_MICRO_TILE_MODE_SHIFT 12 |
| 199 | #define AMDGPU_TILING_MICRO_TILE_MODE_MASK 0x7 |
| 200 | #define AMDGPU_TILING_BANK_WIDTH_SHIFT 15 |
| 201 | #define AMDGPU_TILING_BANK_WIDTH_MASK 0x3 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 202 | #define AMDGPU_TILING_BANK_HEIGHT_SHIFT 17 |
| 203 | #define AMDGPU_TILING_BANK_HEIGHT_MASK 0x3 |
| 204 | #define AMDGPU_TILING_MACRO_TILE_ASPECT_SHIFT 19 |
| 205 | #define AMDGPU_TILING_MACRO_TILE_ASPECT_MASK 0x3 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 206 | #define AMDGPU_TILING_NUM_BANKS_SHIFT 21 |
| 207 | #define AMDGPU_TILING_NUM_BANKS_MASK 0x3 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 208 | #define AMDGPU_TILING_SWIZZLE_MODE_SHIFT 0 |
| 209 | #define AMDGPU_TILING_SWIZZLE_MODE_MASK 0x1f |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 210 | #define AMDGPU_TILING_DCC_OFFSET_256B_SHIFT 5 |
| 211 | #define AMDGPU_TILING_DCC_OFFSET_256B_MASK 0xFFFFFF |
| 212 | #define AMDGPU_TILING_DCC_PITCH_MAX_SHIFT 29 |
| 213 | #define AMDGPU_TILING_DCC_PITCH_MAX_MASK 0x3FFF |
| 214 | #define AMDGPU_TILING_DCC_INDEPENDENT_64B_SHIFT 43 |
| 215 | #define AMDGPU_TILING_DCC_INDEPENDENT_64B_MASK 0x1 |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 216 | #define AMDGPU_TILING_DCC_INDEPENDENT_128B_SHIFT 44 |
| 217 | #define AMDGPU_TILING_DCC_INDEPENDENT_128B_MASK 0x1 |
| 218 | #define AMDGPU_TILING_SCANOUT_SHIFT 63 |
| 219 | #define AMDGPU_TILING_SCANOUT_MASK 0x1 |
Christopher Ferris | 4ba5449 | 2024-09-18 16:25:22 +0000 | [diff] [blame^] | 220 | #define AMDGPU_TILING_GFX12_SWIZZLE_MODE_SHIFT 0 |
| 221 | #define AMDGPU_TILING_GFX12_SWIZZLE_MODE_MASK 0x7 |
| 222 | #define AMDGPU_TILING_GFX12_DCC_MAX_COMPRESSED_BLOCK_SHIFT 3 |
| 223 | #define AMDGPU_TILING_GFX12_DCC_MAX_COMPRESSED_BLOCK_MASK 0x3 |
| 224 | #define AMDGPU_TILING_GFX12_DCC_NUMBER_TYPE_SHIFT 5 |
| 225 | #define AMDGPU_TILING_GFX12_DCC_NUMBER_TYPE_MASK 0x7 |
| 226 | #define AMDGPU_TILING_GFX12_DCC_DATA_FORMAT_SHIFT 8 |
| 227 | #define AMDGPU_TILING_GFX12_DCC_DATA_FORMAT_MASK 0x3f |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 228 | #define AMDGPU_TILING_SET(field,value) (((__u64) (value) & AMDGPU_TILING_ ##field ##_MASK) << AMDGPU_TILING_ ##field ##_SHIFT) |
| 229 | #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] | 230 | #define AMDGPU_GEM_METADATA_OP_SET_METADATA 1 |
| 231 | #define AMDGPU_GEM_METADATA_OP_GET_METADATA 2 |
| 232 | struct drm_amdgpu_gem_metadata { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 233 | __u32 handle; |
| 234 | __u32 op; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 235 | struct { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 236 | __u64 flags; |
| 237 | __u64 tiling_info; |
| 238 | __u32 data_size_bytes; |
| 239 | __u32 data[64]; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 240 | } data; |
| 241 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 242 | struct drm_amdgpu_gem_mmap_in { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 243 | __u32 handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 244 | __u32 _pad; |
| 245 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 246 | struct drm_amdgpu_gem_mmap_out { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 247 | __u64 addr_ptr; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 248 | }; |
| 249 | union drm_amdgpu_gem_mmap { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 250 | struct drm_amdgpu_gem_mmap_in in; |
| 251 | struct drm_amdgpu_gem_mmap_out out; |
| 252 | }; |
| 253 | struct drm_amdgpu_gem_wait_idle_in { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 254 | __u32 handle; |
| 255 | __u32 flags; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 256 | __u64 timeout; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 257 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 258 | struct drm_amdgpu_gem_wait_idle_out { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 259 | __u32 status; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 260 | __u32 domain; |
| 261 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 262 | union drm_amdgpu_gem_wait_idle { |
| 263 | struct drm_amdgpu_gem_wait_idle_in in; |
| 264 | struct drm_amdgpu_gem_wait_idle_out out; |
| 265 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 266 | struct drm_amdgpu_wait_cs_in { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 267 | __u64 handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 268 | __u64 timeout; |
| 269 | __u32 ip_type; |
| 270 | __u32 ip_instance; |
| 271 | __u32 ring; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 272 | __u32 ctx_id; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 273 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 274 | struct drm_amdgpu_wait_cs_out { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 275 | __u64 status; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 276 | }; |
| 277 | union drm_amdgpu_wait_cs { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 278 | struct drm_amdgpu_wait_cs_in in; |
| 279 | struct drm_amdgpu_wait_cs_out out; |
| 280 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 281 | struct drm_amdgpu_fence { |
| 282 | __u32 ctx_id; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 283 | __u32 ip_type; |
| 284 | __u32 ip_instance; |
| 285 | __u32 ring; |
| 286 | __u64 seq_no; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 287 | }; |
| 288 | struct drm_amdgpu_wait_fences_in { |
| 289 | __u64 fences; |
| 290 | __u32 fence_count; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 291 | __u32 wait_all; |
| 292 | __u64 timeout_ns; |
| 293 | }; |
| 294 | struct drm_amdgpu_wait_fences_out { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 295 | __u32 status; |
| 296 | __u32 first_signaled; |
| 297 | }; |
| 298 | union drm_amdgpu_wait_fences { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 299 | struct drm_amdgpu_wait_fences_in in; |
| 300 | struct drm_amdgpu_wait_fences_out out; |
| 301 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 302 | #define AMDGPU_GEM_OP_GET_GEM_CREATE_INFO 0 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 303 | #define AMDGPU_GEM_OP_SET_PLACEMENT 1 |
| 304 | struct drm_amdgpu_gem_op { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 305 | __u32 handle; |
| 306 | __u32 op; |
| 307 | __u64 value; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 308 | }; |
| 309 | #define AMDGPU_VA_OP_MAP 1 |
| 310 | #define AMDGPU_VA_OP_UNMAP 2 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 311 | #define AMDGPU_VA_OP_CLEAR 3 |
| 312 | #define AMDGPU_VA_OP_REPLACE 4 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 313 | #define AMDGPU_VM_DELAY_UPDATE (1 << 0) |
| 314 | #define AMDGPU_VM_PAGE_READABLE (1 << 1) |
| 315 | #define AMDGPU_VM_PAGE_WRITEABLE (1 << 2) |
| 316 | #define AMDGPU_VM_PAGE_EXECUTABLE (1 << 3) |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 317 | #define AMDGPU_VM_PAGE_PRT (1 << 4) |
| 318 | #define AMDGPU_VM_MTYPE_MASK (0xf << 5) |
| 319 | #define AMDGPU_VM_MTYPE_DEFAULT (0 << 5) |
| 320 | #define AMDGPU_VM_MTYPE_NC (1 << 5) |
| 321 | #define AMDGPU_VM_MTYPE_WC (2 << 5) |
| 322 | #define AMDGPU_VM_MTYPE_CC (3 << 5) |
| 323 | #define AMDGPU_VM_MTYPE_UC (4 << 5) |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 324 | #define AMDGPU_VM_MTYPE_RW (5 << 5) |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 325 | #define AMDGPU_VM_PAGE_NOALLOC (1 << 9) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 326 | struct drm_amdgpu_gem_va { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 327 | __u32 handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 328 | __u32 _pad; |
| 329 | __u32 operation; |
| 330 | __u32 flags; |
| 331 | __u64 va_address; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 332 | __u64 offset_in_bo; |
| 333 | __u64 map_size; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 334 | }; |
| 335 | #define AMDGPU_HW_IP_GFX 0 |
| 336 | #define AMDGPU_HW_IP_COMPUTE 1 |
| 337 | #define AMDGPU_HW_IP_DMA 2 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 338 | #define AMDGPU_HW_IP_UVD 3 |
| 339 | #define AMDGPU_HW_IP_VCE 4 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 340 | #define AMDGPU_HW_IP_UVD_ENC 5 |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 341 | #define AMDGPU_HW_IP_VCN_DEC 6 |
| 342 | #define AMDGPU_HW_IP_VCN_ENC 7 |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 343 | #define AMDGPU_HW_IP_VCN_JPEG 8 |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 344 | #define AMDGPU_HW_IP_VPE 9 |
| 345 | #define AMDGPU_HW_IP_NUM 10 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 346 | #define AMDGPU_HW_IP_INSTANCE_MAX_COUNT 1 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 347 | #define AMDGPU_CHUNK_ID_IB 0x01 |
| 348 | #define AMDGPU_CHUNK_ID_FENCE 0x02 |
| 349 | #define AMDGPU_CHUNK_ID_DEPENDENCIES 0x03 |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 350 | #define AMDGPU_CHUNK_ID_SYNCOBJ_IN 0x04 |
| 351 | #define AMDGPU_CHUNK_ID_SYNCOBJ_OUT 0x05 |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 352 | #define AMDGPU_CHUNK_ID_BO_HANDLES 0x06 |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 353 | #define AMDGPU_CHUNK_ID_SCHEDULED_DEPENDENCIES 0x07 |
Christopher Ferris | aeddbcf | 2019-07-08 12:45:46 -0700 | [diff] [blame] | 354 | #define AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_WAIT 0x08 |
| 355 | #define AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_SIGNAL 0x09 |
Christopher Ferris | 8666d04 | 2023-09-06 14:55:31 -0700 | [diff] [blame] | 356 | #define AMDGPU_CHUNK_ID_CP_GFX_SHADOW 0x0a |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 357 | struct drm_amdgpu_cs_chunk { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 358 | __u32 chunk_id; |
| 359 | __u32 length_dw; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 360 | __u64 chunk_data; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 361 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 362 | struct drm_amdgpu_cs_in { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 363 | __u32 ctx_id; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 364 | __u32 bo_list_handle; |
| 365 | __u32 num_chunks; |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 366 | __u32 flags; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 367 | __u64 chunks; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 368 | }; |
| 369 | struct drm_amdgpu_cs_out { |
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 | }; |
| 372 | union drm_amdgpu_cs { |
| 373 | struct drm_amdgpu_cs_in in; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 374 | struct drm_amdgpu_cs_out out; |
| 375 | }; |
| 376 | #define AMDGPU_IB_FLAG_CE (1 << 0) |
| 377 | #define AMDGPU_IB_FLAG_PREAMBLE (1 << 1) |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 378 | #define AMDGPU_IB_FLAG_PREEMPT (1 << 2) |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 379 | #define AMDGPU_IB_FLAG_TC_WB_NOT_INVALIDATE (1 << 3) |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 380 | #define AMDGPU_IB_FLAG_RESET_GDS_MAX_WAVE_ID (1 << 4) |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 381 | #define AMDGPU_IB_FLAGS_SECURE (1 << 5) |
| 382 | #define AMDGPU_IB_FLAG_EMIT_MEM_SYNC (1 << 6) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 383 | struct drm_amdgpu_cs_chunk_ib { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 384 | __u32 _pad; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 385 | __u32 flags; |
| 386 | __u64 va_start; |
| 387 | __u32 ib_bytes; |
| 388 | __u32 ip_type; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 389 | __u32 ip_instance; |
| 390 | __u32 ring; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 391 | }; |
| 392 | struct drm_amdgpu_cs_chunk_dep { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 393 | __u32 ip_type; |
| 394 | __u32 ip_instance; |
| 395 | __u32 ring; |
| 396 | __u32 ctx_id; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 397 | __u64 handle; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 398 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 399 | struct drm_amdgpu_cs_chunk_fence { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 400 | __u32 handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 401 | __u32 offset; |
| 402 | }; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 403 | struct drm_amdgpu_cs_chunk_sem { |
| 404 | __u32 handle; |
| 405 | }; |
Christopher Ferris | aeddbcf | 2019-07-08 12:45:46 -0700 | [diff] [blame] | 406 | struct drm_amdgpu_cs_chunk_syncobj { |
| 407 | __u32 handle; |
| 408 | __u32 flags; |
| 409 | __u64 point; |
| 410 | }; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 411 | #define AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ 0 |
| 412 | #define AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ_FD 1 |
| 413 | #define AMDGPU_FENCE_TO_HANDLE_GET_SYNC_FILE_FD 2 |
| 414 | union drm_amdgpu_fence_to_handle { |
| 415 | struct { |
| 416 | struct drm_amdgpu_fence fence; |
| 417 | __u32 what; |
| 418 | __u32 pad; |
| 419 | } in; |
| 420 | struct { |
| 421 | __u32 handle; |
| 422 | } out; |
| 423 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 424 | struct drm_amdgpu_cs_chunk_data { |
| 425 | union { |
| 426 | struct drm_amdgpu_cs_chunk_ib ib_data; |
| 427 | struct drm_amdgpu_cs_chunk_fence fence_data; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 428 | }; |
| 429 | }; |
Christopher Ferris | 8666d04 | 2023-09-06 14:55:31 -0700 | [diff] [blame] | 430 | #define AMDGPU_CS_CHUNK_CP_GFX_SHADOW_FLAGS_INIT_SHADOW 0x1 |
| 431 | struct drm_amdgpu_cs_chunk_cp_gfx_shadow { |
| 432 | __u64 shadow_va; |
| 433 | __u64 csa_va; |
| 434 | __u64 gds_va; |
| 435 | __u64 flags; |
| 436 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 437 | #define AMDGPU_IDS_FLAGS_FUSION 0x1 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 438 | #define AMDGPU_IDS_FLAGS_PREEMPTION 0x2 |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 439 | #define AMDGPU_IDS_FLAGS_TMZ 0x4 |
Christopher Ferris | b7cef6d | 2023-05-09 19:04:15 +0000 | [diff] [blame] | 440 | #define AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD 0x8 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 441 | #define AMDGPU_INFO_ACCEL_WORKING 0x00 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 442 | #define AMDGPU_INFO_CRTC_FROM_ID 0x01 |
| 443 | #define AMDGPU_INFO_HW_IP_INFO 0x02 |
| 444 | #define AMDGPU_INFO_HW_IP_COUNT 0x03 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 445 | #define AMDGPU_INFO_TIMESTAMP 0x05 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 446 | #define AMDGPU_INFO_FW_VERSION 0x0e |
| 447 | #define AMDGPU_INFO_FW_VCE 0x1 |
| 448 | #define AMDGPU_INFO_FW_UVD 0x2 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 449 | #define AMDGPU_INFO_FW_GMC 0x03 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 450 | #define AMDGPU_INFO_FW_GFX_ME 0x04 |
| 451 | #define AMDGPU_INFO_FW_GFX_PFP 0x05 |
| 452 | #define AMDGPU_INFO_FW_GFX_CE 0x06 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 453 | #define AMDGPU_INFO_FW_GFX_RLC 0x07 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 454 | #define AMDGPU_INFO_FW_GFX_MEC 0x08 |
| 455 | #define AMDGPU_INFO_FW_SMC 0x0a |
| 456 | #define AMDGPU_INFO_FW_SDMA 0x0b |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 457 | #define AMDGPU_INFO_FW_SOS 0x0c |
| 458 | #define AMDGPU_INFO_FW_ASD 0x0d |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 459 | #define AMDGPU_INFO_FW_VCN 0x0e |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 460 | #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_CNTL 0x0f |
| 461 | #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_GPM_MEM 0x10 |
| 462 | #define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_SRM_MEM 0x11 |
Christopher Ferris | 86a4837 | 2019-01-10 14:14:59 -0800 | [diff] [blame] | 463 | #define AMDGPU_INFO_FW_DMCU 0x12 |
Christopher Ferris | aeddbcf | 2019-07-08 12:45:46 -0700 | [diff] [blame] | 464 | #define AMDGPU_INFO_FW_TA 0x13 |
Christopher Ferris | bb9fcb4 | 2020-04-06 11:38:04 -0700 | [diff] [blame] | 465 | #define AMDGPU_INFO_FW_DMCUB 0x14 |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 466 | #define AMDGPU_INFO_FW_TOC 0x15 |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 467 | #define AMDGPU_INFO_FW_CAP 0x16 |
Christopher Ferris | 6cd53a5 | 2022-12-12 23:39:16 +0000 | [diff] [blame] | 468 | #define AMDGPU_INFO_FW_GFX_RLCP 0x17 |
| 469 | #define AMDGPU_INFO_FW_GFX_RLCV 0x18 |
| 470 | #define AMDGPU_INFO_FW_MES_KIQ 0x19 |
| 471 | #define AMDGPU_INFO_FW_MES 0x1a |
| 472 | #define AMDGPU_INFO_FW_IMU 0x1b |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 473 | #define AMDGPU_INFO_FW_VPE 0x1c |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 474 | #define AMDGPU_INFO_NUM_BYTES_MOVED 0x0f |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 475 | #define AMDGPU_INFO_VRAM_USAGE 0x10 |
| 476 | #define AMDGPU_INFO_GTT_USAGE 0x11 |
| 477 | #define AMDGPU_INFO_GDS_CONFIG 0x13 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 478 | #define AMDGPU_INFO_VRAM_GTT 0x14 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 479 | #define AMDGPU_INFO_READ_MMR_REG 0x15 |
| 480 | #define AMDGPU_INFO_DEV_INFO 0x16 |
| 481 | #define AMDGPU_INFO_VIS_VRAM_USAGE 0x17 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 482 | #define AMDGPU_INFO_NUM_EVICTIONS 0x18 |
| 483 | #define AMDGPU_INFO_MEMORY 0x19 |
| 484 | #define AMDGPU_INFO_VCE_CLOCK_TABLE 0x1A |
| 485 | #define AMDGPU_INFO_VBIOS 0x1B |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 486 | #define AMDGPU_INFO_VBIOS_SIZE 0x1 |
| 487 | #define AMDGPU_INFO_VBIOS_IMAGE 0x2 |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 488 | #define AMDGPU_INFO_VBIOS_INFO 0x3 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 489 | #define AMDGPU_INFO_NUM_HANDLES 0x1C |
| 490 | #define AMDGPU_INFO_SENSOR 0x1D |
| 491 | #define AMDGPU_INFO_SENSOR_GFX_SCLK 0x1 |
| 492 | #define AMDGPU_INFO_SENSOR_GFX_MCLK 0x2 |
| 493 | #define AMDGPU_INFO_SENSOR_GPU_TEMP 0x3 |
| 494 | #define AMDGPU_INFO_SENSOR_GPU_LOAD 0x4 |
| 495 | #define AMDGPU_INFO_SENSOR_GPU_AVG_POWER 0x5 |
| 496 | #define AMDGPU_INFO_SENSOR_VDDNB 0x6 |
| 497 | #define AMDGPU_INFO_SENSOR_VDDGFX 0x7 |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 498 | #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_SCLK 0x8 |
| 499 | #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_MCLK 0x9 |
Christopher Ferris | b7cef6d | 2023-05-09 19:04:15 +0000 | [diff] [blame] | 500 | #define AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_SCLK 0xa |
| 501 | #define AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_MCLK 0xb |
Christopher Ferris | 7f4c837 | 2024-06-03 14:22:19 -0700 | [diff] [blame] | 502 | #define AMDGPU_INFO_SENSOR_GPU_INPUT_POWER 0xc |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 503 | #define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 504 | #define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F |
Christopher Ferris | aeddbcf | 2019-07-08 12:45:46 -0700 | [diff] [blame] | 505 | #define AMDGPU_INFO_RAS_ENABLED_FEATURES 0x20 |
| 506 | #define AMDGPU_INFO_RAS_ENABLED_UMC (1 << 0) |
| 507 | #define AMDGPU_INFO_RAS_ENABLED_SDMA (1 << 1) |
| 508 | #define AMDGPU_INFO_RAS_ENABLED_GFX (1 << 2) |
| 509 | #define AMDGPU_INFO_RAS_ENABLED_MMHUB (1 << 3) |
| 510 | #define AMDGPU_INFO_RAS_ENABLED_ATHUB (1 << 4) |
| 511 | #define AMDGPU_INFO_RAS_ENABLED_PCIE (1 << 5) |
| 512 | #define AMDGPU_INFO_RAS_ENABLED_HDP (1 << 6) |
| 513 | #define AMDGPU_INFO_RAS_ENABLED_XGMI (1 << 7) |
| 514 | #define AMDGPU_INFO_RAS_ENABLED_DF (1 << 8) |
| 515 | #define AMDGPU_INFO_RAS_ENABLED_SMN (1 << 9) |
| 516 | #define AMDGPU_INFO_RAS_ENABLED_SEM (1 << 10) |
| 517 | #define AMDGPU_INFO_RAS_ENABLED_MP0 (1 << 11) |
| 518 | #define AMDGPU_INFO_RAS_ENABLED_MP1 (1 << 12) |
| 519 | #define AMDGPU_INFO_RAS_ENABLED_FUSE (1 << 13) |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 520 | #define AMDGPU_INFO_VIDEO_CAPS 0x21 |
| 521 | #define AMDGPU_INFO_VIDEO_CAPS_DECODE 0 |
| 522 | #define AMDGPU_INFO_VIDEO_CAPS_ENCODE 1 |
Christopher Ferris | 8666d04 | 2023-09-06 14:55:31 -0700 | [diff] [blame] | 523 | #define AMDGPU_INFO_MAX_IBS 0x22 |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 524 | #define AMDGPU_INFO_GPUVM_FAULT 0x23 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 525 | #define AMDGPU_INFO_MMR_SE_INDEX_SHIFT 0 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 526 | #define AMDGPU_INFO_MMR_SE_INDEX_MASK 0xff |
| 527 | #define AMDGPU_INFO_MMR_SH_INDEX_SHIFT 8 |
| 528 | #define AMDGPU_INFO_MMR_SH_INDEX_MASK 0xff |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 529 | struct drm_amdgpu_query_fw { |
| 530 | __u32 fw_type; |
| 531 | __u32 ip_instance; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 532 | __u32 index; |
| 533 | __u32 _pad; |
| 534 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 535 | struct drm_amdgpu_info { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 536 | __u64 return_pointer; |
| 537 | __u32 return_size; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 538 | __u32 query; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 539 | union { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 540 | struct { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 541 | __u32 id; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 542 | __u32 _pad; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 543 | } mode_crtc; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 544 | struct { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 545 | __u32 type; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 546 | __u32 ip_instance; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 547 | } query_hw_ip; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 548 | struct { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 549 | __u32 dword_offset; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 550 | __u32 count; |
| 551 | __u32 instance; |
| 552 | __u32 flags; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 553 | } read_mmr_reg; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 554 | struct drm_amdgpu_query_fw query_fw; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 555 | struct { |
| 556 | __u32 type; |
| 557 | __u32 offset; |
| 558 | } vbios_info; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 559 | struct { |
| 560 | __u32 type; |
| 561 | } sensor_info; |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 562 | struct { |
| 563 | __u32 type; |
| 564 | } video_cap; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 565 | }; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 566 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 567 | struct drm_amdgpu_info_gds { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 568 | __u32 gds_gfx_partition_size; |
| 569 | __u32 compute_partition_size; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 570 | __u32 gds_total_size; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 571 | __u32 gws_per_gfx_partition; |
| 572 | __u32 gws_per_compute_partition; |
| 573 | __u32 oa_per_gfx_partition; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 574 | __u32 oa_per_compute_partition; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 575 | __u32 _pad; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 576 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 577 | struct drm_amdgpu_info_vram_gtt { |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 578 | __u64 vram_size; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 579 | __u64 vram_cpu_accessible_size; |
| 580 | __u64 gtt_size; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 581 | }; |
| 582 | struct drm_amdgpu_heap_info { |
| 583 | __u64 total_heap_size; |
| 584 | __u64 usable_heap_size; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 585 | __u64 heap_usage; |
| 586 | __u64 max_allocation; |
| 587 | }; |
| 588 | struct drm_amdgpu_memory_info { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 589 | struct drm_amdgpu_heap_info vram; |
| 590 | struct drm_amdgpu_heap_info cpu_accessible_vram; |
| 591 | struct drm_amdgpu_heap_info gtt; |
| 592 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 593 | struct drm_amdgpu_info_firmware { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 594 | __u32 ver; |
| 595 | __u32 feature; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 596 | }; |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 597 | struct drm_amdgpu_info_vbios { |
| 598 | __u8 name[64]; |
| 599 | __u8 vbios_pn[64]; |
| 600 | __u32 version; |
| 601 | __u32 pad; |
| 602 | __u8 vbios_ver_str[32]; |
| 603 | __u8 date[32]; |
| 604 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 605 | #define AMDGPU_VRAM_TYPE_UNKNOWN 0 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 606 | #define AMDGPU_VRAM_TYPE_GDDR1 1 |
| 607 | #define AMDGPU_VRAM_TYPE_DDR2 2 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 608 | #define AMDGPU_VRAM_TYPE_GDDR3 3 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 609 | #define AMDGPU_VRAM_TYPE_GDDR4 4 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 610 | #define AMDGPU_VRAM_TYPE_GDDR5 5 |
| 611 | #define AMDGPU_VRAM_TYPE_HBM 6 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 612 | #define AMDGPU_VRAM_TYPE_DDR3 7 |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 613 | #define AMDGPU_VRAM_TYPE_DDR4 8 |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 614 | #define AMDGPU_VRAM_TYPE_GDDR6 9 |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 615 | #define AMDGPU_VRAM_TYPE_DDR5 10 |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 616 | #define AMDGPU_VRAM_TYPE_LPDDR4 11 |
| 617 | #define AMDGPU_VRAM_TYPE_LPDDR5 12 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 618 | struct drm_amdgpu_info_device { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 619 | __u32 device_id; |
| 620 | __u32 chip_rev; |
| 621 | __u32 external_rev; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 622 | __u32 pci_rev; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 623 | __u32 family; |
| 624 | __u32 num_shader_engines; |
| 625 | __u32 num_shader_arrays_per_engine; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 626 | __u32 gpu_counter_freq; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 627 | __u64 max_engine_clock; |
| 628 | __u64 max_memory_clock; |
| 629 | __u32 cu_active_number; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 630 | __u32 cu_ao_mask; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 631 | __u32 cu_bitmap[4][4]; |
| 632 | __u32 enabled_rb_pipes_mask; |
| 633 | __u32 num_rb_pipes; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 634 | __u32 num_hw_gfx_contexts; |
Christopher Ferris | b7cef6d | 2023-05-09 19:04:15 +0000 | [diff] [blame] | 635 | __u32 pcie_gen; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 636 | __u64 ids_flags; |
| 637 | __u64 virtual_address_offset; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 638 | __u64 virtual_address_max; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 639 | __u32 virtual_address_alignment; |
| 640 | __u32 pte_fragment_size; |
| 641 | __u32 gart_page_size; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 642 | __u32 ce_ram_size; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 643 | __u32 vram_type; |
| 644 | __u32 vram_bit_width; |
| 645 | __u32 vce_harvest_config; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 646 | __u32 gc_double_offchip_lds_buf; |
| 647 | __u64 prim_buf_gpu_addr; |
| 648 | __u64 pos_buf_gpu_addr; |
| 649 | __u64 cntl_sb_buf_gpu_addr; |
| 650 | __u64 param_buf_gpu_addr; |
| 651 | __u32 prim_buf_size; |
| 652 | __u32 pos_buf_size; |
| 653 | __u32 cntl_sb_buf_size; |
| 654 | __u32 param_buf_size; |
| 655 | __u32 wave_front_size; |
| 656 | __u32 num_shader_visible_vgprs; |
| 657 | __u32 num_cu_per_sh; |
| 658 | __u32 num_tcc_blocks; |
| 659 | __u32 gs_vgt_table_depth; |
| 660 | __u32 gs_prim_buffer_depth; |
| 661 | __u32 max_gs_waves_per_vgt; |
Christopher Ferris | b7cef6d | 2023-05-09 19:04:15 +0000 | [diff] [blame] | 662 | __u32 pcie_num_lanes; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 663 | __u32 cu_ao_bitmap[4][4]; |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 664 | __u64 high_va_offset; |
| 665 | __u64 high_va_max; |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 666 | __u32 pa_sc_tile_steering_override; |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 667 | __u64 tcc_disabled_mask; |
Christopher Ferris | b7cef6d | 2023-05-09 19:04:15 +0000 | [diff] [blame] | 668 | __u64 min_engine_clock; |
| 669 | __u64 min_memory_clock; |
| 670 | __u32 tcp_cache_size; |
| 671 | __u32 num_sqc_per_wgp; |
| 672 | __u32 sqc_data_cache_size; |
| 673 | __u32 sqc_inst_cache_size; |
| 674 | __u32 gl1c_cache_size; |
| 675 | __u32 gl2c_cache_size; |
| 676 | __u64 mall_size; |
| 677 | __u32 enabled_rb_pipes_mask_hi; |
Christopher Ferris | 8666d04 | 2023-09-06 14:55:31 -0700 | [diff] [blame] | 678 | __u32 shadow_size; |
| 679 | __u32 shadow_alignment; |
| 680 | __u32 csa_size; |
| 681 | __u32 csa_alignment; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 682 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 683 | struct drm_amdgpu_info_hw_ip { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 684 | __u32 hw_ip_version_major; |
| 685 | __u32 hw_ip_version_minor; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 686 | __u64 capabilities_flags; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 687 | __u32 ib_start_alignment; |
| 688 | __u32 ib_size_alignment; |
| 689 | __u32 available_rings; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 690 | __u32 ip_discovery_version; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 691 | }; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 692 | struct drm_amdgpu_info_num_handles { |
| 693 | __u32 uvd_max_handles; |
| 694 | __u32 uvd_used_handles; |
| 695 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 696 | #define AMDGPU_VCE_CLOCK_TABLE_ENTRIES 6 |
| 697 | struct drm_amdgpu_info_vce_clock_table_entry { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 698 | __u32 sclk; |
| 699 | __u32 mclk; |
| 700 | __u32 eclk; |
| 701 | __u32 pad; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 702 | }; |
| 703 | struct drm_amdgpu_info_vce_clock_table { |
| 704 | struct drm_amdgpu_info_vce_clock_table_entry entries[AMDGPU_VCE_CLOCK_TABLE_ENTRIES]; |
| 705 | __u32 num_valid_entries; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 706 | __u32 pad; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 707 | }; |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 708 | #define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2 0 |
| 709 | #define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4 1 |
| 710 | #define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1 2 |
| 711 | #define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC 3 |
| 712 | #define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC 4 |
| 713 | #define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG 5 |
| 714 | #define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9 6 |
| 715 | #define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_AV1 7 |
| 716 | #define AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_COUNT 8 |
| 717 | struct drm_amdgpu_info_video_codec_info { |
| 718 | __u32 valid; |
| 719 | __u32 max_width; |
| 720 | __u32 max_height; |
| 721 | __u32 max_pixels_per_frame; |
| 722 | __u32 max_level; |
| 723 | __u32 pad; |
| 724 | }; |
| 725 | struct drm_amdgpu_info_video_caps { |
| 726 | struct drm_amdgpu_info_video_codec_info codec_info[AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_COUNT]; |
| 727 | }; |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 728 | #define AMDGPU_VMHUB_TYPE_MASK 0xff |
| 729 | #define AMDGPU_VMHUB_TYPE_SHIFT 0 |
| 730 | #define AMDGPU_VMHUB_TYPE_GFX 0 |
| 731 | #define AMDGPU_VMHUB_TYPE_MM0 1 |
| 732 | #define AMDGPU_VMHUB_TYPE_MM1 2 |
| 733 | #define AMDGPU_VMHUB_IDX_MASK 0xff00 |
| 734 | #define AMDGPU_VMHUB_IDX_SHIFT 8 |
| 735 | struct drm_amdgpu_info_gpuvm_fault { |
| 736 | __u64 addr; |
| 737 | __u32 status; |
| 738 | __u32 vmhub; |
| 739 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 740 | #define AMDGPU_FAMILY_UNKNOWN 0 |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 741 | #define AMDGPU_FAMILY_SI 110 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 742 | #define AMDGPU_FAMILY_CI 120 |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 743 | #define AMDGPU_FAMILY_KV 125 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 744 | #define AMDGPU_FAMILY_VI 130 |
| 745 | #define AMDGPU_FAMILY_CZ 135 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 746 | #define AMDGPU_FAMILY_AI 141 |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 747 | #define AMDGPU_FAMILY_RV 142 |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 748 | #define AMDGPU_FAMILY_NV 143 |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 749 | #define AMDGPU_FAMILY_VGH 144 |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 750 | #define AMDGPU_FAMILY_GC_11_0_0 145 |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 751 | #define AMDGPU_FAMILY_YC 146 |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 752 | #define AMDGPU_FAMILY_GC_11_0_1 148 |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 753 | #define AMDGPU_FAMILY_GC_10_3_6 149 |
| 754 | #define AMDGPU_FAMILY_GC_10_3_7 151 |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 755 | #define AMDGPU_FAMILY_GC_11_5_0 150 |
Christopher Ferris | 4ba5449 | 2024-09-18 16:25:22 +0000 | [diff] [blame^] | 756 | #define AMDGPU_FAMILY_GC_12_0_0 152 |
| 757 | struct drm_color_ctm_3x4 { |
| 758 | __u64 matrix[12]; |
| 759 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 760 | #ifdef __cplusplus |
Christopher Ferris | 48fe0ae | 2019-01-10 15:59:33 -0800 | [diff] [blame] | 761 | } |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 762 | #endif |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 763 | #endif |