1 /* 2 * SPDX-FileCopyrightText: Copyright (c) 2006-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3 * SPDX-License-Identifier: MIT 4 * 5 * Permission is hereby granted, free of charge, to any person obtaining a 6 * copy of this software and associated documentation files (the "Software"), 7 * to deal in the Software without restriction, including without limitation 8 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * and/or sell copies of the Software, and to permit persons to whom the 10 * Software is furnished to do so, subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice shall be included in 13 * all copies or substantial portions of the Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 * DEALINGS IN THE SOFTWARE. 22 */ 23 24 #pragma once 25 26 #include <nvtypes.h> 27 28 // 29 // This file was generated with FINN, an NVIDIA coding tool. 30 // Source file: ctrl/ctrl2080/ctrl2080fb.finn 31 // 32 33 #include "ctrl/ctrl2080/ctrl2080base.h" 34 35 /* NV20_SUBDEVICE_XX fb control commands and parameters */ 36 37 #include "nvlimits.h" 38 #include "nvcfg_sdk.h" 39 40 /* 41 * NV2080_CTRL_FB_INFO 42 * 43 * This structure represents a single 32bit fb engine value. Clients 44 * request a particular fb engine value by specifying a unique fb 45 * information index. 46 * 47 * Legal fb information index values are: 48 * NV2080_CTRL_FB_INFO_INDEX_TILE_REGION_COUNT 49 * This index is used to request the number of tiled regions supported 50 * by the associated subdevice. The return value is GPU 51 * implementation-dependent. A return value of 0 indicates the GPU 52 * does not support tiling. 53 * NV2080_CTRL_FB_INFO_INDEX_COMPRESSION_SIZE 54 * This index is used to request the amount of compression (in bytes) 55 * supported by the associated subdevice. The return value is GPU 56 * implementation-dependent. A return value of 0 indicates the GPU 57 * does not support compression. 58 * Nv2080_CTRL_FB_INFO_INDEX_DRAM_PAGE_STRIDE 59 * This index is used to request the DRAM page stride (in bytes) 60 * supported by the associated subdevice. The return value is GPU 61 * implementation-dependent. 62 * NV2080_CTRL_FB_INFO_INDEX_TILE_REGION_FREE_COUNT 63 * This index is used to request the number of free tiled regions on 64 * the associated subdevice. The return value represents the current 65 * number of free tiled regions at the time the command is processed and 66 * is not guaranteed to remain unchanged. A return value of 0 indicates 67 * that there are no available tiled regions on the associated subdevice. 68 * NV2080_CTRL_FB_INFO_INDEX_PARTITION_COUNT 69 * This index is used to request the number of frame buffer partitions 70 * on the associated subdevice. Starting with Fermi there are now two units 71 * with the name framebuffer partitions. On those chips this index returns 72 * the number of FBPAs. For number of FBPs use 73 * NV2080_CTRL_FB_INFO_INDEX_FBP_COUNT. 74 * This an SMC aware attribute, thus necessary partition subscription is 75 * required if the device is partitioned. 76 * NV2080_CTRL_FB_INFO_INDEX_RAM_SIZE 77 * This index is used to request the amount of framebuffer memory in 78 * kilobytes physically present on the associated subdevice. This 79 * value will never exceed the value reported by 80 * NV2080_CTRL_FB_INFO_INDEX_TOTAL_RAM_SIZE. 81 * This an SMC aware attribute, so the per-partition framebuffer memory 82 * size will be returned when the client has a partition subscription. 83 * NV2080_CTRL_FB_INFO_INDEX_TOTAL_RAM_SIZE 84 * This index is used to request the total amount of video memory in 85 * kilobytes for use with the associated subdevice. This value will 86 * reflect both framebuffer memory as well as any system memory dedicated 87 * for use with the subdevice. 88 * This an SMC aware attribute, so the per-partition video memory size 89 * will be returned when the client has a partition subscription. 90 * NV2080_CTRL_FB_INFO_INDEX_HEAP_SIZE 91 * This index is used to request the amount of total RAM in kilobytes 92 * available for user allocations. This value reflects the total ram 93 * size less the amount of memory reserved for internal use. 94 * This an SMC aware attribute, thus necessary partition subscription is 95 * required if the device is partitioned. 96 * NV2080_CTRL_FB_INFO_INDEX_HEAP_START 97 * This index is used to request the offset for start of heap in 98 * kilobytes. 99 * This an SMC aware attribute, thus necessary partition subscription is 100 * required if the device is partitioned. 101 * NV2080_CTRL_FB_INFO_INDEX_HEAP_FREE 102 * This index is used to request the available amount of video memory in 103 * kilobytes for use with the associated subdevice or the SMC partition. 104 * This an SMC aware attribute, thus necessary partition subscription is 105 * required to query per partition information, if the device is partitioned. 106 * Alternatively, the SMC/MIG monitor capability can be acquired to query 107 * aggregate available memory across all the valid partitions. 108 * NV2080_CTRL_FB_INFO_INDEX_MAPPABLE_HEAP_SIZE 109 * This index reflects the amount of heap memory in kilobytes that 110 * is accessible by the CPU. On subdevices with video memory sizes that 111 * exceed the amount that can be bus mappable this value will be less 112 * than that reported by NV2080_CTRL_FB_INFO_INDEX_HEAP_SIZE. 113 * This an SMC aware attribute, thus necessary partition subscription is 114 * required if the device is partitioned. 115 * NV2080_CTRL_FB_INFO_INDEX_BUS_WIDTH 116 * This index is used to request the FB bus bandwidth on the associated 117 * subdevice. 118 * NV2080_CTRL_FB_INFO_INDEX_RAM_CFG 119 * This index is used to request the implementation-dependent RAM 120 * configuration value of the associated subdevice. 121 * NV2080_CTRL_FB_INFO_INDEX_RAM_TYPE 122 * This index is used to request the type of RAM used for the framebuffer 123 * on the associated subdevice. Legal RAM types include: 124 * NV2080_CTRL_FB_INFO_RAM_TYPE_UNKNOWN 125 * NV2080_CTRL_FB_INFO_RAM_TYPE_SDRAM 126 * NV2080_CTRL_FB_INFO_RAM_TYPE_DDR1 127 * NV2080_CTRL_FB_INFO_RAM_TYPE_DDR2 128 * NV2080_CTRL_FB_INFO_RAM_TYPE_GDDR2 129 * NV2080_CTRL_FB_INFO_RAM_TYPE_GDDR3 130 * NV2080_CTRL_FB_INFO_RAM_TYPE_GDDR4 131 * NV2080_CTRL_FB_INFO_RAM_TYPE_DDR3 132 * NV2080_CTRL_FB_INFO_RAM_TYPE_GDDR5 133 * NV2080_CTRL_FB_INFO_RAM_TYPE_GDDR5X 134 * NV2080_CTRL_FB_INFO_RAM_TYPE_GDDR6 135 * NV2080_CTRL_FB_INFO_RAM_TYPE_GDDR6X 136 * NV2080_CTRL_FB_INFO_RAM_TYPE_LPDDR2 137 * NV2080_CTRL_FB_INFO_RAM_TYPE_LPDDR4 138 * NV2080_CTRL_FB_INFO_RAM_TYPE_LPDDR5 139 * NV2080_CTRL_FB_INFO_INDEX_BANK_COUNT 140 * This index is used to request the number of FB banks on the associated 141 * subdevice. 142 * NV2080_CTRL_FB_INFO_INDEX_OVERLAY_OFFSET_ADJUSTMENT 143 * This index is used to request the offset relative to the start of the 144 * overlay surface(s), in bytes, at which scanout should happen if the 145 * primary and the overlay surfaces are all aligned on large page 146 * boundaries. 147 * NV2080_CTRL_FB_INFO_INDEX_GPU_VADDR_SPACE_SIZE_KB 148 * This index is used to request the size of the GPU's virtual address 149 * space in kilobytes. 150 * NV2080_CTRL_FB_INFO_INDEX_GPU_VADDR_HEAP_SIZE_KB 151 * This index is used to request the size of the GPU's virtual address 152 * space heap (minus RM-reserved space) in kilobytes. 153 * NV2080_CTRL_FB_INFO_INDEX_GPU_VADDR_MAPPBLE_SIZE_KB 154 * This index is used to request the size of the GPU's BAR1 mappable 155 * virtual address space in kilobytes. 156 * NV2080_CTRL_FB_INFO_INDEX_EFFECTIVE_BW 157 * This index is deprecated, and returns zero value. 158 * NV2080_CTRL_FB_INFO_INDEX_PARTITION_MASK 159 * This index is used to request the mask of currently active partitions. 160 * Each active partition has an ID that's equivalent to the corresponding 161 * bit position in the mask. 162 * This an SMC aware attribute, thus necessary partition subscription is 163 * required if the device is partitioned. 164 * NV2080_CTRL_FB_INFO_INDEX_VISTA_RESERVED_HEAP_SIZE 165 * This index is used to request the amount of total RAM in kilobytes 166 * reserved for internal RM allocations on Vista. This will need to 167 * be subtracted from the total heap size to get the amount available to 168 * KMD. 169 * This an SMC aware attribute, thus necessary partition subscription is 170 * required if the device is partitioned. 171 * NV2080_CTRL_FB_INFO_INDEX_RAM_LOCATION 172 * This index is used to distinguish between different memory 173 * configurations. 174 * NV2080_CTRL_FB_INFO_INDEX_FB_IS_BROKEN 175 * This index is used to check if the FB is functional 176 * NV2080_CTRL_FB_INFO_INDEX_FBP_COUNT 177 * This index is used to get the number of FBPs on the subdevice. This 178 * field is not to be confused with 179 * NV2080_CTRL_FB_INFO_INDEX_PARTITION_COUNT (returns number of FBPAs). 180 * Starting with Fermi the term partition is an ambiguous term, both FBP 181 * and FBPA mean FB partitions. The FBPA is the low level DRAM controller, 182 * while a FBP is the aggregation of one or more FBPAs, L2, ROP, and some 183 * other units. 184 * This an SMC aware attribute, thus necessary partition subscription is 185 * required if the device is partitioned. 186 * NV2080_CTRL_FB_INFO_INDEX_L2CACHE_SIZE 187 * This index is used to get the size of the L2 cache in Bytes. 188 * A value of zero indicates that the L2 cache isn't supported on the 189 * associated subdevice. 190 * NV2080_CTRL_FB_INFO_INDEX_MEMORYINFO_VENDOR_ID 191 * This index is used to get the memory vendor ID information from 192 * the Memory Information Table in the VBIOS. Legal memory Vendor ID 193 * values include: 194 * NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_UNKNOWN 195 * NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_RESERVED 196 * NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_SAMSUNG 197 * NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_QIMONDA 198 * NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_ELPIDA 199 * NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_ETRON 200 * NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_NANYA 201 * NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_HYNIX 202 * NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_MOSEL 203 * NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_WINBOND 204 * NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_ESMT 205 * NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_MICRON 206 * NV2080_CTRL_FB_INFO_INDEX_BAR1_AVAIL_SIZE 207 * This index is used to request the amount of unused bar1 space. The 208 * data returned is a value in KB. It is not guaranteed to be entirely 209 * accurate since it is a snapshot at a particular time and can 210 * change quickly. 211 * NV2080_CTRL_FB_INFO_INDEX_BAR1_MAX_CONTIGUOUS_AVAIL_SIZE 212 * This index is used to request the amount of largest unused contiguous 213 * block in bar1 space. The data returned is a value in KB. It is not 214 * guaranteed to be entirely accurate since it is a snapshot at a particular 215 * time and can change quickly. 216 * NV2080_CTRL_FB_INFO_INDEX_USABLE_RAM_SIZE 217 * This index is used to request the amount of usable framebuffer memory in 218 * kilobytes physically present on the associated subdevice. This 219 * value will never exceed the value reported by 220 * NV2080_CTRL_FB_INFO_INDEX_TOTAL_RAM_SIZE. 221 * This an SMC aware attribute, thus necessary partition subscription is 222 * required if the device is partitioned. 223 * NV2080_CTRL_FB_INFO_INDEX_LTC_COUNT 224 * Returns the active LTC count across all active FBPs. 225 * This an SMC aware attribute, thus necessary partition subscription is 226 * required if the device is partitioned. 227 * NV2080_CTRL_FB_INFO_INDEX_LTS_COUNT 228 * Returns the active LTS count across all active LTCs. 229 * This an SMC aware attribute, thus necessary partition subscription is 230 * required if the device is partitioned. 231 * NV2080_CTRL_FB_INFO_INDEX_PSEUDO_CHANNEL_MODE 232 * This is used to identify if pseudo-channel mode is enabled for HBM 233 * NV2080_CTRL_FB_INFO_INDEX_SMOOTHDISP_RSVD_BAR1_SIZE 234 * This is used by WDDM-KMD to determine whether and how much RM reserved BAR1 for smooth transition 235 * NV2080_CTRL_FB_INFO_INDEX_HEAP_OFFLINE_SIZE 236 * Returns the total size of the all dynamically offlined pages in KiB 237 * NV2080_CTRL_FB_INFO_INDEX_1TO1_COMPTAG_ENABLED 238 * Returns true if 1to1 comptag is enabled 239 * NV2080_CTRL_FB_INFO_INDEX_SUSPEND_RESUME_RSVD_SIZE 240 * Returns the total size of the memory(FB) that will saved/restored during save/restore cycle 241 * NV2080_CTRL_FB_INFO_INDEX_ALLOW_PAGE_RETIREMENT 242 * Returns true if page retirement is allowed 243 * NV2080_CTRL_FB_INFO_POISON_FUSE_ENABLED 244 * Returns true if poison fuse is enabled 245 * NV2080_CTRL_FB_INFO_FBPA_ECC_ENABLED 246 * Returns true if ECC is enabled for FBPA 247 * NV2080_CTRL_FB_INFO_DYNAMIC_PAGE_OFFLINING_ENABLED 248 * Returns true if dynamic page blacklisting is enabled 249 * NV2080_CTRL_FB_INFO_INDEX_FORCED_BAR1_64KB_MAPPING_ENABLED 250 * Returns true if 64KB mapping on BAR1 is force-enabled 251 * NV2080_CTRL_FB_INFO_INDEX_P2P_MAILBOX_SIZE 252 * Returns the P2P mailbox size to be allocated by the client. 253 * Returns 0 if the P2P mailbox is allocated by RM. 254 * NV2080_CTRL_FB_INFO_INDEX_P2P_MAILBOX_ALIGNMENT_SIZE 255 * Returns the P2P mailbox alignment requirement. 256 * Returns 0 if the P2P mailbox is allocated by RM. 257 * NV2080_CTRL_FB_INFO_INDEX_P2P_MAILBOX_BAR1_MAX_OFFSET_64KB 258 * Returns the P2P mailbox max offset requirement. 259 * Returns 0 if the P2P mailbox is allocated by RM. 260 * NV2080_CTRL_FB_INFO_INDEX_PROTECTED_MEM_SIZE_TOTAL_KB 261 * Returns total protected memory when memory protection is enabled 262 * Returns 0 when memory protection is not enabled. 263 * NV2080_CTRL_FB_INFO_INDEX_PROTECTED_MEM_SIZE_FREE_KB 264 * Returns protected memory available for allocation when memory 265 * protection is enabled. 266 * Returns 0 when memory protection is not enabled. 267 * NV2080_CTRL_FB_INFO_INDEX_ECC_STATUS_SIZE 268 * Returns the ECC status size (corresponds to subpartitions or channels 269 * depending on architecture/memory type). 270 * NV2080_CTRL_FB_INFO_INDEX_IS_ZERO_FB 271 * Returns true if FB is not present on this chip 272 */ 273 typedef NVXXXX_CTRL_XXX_INFO NV2080_CTRL_FB_INFO; 274 275 /* valid fb info index values */ 276 #define NV2080_CTRL_FB_INFO_INDEX_TILE_REGION_COUNT (0x00000000U) // Deprecated 277 #define NV2080_CTRL_FB_INFO_INDEX_COMPRESSION_SIZE (0x00000001U) 278 #define NV2080_CTRL_FB_INFO_INDEX_DRAM_PAGE_STRIDE (0x00000002U) 279 #define NV2080_CTRL_FB_INFO_INDEX_TILE_REGION_FREE_COUNT (0x00000003U) 280 #define NV2080_CTRL_FB_INFO_INDEX_PARTITION_COUNT (0x00000004U) 281 #define NV2080_CTRL_FB_INFO_INDEX_BAR1_SIZE (0x00000005U) 282 #define NV2080_CTRL_FB_INFO_INDEX_BANK_SWIZZLE_ALIGNMENT (0x00000006U) 283 #define NV2080_CTRL_FB_INFO_INDEX_RAM_SIZE (0x00000007U) 284 #define NV2080_CTRL_FB_INFO_INDEX_TOTAL_RAM_SIZE (0x00000008U) 285 #define NV2080_CTRL_FB_INFO_INDEX_HEAP_SIZE (0x00000009U) 286 #define NV2080_CTRL_FB_INFO_INDEX_MAPPABLE_HEAP_SIZE (0x0000000AU) 287 #define NV2080_CTRL_FB_INFO_INDEX_BUS_WIDTH (0x0000000BU) 288 #define NV2080_CTRL_FB_INFO_INDEX_RAM_CFG (0x0000000CU) 289 #define NV2080_CTRL_FB_INFO_INDEX_RAM_TYPE (0x0000000DU) 290 #define NV2080_CTRL_FB_INFO_INDEX_BANK_COUNT (0x0000000EU) 291 #define NV2080_CTRL_FB_INFO_INDEX_OVERLAY_OFFSET_ADJUSTMENT (0x0000000FU) // Deprecated (index reused to return 0) 292 #define NV2080_CTRL_FB_INFO_INDEX_GPU_VADDR_SPACE_SIZE_KB (0x0000000FU) // Deprecated (index reused to return 0) 293 #define NV2080_CTRL_FB_INFO_INDEX_GPU_VADDR_HEAP_SIZE_KB (0x0000000FU) // Deprecated (index reused to return 0) 294 #define NV2080_CTRL_FB_INFO_INDEX_GPU_VADDR_MAPPBLE_SIZE_KB (0x0000000FU) // Deprecated (index reused to return 0) 295 #define NV2080_CTRL_FB_INFO_INDEX_EFFECTIVE_BW (0x0000000FU) // Deprecated (index reused to return 0) 296 #define NV2080_CTRL_FB_INFO_INDEX_FB_TAX_SIZE_KB (0x00000010U) 297 #define NV2080_CTRL_FB_INFO_INDEX_HEAP_BASE_KB (0x00000011U) 298 #define NV2080_CTRL_FB_INFO_INDEX_LARGEST_FREE_REGION_SIZE_KB (0x00000012U) 299 #define NV2080_CTRL_FB_INFO_INDEX_LARGEST_FREE_REGION_BASE_KB (0x00000013U) 300 #define NV2080_CTRL_FB_INFO_INDEX_PARTITION_MASK (0x00000014U) 301 #define NV2080_CTRL_FB_INFO_INDEX_VISTA_RESERVED_HEAP_SIZE (0x00000015U) 302 #define NV2080_CTRL_FB_INFO_INDEX_HEAP_FREE (0x00000016U) 303 #define NV2080_CTRL_FB_INFO_INDEX_RAM_LOCATION (0x00000017U) 304 #define NV2080_CTRL_FB_INFO_INDEX_FB_IS_BROKEN (0x00000018U) 305 #define NV2080_CTRL_FB_INFO_INDEX_FBP_COUNT (0x00000019U) 306 #define NV2080_CTRL_FB_INFO_INDEX_FBP_MASK (0x0000001AU) 307 #define NV2080_CTRL_FB_INFO_INDEX_L2CACHE_SIZE (0x0000001BU) 308 #define NV2080_CTRL_FB_INFO_INDEX_MEMORYINFO_VENDOR_ID (0x0000001CU) 309 #define NV2080_CTRL_FB_INFO_INDEX_BAR1_AVAIL_SIZE (0x0000001DU) 310 #define NV2080_CTRL_FB_INFO_INDEX_HEAP_START (0x0000001EU) 311 #define NV2080_CTRL_FB_INFO_INDEX_BAR1_MAX_CONTIGUOUS_AVAIL_SIZE (0x0000001FU) 312 #define NV2080_CTRL_FB_INFO_INDEX_USABLE_RAM_SIZE (0x00000020U) 313 #define NV2080_CTRL_FB_INFO_INDEX_TRAINIG_2T (0x00000021U) 314 #define NV2080_CTRL_FB_INFO_INDEX_LTC_COUNT (0x00000022U) 315 #define NV2080_CTRL_FB_INFO_INDEX_LTS_COUNT (0x00000023U) 316 #define NV2080_CTRL_FB_INFO_INDEX_L2CACHE_ONLY_MODE (0x00000024U) 317 #define NV2080_CTRL_FB_INFO_INDEX_PSEUDO_CHANNEL_MODE (0x00000025U) 318 #define NV2080_CTRL_FB_INFO_INDEX_SMOOTHDISP_RSVD_BAR1_SIZE (0x00000026U) 319 #define NV2080_CTRL_FB_INFO_INDEX_HEAP_OFFLINE_SIZE (0x00000027U) 320 #define NV2080_CTRL_FB_INFO_INDEX_1TO1_COMPTAG_ENABLED (0x00000028U) 321 #define NV2080_CTRL_FB_INFO_INDEX_SUSPEND_RESUME_RSVD_SIZE (0x00000029U) 322 #define NV2080_CTRL_FB_INFO_INDEX_ALLOW_PAGE_RETIREMENT (0x0000002AU) 323 #define NV2080_CTRL_FB_INFO_INDEX_LTC_MASK (0x0000002BU) 324 #define NV2080_CTRL_FB_INFO_POISON_FUSE_ENABLED (0x0000002CU) 325 #define NV2080_CTRL_FB_INFO_FBPA_ECC_ENABLED (0x0000002DU) 326 #define NV2080_CTRL_FB_INFO_DYNAMIC_PAGE_OFFLINING_ENABLED (0x0000002EU) 327 #define NV2080_CTRL_FB_INFO_INDEX_FORCED_BAR1_64KB_MAPPING_ENABLED (0x0000002FU) 328 #define NV2080_CTRL_FB_INFO_INDEX_P2P_MAILBOX_SIZE (0x00000030U) 329 #define NV2080_CTRL_FB_INFO_INDEX_P2P_MAILBOX_ALIGNMENT (0x00000031U) 330 #define NV2080_CTRL_FB_INFO_INDEX_P2P_MAILBOX_BAR1_MAX_OFFSET_64KB (0x00000032U) 331 #define NV2080_CTRL_FB_INFO_INDEX_PROTECTED_MEM_SIZE_TOTAL_KB (0x00000033U) 332 #define NV2080_CTRL_FB_INFO_INDEX_PROTECTED_MEM_SIZE_FREE_KB (0x00000034U) 333 #define NV2080_CTRL_FB_INFO_INDEX_ECC_STATUS_SIZE (0x00000035U) 334 #define NV2080_CTRL_FB_INFO_INDEX_IS_ZERO_FB (0x00000036U) 335 #define NV2080_CTRL_FB_INFO_MAX_LIST_SIZE (0x00000037U) 336 337 #define NV2080_CTRL_FB_INFO_INDEX_MAX (0x36U) /* finn: Evaluated from "(NV2080_CTRL_FB_INFO_MAX_LIST_SIZE - 1)" */ 338 339 /* valid fb RAM type values */ 340 #define NV2080_CTRL_FB_INFO_RAM_TYPE_UNKNOWN (0x00000000U) 341 #define NV2080_CTRL_FB_INFO_RAM_TYPE_SDRAM (0x00000001U) 342 #define NV2080_CTRL_FB_INFO_RAM_TYPE_DDR1 (0x00000002U) /* SDDR and GDDR (aka DDR1 and GDDR1) */ 343 #define NV2080_CTRL_FB_INFO_RAM_TYPE_SDDR2 (0x00000003U) /* SDDR2 Used on NV43 and later */ 344 #define NV2080_CTRL_FB_INFO_RAM_TYPE_DDR2 NV2080_CTRL_FB_INFO_RAM_TYPE_SDDR2 /* Deprecated alias */ 345 #define NV2080_CTRL_FB_INFO_RAM_TYPE_GDDR2 (0x00000004U) /* GDDR2 Used on NV30 and some NV36 */ 346 #define NV2080_CTRL_FB_INFO_RAM_TYPE_GDDR3 (0x00000005U) /* GDDR3 Used on NV40 and later */ 347 #define NV2080_CTRL_FB_INFO_RAM_TYPE_GDDR4 (0x00000006U) /* GDDR4 Used on G80 and later (deprecated) */ 348 #define NV2080_CTRL_FB_INFO_RAM_TYPE_SDDR3 (0x00000007U) /* SDDR3 Used on G9x and later */ 349 #define NV2080_CTRL_FB_INFO_RAM_TYPE_DDR3 NV2080_CTRL_FB_INFO_RAM_TYPE_SDDR3 /* Deprecated alias */ 350 #define NV2080_CTRL_FB_INFO_RAM_TYPE_GDDR5 (0x00000008U) /* GDDR5 Used on GT21x and later */ 351 #define NV2080_CTRL_FB_INFO_RAM_TYPE_LPDDR2 (0x00000009U) /* LPDDR (Low Power SDDR) used on T2x and later. */ 352 353 354 #define NV2080_CTRL_FB_INFO_RAM_TYPE_SDDR4 (0x0000000CU) /* SDDR4 Used on Maxwell and later */ 355 #define NV2080_CTRL_FB_INFO_RAM_TYPE_LPDDR4 (0x0000000DU) /* LPDDR (Low Power SDDR) used on T21x and later.*/ 356 #define NV2080_CTRL_FB_INFO_RAM_TYPE_HBM1 (0x0000000EU) /* HBM1 (High Bandwidth Memory) used on GP100 */ 357 #define NV2080_CTRL_FB_INFO_RAM_TYPE_HBM2 (0x0000000FU) /* HBM2 (High Bandwidth Memory-pseudo channel) */ 358 #define NV2080_CTRL_FB_INFO_RAM_TYPE_GDDR5X (0x00000010U) /* GDDR5X Used on GP10x */ 359 #define NV2080_CTRL_FB_INFO_RAM_TYPE_GDDR6 (0x00000011U) /* GDDR6 Used on TU10x */ 360 #define NV2080_CTRL_FB_INFO_RAM_TYPE_GDDR6X (0x00000012U) /* GDDR6X Used on GA10x */ 361 #define NV2080_CTRL_FB_INFO_RAM_TYPE_LPDDR5 (0x00000013U) /* LPDDR (Low Power SDDR) used on T23x and later.*/ 362 #define NV2080_CTRL_FB_INFO_RAM_TYPE_HBM3 (0x00000014U) /* HBM3 (High Bandwidth Memory) v3 */ 363 364 365 366 /* valid RAM LOCATION types */ 367 #define NV2080_CTRL_FB_INFO_RAM_LOCATION_GPU_DEDICATED (0x00000000U) 368 #define NV2080_CTRL_FB_INFO_RAM_LOCATION_SYS_SHARED (0x00000001U) 369 #define NV2080_CTRL_FB_INFO_RAM_LOCATION_SYS_DEDICATED (0x00000002U) 370 371 /* valid Memory Vendor ID values */ 372 #define NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_SAMSUNG (0x00000001U) 373 #define NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_QIMONDA (0x00000002U) 374 #define NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_ELPIDA (0x00000003U) 375 #define NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_ETRON (0x00000004U) 376 #define NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_NANYA (0x00000005U) 377 #define NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_HYNIX (0x00000006U) 378 #define NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_MOSEL (0x00000007U) 379 #define NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_WINBOND (0x00000008U) 380 #define NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_ESMT (0x00000009U) 381 #define NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_MICRON (0x0000000FU) 382 #define NV2080_CTRL_FB_INFO_MEMORYINFO_VENDOR_ID_UNKNOWN (0xFFFFFFFFU) 383 384 #define NV2080_CTRL_FB_INFO_PSEUDO_CHANNEL_MODE_UNSUPPORTED (0x00000000U) 385 #define NV2080_CTRL_FB_INFO_PSEUDO_CHANNEL_MODE_DISABLED (0x00000001U) 386 #define NV2080_CTRL_FB_INFO_PSEUDO_CHANNEL_MODE_ENABLED (0x00000002U) 387 388 /** 389 * NV2080_CTRL_CMD_FB_GET_INFO 390 * 391 * This command returns fb engine information for the associated GPU. 392 * Requests to retrieve fb information use a list of one or more 393 * NV2080_CTRL_FB_INFO structures. 394 * 395 * fbInfoListSize 396 * This field specifies the number of entries on the caller's 397 * fbInfoList. 398 * fbInfoList 399 * This field specifies a pointer in the caller's address space 400 * to the buffer into which the fb information is to be returned. 401 * This buffer must be at least as big as fbInfoListSize multiplied 402 * by the size of the NV2080_CTRL_FB_INFO structure. 403 * 404 * Possible status values returned are: 405 * NV_OK 406 * NV_ERR_INVALID_PARAM_STRUCT 407 * NV_ERR_INVALID_ARGUMENT 408 * NV_ERR_OPERATING_SYSTEM 409 */ 410 #define NV2080_CTRL_CMD_FB_GET_INFO (0x20801301U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_INFO_PARAMS_MESSAGE_ID" */ 411 412 #define NV2080_CTRL_FB_GET_INFO_PARAMS_MESSAGE_ID (0x1U) 413 414 typedef struct NV2080_CTRL_FB_GET_INFO_PARAMS { 415 NvU32 fbInfoListSize; 416 NV_DECLARE_ALIGNED(NvP64 fbInfoList, 8); 417 } NV2080_CTRL_FB_GET_INFO_PARAMS; 418 419 #define NV2080_CTRL_CMD_FB_GET_INFO_V2 (0x20801303U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_INFO_V2_PARAMS_MESSAGE_ID" */ 420 421 #define NV2080_CTRL_FB_GET_INFO_V2_PARAMS_MESSAGE_ID (0x3U) 422 423 typedef struct NV2080_CTRL_FB_GET_INFO_V2_PARAMS { 424 NvU32 fbInfoListSize; 425 NV2080_CTRL_FB_INFO fbInfoList[NV2080_CTRL_FB_INFO_MAX_LIST_SIZE]; 426 } NV2080_CTRL_FB_GET_INFO_V2_PARAMS; 427 428 /* 429 * NV2080_CTRL_CMD_FB_GET_BAR1_OFFSET 430 * 431 * This command returns the GPU virtual address of a bar1 432 * allocation, given the CPU virtual address. 433 * 434 * cpuVirtAddress 435 * This field specifies the associated CPU virtual address of the 436 * memory allocation. 437 * gpuVirtAddress 438 * The GPU virtual address associated with the allocation 439 * is returned in this field. 440 * 441 * Possible status values returned are 442 * NV_OK 443 * NV_ERR_INVALID_PARAM_STRUCT 444 * NV_ERR_NOT_SUPPORTED 445 * NV_ERR_INVALID_ARGUMENT 446 */ 447 #define NV2080_CTRL_CMD_FB_GET_BAR1_OFFSET (0x20801310U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_BAR1_OFFSET_PARAMS_MESSAGE_ID" */ 448 449 #define NV2080_CTRL_FB_GET_BAR1_OFFSET_PARAMS_MESSAGE_ID (0x10U) 450 451 typedef struct NV2080_CTRL_FB_GET_BAR1_OFFSET_PARAMS { 452 NV_DECLARE_ALIGNED(NvP64 cpuVirtAddress, 8); 453 NV_DECLARE_ALIGNED(NvU64 gpuVirtAddress, 8); 454 } NV2080_CTRL_FB_GET_BAR1_OFFSET_PARAMS; 455 456 /* 457 * Note: Returns Zeros if no System carveout address info 458 * 459 * NV2080_CTRL_CMD_FB_GET_CARVEOUT_ADDRESS_INFO 460 * 461 * This command returns FB carveout address space information 462 * 463 * StartAddr 464 * Returns the system memory address of the start of carveout space. 465 * SpaceSize 466 * Returns the size of carveout space. 467 * 468 * Possible status values returned are: 469 * NV_OK 470 * NV_ERR_INVALID_PARAM_STRUCT 471 * NV_ERR_NOT_SUPPORTED 472 */ 473 474 #define NV2080_CTRL_CMD_FB_GET_CARVEOUT_ADDRESS_INFO (0x2080130bU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_SYSTEM_CARVEOUT_ADDRESS_SPACE_INFO_MESSAGE_ID" */ 475 476 #define NV2080_CTRL_FB_GET_SYSTEM_CARVEOUT_ADDRESS_SPACE_INFO_MESSAGE_ID (0xBU) 477 478 typedef struct NV2080_CTRL_FB_GET_SYSTEM_CARVEOUT_ADDRESS_SPACE_INFO { 479 NV_DECLARE_ALIGNED(NvU64 StartAddr, 8); 480 NV_DECLARE_ALIGNED(NvU64 SpaceSize, 8); 481 } NV2080_CTRL_FB_GET_SYSTEM_CARVEOUT_ADDRESS_SPACE_INFO; 482 483 /* 484 * NV2080_CTRL_FB_CMD_GET_CALIBRATION_LOCK_FAILED 485 * 486 * This command returns the failure counts for calibration. 487 * 488 * uFlags 489 * Just one for now -- ehether to reset the counts. 490 * driveStrengthRiseCount 491 * This parameter specifies the failure count for drive strength rising. 492 * driveStrengthFallCount 493 * This parameter specifies the failure count for drive strength falling. 494 * driveStrengthTermCount 495 * This parameter specifies the failure count for drive strength 496 * termination. 497 * slewStrengthRiseCount 498 * This parameter specifies the failure count for slew strength rising. 499 * slewStrengthFallCount 500 * This parameter specifies the failure count for slew strength falling. 501 * slewStrengthTermCount 502 * This parameter specifies the failure count for slew strength 503 * termination. 504 * 505 * Possible status values returned are: 506 * NV_OK 507 * NVOS_STATUS_INVALID_PARAM_STRUCT 508 * NVOS_STATUS_NOT_SUPPORTED 509 * NV_ERR_INVALID_ARGUMENT 510 */ 511 #define NV2080_CTRL_CMD_FB_GET_CALIBRATION_LOCK_FAILED (0x2080130cU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_CALIBRATION_LOCK_FAILED_PARAMS_MESSAGE_ID" */ 512 513 #define NV2080_CTRL_FB_GET_CALIBRATION_LOCK_FAILED_PARAMS_MESSAGE_ID (0xCU) 514 515 typedef struct NV2080_CTRL_FB_GET_CALIBRATION_LOCK_FAILED_PARAMS { 516 NvU32 flags; 517 NvU32 driveStrengthRiseCount; 518 NvU32 driveStrengthFallCount; 519 NvU32 driveStrengthTermCount; 520 NvU32 slewStrengthRiseCount; 521 NvU32 slewStrengthFallCount; 522 } NV2080_CTRL_FB_GET_CALIBRATION_LOCK_FAILED_PARAMS; 523 524 /* valid flags parameter values */ 525 #define NV2080_CTRL_CMD_FB_GET_CAL_FLAG_NONE (0x00000000U) 526 #define NV2080_CTRL_CMD_FB_GET_CAL_FLAG_RESET (0x00000001U) 527 528 /* 529 * NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL 530 * 531 * If supported by hardware and the OS, this command implements a streamlined version of 532 * NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE which can be called at high IRQL and Bypass the 533 * RM Lock. 534 * 535 * Requires the following NVOS54_PARAMETERS to be set for raised IRQ / Lock Bypass operation: 536 * NVOS54_FLAGS_IRQL_RAISED 537 * NVOS54_FLAGS_LOCK_BYPASS 538 * 539 * flags 540 * Contains flags to control various aspects of the flush. Valid values 541 * are defined in NV2080_CTRL_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL_FLAGS*. 542 * 543 * Possible status values returned are: 544 * NV_OK 545 * NV_ERR_NOT_SUPPORTED 546 * NV_ERR_INVALID_STATE 547 * NV_ERR_INVALID_ARGUMENT 548 * 549 * See Also: 550 * NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE 551 * This is the more generalized version which is not intended to be called at raised IRQ level 552 * NV0080_CTRL_CMD_DMA_FLUSH 553 * Performs flush operations in broadcast for the GPU cache and other hardware 554 * engines. Use this call if you want to flush all GPU caches in a 555 * broadcast device. 556 * NV0041_CTRL_CMD_SURFACE_FLUSH_GPU_CACHE 557 * Flushes memory associated with a single allocation if the hardware 558 * supports it. Use this call if you want to flush a single allocation and 559 * you have a memory object describing the physical memory. 560 */ 561 #define NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL (0x2080130dU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL_PARAMS_MESSAGE_ID" */ 562 563 #define NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL_PARAMS_MESSAGE_ID (0xDU) 564 565 typedef struct NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL_PARAMS { 566 NvU32 flags; 567 } NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL_PARAMS; 568 569 /* valid fields and values for flags */ 570 #define NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL_FLAGS_WRITE_BACK 0:0 571 #define NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL_FLAGS_WRITE_BACK_NO (0x00000000U) 572 #define NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL_FLAGS_WRITE_BACK_YES (0x00000001U) 573 #define NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL_FLAGS_INVALIDATE 1:1 574 #define NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL_FLAGS_INVALIDATE_NO (0x00000000U) 575 #define NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL_FLAGS_INVALIDATE_YES (0x00000001U) 576 #define NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL_FLAGS_FB_FLUSH 2:2 577 #define NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL_FLAGS_FB_FLUSH_NO (0x00000000U) 578 #define NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE_IRQL_FLAGS_FB_FLUSH_YES (0x00000001U) 579 580 /* 581 * NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE 582 * 583 * This command flushes a cache on the GPU which all memory accesses go 584 * through. The types of flushes supported by this API may not be supported by 585 * all hardware. Attempting an unsupported flush type will result in an error. 586 * 587 * addressArray 588 * An array of physical addresses in the aperture defined by 589 * NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_APERTURE. Each entry points to a 590 * contiguous block of memory of size memBlockSizeBytes. The addresses are 591 * aligned down to addressAlign before coalescing adjacent addresses and 592 * sending flushes to hardware. 593 * addressAlign 594 * Used to align-down addresses held in addressArray. A value of 0 will be 595 * forced to 1 to avoid a divide by zero. Value is treated as minimum 596 * alignment and any hardware alignment requirements above this value will 597 * be honored. 598 * addressArraySize 599 * The number of entries in addressArray. 600 * memBlockSizeBytes 601 * The size in bytes of each memory block pointed to by addressArray. 602 * flags 603 * Contains flags to control various aspects of the flush. Valid values 604 * are defined in NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS*. Not all flags are 605 * valid for all defined FLUSH_MODEs or all GPUs. 606 * 607 * Possible status values returned are: 608 * NV_OK 609 * NV_ERR_NOT_SUPPORTED 610 * NV_ERR_INVALID_STATE 611 * NV_ERR_INVALID_ARGUMENT 612 * 613 * See Also: 614 * NV0080_CTRL_CMD_DMA_FLUSH 615 * Performs flush operations in broadcast for the GPU cache and other hardware 616 * engines. Use this call if you want to flush all GPU caches in a 617 * broadcast device. 618 * NV0041_CTRL_CMD_SURFACE_FLUSH_GPU_CACHE 619 * Flushes memory associated with a single allocation if the hardware 620 * supports it. Use this call if you want to flush a single allocation and 621 * you have a memory object describing the physical memory. 622 */ 623 #define NV2080_CTRL_CMD_FB_FLUSH_GPU_CACHE (0x2080130eU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_FLUSH_GPU_CACHE_PARAMS_MESSAGE_ID" */ 624 625 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_MAX_ADDRESSES 500U 626 627 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_PARAMS_MESSAGE_ID (0xEU) 628 629 typedef struct NV2080_CTRL_FB_FLUSH_GPU_CACHE_PARAMS { 630 NV_DECLARE_ALIGNED(NvU64 addressArray[NV2080_CTRL_FB_FLUSH_GPU_CACHE_MAX_ADDRESSES], 8); 631 NvU32 addressArraySize; 632 NvU32 addressAlign; 633 NV_DECLARE_ALIGNED(NvU64 memBlockSizeBytes, 8); 634 NvU32 flags; 635 } NV2080_CTRL_FB_FLUSH_GPU_CACHE_PARAMS; 636 637 /* valid fields and values for flags */ 638 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_APERTURE 1:0 639 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_APERTURE_VIDEO_MEMORY (0x00000000U) 640 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_APERTURE_SYSTEM_MEMORY (0x00000001U) 641 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_APERTURE_PEER_MEMORY (0x00000002U) 642 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_WRITE_BACK 2:2 643 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_WRITE_BACK_NO (0x00000000U) 644 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_WRITE_BACK_YES (0x00000001U) 645 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_INVALIDATE 3:3 646 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_INVALIDATE_NO (0x00000000U) 647 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_INVALIDATE_YES (0x00000001U) 648 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_FLUSH_MODE 4:4 649 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_FLUSH_MODE_ADDRESS_ARRAY (0x00000000U) 650 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_FLUSH_MODE_FULL_CACHE (0x00000001U) 651 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_FB_FLUSH 5:5 652 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_FB_FLUSH_NO (0x00000000U) 653 #define NV2080_CTRL_FB_FLUSH_GPU_CACHE_FLAGS_FB_FLUSH_YES (0x00000001U) 654 655 /* 656 * NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY (deprecated; use NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2 instead) 657 * 658 * These commands access the cache allocation policy on a specific 659 * engine, if supported. 660 * 661 * engine 662 * Specifies the target engine. Possible values are defined in 663 * NV2080_ENGINE_TYPE. 664 * allocPolicy 665 * Specifies the read/write allocation policy of the cache on the specified 666 * engine. Possible values are defined in 667 * NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_READS and 668 * NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_WRITES. 669 * 670 */ 671 typedef struct NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_PARAMS { 672 NvU32 engine; 673 NvU32 allocPolicy; 674 } NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_PARAMS; 675 676 /* valid values for allocPolicy */ 677 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_READS 0:0 678 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_READS_NO (0x00000000U) 679 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_READS_YES (0x00000001U) 680 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_WRITES 1:1 681 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_WRITES_NO (0x00000000U) 682 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_WRITES_YES (0x00000001U) 683 684 685 /* 686 * NV2080_CTRL_CMD_FB_SET_GPU_CACHE_ALLOC_POLICY 687 * 688 * This command is deprecated. 689 * Use NV2080_CTRL_CMD_FB_SET_GPU_CACHE_ALLOC_POLICY_V2 instead. 690 * 691 * This command sets the state of the cache allocation policy on a specific 692 * engine, if supported. 693 * 694 * Possible status values returned are: 695 * NV_OK 696 * NV_ERR_NOT_SUPPORTED 697 * NV_ERR_INVALID_ARGUMENT 698 */ 699 #define NV2080_CTRL_CMD_FB_SET_GPU_CACHE_ALLOC_POLICY (0x2080130fU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_SET_GPU_CACHE_ALLOC_POLICY_PARAMS_MESSAGE_ID" */ 700 701 #define NV2080_CTRL_FB_SET_GPU_CACHE_ALLOC_POLICY_PARAMS_MESSAGE_ID (0xFU) 702 703 typedef NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_PARAMS NV2080_CTRL_FB_SET_GPU_CACHE_ALLOC_POLICY_PARAMS; 704 705 /* 706 * NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_PARAM 707 * 708 * These commands access the cache allocation policy on a specific 709 * client, if supported. 710 * 711 * count 712 * Specifies the number of entries in entry. 713 * entry 714 * Specifies an array of allocation policy entries. 715 * 716 * NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_ENTRY 717 * 718 * clients 719 * Specifies the target client. Possible values are defined in 720 * NV2080_CLIENT_TYPE_*. 721 * allocPolicy 722 * Specifies the read/write allocation policy of the cache on the specified 723 * engine. Possible values are defined in 724 * NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_READS and 725 * NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_WRITES. 726 * 727 * NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_ENTRY_SIZE 728 * 729 * Specifies the maximum number of allocation policy entries allowed 730 */ 731 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_ENTRY_SIZE 11U 732 733 typedef struct NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_ENTRY { 734 NvU32 client; 735 NvU32 allocPolicy; 736 } NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_ENTRY; 737 738 typedef struct NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_PARAMS { 739 NvU32 count; 740 NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_ENTRY entry[NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_ENTRY_SIZE]; 741 } NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_PARAMS; 742 743 /* valid values for allocPolicy */ 744 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_READS 0:0 745 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_READS_DISABLE (0x00000000U) 746 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_READS_ENABLE (0x00000001U) 747 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_READS_ALLOW 1:1 748 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_READS_ALLOW_NO (0x00000000U) 749 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_READS_ALLOW_YES (0x00000001U) 750 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_WRITES 2:2 751 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_WRITES_DISABLE (0x00000000U) 752 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_WRITES_ENABLE (0x00000001U) 753 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_WRITES_ALLOW 3:3 754 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_WRITES_ALLOW_NO (0x00000000U) 755 #define NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_WRITES_ALLOW_YES (0x00000001U) 756 757 758 /* 759 * NV2080_CTRL_CMD_FB_SET_GPU_CACHE_ALLOC_POLICY_V2 760 * 761 * This command sets the state of the cache allocation policy on a specific 762 * engine, if supported. 763 * 764 * Possible status values returned are: 765 * NV_OK 766 * NV_ERR_NOT_SUPPORTED 767 * NV_ERR_INVALID_ARGUMENT 768 */ 769 #define NV2080_CTRL_CMD_FB_SET_GPU_CACHE_ALLOC_POLICY_V2 (0x20801318U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_SET_GPU_CACHE_ALLOC_POLICY_V2_PARAMS_MESSAGE_ID" */ 770 771 #define NV2080_CTRL_FB_SET_GPU_CACHE_ALLOC_POLICY_V2_PARAMS_MESSAGE_ID (0x18U) 772 773 typedef NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_PARAMS NV2080_CTRL_FB_SET_GPU_CACHE_ALLOC_POLICY_V2_PARAMS; 774 775 /* 776 * NV2080_CTRL_CMD_FB_GET_GPU_CACHE_ALLOC_POLICY (deprecated; use NV2080_CTRL_CMD_FB_GET_GPU_CACHE_ALLOC_POLICY_V2 instead) 777 * 778 * This command gets the state of the cache allocation policy on a specific 779 * engine, if supported. 780 * 781 * Possible status values returned are: 782 * NV_OK 783 * NV_ERR_NOT_SUPPORTED 784 * NV_ERR_INVALID_ARGUMENT 785 */ 786 #define NV2080_CTRL_CMD_FB_GET_GPU_CACHE_ALLOC_POLICY (0x20801312U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_GPU_CACHE_ALLOC_POLICY_PARAMS_MESSAGE_ID" */ 787 788 #define NV2080_CTRL_FB_GET_GPU_CACHE_ALLOC_POLICY_PARAMS_MESSAGE_ID (0x12U) 789 790 typedef NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_PARAMS NV2080_CTRL_FB_GET_GPU_CACHE_ALLOC_POLICY_PARAMS; 791 792 /* 793 * NV2080_CTRL_CMD_FB_GET_GPU_CACHE_ALLOC_POLICY_V2 794 * 795 * This command gets the state of the cache allocation policy on a specific 796 * engine, if supported. 797 * 798 * Possible status values returned are: 799 * NV_OK 800 * NV_ERR_NOT_SUPPORTED 801 * NV_ERR_INVALID_ARGUMENT 802 */ 803 #define NV2080_CTRL_CMD_FB_GET_GPU_CACHE_ALLOC_POLICY_V2 (0x20801319U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_GPU_CACHE_ALLOC_POLICY_V2_PARAMS_MESSAGE_ID" */ 804 805 #define NV2080_CTRL_FB_GET_GPU_CACHE_ALLOC_POLICY_V2_PARAMS_MESSAGE_ID (0x19U) 806 807 typedef NV2080_CTRL_FB_GPU_CACHE_ALLOC_POLICY_V2_PARAMS NV2080_CTRL_FB_GET_GPU_CACHE_ALLOC_POLICY_V2_PARAMS; 808 809 810 /* 811 * NV2080_CTRL_CMD_FB_IS_KIND 812 * 813 * This command is used to perform various operations like 'IS_KIND_VALID', 814 * 'IS_KIND_COMPRESSIBLE'on the kind passed by the caller. The operation to be 815 * performed should be passed in the 'operation' parameter of 816 * NV2080_CTRL_FB_IS_KIND_PARAMS, the kind on which the operation is to be 817 * performed should be passed in the 'kind' parameter. The result of the 818 * operation (true/false) will be returned in the 'result' parameter. 819 * 820 * operation 821 * Specifies what operation is to be performed on the kind passed by the 822 * caller. The supported operations are 823 * NV2080_CTRL_FB_IS_KIND_OPERATION_SUPPORTED 824 * This operation checks whether the kind passed in the 'kind' 825 * parameter of the 'NV2080_CTRL_FB_IS_KIND_PARAMS' structure is 826 * supported for this GPU. Returns nonzero value in 'result' parameter 827 * if the input kind is supported, else returns zero in the result. 828 * NV2080_CTRL_FB_IS_KIND_OPERATION_COMPRESSIBLE 829 * This operation checks whether the kind passed in the 'kind' 830 * parameter of the 'NV2080_CTRL_FB_IS_KIND_PARAMS' structure is 831 * compressible. Returns nonzero value in 'result' parameter if the 832 * input kind is compressible, else returns zero in the result. 833 * NV2080_CTRL_FB_IS_KIND_OPERATION_COMPRESSIBLE_1 834 * This operation checks whether the kind passed in the 'kind' 835 * parameter of the 'NV2080_CTRL_FB_IS_KIND_PARAMS' structure supports 836 * 1 bit compression. Returns nonzero value in 'result' parameter if 837 * kind supports 1 bit compression, else returns zero in the result. 838 * NV2080_CTRL_FB_IS_KIND_OPERATION_COMPRESSIBLE_2 839 * This operation checks whether the kind passed in the 'kind' 840 * parameter of the 'NV2080_CTRL_FB_IS_KIND_PARAMS' structure supports 841 * 2 bit compression. Returns nonzero value in 'result' parameter if 842 * kind supports 1 bit compression, else returns zero in the result. 843 * NV2080_CTRL_FB_IS_KIND_OPERATION_COMPRESSIBLE_4 844 * This operation checks whether the kind passed in the 'kind' 845 * parameter of the 'NV2080_CTRL_FB_IS_KIND_PARAMS' structure supports 846 * 4 bit compression. Returns nonzero value in 'result' parameter if 847 * kind supports 4 bit compression, else returns zero in the result. 848 * NV2080_CTRL_FB_IS_KIND_OPERATION_ZBC 849 * This operation checks whether the kind passed in the 'kind' 850 * parameter of the 'NV2080_CTRL_FB_IS_KIND_PARAMS' structure 851 * supports ZBC. Returns nonzero value in 'result' parameter if the 852 * input kind supports ZBC, else returns zero in the result. 853 * NV2080_CTRL_FB_IS_KIND_OPERATION_ZBC_ALLOWS_1 854 * This operation checks whether the kind passed in the 'kind' 855 * parameter of the 'NV2080_CTRL_FB_IS_KIND_PARAMS' structure 856 * supports 1 bit ZBC. Returns nonzero value in 'result' parameter if 857 * the input kind supports 1 bit ZBC, else returns zero in the result. 858 * NV2080_CTRL_FB_IS_KIND_OPERATION_ZBC_ALLOWS_2 859 * This operation checks whether the kind passed in the 'kind' 860 * parameter of the 'NV2080_CTRL_FB_IS_KIND_PARAMS' structure 861 * supports 2 bit ZBC. Returns nonzero value in 'result' parameter if 862 * the input kind supports 2 bit ZBC, else returns zero in the result. 863 * NV2080_CTRL_FB_IS_KIND_OPERATION_ZBC_ALLOWS_4 864 * This operation checks whether the kind passed in the 'kind' 865 * parameter of the 'NV2080_CTRL_FB_IS_KIND_PARAMS' structure 866 * supports 4 bit ZBC. Returns nonzero value in 'result' parameter if 867 * the input kind supports 4 bit ZBC, else returns zero in the result. 868 * kind 869 * Specifies the kind on which the operation is to be carried out. The 870 * legal range of values for the kind parameter is different on different 871 * GPUs. For e.g. on Fermi, valid range is 0x00 to 0xfe. Still, some values 872 * inside this legal range can be invalid i.e. not defined. 873 * So its always better to first check if a particular kind is supported on 874 * the current GPU with 'NV2080_CTRL_FB_IS_KIND_SUPPORTED' operation. 875 * result 876 * Upon return, this parameter will hold the result (true/false) of the 877 * operation performed on the kind. 878 * 879 * Possible status values returned are: 880 * NV_OK 881 * NV_ERR_INVALID_ARGUMENT 882 */ 883 #define NV2080_CTRL_CMD_FB_IS_KIND (0x20801313U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_IS_KIND_PARAMS_MESSAGE_ID" */ 884 885 #define NV2080_CTRL_FB_IS_KIND_PARAMS_MESSAGE_ID (0x13U) 886 887 typedef struct NV2080_CTRL_FB_IS_KIND_PARAMS { 888 NvU32 operation; 889 NvU32 kind; 890 NvBool result; 891 } NV2080_CTRL_FB_IS_KIND_PARAMS; 892 893 /* valid values for operation */ 894 #define NV2080_CTRL_FB_IS_KIND_OPERATION_SUPPORTED (0x00000000U) 895 #define NV2080_CTRL_FB_IS_KIND_OPERATION_COMPRESSIBLE (0x00000001U) 896 #define NV2080_CTRL_FB_IS_KIND_OPERATION_COMPRESSIBLE_1 (0x00000002U) 897 #define NV2080_CTRL_FB_IS_KIND_OPERATION_COMPRESSIBLE_2 (0x00000003U) 898 #define NV2080_CTRL_FB_IS_KIND_OPERATION_COMPRESSIBLE_4 (0x00000004U) 899 #define NV2080_CTRL_FB_IS_KIND_OPERATION_ZBC (0x00000005U) 900 #define NV2080_CTRL_FB_IS_KIND_OPERATION_ZBC_ALLOWS_1 (0x00000006U) 901 #define NV2080_CTRL_FB_IS_KIND_OPERATION_ZBC_ALLOWS_2 (0x00000007U) 902 #define NV2080_CTRL_FB_IS_KIND_OPERATION_ZBC_ALLOWS_4 (0x00000008U) 903 904 /** 905 * NV2080_CTRL_CMD_FB_GET_GPU_CACHE_INFO 906 * 907 * This command returns the state of a cache which all GPU memory accesess go 908 * through. 909 * 910 * powerState 911 * Returns the power state of the cache. Possible values are defined in 912 * NV2080_CTRL_FB_GET_GPU_CACHE_INFO_POWER_STATE. 913 * 914 * writeMode 915 * Returns the write mode of the cache. Possible values are defined in 916 * NV2080_CTRL_FB_GET_GPU_CACHE_INFO_WRITE_MODE. 917 * 918 * bypassMode 919 * Returns the bypass mode of the L2 cache. Possible values are defined in 920 * NV2080_CTRL_FB_GET_GPU_CACHE_INFO_BYPASS_MODE. 921 * 922 * rcmState 923 * Returns the RCM state of the cache. Possible values are defined in 924 * NV2080_CTRL_FB_GET_GPU_CACHE_INFO_RCM_STATE. 925 * 926 * 927 * Possible status values returned are: 928 * NV_OK 929 * NV_ERR_NOT_SUPPORTED 930 * NV_ERR_INVALID_STATE 931 * NV_ERR_INVALID_ARGUMENT 932 */ 933 934 #define NV2080_CTRL_CMD_FB_GET_GPU_CACHE_INFO (0x20801315U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_GPU_CACHE_INFO_PARAMS_MESSAGE_ID" */ 935 936 #define NV2080_CTRL_FB_GET_GPU_CACHE_INFO_PARAMS_MESSAGE_ID (0x15U) 937 938 typedef struct NV2080_CTRL_FB_GET_GPU_CACHE_INFO_PARAMS { 939 NvU32 powerState; 940 NvU32 writeMode; 941 NvU32 bypassMode; 942 NvU32 rcmState; 943 } NV2080_CTRL_FB_GET_GPU_CACHE_INFO_PARAMS; 944 945 /* valid values for powerState */ 946 #define NV2080_CTRL_FB_GET_GPU_CACHE_INFO_POWER_STATE_ENABLED (0x00000000U) 947 #define NV2080_CTRL_FB_GET_GPU_CACHE_INFO_POWER_STATE_DISABLED (0x00000001U) 948 /* valid values for writeMode */ 949 #define NV2080_CTRL_FB_GET_GPU_CACHE_INFO_WRITE_MODE_WRITETHROUGH (0x00000000U) 950 #define NV2080_CTRL_FB_GET_GPU_CACHE_INFO_WRITE_MODE_WRITEBACK (0x00000001U) 951 /* valid values for bypassMode */ 952 #define NV2080_CTRL_FB_GET_GPU_CACHE_INFO_BYPASS_MODE_DISABLED (0x00000000U) 953 #define NV2080_CTRL_FB_GET_GPU_CACHE_INFO_BYPASS_MODE_ENABLED (0x00000001U) 954 /* valid values for rcmState */ 955 #define NV2080_CTRL_FB_GET_GPU_CACHE_INFO_RCM_STATE_FULL (0x00000000U) 956 #define NV2080_CTRL_FB_GET_GPU_CACHE_INFO_RCM_STATE_TRANSITIONING (0x00000001U) 957 #define NV2080_CTRL_FB_GET_GPU_CACHE_INFO_RCM_STATE_REDUCED (0x00000002U) 958 #define NV2080_CTRL_FB_GET_GPU_CACHE_INFO_RCM_STATE_ZERO_CACHE (0x00000003U) 959 960 /* 961 * NV2080_CTRL_FB_GPU_CACHE_PROMOTION_POLICY 962 * 963 * These commands access the cache promotion policy on a specific 964 * engine, if supported by the hardware. 965 * 966 * Cache promotion refers to the GPU promoting a memory read to a larger 967 * size to preemptively fill the cache so future reads to nearby memory 968 * addresses will hit in the cache. 969 * 970 * engine 971 * Specifies the target engine. Possible values are defined in 972 * NV2080_ENGINE_TYPE. 973 * promotionPolicy 974 * Specifies the promotion policy of the cache on the specified 975 * engine. Possible values are defined by 976 * NV2080_CTRL_FB_GPU_CACHE_PROMOTION_POLICY_*. These values are in terms 977 * of the hardware cache line size. 978 * 979 */ 980 typedef struct NV2080_CTRL_FB_GPU_CACHE_PROMOTION_POLICY_PARAMS { 981 NvU32 engine; 982 NvU32 promotionPolicy; 983 } NV2080_CTRL_FB_GPU_CACHE_PROMOTION_POLICY_PARAMS; 984 985 /* valid values for promotionPolicy */ 986 #define NV2080_CTRL_FB_GPU_CACHE_PROMOTION_POLICY_NONE (0x00000000U) 987 #define NV2080_CTRL_FB_GPU_CACHE_PROMOTION_POLICY_QUARTER (0x00000001U) 988 #define NV2080_CTRL_FB_GPU_CACHE_PROMOTION_POLICY_HALF (0x00000002U) 989 #define NV2080_CTRL_FB_GPU_CACHE_PROMOTION_POLICY_FULL (0x00000003U) 990 991 992 /* 993 * NV2080_CTRL_CMD_FB_SET_GPU_CACHE_PROMOTION_POLICY 994 * 995 * This command sets the cache promotion policy on a specific engine, if 996 * supported by the hardware. 997 * 998 * Possible status values returned are: 999 * NV_OK 1000 * NV_ERR_NOT_SUPPORTED 1001 * NV_ERR_INVALID_ARGUMENT 1002 */ 1003 #define NV2080_CTRL_CMD_FB_SET_GPU_CACHE_PROMOTION_POLICY (0x20801316U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | 0x16" */ // Deprecated, removed form RM 1004 1005 1006 /* 1007 * NV2080_CTRL_CMD_FB_GET_GPU_CACHE_PROMOTION_POLICY 1008 * 1009 * This command gets the cache promotion policy on a specific engine, if 1010 * supported by the hardware. 1011 * 1012 * Possible status values returned are: 1013 * NV_OK 1014 * NV_ERR_NOT_SUPPORTED 1015 * NV_ERR_INVALID_ARGUMENT 1016 */ 1017 #define NV2080_CTRL_CMD_FB_GET_GPU_CACHE_PROMOTION_POLICY (0x20801317U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | 0x17" */ // Deprecated, removed form RM 1018 1019 /* 1020 * NV2080_CTRL_FB_CMD_GET_FB_REGION_INFO 1021 * 1022 * This command returns the FB memory region characteristics. 1023 * 1024 * numFBRegions 1025 * Number of valid regions returned in fbRegion[] 1026 * fbRegion[].base 1027 * Base address of region. The first valid address in the range 1028 * [base..limit]. 1029 * fbRegion[].limit 1030 * Last/end address of region. The last valid address in the range 1031 * [base..limit]. 1032 * (limit - base + 1) = size of the region 1033 * fbRegion[].reserved 1034 * Amount of memory that RM speculatively needs within the region. A 1035 * client doing its own memory management should leave at least this much 1036 * memory available for RM use. This particularly applies to a driver 1037 * model like LDDM. 1038 * fbRegion[].performance 1039 * Relative performance of this region compared to other regions. 1040 * The definition is vague, and only connotes relative bandwidth or 1041 * performance. The higher the value, the higher the performance. 1042 * fbRegion[].supportCompressed 1043 * TRUE if compressed surfaces/kinds are supported 1044 * FALSE if compressed surfaces/kinds are not allowed to be allocated in 1045 * this region 1046 * fbRegion[].supportISO 1047 * TRUE if ISO surfaces/kinds are supported (Display, cursor, video) 1048 * FALSE if ISO surfaces/kinds are not allowed to be allocated in this 1049 * region 1050 * fbRegion[].bProtected 1051 * TRUE if this region is a protected memory region. If true only 1052 * allocations marked as protected (NVOS32_ALLOC_FLAGS_PROTECTED) can be 1053 * allocated in this region. 1054 * fbRegion[].blackList[] - DEPRECATED: Use supportISO 1055 * TRUE for each NVOS32_TYPE_IMAGE* that is NOT allowed in this region. 1056 * 1057 * Possible status values returned are: 1058 * NV_OK 1059 * NV_ERR_NOT_SUPPORTED 1060 */ 1061 #define NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO (0x20801320U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO_PARAMS_MESSAGE_ID" */ 1062 1063 #define NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO_MEM_TYPES 17U 1064 1065 typedef NvBool NV2080_CTRL_CMD_FB_GET_FB_REGION_SURFACE_MEM_TYPE_FLAG[NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO_MEM_TYPES]; 1066 1067 typedef struct NV2080_CTRL_CMD_FB_GET_FB_REGION_FB_REGION_INFO { 1068 NV_DECLARE_ALIGNED(NvU64 base, 8); 1069 NV_DECLARE_ALIGNED(NvU64 limit, 8); 1070 NV_DECLARE_ALIGNED(NvU64 reserved, 8); 1071 NvU32 performance; 1072 NvBool supportCompressed; 1073 NvBool supportISO; 1074 NvBool bProtected; 1075 NV2080_CTRL_CMD_FB_GET_FB_REGION_SURFACE_MEM_TYPE_FLAG blackList; 1076 } NV2080_CTRL_CMD_FB_GET_FB_REGION_FB_REGION_INFO; 1077 1078 #define NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO_MAX_ENTRIES 16U 1079 1080 #define NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO_PARAMS_MESSAGE_ID (0x20U) 1081 1082 typedef struct NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO_PARAMS { 1083 NvU32 numFBRegions; 1084 NV_DECLARE_ALIGNED(NV2080_CTRL_CMD_FB_GET_FB_REGION_FB_REGION_INFO fbRegion[NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO_MAX_ENTRIES], 8); 1085 } NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO_PARAMS; 1086 1087 /* 1088 * NV2080_CTRL_CMD_FB_OFFLINE_PAGES 1089 * 1090 * This command adds video memory page addresses to the list of offlined 1091 * addresses so that they're not allocated to any client. The newly offlined 1092 * addresses take effect after a reboot. 1093 * 1094 * offlined 1095 * This input parameter is an array of NV2080_CTRL_FB_OFFLINED_ADDRESS_INFO 1096 * structures, containing the video memory physical page numbers that 1097 * are to be blacklisted. This array can hold a maximum of NV2080_CTRL_FB_ 1098 * BLACKLIST_PAGES_MAX_PAGES address pairs. Valid entries are adjacent. 1099 * pageSize 1100 * This input parameter contains the size of the page that is to be 1101 * blacklisted. 1102 * validEntries 1103 * This input parameter specifies the number of valid entries in the 1104 * offlined array. 1105 * numPagesAdded 1106 * This output parameter specifies how many of the validEntries were 1107 * actually offlined. If numPagesAdded < validEntries, it 1108 * means that only addresses from offlined[0] to offlined[numPagesAdded - 1] 1109 * were added to the list of offlined addresses. 1110 * 1111 * Possible status values returned are: 1112 * NV_OK 1113 * NV_ERR_NOT_SUPPORTED 1114 * NV_ERR_INVALID_ARGUMENT 1115 */ 1116 #define NV2080_CTRL_CMD_FB_OFFLINE_PAGES (0x20801321U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_OFFLINE_PAGES_PARAMS_MESSAGE_ID" */ 1117 1118 #define NV2080_CTRL_FB_OFFLINED_PAGES_MAX_PAGES (0x00000040U) 1119 #define NV2080_CTRL_FB_OFFLINED_PAGES_INVALID_ADDRESS (0xffffffffffffffffULL) 1120 #define NV2080_CTRL_FB_OFFLINED_PAGES_PAGE_SIZE_4K (0x00000000U) 1121 #define NV2080_CTRL_FB_OFFLINED_PAGES_PAGE_SIZE_64K (0x00000001U) 1122 #define NV2080_CTRL_FB_OFFLINED_PAGES_PAGE_SIZE_128K (0x00000002U) 1123 1124 /* 1125 * NV2080_CTRL_FB_OFFLINED_ADDRESS_INFO 1126 * 1127 * pageAddressWithEccOn 1128 * Address of the memory page retired when ECC is enabled on the board. 1129 * pageAddressWithEccOff 1130 * Address of the memory page retired when ECC is disabled on the board. 1131 * rbcAddress 1132 * Row/Bank/Column Address of the faulty memory which caused the page to 1133 * be retired 1134 * source 1135 * The reason for the page to be retired 1136 * status 1137 * Non-exceptional reasons for a page retirement failure 1138 * NV2080_CTRL_FB_OFFLINED_PAGES_STATUS_OK 1139 * No error 1140 * NV2080_CTRL_FB_OFFLINED_PAGES_STATUS_PENDING_RETIREMENT 1141 * The given address is already pending retirement or has 1142 * been retired during the current driver run. The page 1143 * will be offlined during the next driver run. 1144 * NV2080_CTRL_FB_OFFLINED_PAGES_STATUS_BLACKLISTING_FAILED 1145 * The given page was retired on a previous driver run, 1146 * so it should not be accessible unless offlining failed. 1147 * Failing to offline a page is strongly indicative of a 1148 * driver offlining bug. 1149 * NV2080_CTRL_FB_OFFLINED_PAGES_STATUS_TABLE_FULL 1150 * The PBL is full and no more pages can be retired 1151 * NV2080_CTRL_FB_OFFLINED_PAGES_STATUS_INTERNAL_ERROR 1152 * Internal driver error 1153 * 1154 */ 1155 1156 1157 1158 typedef struct NV2080_CTRL_FB_OFFLINED_ADDRESS_INFO { 1159 NV_DECLARE_ALIGNED(NvU64 pageAddressWithEccOn, 8); 1160 NV_DECLARE_ALIGNED(NvU64 pageAddressWithEccOff, 8); 1161 NvU32 rbcAddress; 1162 NvU32 source; 1163 NvU32 status; 1164 NvU32 timestamp; 1165 } NV2080_CTRL_FB_OFFLINED_ADDRESS_INFO; 1166 1167 /* valid values for source */ 1168 #define NV2080_CTRL_FB_OFFLINED_PAGES_SOURCE_DPR_MULTIPLE_SBE (0x00000002U) 1169 #define NV2080_CTRL_FB_OFFLINED_PAGES_SOURCE_DPR_DBE (0x00000004U) 1170 1171 1172 1173 /* valid values for status */ 1174 #define NV2080_CTRL_FB_OFFLINED_PAGES_STATUS_OK (0x00000000U) 1175 #define NV2080_CTRL_FB_OFFLINED_PAGES_STATUS_PENDING_RETIREMENT (0x00000001U) 1176 #define NV2080_CTRL_FB_OFFLINED_PAGES_STATUS_BLACKLISTING_FAILED (0x00000002U) 1177 #define NV2080_CTRL_FB_OFFLINED_PAGES_STATUS_TABLE_FULL (0x00000003U) 1178 #define NV2080_CTRL_FB_OFFLINED_PAGES_STATUS_INTERNAL_ERROR (0x00000004U) 1179 1180 /* deprecated */ 1181 #define NV2080_CTRL_FB_OFFLINED_PAGES_SOURCE_MULTIPLE_SBE NV2080_CTRL_FB_OFFLINED_PAGES_SOURCE_DPR_MULTIPLE_SBE 1182 #define NV2080_CTRL_FB_OFFLINED_PAGES_SOURCE_DBE NV2080_CTRL_FB_OFFLINED_PAGES_SOURCE_DPR_DBE 1183 1184 1185 #define NV2080_CTRL_FB_OFFLINE_PAGES_PARAMS_MESSAGE_ID (0x21U) 1186 1187 typedef struct NV2080_CTRL_FB_OFFLINE_PAGES_PARAMS { 1188 NV_DECLARE_ALIGNED(NV2080_CTRL_FB_OFFLINED_ADDRESS_INFO offlined[NV2080_CTRL_FB_OFFLINED_PAGES_MAX_PAGES], 8); 1189 NvU32 pageSize; 1190 NvU32 validEntries; 1191 NvU32 numPagesAdded; 1192 } NV2080_CTRL_FB_OFFLINE_PAGES_PARAMS; 1193 1194 /* 1195 * NV2080_CTRL_CMD_FB_GET_OFFLINED_PAGES 1196 * 1197 * This command returns the list of video memory page addresses in the 1198 * Inforom's blacklist. 1199 * 1200 * offlined 1201 * This output parameter is an array of NV2080_CTRL_FB_BLACKLIST_ADDRESS_ 1202 * INFO structures, containing the video memory physical page numbers that 1203 * are blacklisted. This array can hold a maximum of NV2080_CTRL_FB_ 1204 * BLACKLIST_PAGES_MAX_PAGES address pairs. Valid entries are adjacent. 1205 * The array also contains the Row/Bank/Column Address and source. 1206 * validEntries 1207 * This output parameter specifies the number of valid entries in the 1208 * offlined array. 1209 * bRetirementPending (DEPRECATED, use retirementPending instead) 1210 * This output parameter returns if any pages on the list are pending 1211 * retirement. 1212 * retirementPending 1213 * Communicates to the caller whether retirement updates are pending and the 1214 * reason for the updates. Possible fields are: 1215 * NV2080_CTRL_FB_GET_OFFLINED_PAGES_RETIREMENT_PENDING_*: 1216 * NV2080_CTRL_FB_GET_OFFLINED_PAGES_RETIREMENT_PENDING_SBE: 1217 * Indicates whether pages are pending retirement due to SBE. 1218 * NV2080_CTRL_FB_GET_OFFLINED_PAGES_RETIREMENT_PENDING_DBE: 1219 * Indicates whether pages are pending retirement due to DBE. Driver 1220 * reload needed to retire bad memory pages and allow compute app runs. 1221 * 1222 * Possible status values returned are: 1223 * NV_OK 1224 * NV_ERR_NOT_SUPPORTED 1225 */ 1226 1227 1228 1229 #define NV2080_CTRL_CMD_FB_GET_OFFLINED_PAGES (0x20801322U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_OFFLINED_PAGES_PARAMS_MESSAGE_ID" */ 1230 1231 #define NV2080_CTRL_FB_GET_OFFLINED_PAGES_RETIREMENT_PENDING_SBE 0:0 1232 #define NV2080_CTRL_FB_GET_OFFLINED_PAGES_RETIREMENT_PENDING_SBE_FALSE 0U 1233 #define NV2080_CTRL_FB_GET_OFFLINED_PAGES_RETIREMENT_PENDING_SBE_TRUE 1U 1234 #define NV2080_CTRL_FB_GET_OFFLINED_PAGES_RETIREMENT_PENDING_DBE 1:1 1235 #define NV2080_CTRL_FB_GET_OFFLINED_PAGES_RETIREMENT_PENDING_DBE_FALSE 0U 1236 #define NV2080_CTRL_FB_GET_OFFLINED_PAGES_RETIREMENT_PENDING_DBE_TRUE 1U 1237 1238 1239 1240 #define NV2080_CTRL_FB_GET_OFFLINED_PAGES_PARAMS_MESSAGE_ID (0x22U) 1241 1242 typedef struct NV2080_CTRL_FB_GET_OFFLINED_PAGES_PARAMS { 1243 NV_DECLARE_ALIGNED(NV2080_CTRL_FB_OFFLINED_ADDRESS_INFO offlined[NV2080_CTRL_FB_OFFLINED_PAGES_MAX_PAGES], 8); 1244 NvU32 validEntries; 1245 NvBool bRetirementPending; 1246 NvU8 retirementPending; 1247 } NV2080_CTRL_FB_GET_OFFLINED_PAGES_PARAMS; 1248 1249 /* 1250 * NV2080_CTRL_CMD_FB_QUERY_ACR_REGION 1251 * 1252 * This control command is used to query the secured region allocated 1253 * 1254 * queryType 1255 * NV2080_CTRL_CMD_FB_ACR_QUERY_GET_REGION_STATUS: Provides the alloc 1256 * status and ACR region ID. 1257 * NV2080_CTRL_CMD_FB_QUERY_MAP_REGION : Maps the region on BAR1 1258 * it returns the "pCpuAddr" and pPriv to user. 1259 * NV2080_CTRL_CMD_FB_QUERY_UNMAP_REGION: Unmaps the mapped region. 1260 * it takes the pPriv as input 1261 * 1262 * clientReq : struct ACR_REQUEST_PARAMS 1263 * It is used to find the allocated ACR region for that client 1264 * clientId : ACR Client ID 1265 * reqReadMask : read mask of ACR region 1266 * reqWriteMask : Write mask of ACR region 1267 * regionSize : ACR region Size 1268 * 1269 * clientReqStatus : struct ACR_STATUS_PARAMS 1270 * This struct is stores the output of requested ACR region. 1271 * allocStatus : Allocated Status of ACR region 1272 * regionId : ACR region ID 1273 * physicalAddress : Physical address on FB 1274 * 1275 * 1276 * NV2080_CTRL_CMD_FB_ACR_QUERY_ERROR_CODE 1277 * NV2080_CTRL_CMD_FB_ACR_QUERY_ERROR_NONE : Control command executed successfully 1278 * NV2080_CTRL_CMD_FB_ACR_QUERY_ERROR_INVALID_CLIENT_REQUEST : Please check the parameter 1279 * for ACR client request 1280 * NV2080_CTRL_CMD_FB_ACR_QUERY_ERROR_FAILED_TO_MAP_ON_BAR1 : RM Fails to map ACR region 1281 * on BAR1 1282 * 1283 * Possible status values returned are: 1284 * NV_OK 1285 * NV_ERR_NOT_SUPPORTED 1286 */ 1287 #define NV2080_CTRL_CMD_FB_QUERY_ACR_REGION (0x20801325U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_CMD_FB_QUERY_ACR_REGION_PARAMS_MESSAGE_ID" */ 1288 1289 // 1290 // We can create an ACR region by using RMCreateAcrRegion[1|2] regkey or mods -acr[1|2]_size 1291 // Client ID for such region is 2 in RM. 1292 // 1293 #define NV2080_CTRL_CMD_FB_ACR_CLIENT_ID 2U 1294 1295 typedef enum NV2080_CTRL_CMD_FB_ACR_QUERY_TYPE { 1296 NV2080_CTRL_CMD_FB_ACR_QUERY_GET_CLIENT_REGION_STATUS = 0, 1297 NV2080_CTRL_CMD_FB_ACR_QUERY_GET_REGION_PROPERTY = 1, 1298 NV2080_CTRL_CMD_FB_ACR_QUERY_GET_FALCON_STATUS = 2, 1299 } NV2080_CTRL_CMD_FB_ACR_QUERY_TYPE; 1300 1301 typedef enum NV2080_CTRL_CMD_FB_ACR_QUERY_ERROR_CODE { 1302 NV2080_CTRL_CMD_FB_ACR_QUERY_ERROR_NONE = 0, 1303 NV2080_CTRL_CMD_FB_ACR_QUERY_ERROR_INVALID_CLIENT_REQUEST = 1, 1304 } NV2080_CTRL_CMD_FB_ACR_QUERY_ERROR_CODE; 1305 1306 typedef struct ACR_REQUEST_PARAMS { 1307 NvU32 clientId; 1308 NvU32 reqReadMask; 1309 NvU32 reqWriteMask; 1310 NvU32 regionSize; 1311 } ACR_REQUEST_PARAMS; 1312 1313 typedef struct ACR_REGION_ID_PROP { 1314 NvU32 regionId; 1315 NvU32 readMask; 1316 NvU32 writeMask; 1317 NvU32 regionSize; 1318 NvU32 clientMask; 1319 NV_DECLARE_ALIGNED(NvU64 physicalAddress, 8); 1320 } ACR_REGION_ID_PROP; 1321 1322 typedef struct ACR_STATUS_PARAMS { 1323 NvU32 allocStatus; 1324 NvU32 regionId; 1325 NV_DECLARE_ALIGNED(NvU64 physicalAddress, 8); 1326 } ACR_STATUS_PARAMS; 1327 1328 typedef struct ACR_REGION_HANDLE { 1329 NvHandle hClient; 1330 NvHandle hParent; 1331 NvHandle hMemory; 1332 NvU32 hClass; 1333 NvHandle hDevice; 1334 } ACR_REGION_HANDLE; 1335 1336 typedef struct ACR_FALCON_LS_STATUS { 1337 NvU16 falconId; 1338 NvBool bIsInLs; 1339 } ACR_FALCON_LS_STATUS; 1340 1341 #define NV2080_CTRL_CMD_FB_QUERY_ACR_REGION_PARAMS_MESSAGE_ID (0x25U) 1342 1343 typedef struct NV2080_CTRL_CMD_FB_QUERY_ACR_REGION_PARAMS { 1344 NV2080_CTRL_CMD_FB_ACR_QUERY_TYPE queryType; 1345 NV2080_CTRL_CMD_FB_ACR_QUERY_ERROR_CODE errorCode; 1346 NV_DECLARE_ALIGNED(ACR_REGION_ID_PROP acrRegionIdProp, 8); 1347 ACR_REQUEST_PARAMS clientReq; 1348 NV_DECLARE_ALIGNED(ACR_STATUS_PARAMS clientReqStatus, 8); 1349 ACR_REGION_HANDLE handle; 1350 ACR_FALCON_LS_STATUS falconStatus; 1351 } NV2080_CTRL_CMD_FB_QUERY_ACR_REGION_PARAMS; 1352 1353 /* 1354 * NV2080_CTRL_CMD_FB_CLEAR_OFFLINED_PAGES 1355 * 1356 * This command clears offlined video memory page addresses from the Inforom. 1357 * 1358 * sourceMask 1359 * This is a bit mask of NV2080_CTRL_FB_OFFLINED_PAGES_SOURCE. Pages 1360 * offlined from the specified sources will be cleared/removed from the 1361 * Inforom PBL object denylist. 1362 * 1363 * Possible status values returned are: 1364 * NV_OK 1365 * NV_ERR_NOT_SUPPORTED 1366 */ 1367 #define NV2080_CTRL_CMD_FB_CLEAR_OFFLINED_PAGES (0x20801326U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_CLEAR_OFFLINED_PAGES_PARAMS_MESSAGE_ID" */ 1368 1369 #define NV2080_CTRL_FB_CLEAR_OFFLINED_PAGES_PARAMS_MESSAGE_ID (0x26U) 1370 1371 typedef struct NV2080_CTRL_FB_CLEAR_OFFLINED_PAGES_PARAMS { 1372 NvU32 sourceMask; 1373 } NV2080_CTRL_FB_CLEAR_OFFLINED_PAGES_PARAMS; 1374 1375 /*! 1376 * NV2080_CTRL_CMD_FB_GET_COMPBITCOPY_INFO 1377 * 1378 * Gets pointer to then object of class CompBitCopy, which is used for swizzling 1379 * compression bits in the compression backing store. The caller is expected to 1380 * have the appropriate headers for class CompBitCopy. Also retrieves values of some 1381 * parameters needed to call the compbit swizzling method. 1382 * 1383 * @params[out] void *pCompBitCopyObj 1384 * Opaque pointer to object of class CompBitCopy 1385 * @params[out] void *pSwizzleParams 1386 * Opaque pointer to values needed to call the compbit 1387 * swizzle method. 1388 * 1389 * Possible status values returned are: 1390 * NV_OK NV_ERR_NOT_SUPPORTED 1391 */ 1392 #define NV2080_CTRL_CMD_FB_GET_COMPBITCOPY_INFO (0x20801327U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_CMD_FB_GET_COMPBITCOPY_INFO_PARAMS_MESSAGE_ID" */ 1393 1394 #define NV2080_CTRL_CMD_FB_GET_COMPBITCOPY_INFO_PARAMS_MESSAGE_ID (0x27U) 1395 1396 typedef struct NV2080_CTRL_CMD_FB_GET_COMPBITCOPY_INFO_PARAMS { 1397 NV_DECLARE_ALIGNED(NvP64 pCompBitCopyObj, 8); 1398 NV_DECLARE_ALIGNED(NvP64 pSwizzleParams, 8); 1399 } NV2080_CTRL_CMD_FB_GET_COMPBITCOPY_INFO_PARAMS; 1400 1401 /* 1402 * NV2080_CTRL_CMD_FB_GET_LTC_INFO_FOR_FBP 1403 * 1404 * Gets the count and mask of LTCs for a given FBP. 1405 * 1406 * fbpIndex 1407 * The physical index of the FBP to get LTC info for. 1408 * ltcMask 1409 * The mask of active LTCs for the given FBP. 1410 * ltcCount 1411 * The count of active LTCs for the given FBP. 1412 * ltsMask 1413 * The mask of active LTSs for the given FBP 1414 * ltsCount 1415 * The count of active LTSs for the given FBP 1416 * 1417 * Possible status values returned are: 1418 * NV_OK 1419 * NV_ERR_NOT_SUPPORTED 1420 */ 1421 #define NV2080_CTRL_CMD_FB_GET_LTC_INFO_FOR_FBP (0x20801328U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_LTC_INFO_FOR_FBP_PARAMS_MESSAGE_ID" */ 1422 1423 #define NV2080_CTRL_FB_GET_LTC_INFO_FOR_FBP_PARAMS_MESSAGE_ID (0x28U) 1424 1425 typedef struct NV2080_CTRL_FB_GET_LTC_INFO_FOR_FBP_PARAMS { 1426 NvU8 fbpIndex; 1427 NvU32 ltcMask; 1428 NvU32 ltcCount; 1429 NvU32 ltsMask; 1430 NvU32 ltsCount; 1431 } NV2080_CTRL_FB_GET_LTC_INFO_FOR_FBP_PARAMS; 1432 1433 1434 /*! 1435 * NV2080_CTRL_CMD_FB_COMPBITCOPY_SET_CONTEXT < Deprecated > 1436 * 1437 * "set the context" for following CompBitCopy member functions. 1438 * These are the CompBitCopy member variables that remain connstant 1439 * over multiple CompBitCopy member function calls, yet stay the same 1440 * throughout a single surface eviction. 1441 * 1442 * @params[in] UINT64 backingStorePA; 1443 * Physical Address of the Backing Store 1444 * @params[in] UINT08 *backingStoreVA; 1445 * Virtual Address of the Backing Store 1446 * @params[in] UINT64 backingStoreChunkPA; 1447 * Physical Address of the "Chunk Buffer" 1448 * @params[in] UINT08 *backingStoreChunkVA; 1449 * Virtual Address of the "Chunk Buffer" 1450 * @params[in] UINT32 backingStoreChunkSize; 1451 * Size of the "Chunk Buffer" 1452 * @params[in] UINT08 *cacheWriteBitMap; 1453 * Pointer to the bitmap which parts of the 1454 * "Chunk" was updated. 1455 * @params[in] bool backingStoreChunkOverfetch; 1456 * Overfetch factor. 1457 * @params[in] UINT32 PageSizeSrc; 1458 * Page size of Source Surface. 1459 * @params[in] UINT32 PageSizeDest; 1460 * page size of Destination Surface. 1461 * 1462 * Possible status values returned are: 1463 * NV_OK 1464 * NV_ERR_NOT_SUPPORTED 1465 */ 1466 #define NV2080_CTRL_CMD_FB_COMPBITCOPY_SET_CONTEXT (0x20801329U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | 0x29" */ 1467 1468 typedef struct NV2080_CTRL_CMD_FB_COMPBITCOPY_SET_CONTEXT_PARAMS { 1469 NvU32 CBCBaseAddress; 1470 NV_DECLARE_ALIGNED(NvU64 backingStorePA, 8); 1471 NV_DECLARE_ALIGNED(NvU8 *backingStoreVA, 8); 1472 NV_DECLARE_ALIGNED(NvU64 backingStoreChunkPA, 8); 1473 NV_DECLARE_ALIGNED(NvU8 *backingStoreChunkVA, 8); 1474 NvU32 backingStoreChunkSize; 1475 NV_DECLARE_ALIGNED(NvU8 *cacheWriteBitMap, 8); 1476 NvBool backingStoreChunkOverfetch; 1477 NvU32 PageSizeSrc; 1478 NvU32 PageSizeDest; 1479 } NV2080_CTRL_CMD_FB_COMPBITCOPY_SET_CONTEXT_PARAMS; 1480 1481 /*! 1482 * NV2080_CTRL_CMD_FB_COMPBITCOPY_GET_COMPBITS < Deprecated > 1483 * 1484 * Retrieves the Compression and Fast Clear bits for the surface+offset given. 1485 * 1486 * @params[out] NvU32 *fcbits; 1487 * Fast Clear Bits returned 1488 * @params[out] NvU32 *compbits; 1489 * Compression Bits returned 1490 * @params[in] NvU64 dataPhysicalStart; 1491 * Start Address of Data 1492 * @params[in] NvU64 surfaceOffset; 1493 * Offset in the surface 1494 * @params[in] NvU32 comptagLine; 1495 * Compression Tag Number 1496 * @params[in] NvBool upper64KBCompbitSel; 1497 * Selects Upper or Lower 64K 1498 * 1499 * Possible status values returned are: 1500 * NV_OK 1501 * NV_ERR_NOT_SUPPORTEDD 1502 */ 1503 #define NV2080_CTRL_CMD_FB_COMPBITCOPY_GET_COMPBITS (0x2080132aU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | 0x2A" */ 1504 1505 typedef struct NV2080_CTRL_CMD_FB_COMPBITCOPY_GET_COMPBITS_PARAMS { 1506 NV_DECLARE_ALIGNED(NvU32 *fcbits, 8); 1507 NV_DECLARE_ALIGNED(NvU32 *compbits, 8); 1508 NV_DECLARE_ALIGNED(NvU64 dataPhysicalStart, 8); 1509 NV_DECLARE_ALIGNED(NvU64 surfaceOffset, 8); 1510 NvU32 comptagLine; 1511 NvBool upper64KBCompbitSel; 1512 } NV2080_CTRL_CMD_FB_COMPBITCOPY_GET_COMPBITS_PARAMS; 1513 1514 /*! 1515 * NV2080_CTRL_CMD_FB_COMPBITCOPY_PUT_COMPBITS < Deprecated > 1516 * 1517 * Sets the Compression and Fast Clear bits for the surface+offset given. 1518 * 1519 * @params[in] NvU32 fcbits; 1520 * Fast Clear Bits to write. 1521 * @params[in] NvU32 compbits; 1522 * Compression Bits to write 1523 * @params[in] NvBool writeFc; 1524 * Indicates if Fast Clear Bits should be written 1525 * @params[in] NvU64 dataPhysicalStart; 1526 * Start Address of Data 1527 * @params[in] NvU64 surfaceOffset; 1528 * Offset in the surface 1529 * @params[in] NvU32 comptagLine; 1530 * Compression Tag Number 1531 * @params[in] NvBool upper64KBCompbitSel; 1532 * Selects Upper or Lower 64K 1533 * 1534 * Possible status values returned are: 1535 * NV_OK 1536 * NV_ERR_NOT_SUPPORTED 1537 */ 1538 #define NV2080_CTRL_CMD_FB_COMPBITCOPY_PUT_COMPBITS (0x2080132bU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | 0x2B" */ 1539 1540 typedef struct NV2080_CTRL_CMD_FB_COMPBITCOPY_PUT_COMPBITS_PARAMS { 1541 NvU32 fcbits; 1542 NvU32 compbits; 1543 NvBool writeFc; 1544 NV_DECLARE_ALIGNED(NvU64 dataPhysicalStart, 8); 1545 NV_DECLARE_ALIGNED(NvU64 surfaceOffset, 8); 1546 NvU32 comptagLine; 1547 NvBool upper64KBCompbitSel; 1548 } NV2080_CTRL_CMD_FB_COMPBITCOPY_PUT_COMPBITS_PARAMS; 1549 1550 /*! 1551 * NV2080_CTRL_CMD_FB_COMPBITCOPY_READ_COMPBITS64KB < Deprecated > 1552 * 1553 * Read 64KB chunk of CompBits 1554 * 1555 * @params[in] NvU64 SrcDataPhysicalStart; 1556 * Start Address of Data 1557 * @params[in] NvU32 SrcComptagLine; 1558 * Compression Tag Number 1559 * @params[in] NvU32 page64KB; 1560 * Which 64K block to read from. 1561 * @params[out] NvU32 *compbitBuffer; 1562 * Buffer for CompBits read, 1563 * @params[in] NvBool upper64KBCompbitSel; 1564 * Selects Upper or Lower 64K 1565 * 1566 * Possible status values returned are: 1567 * NV_OK 1568 * NV_ERR_NOT_SUPPORTED 1569 */ 1570 #define NV2080_CTRL_CMD_FB_COMPBITCOPY_READ_COMPBITS64KB (0x2080132cU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | 0x2C" */ 1571 1572 typedef struct NV2080_CTRL_CMD_FB_COMPBITCOPY_READ_COMPBITS64KB_PARAMS { 1573 NV_DECLARE_ALIGNED(NvU64 SrcDataPhysicalStart, 8); 1574 NvU32 SrcComptagLine; 1575 NvU32 page64KB; 1576 NV_DECLARE_ALIGNED(NvU32 *compbitBuffer, 8); 1577 NvBool upper64KBCompbitSel; 1578 } NV2080_CTRL_CMD_FB_COMPBITCOPY_READ_COMPBITS64KB_PARAMS; 1579 1580 /*! 1581 * NV2080_CTRL_CMD_FB_COMPBITCOPY_WRITE_COMPBITS64KB < Deprecated > 1582 * 1583 * Write 64K chunk of COmpBits. 1584 * 1585 * @params[in] NvU64 SrcDataPhysicalStart; 1586 * Start Address of Data 1587 * @params[in] NvU32 SrcComptagLine; 1588 * Compression Tag Number 1589 * @params[in] NvU32 page64KB; 1590 * Which 64K block to read from. 1591 * @params[in] NvU32 *compbitBuffer; 1592 * Buffer for CompBits to write. 1593 * @params[in] NvBool upper64KBCompbitSel 1594 * Selects Upper or Lower 64K 1595 * 1596 * Possible status values returned are: 1597 * NV_OK 1598 * NV_ERR_NOT_SUPPORTED 1599 */ 1600 #define NV2080_CTRL_CMD_FB_COMPBITCOPY_WRITE_COMPBITS64KB (0x2080132dU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | 0x2D" */ 1601 1602 typedef struct NV2080_CTRL_CMD_FB_COMPBITCOPY_WRITE_COMPBITS64KB_PARAMS { 1603 NV_DECLARE_ALIGNED(NvU64 DstDataPhysicalStart, 8); 1604 NvU32 DstComptagLine; 1605 NvU32 page64KB; 1606 NV_DECLARE_ALIGNED(NvU32 *compbitBuffer, 8); 1607 NvBool upper64KBCompbitSel; 1608 } NV2080_CTRL_CMD_FB_COMPBITCOPY_WRITE_COMPBITS64KB_PARAMS; 1609 1610 /*! 1611 * NV2080_CTRL_CMD_FB_COMPBITCOPY_SET_FORCE_BAR1 < Deprecated > 1612 * 1613 * Used by MODS (and possibly other clients) to have compbit code write 1614 * write directly to BAR1, rather than a intermediate buffer. 1615 * 1616 * @params[in] NvBool bForceBar1; 1617 * Enables or disables direct writes to BAR1. 1618 * 1619 * Possible status values returned are: 1620 * NV_OK 1621 * NV_ERR_NOT_SUPPORTED 1622 */ 1623 #define NV2080_CTRL_CMD_FB_COMPBITCOPY_SET_FORCE_BAR1 (0x20801335U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | 0x35" */ 1624 1625 typedef struct NV2080_CTRL_CMD_FB_COMPBITCOPY_SET_FORCE_BAR1_PARAMS { 1626 NvBool bForceBar1; 1627 } NV2080_CTRL_CMD_FB_COMPBITCOPY_SET_FORCE_BAR1_PARAMS; 1628 1629 /*! 1630 * NV2080_CTRL_CMD_FB_GET_AMAP_CONF 1631 * 1632 * Fills in fields of a structure of class ConfParamsV1, which is used for 1633 * swizzling compression bits in the compression backing store. 1634 * The caller is expected to have the appropriate headers for class ConfParamsV1. 1635 * 1636 * @params[in|out] void *pAmapConfParms 1637 * Opaque pointer to structure of values for ConfParamsV1 1638 * @params[in|out] void *pCbcSwizzleParms 1639 * Opaque pointer to structure of values for CbcSwizzleParamsV1 1640 * 1641 * Possible status values returned are: 1642 * NV_OK NV_ERR_NOT_SUPPORTED 1643 * 1644 * pCbcSwizzleParams will be filled in with certain parameters from 1645 * @CbcSwizzleParamsV1. However, the caller is responsible for making sure 1646 * all parameters are filled in before using it. 1647 */ 1648 #define NV2080_CTRL_CMD_FB_GET_AMAP_CONF (0x20801336U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_CMD_FB_GET_AMAP_CONF_PARAMS_MESSAGE_ID" */ 1649 1650 #define NV2080_CTRL_CMD_FB_GET_AMAP_CONF_PARAMS_MESSAGE_ID (0x36U) 1651 1652 typedef struct NV2080_CTRL_CMD_FB_GET_AMAP_CONF_PARAMS { 1653 NV_DECLARE_ALIGNED(NvP64 pAmapConfParams, 8); 1654 NV_DECLARE_ALIGNED(NvP64 pCbcSwizzleParams, 8); 1655 } NV2080_CTRL_CMD_FB_GET_AMAP_CONF_PARAMS; 1656 1657 /*! 1658 * NV2080_CTRL_CMD_FB_CBC_OP 1659 * 1660 * Provides a way for clients to request a CBC Operation 1661 * 1662 * @params[in] CTRL_CMD_FB_CBC_OP fbCBCOp 1663 * CBC Operation requested. 1664 * Valid Values: 1665 * CTRL_CMD_FB_CBC_OP_CLEAN 1666 * CTRL_CMD_FB_CBC_OP_INVALIDATE 1667 * 1668 * Possible status values returned are: 1669 * NV_OK NV_ERR_NOT_SUPPORTED NV_ERR_INVALID_ARGUMENT NV_ERR_TIMEOUT 1670 */ 1671 #define NV2080_CTRL_CMD_FB_CBC_OP (0x20801337U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_CMD_FB_CBC_OP_PARAMS_MESSAGE_ID" */ 1672 1673 /*! 1674 * Permitted CBC Operations 1675 */ 1676 typedef enum CTRL_CMD_FB_CBC_OP { 1677 CTRL_CMD_FB_CBC_OP_CLEAN = 0, 1678 CTRL_CMD_FB_CBC_OP_INVALIDATE = 1, 1679 } CTRL_CMD_FB_CBC_OP; 1680 1681 #define NV2080_CTRL_CMD_FB_CBC_OP_PARAMS_MESSAGE_ID (0x37U) 1682 1683 typedef struct NV2080_CTRL_CMD_FB_CBC_OP_PARAMS { 1684 CTRL_CMD_FB_CBC_OP fbCBCOp; 1685 } NV2080_CTRL_CMD_FB_CBC_OP_PARAMS; 1686 1687 /*! 1688 * NV2080_CTRL_CMD_FB_GET_CTAGS_FOR_CBC_EVICTION 1689 * 1690 * The call will fetch the compression tags reserved for CBC eviction. 1691 * 1692 * Each comptag will correspond to a unique compression cacheline. The usage of 1693 * these comptags is to evict the CBC by making accesses to a dummy compressed page, 1694 * thereby evicting each CBC line. 1695 * 1696 * @param [in][out] NvU32 pCompTags 1697 * Array of reserved compression tags of size @ref NV2080_MAX_CTAGS_FOR_CBC_EVICTION 1698 * @param [out] numCompTags 1699 * Number of entries returned in @ref pCompTags 1700 * 1701 * @returns 1702 * NV_OK 1703 * NV_ERR_INVALID_STATE 1704 * NV_ERR_OUT_OF_RANGE 1705 * NV_ERR_INVALID_PARAMETER 1706 */ 1707 #define NV2080_CTRL_CMD_FB_GET_CTAGS_FOR_CBC_EVICTION (0x20801338U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_CTAGS_FOR_CBC_EVICTION_PARAMS_MESSAGE_ID" */ 1708 1709 /*! 1710 * Max size of @ref NV2080_CTRL_FB_GET_CTAGS_FOR_CBC_EVICTION_PARAMS::pCompTags 1711 * Arbitrary, but sufficiently large number. Should be checked against CBC size. 1712 */ 1713 #define NV2080_MAX_CTAGS_FOR_CBC_EVICTION 0x7FU 1714 1715 1716 #define NV2080_CTRL_FB_GET_CTAGS_FOR_CBC_EVICTION_PARAMS_MESSAGE_ID (0x38U) 1717 1718 typedef struct NV2080_CTRL_FB_GET_CTAGS_FOR_CBC_EVICTION_PARAMS { 1719 NvU32 pCompTags[NV2080_MAX_CTAGS_FOR_CBC_EVICTION]; 1720 NvU32 numCompTags; 1721 } NV2080_CTRL_FB_GET_CTAGS_FOR_CBC_EVICTION_PARAMS; 1722 1723 /*! 1724 * NV2080_CTRL_CMD_FB_ALLOC_COMP_RESOURCE 1725 * 1726 * This Call will allocate compression tag 1727 * 1728 * @params[in] NvU32 attr 1729 * Stores the information: 1730 * 1. NVOS32_ATTR_COMPR_REQUIRED or not 1731 * 2. NVOS32_ATTR_PAGE_SIZE 1732 * @params[in] NvU32 attr2 1733 * Determine whether to allocate 1734 * an entire cache line or allocate by size 1735 * @params[in] NvU32 size 1736 * Specify the size of allocation, in pages not bytes 1737 * @params[in] NvU32 ctagOffset 1738 * Determine the offset usage of the allocation 1739 * @params[out] NvU32 hwResId 1740 * Stores the result of the allocation 1741 * @params[out] NvU32 RetcompTagLineMin 1742 * The resulting min Ctag Number from the allocation 1743 * @params[out] NvU32 RetcompTagLineMax 1744 * The resulting max Ctag Number from the allocation 1745 * @returns 1746 * NV_OK 1747 * NV_ERR_INSUFFICIENT_RESOURCES 1748 * NV_ERR_INVALID_ARGUMENT 1749 * NV_ERR_INVALID_STATE 1750 */ 1751 1752 #define NV2080_CTRL_CMD_FB_ALLOC_COMP_RESOURCE (0x20801339U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_CMD_FB_ALLOC_COMP_RESOURCE_PARAMS_MESSAGE_ID" */ 1753 1754 #define NV2080_CTRL_CMD_FB_ALLOC_COMP_RESOURCE_PARAMS_MESSAGE_ID (0x39U) 1755 1756 typedef struct NV2080_CTRL_CMD_FB_ALLOC_COMP_RESOURCE_PARAMS { 1757 NvU32 attr; 1758 NvU32 attr2; 1759 NvU32 size; 1760 NvU32 ctagOffset; 1761 NvU32 hwResId; 1762 NvU32 retCompTagLineMin; 1763 NvU32 retCompTagLineMax; 1764 } NV2080_CTRL_CMD_FB_ALLOC_COMP_RESOURCE_PARAMS; 1765 1766 /*! 1767 * NV2080_CTRL_CMD_FB_FREE_TILE 1768 * 1769 * This control call is used to release tile back to the free pool 1770 * 1771 * @params[in] NvU32 hwResId 1772 * Stores the information of a previous allocation 1773 * @returns 1774 * NV_OK 1775 * NV_ERR_INVALID_ARGUMENT 1776 * NV_ERR_INVALID_STATE 1777 */ 1778 1779 #define NV2080_CTRL_CMD_FB_FREE_TILE (0x2080133aU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_CMD_FB_FREE_TILE_PARAMS_MESSAGE_ID" */ 1780 1781 #define NV2080_CTRL_CMD_FB_FREE_TILE_PARAMS_MESSAGE_ID (0x3AU) 1782 1783 typedef struct NV2080_CTRL_CMD_FB_FREE_TILE_PARAMS { 1784 NvU32 hwResId; 1785 } NV2080_CTRL_CMD_FB_FREE_TILE_PARAMS; 1786 1787 1788 /* 1789 * NV2080_CTRL_CMD_FB_SETUP_VPR_REGION 1790 * 1791 * This control command is used to request vpr region setup 1792 * 1793 * requestType 1794 * NV2080_CTRL_CMD_FB_SET_VPR: Request to setup VPR 1795 * 1796 * requestParams : struct VPR_REQUEST_PARAMS 1797 * It contains the VPR region request details like, 1798 * startAddr : FB offset from which we need to setup VPR 1799 * size : required size of the region 1800 * 1801 * statusParams : struct VPR_STATUS_PARAMS 1802 * This struct stores the output of requested VPR region 1803 * status : Whether the request was successful 1804 * 1805 * NV2080_CTRL_CMD_FB_VPR_ERROR_CODE : 1806 * NV2080_CTRL_CMD_FB_VPR_ERROR_GENERIC : Some unknown error occurred 1807 * NV2080_CTRL_CMD_FB_VPR_ERROR_INVALID_CLIENT_REQUEST : Request was invalid 1808 * 1809 * Possible status values returned are: 1810 * NV_OK 1811 * NV_ERR_NOT_SUPPORTED 1812 */ 1813 #define NV2080_CTRL_CMD_FB_SETUP_VPR_REGION (0x2080133bU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_CMD_FB_SETUP_VPR_REGION_PARAMS_MESSAGE_ID" */ 1814 1815 typedef enum NV2080_CTRL_CMD_FB_VPR_REQUEST_TYPE { 1816 NV2080_CTRL_CMD_FB_SET_VPR = 0, 1817 } NV2080_CTRL_CMD_FB_VPR_REQUEST_TYPE; 1818 1819 typedef enum NV2080_CTRL_CMD_FB_VPR_ERROR_CODE { 1820 NV2080_CTRL_CMD_FB_VPR_ERROR_GENERIC = 0, 1821 NV2080_CTRL_CMD_FB_VPR_ERROR_INVALID_CLIENT_REQUEST = 1, 1822 } NV2080_CTRL_CMD_FB_VPR_ERROR_CODE; 1823 1824 typedef struct VPR_REQUEST_PARAMS { 1825 NvU32 startAddr; 1826 NvU32 size; 1827 } VPR_REQUEST_PARAMS; 1828 1829 typedef struct VPR_STATUS_PARAMS { 1830 NvU32 status; 1831 } VPR_STATUS_PARAMS; 1832 1833 #define NV2080_CTRL_CMD_FB_SETUP_VPR_REGION_PARAMS_MESSAGE_ID (0x3BU) 1834 1835 typedef struct NV2080_CTRL_CMD_FB_SETUP_VPR_REGION_PARAMS { 1836 NV2080_CTRL_CMD_FB_VPR_REQUEST_TYPE requestType; 1837 VPR_REQUEST_PARAMS requestParams; 1838 VPR_STATUS_PARAMS statusParams; 1839 } NV2080_CTRL_CMD_FB_SETUP_VPR_REGION_PARAMS; 1840 typedef struct NV2080_CTRL_CMD_FB_SETUP_VPR_REGION_PARAMS *PNV2080_CTRL_CMD_FB_SETUP_VPR_REGION_PARAMS; 1841 1842 /* 1843 * NV2080_CTRL_CMD_FB_GET_CLI_MANAGED_OFFLINED_PAGES 1844 * 1845 * This command returns the list of offlined video memory page addresses in the 1846 * region managed by Client 1847 * 1848 * offlinedPages 1849 * This output parameter is an array of video memory physical page numbers that 1850 * are offlined. This array can hold a maximum of NV2080_CTRL_FB_ 1851 * OFFLINED_PAGES_MAX_PAGES addresses. 1852 * pageSize 1853 * This output parameter contains the size of the page that is offlined. 1854 * validEntries 1855 * This output parameter specifies the number of valid entries in the 1856 * offlined array. 1857 * 1858 * Possible status values returned are: 1859 * NV_OK 1860 */ 1861 #define NV2080_CTRL_CMD_FB_GET_CLI_MANAGED_OFFLINED_PAGES (0x2080133cU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_CLI_MANAGED_OFFLINED_PAGES_PARAMS_MESSAGE_ID" */ 1862 1863 #define NV2080_CTRL_FB_GET_CLI_MANAGED_OFFLINED_PAGES_PARAMS_MESSAGE_ID (0x3CU) 1864 1865 typedef struct NV2080_CTRL_FB_GET_CLI_MANAGED_OFFLINED_PAGES_PARAMS { 1866 NvU32 offlinedPages[NV2080_CTRL_FB_OFFLINED_PAGES_MAX_PAGES]; // A 32B can hold enough. 1867 NvU32 pageSize; 1868 NvU32 validEntries; 1869 } NV2080_CTRL_FB_GET_CLI_MANAGED_OFFLINED_PAGES_PARAMS; 1870 1871 /*! 1872 * NV2080_CTRL_CMD_FB_GET_COMPBITCOPY_CONSTRUCT_INFO 1873 * 1874 * This command returns parameters required to initialize compbit copy object 1875 * used by address mapping library 1876 * 1877 * defaultPageSize 1878 * Page size used by @ref CompBitCopy methods 1879 * comptagsPerCacheLine 1880 * Number of compression tags in a single compression cache line. 1881 * unpackedComptagLinesPerCacheLine; 1882 * From hw (not adjusted for CompBits code) Number of compression tags 1883 * in a single compression cache line. 1884 * compCacheLineSizePerLTC; 1885 * Size of compression cache line per L2 slice. Size in Bytes. 1886 * unpackedCompCacheLineSizePerLTC; 1887 * From hw (not adjusted for CompBits code) size of compression 1888 * cache line per L2 slice. Size in Bytes 1889 * slicesPerLTC; 1890 * Number of L2 slices per L2 cache. 1891 * numActiveLTCs; 1892 * Number of active L2 caches. (Not floorswept) 1893 * familyName; 1894 * Family name for the GPU. 1895 * chipName; 1896 * Chip name for the GPU. 1897 * bitsPerRAMEntry; 1898 * Bits per RAM entry. (Need better doc) 1899 * ramBankWidth; 1900 * Width of RAM bank. (Need better doc) 1901 * bitsPerComptagLine; 1902 * Number of bits per compression tag line. 1903 * ramEntriesPerCompCacheLine; 1904 * Number of RAM entries spanned by 1 compression cache line. 1905 * comptagLineSize; 1906 * Size of compression tag line, in Bytes. 1907 * 1908 * Possible status values returned are: 1909 * NV_OK 1910 */ 1911 1912 #define NV2080_CTRL_CMD_FB_GET_COMPBITCOPY_CONSTRUCT_INFO (0x2080133dU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_CMD_FB_GET_COMPBITCOPY_CONSTRUCT_INFO_PARAMS_MESSAGE_ID" */ 1913 1914 #define NV2080_CTRL_CMD_FB_GET_COMPBITCOPY_CONSTRUCT_INFO_PARAMS_MESSAGE_ID (0x3DU) 1915 1916 typedef struct NV2080_CTRL_CMD_FB_GET_COMPBITCOPY_CONSTRUCT_INFO_PARAMS { 1917 NvU32 defaultPageSize; 1918 NvU32 comptagsPerCacheLine; 1919 NvU32 unpackedComptagLinesPerCacheLine; 1920 NvU32 compCacheLineSizePerLTC; 1921 NvU32 unpackedCompCacheLineSizePerLTC; 1922 NvU32 slicesPerLTC; 1923 NvU32 numActiveLTCs; 1924 NvU32 familyName; 1925 NvU32 chipName; 1926 NvU32 bitsPerRAMEntry; 1927 NvU32 ramBankWidth; 1928 NvU32 bitsPerComptagLine; 1929 NvU32 ramEntriesPerCompCacheLine; 1930 NvU32 comptagLineSize; 1931 } NV2080_CTRL_CMD_FB_GET_COMPBITCOPY_CONSTRUCT_INFO_PARAMS; 1932 1933 /* 1934 * NV2080_CTRL_CMD_FB_SET_RRD 1935 * 1936 * Sets the row-to-row delay on the GPU's FB 1937 * 1938 * Possible status values returned are: 1939 * NV_OK 1940 * Any error code 1941 */ 1942 #define NV2080_CTRL_CMD_FB_SET_RRD (0x2080133eU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_SET_RRD_PARAMS_MESSAGE_ID" */ 1943 1944 #define NV2080_CTRL_FB_SET_RRD_RESET_VALUE (~((NvU32)0)) 1945 #define NV2080_CTRL_FB_SET_RRD_PARAMS_MESSAGE_ID (0x3EU) 1946 1947 typedef struct NV2080_CTRL_FB_SET_RRD_PARAMS { 1948 NvU32 rrd; 1949 } NV2080_CTRL_FB_SET_RRD_PARAMS; 1950 1951 /* 1952 * NV2080_CTRL_FB_SET_READ_WRITE_LIMIT_PARAMS 1953 * 1954 * This is not a control call of it's own, but there are common definitions for 1955 * the two NV2080_CTRL_CMD_FB_SET_READ/WRITE_LIMIT control calls. 1956 */ 1957 typedef struct NV2080_CTRL_FB_SET_READ_WRITE_LIMIT_PARAMS { 1958 NvU8 limit; 1959 } NV2080_CTRL_FB_SET_READ_WRITE_LIMIT_PARAMS; 1960 #define NV2080_CTRL_FB_SET_READ_WRITE_LIMIT_RESET_VALUE (0xffU) 1961 1962 /* 1963 * NV2080_CTRL_CMD_FB_SET_READ_LIMIT 1964 * 1965 * Sets the READ_LIMIT to be used in the NV_PFB_FBPA_DIR_ARB_CFG0 register 1966 * 1967 * limit 1968 * The limit value to use 1969 * 1970 * Possible status values returned are: 1971 * NV_OK 1972 * Any error code 1973 */ 1974 #define NV2080_CTRL_CMD_FB_SET_READ_LIMIT (0x2080133fU) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_SET_READ_LIMIT_PARAMS_MESSAGE_ID" */ 1975 1976 #define NV2080_CTRL_FB_SET_READ_LIMIT_RESET_VALUE NV2080_CTRL_FB_SET_READ_WRITE_LIMIT_RESET_VALUE 1977 #define NV2080_CTRL_FB_SET_READ_LIMIT_PARAMS_MESSAGE_ID (0x3FU) 1978 1979 typedef NV2080_CTRL_FB_SET_READ_WRITE_LIMIT_PARAMS NV2080_CTRL_FB_SET_READ_LIMIT_PARAMS; 1980 1981 /* 1982 * NV2080_CTRL_CMD_FB_SET_WRITE_LIMIT 1983 * 1984 * Sets the WRITE_LIMIT to be used in the NV_PFB_FBPA_DIR_ARB_CFG0 register 1985 * 1986 * limit 1987 * The limit value to us 1988 * 1989 * Possible status values returned are: 1990 * NV_OK 1991 * Any error code 1992 */ 1993 #define NV2080_CTRL_CMD_FB_SET_WRITE_LIMIT (0x20801340U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_SET_WRITE_LIMIT_PARAMS_MESSAGE_ID" */ 1994 1995 #define NV2080_CTRL_FB_SET_WRITE_LIMIT_RESET_VALUE NV2080_CTRL_FB_SET_READ_WRITE_LIMIT_RESET_VALUE 1996 #define NV2080_CTRL_FB_SET_WRITE_LIMIT_PARAMS_MESSAGE_ID (0x40U) 1997 1998 typedef NV2080_CTRL_FB_SET_READ_WRITE_LIMIT_PARAMS NV2080_CTRL_FB_SET_WRITE_LIMIT_PARAMS; 1999 2000 /*! 2001 * NV2080_CTRL_CMD_FB_PATCH_PBR_FOR_MINING 2002 * 2003 * Patches some VBIOS values related to PBR to better suit mining applications 2004 * 2005 * bEnable 2006 * Set the mining-specific values or reset to the original values 2007 * 2008 * Possible status values returned are: 2009 * NV_OK 2010 * Any error code 2011 */ 2012 #define NV2080_CTRL_CMD_FB_PATCH_PBR_FOR_MINING (0x20801341U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_PATCH_PBR_FOR_MINING_PARAMS_MESSAGE_ID" */ 2013 2014 #define NV2080_CTRL_FB_PATCH_PBR_FOR_MINING_PARAMS_MESSAGE_ID (0x41U) 2015 2016 typedef struct NV2080_CTRL_FB_PATCH_PBR_FOR_MINING_PARAMS { 2017 NvBool bEnable; 2018 } NV2080_CTRL_FB_PATCH_PBR_FOR_MINING_PARAMS; 2019 2020 /*! 2021 * NV2080_CTRL_CMD_FB_GET_MEM_ALIGNMENT 2022 * 2023 * Get memory alignment. Replacement for NVOS32_FUNCTION_GET_MEM_ALIGNMENT 2024 */ 2025 #define NV2080_CTRL_CMD_FB_GET_MEM_ALIGNMENT (0x20801342U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_MEM_ALIGNMENT_PARAMS_MESSAGE_ID" */ 2026 2027 #define NV2080_CTRL_FB_GET_MEM_ALIGNMENT_MAX_BANKS (4U) 2028 #define NV2080_CTRL_FB_GET_MEM_ALIGNMENT_PARAMS_MESSAGE_ID (0x42U) 2029 2030 typedef struct NV2080_CTRL_FB_GET_MEM_ALIGNMENT_PARAMS { 2031 NvU32 alignType; // Input 2032 NvU32 alignAttr; 2033 NvU32 alignInputFlags; 2034 NvU32 alignHead; 2035 NV_DECLARE_ALIGNED(NvU64 alignSize, 8); 2036 NvU32 alignHeight; 2037 NvU32 alignWidth; 2038 NvU32 alignPitch; 2039 NvU32 alignPad; 2040 NvU32 alignMask; 2041 NvU32 alignOutputFlags[NV2080_CTRL_FB_GET_MEM_ALIGNMENT_MAX_BANKS]; 2042 NvU32 alignBank[NV2080_CTRL_FB_GET_MEM_ALIGNMENT_MAX_BANKS]; 2043 NvU32 alignKind; 2044 NvU32 alignAdjust; // Output -- If non-zero the amount we need to adjust the offset 2045 NvU32 alignAttr2; 2046 } NV2080_CTRL_FB_GET_MEM_ALIGNMENT_PARAMS; 2047 2048 /*! 2049 * NV2080_CTRL_CMD_FB_GET_CBC_BASEADDR 2050 * 2051 * Get the CBC Base physical address 2052 * This control call is required by error containment tests 2053 * NV2080_CTRL_CMD_FB_GET_AMAP_CONF can also return CBC base address 2054 * but it requires kernel privilege, and it not callalble from SRT test 2055 * 2056 * @params[out] NvU64 cbcBaseAddr 2057 * Base physical address for CBC data. 2058 * 2059 * Possible status values returned are: 2060 * NV_OK NV_ERR_NOT_SUPPORTED 2061 * 2062 */ 2063 #define NV2080_CTRL_CMD_FB_GET_CBC_BASE_ADDR (0x20801343U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_CMD_FB_GET_CBC_BASE_ADDR_PARAMS_MESSAGE_ID" */ 2064 2065 #define NV2080_CTRL_CMD_FB_GET_CBC_BASE_ADDR_PARAMS_MESSAGE_ID (0x43U) 2066 2067 typedef struct NV2080_CTRL_CMD_FB_GET_CBC_BASE_ADDR_PARAMS { 2068 NvU32 cbcBaseAddress; 2069 NvU32 compCacheLineSize; 2070 NV_DECLARE_ALIGNED(NvU64 backingStoreStartPA, 8); 2071 NV_DECLARE_ALIGNED(NvU64 backingStoreAllocPA, 8); 2072 NvU32 backingStoreChunkOverfetch; 2073 } NV2080_CTRL_CMD_FB_GET_CBC_BASE_ADDR_PARAMS; 2074 2075 #define NV2080_CTRL_FB_REMAP_ENTRY_FLAGS_PENDING 0:0 2076 #define NV2080_CTRL_FB_REMAP_ENTRY_FLAGS_PENDING_FALSE 0U 2077 #define NV2080_CTRL_FB_REMAP_ENTRY_FLAGS_PENDING_TRUE 1U 2078 2079 2080 2081 typedef struct NV2080_CTRL_FB_REMAP_ENTRY { 2082 NvU32 remapRegVal; 2083 NvU32 timestamp; 2084 NvU8 fbpa; 2085 NvU8 sublocation; 2086 NvU8 source; 2087 NvU8 flags; 2088 } NV2080_CTRL_FB_REMAP_ENTRY; 2089 2090 /* valid values for source */ 2091 2092 2093 #define NV2080_CTRL_FB_REMAPPED_ROW_SOURCE_SBE_FIELD (0x00000002U) 2094 #define NV2080_CTRL_FB_REMAPPED_ROW_SOURCE_DBE_FIELD (0x00000003U) 2095 2096 #define NV2080_CTRL_FB_REMAPPED_ROWS_MAX_ROWS (0x00000200U) 2097 2098 /* 2099 * NV2080_CTRL_CMD_FB_GET_REMAPPED_ROWS 2100 * 2101 * This command returns the list of remapped rows stored in the Inforom. 2102 * 2103 * entryCount 2104 * This output parameter specifies the number of remapped rows 2105 * flags 2106 * This output parameter contains info on whether or not there are pending 2107 * remappings and whether or not a remapping failed 2108 * entries 2109 * This output parameter is an array of NV2080_CTRL_FB_REMAP_ENTRY 2110 * containing inforomation on the remapping that occurred. This array can 2111 * hold a maximum of NV2080_CTRL_FB_REMAPPED_ROWS_MAX_ROWS 2112 * 2113 * Possible status values returned are: 2114 * NV_OK 2115 * NV_ERR_INVALID_ARGUMENT 2116 * NV_ERR_INVALID_POINTER 2117 * NV_ERR_OBJECT_NOT_FOUND 2118 * NV_ERR_NOT_SUPPORTED 2119 */ 2120 #define NV2080_CTRL_CMD_FB_GET_REMAPPED_ROWS (0x20801344U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_REMAPPED_ROWS_PARAMS_MESSAGE_ID" */ 2121 2122 #define NV2080_CTRL_FB_GET_REMAPPED_ROWS_FLAGS_PENDING \ 2123 NV2080_CTRL_FB_REMAP_ENTRY_FLAGS_PENDING 2124 #define NV2080_CTRL_FB_GET_REMAPPED_ROWS_FLAGS_PENDING_FALSE NV2080_CTRL_FB_REMAP_ENTRY_FLAGS_PENDING_FALSE 2125 #define NV2080_CTRL_FB_GET_REMAPPED_ROWS_FLAGS_PENDING_TRUE NV2080_CTRL_FB_REMAP_ENTRY_FLAGS_PENDING_TRUE 2126 #define NV2080_CTRL_FB_GET_REMAPPED_ROWS_FLAGS_FAILURE 1:1 2127 #define NV2080_CTRL_FB_GET_REMAPPED_ROWS_FLAGS_FAILURE_FALSE 0U 2128 #define NV2080_CTRL_FB_GET_REMAPPED_ROWS_FLAGS_FAILURE_TRUE 1U 2129 2130 #define NV2080_CTRL_FB_GET_REMAPPED_ROWS_PARAMS_MESSAGE_ID (0x44U) 2131 2132 typedef struct NV2080_CTRL_FB_GET_REMAPPED_ROWS_PARAMS { 2133 NvU32 entryCount; 2134 NvU8 flags; 2135 NV2080_CTRL_FB_REMAP_ENTRY entries[NV2080_CTRL_FB_REMAPPED_ROWS_MAX_ROWS]; 2136 } NV2080_CTRL_FB_GET_REMAPPED_ROWS_PARAMS; 2137 2138 // Max size of the queryParams in Bytes, so that the NV2080_CTRL_FB_FS_INFO_QUERY struct is still 32B 2139 #define NV2080_CTRL_FB_FS_INFO_MAX_QUERY_SIZE 24U 2140 2141 /*! 2142 * Structure holding the out params for NV2080_CTRL_FB_FS_INFO_INVALID_QUERY. 2143 */ 2144 typedef struct NV2080_CTRL_FB_FS_INFO_INVALID_QUERY_PARAMS { 2145 // Unused param, will ensure the size of NV2080_CTRL_FB_FS_INFO_QUERY struct to be 32B 2146 NvU8 data[NV2080_CTRL_FB_FS_INFO_MAX_QUERY_SIZE]; 2147 } NV2080_CTRL_FB_FS_INFO_INVALID_QUERY_PARAMS; 2148 2149 /*! 2150 * Structure holding the in/out params for NV2080_CTRL_FB_FS_INFO_FBP_MASK. 2151 */ 2152 typedef struct NV2080_CTRL_FB_FS_INFO_FBP_MASK_PARAMS { 2153 /*! 2154 * [IN]: swizzId 2155 * PartitionID associated with a created smc partition. Currently used only for a 2156 * device monitoring client to get the physical values of the FB. The client needs to pass 2157 * 'NV2080_CTRL_GPU_PARTITION_ID_INVALID' explicitly if it wants RM to ignore the swizzId. 2158 * RM will consider this request similar to a legacy case. 2159 * The client's subscription is used only as a capability check and not as an input swizzId. 2160 */ 2161 NvU32 swizzId; 2162 /*! 2163 * [OUT]: physical/local fbp mask. 2164 */ 2165 NV_DECLARE_ALIGNED(NvU64 fbpEnMask, 8); 2166 } NV2080_CTRL_FB_FS_INFO_FBP_MASK_PARAMS; 2167 2168 /*! 2169 * Structure holding the in/out params for NV2080_CTRL_FB_FS_INFO_LTC_MASK. 2170 */ 2171 typedef struct NV2080_CTRL_FB_FS_INFO_LTC_MASK_PARAMS { 2172 /*! 2173 * [IN]: physical/local FB partition index. 2174 */ 2175 NvU32 fbpIndex; 2176 /*! 2177 * [OUT]: physical/local ltc mask. 2178 */ 2179 NvU32 ltcEnMask; 2180 } NV2080_CTRL_FB_FS_INFO_LTC_MASK_PARAMS; 2181 2182 /*! 2183 * Structure holding the in/out params for NV2080_CTRL_FB_FS_INFO_LTS_MASK. 2184 */ 2185 typedef struct NV2080_CTRL_FB_FS_INFO_LTS_MASK_PARAMS { 2186 /*! 2187 * [IN]: physical/local FB partition index. 2188 */ 2189 NvU32 fbpIndex; 2190 /*! 2191 * [OUT]: physical/local lts mask. 2192 * Note that lts bits are flattened out for all ltc with in a fbp. 2193 */ 2194 NvU32 ltsEnMask; 2195 } NV2080_CTRL_FB_FS_INFO_LTS_MASK_PARAMS; 2196 2197 /*! 2198 * Structure holding the in/out params for NV2080_CTRL_FB_FS_INFO_FBPA_MASK. 2199 */ 2200 typedef struct NV2080_CTRL_FB_FS_INFO_FBPA_MASK_PARAMS { 2201 /*! 2202 * [IN]: physical/local FB partition index. 2203 */ 2204 NvU32 fbpIndex; 2205 /*! 2206 * [OUT]: physical/local FBPA mask. 2207 */ 2208 NvU32 fbpaEnMask; 2209 } NV2080_CTRL_FB_FS_INFO_FBPA_MASK_PARAMS; 2210 2211 /*! 2212 * Structure holding the in/out params for NV2080_CTRL_FB_FS_INFO_FBPA_SUBP_MASK. 2213 */ 2214 typedef struct NV2080_CTRL_FB_FS_INFO_FBPA_SUBP_MASK_PARAMS { 2215 /*! 2216 * [IN]: physical/local FB partition index. 2217 */ 2218 NvU32 fbpIndex; 2219 /*! 2220 * [OUT]: physical/local FBPA-SubPartition mask. 2221 */ 2222 NvU32 fbpaSubpEnMask; 2223 } NV2080_CTRL_FB_FS_INFO_FBPA_SUBP_MASK_PARAMS; 2224 2225 /*! 2226 * Structure holding the in/out params for NV2080_CTRL_FB_FS_INFO_FBP_LOGICAL_MAP 2227 */ 2228 typedef struct NV2080_CTRL_FB_FS_INFO_FBP_LOGICAL_MAP_PARAMS { 2229 /*! 2230 * [IN]: physical/local FB partition index. 2231 */ 2232 NvU32 fbpIndex; 2233 /*! 2234 * [OUT]: Logical/local FBP index 2235 */ 2236 NvU32 fbpLogicalIndex; 2237 } NV2080_CTRL_FB_FS_INFO_FBP_LOGICAL_MAP_PARAMS; 2238 2239 /*! 2240 * Structure holding the in/out params for NV2080_CTRL_FB_FS_INFO_ROP_MASK. 2241 */ 2242 typedef struct NV2080_CTRL_FB_FS_INFO_ROP_MASK_PARAMS { 2243 /*! 2244 * [IN]: physical/local FB partition index. 2245 */ 2246 NvU32 fbpIndex; 2247 /*! 2248 * [OUT]: physical/local ROP mask. 2249 */ 2250 NvU32 ropEnMask; 2251 } NV2080_CTRL_FB_FS_INFO_ROP_MASK_PARAMS; 2252 2253 /*! 2254 * Structure holding the in/out params for NV2080_CTRL_FB_FS_INFO_PROFILER_MON_LTC_MASK. 2255 */ 2256 typedef struct NV2080_CTRL_FB_FS_INFO_PROFILER_MON_LTC_MASK_PARAMS { 2257 /*! 2258 * [IN]: Physical FB partition index. 2259 */ 2260 NvU32 fbpIndex; 2261 /*! 2262 * [IN]: swizzId 2263 * PartitionID associated with a created smc partition. 2264 */ 2265 NvU32 swizzId; 2266 /*! 2267 * [OUT]: physical ltc mask. 2268 */ 2269 NvU32 ltcEnMask; 2270 } NV2080_CTRL_FB_FS_INFO_PROFILER_MON_LTC_MASK_PARAMS; 2271 2272 /*! 2273 * Structure holding the in/out params for NV2080_CTRL_FB_FS_INFO_PROFILER_MON_LTS_MASK. 2274 */ 2275 typedef struct NV2080_CTRL_FB_FS_INFO_PROFILER_MON_LTS_MASK_PARAMS { 2276 /*! 2277 * [IN]: Physical FB partition index. 2278 */ 2279 NvU32 fbpIndex; 2280 /*! 2281 * [IN]: swizzId 2282 * PartitionID associated with a created smc partition. 2283 */ 2284 NvU32 swizzId; 2285 /*! 2286 * [OUT]: physical lts mask. 2287 */ 2288 NvU32 ltsEnMask; 2289 } NV2080_CTRL_FB_FS_INFO_PROFILER_MON_LTS_MASK_PARAMS; 2290 2291 /*! 2292 * Structure holding the in/out params for NV2080_CTRL_FB_FS_INFO_PROFILER_MON_FBPA_MASK. 2293 */ 2294 typedef struct NV2080_CTRL_FB_FS_INFO_PROFILER_MON_FBPA_MASK_PARAMS { 2295 /*! 2296 * [IN]: Physical FB partition index. 2297 */ 2298 NvU32 fbpIndex; 2299 /*! 2300 * [IN]: swizzId 2301 * PartitionID associated with a created smc partition. 2302 */ 2303 NvU32 swizzId; 2304 /*! 2305 * [OUT]: physical fbpa mask. 2306 */ 2307 NvU32 fbpaEnMask; 2308 } NV2080_CTRL_FB_FS_INFO_PROFILER_MON_FBPA_MASK_PARAMS; 2309 2310 /*! 2311 * Structure holding the in/out params for NV2080_CTRL_FB_FS_INFO_PROFILER_MON_ROP_MASK. 2312 */ 2313 typedef struct NV2080_CTRL_FB_FS_INFO_PROFILER_MON_ROP_MASK_PARAMS { 2314 /*! 2315 * [IN]: Physical FB partition index. 2316 */ 2317 NvU32 fbpIndex; 2318 /*! 2319 * [IN]: swizzId 2320 * PartitionID associated with a created smc partition. 2321 */ 2322 NvU32 swizzId; 2323 /*! 2324 * [OUT]: physical rop mask. 2325 */ 2326 NvU32 ropEnMask; 2327 } NV2080_CTRL_FB_FS_INFO_PROFILER_MON_ROP_MASK_PARAMS; 2328 2329 /*! 2330 * Structure holding the in/out params for NV2080_CTRL_FB_FS_INFO_PROFILER_MON_FBPA_SUBP_MASK. 2331 */ 2332 typedef struct NV2080_CTRL_FB_FS_INFO_PROFILER_MON_FBPA_SUBP_MASK_PARAMS { 2333 /*! 2334 * [IN]: Physical FB partition index. 2335 */ 2336 NvU32 fbpIndex; 2337 /*! 2338 * [IN]: swizzId 2339 * PartitionID associated with a created smc partition. Currently used only for a 2340 * device monitoring client to get the physical values of the FB. The client needs to pass 2341 * 'NV2080_CTRL_GPU_PARTITION_ID_INVALID' explicitly if it wants RM to ignore the swizzId. 2342 * RM will consider this request similar to a legacy case. 2343 * The client's subscription is used only as a capability check and not as an input swizzId. 2344 */ 2345 NvU32 swizzId; 2346 /*! 2347 * [OUT]: physical FBPA_SubPartition mask associated with requested partition. 2348 */ 2349 NV_DECLARE_ALIGNED(NvU64 fbpaSubpEnMask, 8); 2350 } NV2080_CTRL_FB_FS_INFO_PROFILER_MON_FBPA_SUBP_MASK_PARAMS; 2351 2352 /*! 2353 * Structure holding the in/out params for NV2080_CTRL_SYSL2_FS_INFO_SYSLTC_MASK. 2354 */ 2355 typedef struct NV2080_CTRL_SYSL2_FS_INFO_SYSLTC_MASK_PARAMS { 2356 /*! 2357 * [IN]: physical/local sys Id. 2358 */ 2359 NvU32 sysIdx; 2360 /*! 2361 * [OUT]: physical/local sysltc mask. 2362 */ 2363 NvU32 sysl2LtcEnMask; 2364 } NV2080_CTRL_SYSL2_FS_INFO_SYSLTC_MASK_PARAMS; 2365 2366 /*! 2367 * Structure holding the in/out params for NV2080_CTRL_FB_FS_INFO_PAC_MASK. 2368 */ 2369 typedef struct NV2080_CTRL_FB_FS_INFO_PAC_MASK_PARAMS { 2370 /*! 2371 * [IN]: physical/local FB partition index. 2372 */ 2373 NvU32 fbpIndex; 2374 /*! 2375 * [OUT]: physical/local PAC mask. 2376 */ 2377 NvU32 pacEnMask; 2378 } NV2080_CTRL_FB_FS_INFO_PAC_MASK_PARAMS; 2379 2380 // Possible values for queryType 2381 #define NV2080_CTRL_FB_FS_INFO_INVALID_QUERY 0x0U 2382 #define NV2080_CTRL_FB_FS_INFO_FBP_MASK 0x1U 2383 #define NV2080_CTRL_FB_FS_INFO_LTC_MASK 0x2U 2384 #define NV2080_CTRL_FB_FS_INFO_LTS_MASK 0x3U 2385 #define NV2080_CTRL_FB_FS_INFO_FBPA_MASK 0x4U 2386 #define NV2080_CTRL_FB_FS_INFO_ROP_MASK 0x5U 2387 #define NV2080_CTRL_FB_FS_INFO_PROFILER_MON_LTC_MASK 0x6U 2388 #define NV2080_CTRL_FB_FS_INFO_PROFILER_MON_LTS_MASK 0x7U 2389 #define NV2080_CTRL_FB_FS_INFO_PROFILER_MON_FBPA_MASK 0x8U 2390 #define NV2080_CTRL_FB_FS_INFO_PROFILER_MON_ROP_MASK 0x9U 2391 #define NV2080_CTRL_FB_FS_INFO_FBPA_SUBP_MASK 0xAU 2392 #define NV2080_CTRL_FB_FS_INFO_PROFILER_MON_FBPA_SUBP_MASK 0xBU 2393 #define NV2080_CTRL_FB_FS_INFO_FBP_LOGICAL_MAP 0xCU 2394 #define NV2080_CTRL_SYSL2_FS_INFO_SYSLTC_MASK 0xDU 2395 #define NV2080_CTRL_FB_FS_INFO_PAC_MASK 0xEU 2396 2397 typedef struct NV2080_CTRL_FB_FS_INFO_QUERY { 2398 NvU16 queryType; 2399 NvU8 reserved[2]; 2400 NvU32 status; 2401 union { 2402 NV2080_CTRL_FB_FS_INFO_INVALID_QUERY_PARAMS inv; 2403 NV_DECLARE_ALIGNED(NV2080_CTRL_FB_FS_INFO_FBP_MASK_PARAMS fbp, 8); 2404 NV2080_CTRL_FB_FS_INFO_LTC_MASK_PARAMS ltc; 2405 NV2080_CTRL_FB_FS_INFO_LTS_MASK_PARAMS lts; 2406 NV2080_CTRL_FB_FS_INFO_FBPA_MASK_PARAMS fbpa; 2407 NV2080_CTRL_FB_FS_INFO_ROP_MASK_PARAMS rop; 2408 NV2080_CTRL_FB_FS_INFO_PROFILER_MON_LTC_MASK_PARAMS dmLtc; 2409 NV2080_CTRL_FB_FS_INFO_PROFILER_MON_LTS_MASK_PARAMS dmLts; 2410 NV2080_CTRL_FB_FS_INFO_PROFILER_MON_FBPA_MASK_PARAMS dmFbpa; 2411 NV2080_CTRL_FB_FS_INFO_PROFILER_MON_ROP_MASK_PARAMS dmRop; 2412 NV_DECLARE_ALIGNED(NV2080_CTRL_FB_FS_INFO_PROFILER_MON_FBPA_SUBP_MASK_PARAMS dmFbpaSubp, 8); 2413 NV2080_CTRL_FB_FS_INFO_FBPA_SUBP_MASK_PARAMS fbpaSubp; 2414 NV2080_CTRL_FB_FS_INFO_FBP_LOGICAL_MAP_PARAMS fbpLogicalMap; 2415 NV2080_CTRL_SYSL2_FS_INFO_SYSLTC_MASK_PARAMS sysl2Ltc; 2416 NV2080_CTRL_FB_FS_INFO_PAC_MASK_PARAMS pac; 2417 } queryParams; 2418 } NV2080_CTRL_FB_FS_INFO_QUERY; 2419 2420 // Max number of queries that can be batched in a single call to NV2080_CTRL_CMD_FB_GET_FS_INFO 2421 #define NV2080_CTRL_FB_FS_INFO_MAX_QUERIES 120U 2422 2423 #define NV2080_CTRL_FB_GET_FS_INFO_PARAMS_MESSAGE_ID (0x46U) 2424 2425 typedef struct NV2080_CTRL_FB_GET_FS_INFO_PARAMS { 2426 NvU16 numQueries; 2427 NvU8 reserved[6]; 2428 NV_DECLARE_ALIGNED(NV2080_CTRL_FB_FS_INFO_QUERY queries[NV2080_CTRL_FB_FS_INFO_MAX_QUERIES], 8); 2429 } NV2080_CTRL_FB_GET_FS_INFO_PARAMS; 2430 2431 /*! 2432 * NV2080_CTRL_CMD_FB_GET_FS_INFO 2433 * 2434 * This control call returns the fb engine information for a partition/GPU. 2435 * Supports an interface so that the caller can issue multiple queries by batching them 2436 * in a single call. Returns the first error it encounters. 2437 * 2438 * numQueries[IN] 2439 * - Specifies the number of valid queries. 2440 * 2441 * Possible status values returned are: 2442 * NV_OK 2443 * NV_ERR_INVALID_PARAM_STRUCT 2444 * NV_ERR_INVALID_ARGUMENT 2445 * NV_ERR_NOT_SUPPORTED 2446 */ 2447 #define NV2080_CTRL_CMD_FB_GET_FS_INFO (0x20801346U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_FS_INFO_PARAMS_MESSAGE_ID" */ 2448 2449 #define NV2080_CTRL_FB_HISTOGRAM_IDX_NO_REMAPPED_ROWS (0x0U) 2450 #define NV2080_CTRL_FB_HISTOGRAM_IDX_SINGLE_REMAPPED_ROW (0x1U) 2451 #define NV2080_CTRL_FB_HISTOGRAM_IDX_MIXED_REMAPPED_REMAINING_ROWS (0x2U) 2452 #define NV2080_CTRL_FB_HISTOGRAM_IDX_SINGLE_REMAINING_ROW (0x3U) 2453 #define NV2080_CTRL_FB_HISTOGRAM_IDX_MAX_REMAPPED_ROWS (0x4U) 2454 2455 #define NV2080_CTRL_FB_GET_ROW_REMAPPER_HISTOGRAM_PARAMS_MESSAGE_ID (0x47U) 2456 2457 typedef struct NV2080_CTRL_FB_GET_ROW_REMAPPER_HISTOGRAM_PARAMS { 2458 NvU32 histogram[5]; 2459 } NV2080_CTRL_FB_GET_ROW_REMAPPER_HISTOGRAM_PARAMS; 2460 2461 /*! 2462 * NV2080_CTRL_CMD_FB_GET_ROW_REMAPPER_HISTOGRAM 2463 * 2464 * This control call returns stats on the number of banks that have a certain 2465 * number of rows remapped in the bank. Specifically the number of banks that 2466 * have 0, 1, 2 through (max-2), max-1 and max number of rows remapped in the 2467 * bank. Values will be returned in an array. 2468 * 2469 * Index values are: 2470 * 2471 * NV2080_CTRL_FB_HISTOGRAM_IDX_NO_REMAPPED_ROWS 2472 * Number of banks with zero rows remapped 2473 NV2080_CTRL_FB_HISTOGRAM_IDX_SINGLE_REMAPPED_ROW 2474 * Number of banks with one row remapped 2475 NV2080_CTRL_FB_HISTOGRAM_IDX_MIXED_REMAPPED_REMAINING_ROWS 2476 * Number of banks with 2 through (max-2) rows remapped 2477 NV2080_CTRL_FB_HISTOGRAM_IDX_SINGLE_REMAINING_ROW 2478 * Number of banks with (max-1) rows remapped 2479 NV2080_CTRL_FB_HISTOGRAM_IDX_MAX_REMAPPED_ROWS 2480 * Number of banks with max rows remapped 2481 * 2482 * Possible status values returned are: 2483 * NV_OK 2484 * NV_ERR_NOT_SUPPORTED 2485 */ 2486 #define NV2080_CTRL_CMD_FB_GET_ROW_REMAPPER_HISTOGRAM (0x20801347U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_ROW_REMAPPER_HISTOGRAM_PARAMS_MESSAGE_ID" */ 2487 2488 /* 2489 * NV2080_CTRL_CMD_FB_GET_DYNAMICALLY_BLACKLISTED_PAGES 2490 * 2491 * This command returns the list of dynamically blacklisted video memory page addresses 2492 * after last driver load. 2493 * 2494 * blackList 2495 * This output parameter is an array of NV2080_CTRL_FB_DYNAMIC_BLACKLIST_ADDRESS_INFO 2496 * This array can hold a maximum of NV2080_CTRL_FB_DYNAMIC_BLACKLIST_MAX_ENTRIES. 2497 * validEntries 2498 * This output parameter specifies the number of valid entries in the 2499 * blackList array. 2500 * baseIndex 2501 * With the limit of up to 512 blacklisted pages, the size of this array 2502 * exceeds the rpc buffer limit. This control call will collect the data 2503 * in multiple passes. This parameter indicates the start index of the 2504 * data to be passed back to the caller 2505 * This cannot be greater than NV2080_CTRL_FB_DYNAMIC_BLACKLIST_MAX_PAGES 2506 * bMore 2507 * This parameter indicates whether there are more valid elements to be 2508 * fetched. 2509 * 2510 * Possible status values returned are: 2511 * NV_OK 2512 */ 2513 #define NV2080_CTRL_CMD_FB_GET_DYNAMIC_OFFLINED_PAGES (0x20801348U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_DYNAMIC_OFFLINED_PAGES_PARAMS_MESSAGE_ID" */ 2514 2515 /* Maximum pages that can be dynamically blacklisted */ 2516 #define NV2080_CTRL_FB_DYNAMIC_BLACKLIST_MAX_PAGES 512U 2517 2518 /* 2519 * Maximum entries that can be sent in a single pass of 2520 * NV2080_CTRL_CMD_FB_GET_DYNAMIC_OFFLINED_PAGES 2521 */ 2522 #define NV2080_CTRL_FB_DYNAMIC_BLACKLIST_MAX_ENTRIES 64U 2523 2524 /** 2525 * NV2080_CTRL_FB_DYNAMIC_OFFLINED_ADDRESS_INFO 2526 * pageNumber 2527 * This output parameter specifies the dynamically blacklisted page number. 2528 * source 2529 * The reason for the page to be retired. Valid values for 2530 * this parameter include: 2531 * NV2080_CTRL_FB_OFFLINED_PAGES_SOURCE_INVALID 2532 * Invalid source. 2533 * NV2080_CTRL_FB_OFFLINED_PAGES_SOURCE_DPR_DBE 2534 * Page retired by dynamic page retirement due to a double bit 2535 * error seen. 2536 */ 2537 typedef struct NV2080_CTRL_FB_DYNAMIC_OFFLINED_ADDRESS_INFO { 2538 NV_DECLARE_ALIGNED(NvU64 pageNumber, 8); 2539 NvU8 source; 2540 } NV2080_CTRL_FB_DYNAMIC_OFFLINED_ADDRESS_INFO; 2541 2542 #define NV2080_CTRL_FB_GET_DYNAMIC_OFFLINED_PAGES_PARAMS_MESSAGE_ID (0x48U) 2543 2544 typedef struct NV2080_CTRL_FB_GET_DYNAMIC_OFFLINED_PAGES_PARAMS { 2545 NV_DECLARE_ALIGNED(NV2080_CTRL_FB_DYNAMIC_OFFLINED_ADDRESS_INFO offlined[NV2080_CTRL_FB_DYNAMIC_BLACKLIST_MAX_ENTRIES], 8); 2546 NvU32 validEntries; 2547 NvU32 baseIndex; 2548 NvBool bMore; 2549 } NV2080_CTRL_FB_GET_DYNAMIC_OFFLINED_PAGES_PARAMS; 2550 2551 /* valid values for source */ 2552 2553 #define NV2080_CTRL_FB_DYNAMIC_BLACKLISTED_PAGES_SOURCE_INVALID (0x00000000U) 2554 #define NV2080_CTRL_FB_DYNAMIC_BLACKLISTED_PAGES_SOURCE_DPR_DBE (0x00000001U) 2555 2556 /* 2557 * NV2080_CTRL_CMD_FB_GET_CLIENT_ALLOCATION_INFO 2558 * 2559 * This control command is used by clients to query information pertaining to client allocations. 2560 * 2561 * 2562 * @params [IN/OUT] NvU64 allocCount: 2563 * Client specifies the allocation count that it received using the 2564 * previous NV2080_CTRL_CMD_FB_GET_CLIENT_ALLOCATION_INFO control call. 2565 * RM will get the total number of allocations known by RM and fill 2566 * allocCount with it. 2567 * 2568 * @params [IN] NvP64 pAllocInfo: 2569 * Pointer to the buffer allocated by client of size NV2080_CTRL_CMD_FB_ALLOCATION_INFO * 2570 * allocCount. RM returns the info pertaining to each of the contiguous client 2571 * allocation chunks in pAllocInfo. The format of the allocation information is given by 2572 * NV2080_CTRL_CMD_FB_ALLOCATION_INFO. The client has to sort the returned information if 2573 * it wants to retain the legacy behavior of SORTED BY OFFSET. Information is only returned 2574 * if and only if allocCount[IN]>=allocCount[OUT] and clientCount[IN]>=clientCount[OUT]. 2575 * 2576 * @params [IN/OUT] NvP64 clientCount: 2577 * Client specifies the client count that it received using the 2578 * previous NV2080_CTRL_CMD_FB_GET_CLIENT_ALLOCATION_INFO control call. 2579 * RM will get the total number of clients that have allocations with RM 2580 * and fill clientCount with it. 2581 * 2582 * @params [IN] NvP64 pClientInfo: 2583 * Pointer to the buffer allocated by client of size NV2080_CTRL_CMD_FB_CLIENT_INFO * 2584 * clientCount. RM returns the info pertaining to each of the clients that have allocations 2585 * known about by RM in pClientInfo. The format of the allocation information is given by 2586 * NV2080_CTRL_CMD_FB_CLIENT_INFO. Information is only returned if and only if 2587 * allocCount[IN]>=allocCount[OUT] and clientCount[IN]>=clientCount[OUT]. 2588 * 2589 * @returns Possible status values returned are: 2590 * NV_OK 2591 * NV_ERR_INVALID_POINTER 2592 * NV_ERR_NO_MEMORY 2593 * 2594 * @Usage: All privileged RM clients for debugging only. Initially, call this with allocCount = 2595 * clientCount = 0 to get client count, and then call again with allocated memory and sizes. 2596 * Client can repeat with the new count-sized allocations until a maximum try count is 2597 * reached or client is out of memory. 2598 */ 2599 2600 #define NV2080_CTRL_CMD_FB_GET_CLIENT_ALLOCATION_INFO (0x20801349U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_CMD_FB_GET_CLIENT_ALLOCATION_INFO_PARAMS_MESSAGE_ID" */ 2601 2602 /* 2603 * These work with the FLD_SET_REF_NUM and FLD_TEST_REF macros and describe the 'flags' member 2604 * of the NV2080_CTRL_CMD_FB_ALLOCATION_INFO struct. 2605 */ 2606 2607 // Address space of the allocation 2608 #define NV2080_CTRL_CMD_FB_ALLOCATION_FLAGS_TYPE 4:0 2609 #define NV2080_CTRL_CMD_FB_ALLOCATION_FLAGS_TYPE_SYSMEM 0U 2610 #define NV2080_CTRL_CMD_FB_ALLOCATION_FLAGS_TYPE_VIDMEM 1U 2611 2612 // Whether the allocation is shared 2613 #define NV2080_CTRL_CMD_FB_ALLOCATION_FLAGS_SHARED 5:5 2614 #define NV2080_CTRL_CMD_FB_ALLOCATION_FLAGS_SHARED_FALSE 0U 2615 #define NV2080_CTRL_CMD_FB_ALLOCATION_FLAGS_SHARED_TRUE 1U 2616 2617 // Whether this client owns this allocation 2618 #define NV2080_CTRL_CMD_FB_ALLOCATION_FLAGS_OWNER 6:6 2619 #define NV2080_CTRL_CMD_FB_ALLOCATION_FLAGS_OWNER_FALSE 0U 2620 #define NV2080_CTRL_CMD_FB_ALLOCATION_FLAGS_OWNER_TRUE 1U 2621 2622 typedef struct NV2080_CTRL_CMD_FB_ALLOCATION_INFO { 2623 NvU32 client; /* [OUT] Identifies the client that made or shares the allocation (index into pClientInfo)*/ 2624 NvU32 flags; /* [OUT] Flags associated with the allocation (see previous defines) */ 2625 NV_DECLARE_ALIGNED(NvU64 beginAddr, 8); /* [OUT] Starting physical address of the chunk */ 2626 NV_DECLARE_ALIGNED(NvU64 size, 8); /* [OUT] Size of the allocated contiguous chunk in bytes */ 2627 } NV2080_CTRL_CMD_FB_ALLOCATION_INFO; 2628 2629 typedef struct NV2080_CTRL_CMD_FB_CLIENT_INFO { 2630 NvHandle handle; /* [OUT] Handle of the client that made or shares the allocation */ 2631 NvU32 pid; /* [OUT] PID of the client that made or shares the allocation */ 2632 2633 /* For the definition of the subprocessID and subprocessName params, see NV0000_CTRL_CMD_SET_SUB_PROCESS_ID */ 2634 NvU32 subProcessID; /* [OUT] Subprocess ID of the client that made or shares the allocation */ 2635 char subProcessName[NV_PROC_NAME_MAX_LENGTH]; /* [OUT] Subprocess Name of the client that made or shares the allocation */ 2636 } NV2080_CTRL_CMD_FB_CLIENT_INFO; 2637 2638 #define NV2080_CTRL_CMD_FB_GET_CLIENT_ALLOCATION_INFO_PARAMS_MESSAGE_ID (0x49U) 2639 2640 typedef struct NV2080_CTRL_CMD_FB_GET_CLIENT_ALLOCATION_INFO_PARAMS { 2641 NV_DECLARE_ALIGNED(NvU64 allocCount, 8); 2642 NV_DECLARE_ALIGNED(NvP64 pAllocInfo, 8); 2643 NV_DECLARE_ALIGNED(NvU64 clientCount, 8); 2644 NV_DECLARE_ALIGNED(NvP64 pClientInfo, 8); 2645 } NV2080_CTRL_CMD_FB_GET_CLIENT_ALLOCATION_INFO_PARAMS; 2646 2647 /* 2648 * NV2080_CTRL_CMD_FB_UPDATE_NUMA_STATUS 2649 * 2650 * This control command is used by clients to update the NUMA status. 2651 * 2652 * @params [IN] NvBool bOnline: 2653 * 2654 * @returns Possible status values returned are: 2655 * NV_OK 2656 * NV_ERR_INVALID_STATE 2657 * 2658 */ 2659 #define NV2080_CTRL_CMD_FB_UPDATE_NUMA_STATUS (0x20801350U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_UPDATE_NUMA_STATUS_PARAMS_MESSAGE_ID" */ 2660 2661 #define NV2080_CTRL_FB_UPDATE_NUMA_STATUS_PARAMS_MESSAGE_ID (0x50U) 2662 2663 typedef struct NV2080_CTRL_FB_UPDATE_NUMA_STATUS_PARAMS { 2664 NvBool bOnline; 2665 } NV2080_CTRL_FB_UPDATE_NUMA_STATUS_PARAMS; 2666 2667 /* 2668 * NV2080_CTRL_CMD_FB_GET_NUMA_INFO 2669 * 2670 * This control command is used by clients to get per-subdevice or 2671 * subscribed MIG partition(when MIG is enabled) NUMA memory information as 2672 * assigned by the system. 2673 * 2674 * numaNodeId[OUT] 2675 * - Specifies the NUMA node ID. 2676 * 2677 * numaMemAddr[OUT] 2678 * - Specifies the NUMA memory address. 2679 * 2680 * numaMemSize[OUT] 2681 * - Specifies the NUMA memory size. 2682 * 2683 * numaOfflineAddressesCount[IN/OUT] 2684 * - If non-zero, then it specifies the maximum number of entries in 2685 * numaOfflineAddresses[] for which the information is required. 2686 * It will be updated with the actual number of entries present in 2687 * the numaOfflineAddresses[]. 2688 * 2689 * numaOfflineAddresses[OUT] 2690 * - If numaOfflineAddressesCount is non-zero, it contains the addresses 2691 * of offline pages in the NUMA region. 2692 * 2693 * @returns Possible status values returned are: 2694 * NV_OK 2695 * NV_ERR_INVALID_ARGUMENT 2696 */ 2697 #define NV2080_CTRL_CMD_FB_GET_NUMA_INFO (0x20801351U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_NUMA_INFO_PARAMS_MESSAGE_ID" */ 2698 2699 #define NV2080_CTRL_FB_NUMA_INFO_MAX_OFFLINE_ADDRESSES 64U 2700 2701 #define NV2080_CTRL_FB_GET_NUMA_INFO_PARAMS_MESSAGE_ID (0x51U) 2702 2703 typedef struct NV2080_CTRL_FB_GET_NUMA_INFO_PARAMS { 2704 NvS32 numaNodeId; 2705 NV_DECLARE_ALIGNED(NvU64 numaMemAddr, 8); 2706 NV_DECLARE_ALIGNED(NvU64 numaMemSize, 8); 2707 NvU32 numaOfflineAddressesCount; 2708 NV_DECLARE_ALIGNED(NvU64 numaOfflineAddresses[NV2080_CTRL_FB_NUMA_INFO_MAX_OFFLINE_ADDRESSES], 8); 2709 } NV2080_CTRL_FB_GET_NUMA_INFO_PARAMS; 2710 2711 /* 2712 * NV2080_CTRL_CMD_FB_GET_SEMAPHORE_SURFACE_LAYOUT 2713 * 2714 * This control command is used by clients to get NV_SEMAPHORE_SURFACE layout/caps before allocation. 2715 * A semaphore surface can be viewed as an array of independent semaphore entries. 2716 * 2717 * maxSubmittedSemaphoreValueOffset[OUT] 2718 * - An offset of the max submitted value, relative to the semaphore surface entry start, if used. 2719 * Used to emulate 64-bit semaphore values on chips where 64-bit semaphores are not supported. 2720 * 2721 * monitoredFenceThresholdOffset[OUT] 2722 * - An offset of the monitored fence memory, relative to the semaphore surface entry start, if supported. 2723 * 2724 * size[OUT] 2725 * - A size of a single semaphore surface entry. 2726 * 2727 * caps[OUT] 2728 * - A mask of NV2080_CTRL_FB_GET_SEMAPHORE_SURFACE_LAYOUT_CAPS_* values. 2729 */ 2730 #define NV2080_CTRL_CMD_FB_GET_SEMAPHORE_SURFACE_LAYOUT (0x20801352U) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_FB_GET_SEMAPHORE_SURFACE_LAYOUT_PARAMS_MESSAGE_ID" */ 2731 2732 #define NV2080_CTRL_FB_GET_SEMAPHORE_SURFACE_LAYOUT_CAPS_MONITORED_FENCE_SUPPORTED (0x00000001U) 2733 #define NV2080_CTRL_FB_GET_SEMAPHORE_SURFACE_LAYOUT_CAPS_64BIT_SEMAPHORES_SUPPORTED (0x00000002U) 2734 2735 #define NV2080_CTRL_FB_GET_SEMAPHORE_SURFACE_LAYOUT_PARAMS_MESSAGE_ID (0x52U) 2736 2737 typedef struct NV2080_CTRL_FB_GET_SEMAPHORE_SURFACE_LAYOUT_PARAMS { 2738 NV_DECLARE_ALIGNED(NvU64 maxSubmittedSemaphoreValueOffset, 8); 2739 NV_DECLARE_ALIGNED(NvU64 monitoredFenceThresholdOffset, 8); 2740 NV_DECLARE_ALIGNED(NvU64 size, 8); 2741 NvU32 caps; 2742 } NV2080_CTRL_FB_GET_SEMAPHORE_SURFACE_LAYOUT_PARAMS; 2743 2744 typedef struct NV2080_CTRL_CMD_FB_STATS_ENTRY { 2745 //! Total physical memory available (accounts row-remapping) 2746 NV_DECLARE_ALIGNED(NvU64 totalSize, 8); 2747 2748 //! Total reserved memory (includes both Region 1 and region 2) 2749 NV_DECLARE_ALIGNED(NvU64 rsvdSize, 8); 2750 2751 //! Total usable memory (Region 0) for OS/KMD 2752 NV_DECLARE_ALIGNED(NvU64 osSize, 8); 2753 2754 //! Region 1 (RM Internal) memory 2755 NV_DECLARE_ALIGNED(NvU64 r1Size, 8); 2756 2757 //! Region 2 (Reserved) memory 2758 NV_DECLARE_ALIGNED(NvU64 r2Size, 8); 2759 2760 //! Free memory (reserved but not allocated) 2761 NV_DECLARE_ALIGNED(NvU64 freeSize, 8); 2762 } NV2080_CTRL_CMD_FB_STATS_ENTRY; 2763 2764 typedef struct NV2080_CTRL_CMD_FB_STATS_OWNER_INFO { 2765 //! Total allocated size for this owner 2766 NV_DECLARE_ALIGNED(NvU64 allocSize, 8); 2767 2768 //! Total memory blocks belonging this owner 2769 NvU32 numBlocks; 2770 2771 //! Total reserved size for this owner 2772 NV_DECLARE_ALIGNED(NvU64 rsvdSize, 8); 2773 } NV2080_CTRL_CMD_FB_STATS_OWNER_INFO; 2774 2775 #define NV2080_CTRL_CMD_FB_STATS_MAX_OWNER 200U 2776 2777 /* 2778 * NV2080_CTRL_CMD_FB_STATS_GET 2779 * 2780 * Get the FB allocations info. 2781 */ 2782 #define NV2080_CTRL_CMD_FB_STATS_GET (0x2080132a) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_0_FB_INTERFACE_ID << 8) | NV2080_CTRL_CMD_FB_STATS_GET_PARAMS_MESSAGE_ID" */ 2783 2784 #define NV2080_CTRL_CMD_FB_STATS_GET_PARAMS_MESSAGE_ID (0x2AU) 2785 2786 typedef struct NV2080_CTRL_CMD_FB_STATS_GET_PARAMS { 2787 2788 //! Version id for driver and tool matching 2789 NV_DECLARE_ALIGNED(NvU64 version, 8); 2790 2791 //! All sizes info 2792 NV_DECLARE_ALIGNED(NV2080_CTRL_CMD_FB_STATS_ENTRY fbSizeInfo, 8); 2793 2794 //! Level 2 owner info table 2795 NV_DECLARE_ALIGNED(NV2080_CTRL_CMD_FB_STATS_OWNER_INFO fbBlockInfo[NV2080_CTRL_CMD_FB_STATS_MAX_OWNER], 8); 2796 } NV2080_CTRL_CMD_FB_STATS_GET_PARAMS; 2797 2798 /* _ctrl2080fb_h_ */ 2799