1 /* 2 * Copyright (c) 2024, Intel Corporation 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included 12 * in all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 * OTHER DEALINGS IN THE SOFTWARE. 21 */ 22 23 //! 24 //! \file mhw_blt_hwcmd_XE2_HPM_next.h 25 //! \brief Auto-generated constructors for MHW and states. 26 //! \details This file may not be included outside of XE2_HPM as other components 27 //! should use MHW interface to interact with MHW commands and states. 28 //! 29 30 #ifndef __MHW_BLT_HWCMD_XE2_HPM_NEXT_H__ 31 #define __MHW_BLT_HWCMD_XE2_HPM_NEXT_H__ 32 33 #pragma once 34 #pragma pack(1) 35 36 #include <cstdint> 37 #include <cstddef> 38 #include "media_class_trace.h" 39 40 namespace mhw 41 { 42 namespace blt 43 { 44 namespace xe2_hpm 45 { 46 class Cmd 47 { 48 public: 49 // Internal Macros 50 #define __CODEGEN_MAX(_a, _b) (((_a) > (_b)) ? (_a) : (_b)) 51 #define __CODEGEN_BITFIELD(l, h) (h) - (l) + 1 52 ////////////////////////////////////////////////////////////////////////// 53 /// @brief XY_BLOCK_COPY_BLT 54 /// @details 55 /// XY_BLOCK_COPY_BLT instruction performs a color source copy where the 56 /// only operands involved are a color source and destination of the same 57 /// bit width. The source and destination surfaces CAN overlap, the hardware 58 /// handles this internally. Legacy blit commands (2D BLT instructions other 59 /// than XY_BLOCK_COPY_BLT, XY_FAST_COPY_BLT, XY_FAST_COLOR_BLT) and this 60 /// new copy command can be interspersed. No implied flush required between 61 /// the two provided there is no producer consumer relationship between the 62 /// two.The starting pixel of the blit operation for both source and 63 /// destination should be on a pixel boundary. This command now supports 64 /// copy of compressed surface. 65 /// In case of producer consumer relationship between a legacy blitter 66 /// command and anew copy command a flush must be inserted between the two 67 /// by software. 68 /// 69 struct XY_BLOCK_COPY_BLT_CMD 70 { 71 union 72 { 73 struct 74 { 75 uint32_t DWordLength : __CODEGEN_BITFIELD( 0, 7) ; ///< U8 76 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 8) ; ///< U1 77 uint32_t NumberofMultisamples : __CODEGEN_BITFIELD( 9, 11) ; ///< U3 78 uint32_t SpecialModeofOperation : __CODEGEN_BITFIELD(12, 13) ; ///< U2 79 uint32_t Reserved14 : __CODEGEN_BITFIELD(14, 18) ; ///< U5 80 uint32_t ColorDepth : __CODEGEN_BITFIELD(19, 21) ; ///< U3 81 uint32_t InstructionTargetOpcode : __CODEGEN_BITFIELD(22, 28) ; ///< U7 82 uint32_t Client : __CODEGEN_BITFIELD(29, 31) ; ///< U3 83 }; 84 uint32_t Value; 85 } DW0; 86 union 87 { 88 struct 89 { 90 uint32_t DestinationPitch : __CODEGEN_BITFIELD( 0, 17) ; ///< U18 91 uint32_t Reserved18 : __CODEGEN_BITFIELD(18, 20) ; ///< U3 92 uint32_t DestinationEncryptEn : __CODEGEN_BITFIELD(21, 21) ; ///< U7 93 uint32_t Reserved22 : __CODEGEN_BITFIELD(22, 23) ; ///< U4 94 uint32_t DestinationMocsValue : __CODEGEN_BITFIELD(24, 27) ; ///< U7 95 uint32_t Reserved28 : __CODEGEN_BITFIELD(28, 28); ///< U1 96 uint32_t Reserved29 : __CODEGEN_BITFIELD(29, 29); ///< U1 97 uint32_t DestinationTiling : __CODEGEN_BITFIELD(30, 31) ; ///< U2 98 }; 99 uint32_t Value; 100 } DW1; 101 union 102 { 103 struct 104 { 105 uint32_t DestinationX1CoordinateLeft : __CODEGEN_BITFIELD(0, 15); ///< U16 106 uint32_t DestinationY1CoordinateTop : __CODEGEN_BITFIELD(16, 31); ///< U16 107 }; 108 uint32_t Value; 109 } DW2; 110 union 111 { 112 struct 113 { 114 uint32_t DestinationX2CoordinateRight : __CODEGEN_BITFIELD( 0, 15) ; ///< U16 115 uint32_t DestinationY2CoordinateBottom : __CODEGEN_BITFIELD(16, 31) ; ///< U16 116 }; 117 uint32_t Value; 118 } DW3; 119 union 120 { 121 struct 122 { 123 uint64_t DestinationBaseAddress; //!< U64 124 }; 125 uint32_t Value[2]; 126 } DW4_5; 127 union 128 { 129 struct 130 { 131 uint32_t DestinationXOffset : __CODEGEN_BITFIELD(0, 13); ///< U14 132 uint32_t Reserved206 : __CODEGEN_BITFIELD(14, 15); ///< U2 133 uint32_t DestinationYOffset : __CODEGEN_BITFIELD(16, 29); ///< U14 134 uint32_t Reserved222 : __CODEGEN_BITFIELD(30, 30); ///< U1 135 uint32_t DestinationTargetMemory : __CODEGEN_BITFIELD(31, 31); ///< U1 136 }; 137 uint32_t Value; 138 } DW6; 139 union 140 { 141 struct 142 { 143 uint32_t SourceX1CoordinateLeft : __CODEGEN_BITFIELD( 0, 15) ; ///< U16 144 uint32_t SourceY1CoordinateTop : __CODEGEN_BITFIELD(16, 31) ; ///< U16 145 }; 146 uint32_t Value; 147 } DW7; 148 union 149 { 150 struct 151 { 152 uint32_t SourcePitch : __CODEGEN_BITFIELD(0, 17); ///< U18 153 uint32_t Reserved18 : __CODEGEN_BITFIELD(18, 20); ///< U3 154 uint32_t SourceEncrypEn : __CODEGEN_BITFIELD(21, 21); ///< U1 155 uint32_t Reserved2 : __CODEGEN_BITFIELD(22, 23); ///< U2 156 uint32_t SourceMocs : __CODEGEN_BITFIELD(24, 27); ///< U4 157 uint32_t Reserved28 : __CODEGEN_BITFIELD(28, 28); ///< U1 158 uint32_t Reserved29 : __CODEGEN_BITFIELD(29, 29); ///< U1 159 uint32_t SourceTiling : __CODEGEN_BITFIELD(30, 31); ///< U2 160 }; 161 uint32_t Value; 162 } DW8; 163 union 164 { 165 struct 166 { 167 uint64_t SourceBaseAddress; //!< U64 168 }; 169 uint32_t Value[2]; 170 } DW9_10; 171 union 172 { 173 struct 174 { 175 uint32_t SourceXoffset : __CODEGEN_BITFIELD( 0, 13) ; ///< U14 176 uint32_t Reserved366 : __CODEGEN_BITFIELD(14, 15) ; ///< U2 177 uint32_t SourceYoffset : __CODEGEN_BITFIELD(16, 29) ; ///< U14 178 uint32_t Reserved382 : __CODEGEN_BITFIELD(30, 30) ; ///< U1 179 uint32_t SourceTargetMemory : __CODEGEN_BITFIELD(31, 31) ; ///< U1 180 }; 181 uint32_t Value; 182 } DW11; 183 union 184 { 185 struct 186 { 187 uint32_t Reserved0 : __CODEGEN_BITFIELD(0, 3); ///< U4 188 uint32_t Reserved4 : __CODEGEN_BITFIELD(4, 31); ///< U28 189 }; 190 uint32_t Value; 191 } DW12; 192 union 193 { 194 struct 195 { 196 uint32_t Reserved441 : __CODEGEN_BITFIELD(0, 31) ; ///< U32 197 }; 198 uint32_t Value; 199 } DW13; 200 union 201 { 202 struct 203 { 204 uint32_t Reserved0 : __CODEGEN_BITFIELD(0, 3); ///< U4 205 uint32_t Reserved4 : __CODEGEN_BITFIELD( 4, 31) ; ///< U28 206 }; 207 uint32_t Value; 208 } DW14; 209 union 210 { 211 struct 212 { 213 uint32_t Reserved505 : __CODEGEN_BITFIELD(0, 31) ; ///< U32 214 }; 215 uint32_t Value; 216 } DW15; 217 union 218 { 219 struct 220 { 221 uint32_t DestinationSurfaceHeight : __CODEGEN_BITFIELD( 0, 13) ; ///< U14 222 uint32_t DestinationSurfaceWidth : __CODEGEN_BITFIELD(14, 27) ; ///< U14 223 uint32_t Reserved540 : __CODEGEN_BITFIELD(28, 28) ; ///< U1 224 uint32_t DestinationSurfaceType : __CODEGEN_BITFIELD(29, 31) ; ///< U3 225 }; 226 uint32_t Value; 227 } DW16; 228 union 229 { 230 struct 231 { 232 uint32_t DestinationLOD : __CODEGEN_BITFIELD(0, 3); ///< U4 233 uint32_t DestinationSurfaceQpitch : __CODEGEN_BITFIELD(4, 18); ///< U15 234 uint32_t Reserved563 : __CODEGEN_BITFIELD(19, 20); ///< U2 235 uint32_t DestinationSurfaceDepth : __CODEGEN_BITFIELD(21, 31); ///< U11 236 }; 237 uint32_t Value; 238 } DW17; 239 union 240 { 241 struct 242 { 243 uint32_t DestinationHorizontalAlign : __CODEGEN_BITFIELD( 0, 1) ; ///< U2 244 uint32_t Reserved578 : __CODEGEN_BITFIELD( 2, 2) ; ///< U1 245 uint32_t DestinationVerticalAlign : __CODEGEN_BITFIELD( 3, 4) ; ///< U2 246 uint32_t Reserved581 : __CODEGEN_BITFIELD( 5, 7) ; ///< U3 247 uint32_t DestinationMipTailStartLOD : __CODEGEN_BITFIELD( 8, 11) ; ///< U4 248 uint32_t Reserved588 : __CODEGEN_BITFIELD(12, 17) ; ///< U6 249 uint32_t Reserved18 : __CODEGEN_BITFIELD(18, 18); ///< U1 250 uint32_t Reserved595 : __CODEGEN_BITFIELD(19, 20) ; ///< U2 251 uint32_t DestinationArrayIndex : __CODEGEN_BITFIELD(21, 31) ; ///< U11 252 }; 253 uint32_t Value; 254 } DW18; 255 union 256 { 257 struct 258 { 259 uint32_t SourceSurfaceHeight : __CODEGEN_BITFIELD( 0, 13) ; ///< U14 260 uint32_t SourceSurfaceWidth : __CODEGEN_BITFIELD(14, 27) ; ///< U14 261 uint32_t Reserved636 : __CODEGEN_BITFIELD(28, 28) ; ///< U1 262 uint32_t SourceSurfaceType : __CODEGEN_BITFIELD(29, 31) ; ///< U3 263 }; 264 uint32_t Value; 265 } DW19; 266 union 267 { 268 struct 269 { 270 uint32_t SourceLOD : __CODEGEN_BITFIELD( 0, 3) ; ///< U4 271 uint32_t SourceSurfaceQpitch : __CODEGEN_BITFIELD( 4, 18) ; ///< U15 272 uint32_t Reserved659 : __CODEGEN_BITFIELD(19, 20) ; ///< U2 273 uint32_t SourceSurfaceDepth : __CODEGEN_BITFIELD(21, 31) ; ///< U11 274 }; 275 uint32_t Value; 276 } DW20; 277 union 278 { 279 struct 280 { 281 uint32_t SourceHorizontalAlign : __CODEGEN_BITFIELD( 0, 1) ; ///< U2 282 uint32_t Reserved674 : __CODEGEN_BITFIELD( 2, 2) ; ///< U1 283 uint32_t SourceVerticalAlign : __CODEGEN_BITFIELD( 3, 4) ; ///< U2 284 uint32_t Reserved677 : __CODEGEN_BITFIELD( 5, 7) ; ///< U3 285 uint32_t SourceMipTailStartLOD : __CODEGEN_BITFIELD( 8, 11) ; ///< U4 286 uint32_t Reserved684 : __CODEGEN_BITFIELD(12, 17) ; ///< U6 287 uint32_t Reserved18 : __CODEGEN_BITFIELD(18, 18); ///< U1 288 uint32_t Reserved691 : __CODEGEN_BITFIELD(19, 20) ; ///< U2 289 uint32_t SourceArrayIndex : __CODEGEN_BITFIELD(21, 31) ; ///< U11 290 }; 291 uint32_t Value; 292 } DW21; 293 294 ////////////////////////////////////////////////////////////////////////// 295 /// @name LOCAL ENUMERATIONS 296 /// @{ 297 298 /// @brief U8 299 enum DWORD_LENGTH 300 { 301 DWORD_LENGTH_EXCLUDES_DWORD_0_1 = 20, ///< 302 }; 303 304 /// @brief U3 305 enum NUMBER_OF_MULTISAMPLES 306 { 307 NUMBER_OF_MULTISAMPLES_MULTISAMPLECOUNT_1 = 0, ///< 308 NUMBER_OF_MULTISAMPLES_MULTISAMPLECOUNT_2 = 1, ///< 309 NUMBER_OF_MULTISAMPLES_MULTISAMPLECOUNT_4 = 2, ///< 310 NUMBER_OF_MULTISAMPLES_MULTISAMPLECOUNT_8 = 3, ///< 311 NUMBER_OF_MULTISAMPLES_MULTISAMPLECOUNT_16 = 4, ///< 312 }; 313 314 /// @brief U2 315 enum SPECIAL_MODE_OF_OPERATION 316 { 317 SPECIAL_MODE_OF_OPERATION_NONE = 0, ///< No special mode. It will act as regular copy command. 318 SPECIAL_MODE_OF_OPERATION_FULL_RESOLVE = 1, ///< In-place resolve to get rid of 128B blocks from clear or compression state. 319 SPECIAL_MODE_OF_OPERATION_PARTIAL_RESOLVE = 2, ///< Partial resolve is for resolving the surface for clear values. If the surface is compressed it keeps it compressed, no implied clear values. 320 }; 321 322 /// @brief U3 323 enum COLOR_DEPTH 324 { 325 COLOR_DEPTH_8BITCOLOR = 0, //!< No additional details 326 COLOR_DEPTH_16BITCOLOR = 1, //!< No additional details 327 COLOR_DEPTH_32BITCOLOR = 2, //!< No additional details 328 COLOR_DEPTH_64BITCOLOR = 3, //!< No additional details 329 COLOR_DEPTH_96BITCOLOR_ONLYLINEARCASEISSUPPORTED = 4, //!< No additional details 330 COLOR_DEPTH_128BITCOLOR = 5, //!< No additional details 331 }; 332 333 /// @brief U3 334 enum CLIENT 335 { 336 CLIENT_2D_PROCESSOR = 2, ///< 337 }; 338 339 /// @brief U3 340 enum DESTINATION_AUXILIARY_SURFACE_MODE 341 { 342 DESTINATION_AUXILIARY_SURFACE_MODE_AUX_NONE = 0, ///< No Auxiliary surface used 343 DESTINATION_AUXILIARY_SURFACE_MODE_AUX_CCS_E = 5, ///Auxiliary surface is a CCS with lossless compression enabled when number of multisamples is 1. When number of multisamples > 1, programming this value means MSAA compression enabled. 344 }; 345 346 /// @brief U1 347 enum DESTINATION_CONTROL_SURFACE_TYPE 348 { 349 DESTINATION_CONTROL_SURFACE_TYPE_3D_CONTROL_SURFACE = 0, ///< Control Surface type is 3D. 350 DESTINATION_CONTROL_SURFACE_TYPE_MEDIA_CONTROL_SURFACE = 1, ///< Control Surface type is media. 351 }; 352 353 /// @brief U1 354 enum DESTINATION_COMPRESSION_ENABLE 355 { 356 DESTINATION_COMPRESSION_ENABLE_COMPRESSION_DISABLE = 0, ///< Enables uncompressed write operation to destination surface. 357 DESTINATION_COMPRESSION_ENABLE_COMPRESSION_ENABLE = 1, ///< Enables compressed write operation to destination surface provided special mode of operation is not FULL_RESOLVE. 358 }; 359 360 /// @brief U2 361 enum DESTINATION_TILING 362 { 363 DESTINATION_TILING_LINEAR = 0, ///< Linear mode (no tiling) 364 DESTINATION_TILING_XMAJOR = 1, ///< X major Tiling 365 DESTINATION_TILING_TILE4 = 2, ///< Tile4 4KB tiling 366 DESTINATION_TILING_TILE64 = 3, ///< Tile64 64KB tiling 367 }; 368 369 /// @brief U1 370 enum DESTINATION_TARGET_MEMORY 371 { 372 DESTINATION_TARGET_MEMORY_LOCAL_MEM = 0, ///< Traget memory is local memory. 373 DESTINATION_TARGET_MEMORY_SYSTEM_MEM = 1, ///< Target memory is system memory. 374 }; 375 376 /// @brief U3 377 enum SOURCE_AUXILIARY_SURFACE_MODE 378 { 379 SOURCE_AUXILIARY_SURFACE_MODE_AUX_NONE = 0, ///< No Auxiliary surface used 380 SOURCE_AUXILIARY_SURFACE_MODE_AUX_CCS_E = 5, ///< Auxiliary surface is a CCS with lossless compression enabled when number of multisamples is 1. When number of multisamples > 1, programming this value means MSAA compression enabled. 381 }; 382 383 /// @brief U1 384 enum SOURCE_CONTROL_SURFACE_TYPE 385 { 386 SOURCE_CONTROL_SURFACE_TYPE_3D_CONTROL_SURFACE = 0, ///< Control Surface type is 3D. 387 SOURCE_CONTROL_SURFACE_TYPE_MEDIA_CONTROL_SURFACE = 1, ///< Control Surface type is media 388 }; 389 390 /// @brief U1 391 enum SOURCE_COMPRESSION_ENABLE 392 { 393 SOURCE_COMPRESSION_ENABLE_COMPRESSION_DISABLE = 0, ///< 394 SOURCE_COMPRESSION_ENABLE_COMPRESSION_ENABLE = 1, ///< 395 }; 396 397 /// @brief U2 398 enum SOURCE_TILING 399 { 400 SOURCE_TILING_LINEAR = 0, ///< Linear Tiling (tiking disabled) 401 SOURCE_TILING_XMAJOR = 1, ///< X major tiling 402 SOURCE_TILING_TILE4 = 2, ///< Tile4 4KB tiling 403 SOURCE_TILING_TILE64 = 3, ///< Tile64 64KB tiling 404 }; 405 406 /// @brief U1 407 enum SOURCE_TARGET_MEMORY 408 { 409 SOURCE_TARGET_MEMORY_LOCAL_MEM = 0, ///< Target memory is local memory. 410 SOURCE_TARGET_MEMORY_SYSTEM_MEM = 1, ///< Target memory is system memory. 411 }; 412 413 /// @brief U1 414 enum SOURCE_CLEAR_VALUE_ENABLE 415 { 416 SOURCE_CLEAR_VALUE_ENABLE_DISABLE = 0, ///< 417 SOURCE_CLEAR_VALUE_ENABLE_ENABLE = 1, ///< 418 }; 419 420 /// @brief U1 421 enum DESTINATION_CLEAR_VALUE_ENABLE 422 { 423 DESTINATION_CLEAR_VALUE_ENABLE_DISABLE = 0, ///< 424 DESTINATION_CLEAR_VALUE_ENABLE_ENABLE = 1, ///< 425 }; 426 427 /// @brief U3 428 enum DESTINATION_SURFACE_TYPE 429 { 430 DESTINATION_SURFACE_TYPE_SURFTYPE_1D = 0, ///< Defines a 1-dimensional map or array of maps 431 DESTINATION_SURFACE_TYPE_SURFTYPE_2D = 1, ///< Defines a 2-dimensional map or array of maps 432 DESTINATION_SURFACE_TYPE_SURFTYPE_3D = 2, ///< Defines a 3-dimensional (volumetric) map 433 DESTINATION_SURFACE_TYPE_SURFTYPE_CUBE = 3, ///< Defines a cube map or array of cube maps. 434 }; 435 436 /// @brief U3 437 enum SOURCE_SURFACE_TYPE 438 { 439 SOURCE_SURFACE_TYPE_SURFTYPE_1D = 0, ///< Defines a 1-dimensional map or array of maps 440 SOURCE_SURFACE_TYPE_SURFTYPE_2D = 1, ///< Defines a 2-dimensional map or array of maps 441 SOURCE_SURFACE_TYPE_SURFTYPE_3D = 2, ///< Defines a 1-dimensional (volumetric) map. 442 SOURCE_SURFACE_TYPE_SURFTYPE_CUBE = 3, ///< Defines a cube map or array of cube maps. 443 }; 444 //! \name Initializations 445 446 //! \brief Explicit member initialization function XY_BLOCK_COPY_BLT_CMDXY_BLOCK_COPY_BLT_CMD447 XY_BLOCK_COPY_BLT_CMD() 448 { 449 DW0.Value = 0x50400014; 450 //DW0.DwordLength = DWORD_LENGTH_EXCLUDES_DWORD_0_1; 451 //DW0.NumberOfMultisamples = NUMBER_OF_MULTISAMPLES_MULTISAMPLECOUNT_1; 452 //DW0.SpecialModeofOperation = SPECIAL_MODE_OF_OPERATION_NONE; 453 //DW0.ColorDepth = COLOR_DEPTH_8_BIT_COLOR; 454 //DW0.InstructionTarget_Opcode = 0x0; 455 //DW0.Client = CLIENT_2D_PROCESSOR; 456 DW1.Value = 0x0; 457 //DW1.DestinationPitch = 0x0; 458 //DW1.DestinationMOCSvalue = 0x0; 459 //DW1.DestinationTiling = DESTINATION_TILING_LINEAR; 460 DW2.Value = 0x0; 461 //DW2.DestinationX1Coordinate_Left = 0x0; 462 //DW2.DestinationY1Coordinate_Top = 0x0; 463 DW3.Value = 0x0; 464 //DW3.DestinationX2Coordinate_Right = 0x0; 465 //DW3.DestinationY2Coordinate_Bottom = 0x0; 466 DW4_5.Value[0] = DW4_5.Value[1] = 0x0; 467 //DW4_5.DestinationBaseAddress = 0x0; 468 DW6.Value = 0x0; 469 //DW6.DestinationXoffset = 0x0; 470 //DW6.DestinationYoffset = 0x0; 471 //DW6.DestinationTargetMemory = DESTINATION_TARGET_MEMORY_LOCAL_MEM; 472 DW7.Value = 0x0; 473 //DW7.SourceX1Coordinate_Left = 0x0; 474 //DW7.SourceY1Coordinate_Top = 0x0; 475 DW8.Value = 0x0; 476 //DW8.SourcePitch = 0x0; 477 //DW8.SourceMOCS = 0x0; 478 //DW8.SourceTiling = SOURCE_TILING_LINEAR; 479 DW9_10.Value[0] = DW9_10.Value[1] = 0x0; 480 //DW9.SourceBaseAddress = 0x0; 481 DW11.Value = 0x0; 482 //DW11.SourceXoffset = 0x0; 483 //DW11.SourceYoffset = 0x0; 484 //DW11.SourceTargetMemory = SOURCE_TARGET_MEMORY_LOCAL_MEM; 485 DW12.Value = 0x0; 486 DW13.Value = 0x0; 487 DW14.Value = 0x0; 488 DW15.Value = 0x0; 489 //DW15.DestinationClearAddressHigh = 0x0; 490 DW16.Value = 0x0; 491 //DW16.DestinationSurfaceHeight = 0x0; 492 //DW16.DestinationSurfaceWidth = 0x0; 493 //DW16.DestinationSurfaceType = DESTINATION_SURFACE_TYPE_SURFTYPE_1D; 494 DW17.Value = 0x0; 495 //DW17.DestinationLOD = 0x0; 496 //DW17.DestinationSurfaceQpitch = 0x0; 497 //DW17.DestinationSurfaceDepth = 0x0; 498 DW18.Value = 0x0; 499 //DW18.DestinationHorizontalAlign = 0x0; 500 //DW18.DestinationVerticalAlign = 0x0; 501 //DW18.DestinationMipTailStartLOD = 0x0; 502 //DW18.DestinationArrayIndex = 0x0; 503 DW19.Value = 0x0; 504 //DW19.SourceSurfaceHeight = 0x0; 505 //DW19.SourceSurfaceWidth = 0x0; 506 //DW19.SourceSurfaceType = SOURCE_SURFACE_TYPE_SURFTYPE_1D; 507 DW20.Value = 0x0; 508 //DW20.SourceLOD = 0x0; 509 //DW20.SourceSurfaceQpitch = 0x0; 510 //DW20.SourceSurfaceDepth = 0x0; 511 DW21.Value = 0x0; 512 //DW21.SourceHorizontalAlign = 0x0; 513 //DW21.SourceVerticalAlign = 0x0; 514 //DW21.SourceMipTailStartLOD = 0x0; 515 //DW21.SourceArrayIndex 516 } 517 518 static const size_t dwSize = 22; 519 static const size_t byteSize = 88; 520 }; 521 522 ////////////////////////////////////////////////////////////////////////// 523 /// @brief BCS_SWCTRL 524 /// @details 525 /// 526 /// 527 struct BCS_SWCTRL 528 { 529 union 530 { 531 struct 532 { 533 /// DWORD 0 534 uint32_t Reserved_0 : __CODEGEN_BITFIELD(0, 1); ///< U2 535 uint32_t Disable256Bctypegeneration : __CODEGEN_BITFIELD(2, 2); ///< U1 536 uint32_t ForceEnable4bitCCSupdate : __CODEGEN_BITFIELD(3, 3); ///< U1 537 uint32_t Reserved_4 : __CODEGEN_BITFIELD(4, 15); ///< U12 538 uint32_t Mask : __CODEGEN_BITFIELD(16, 31); ///< U16 539 }; 540 uint32_t Value; 541 } DW0; 542 543 ////////////////////////////////////////////////////////////////////////// 544 /// @name LOCAL ENUMERATIONS 545 /// @{ 546 547 /// @brief U1 548 enum DISABLE_256B_CTYPE_GENERATION 549 { 550 DISABLE_256B_CTYPE_GENERATION_EN = 0, ///< Enable 256B ctype generation. 551 DISABLE_256B_CTYPE_GENERATION_DIS = 1, ///< Disable 256B ctype generation logic 552 }; 553 554 /// @brief U1 555 enum FORCE_ENABLE_4_BIT_CCS_UPDATE 556 { 557 FORCE_ENABLE_4_BIT_CCS_UPDATE_DISABLE = 0, ///< 558 FORCE_ENABLE_4_BIT_CCS_UPDATE_ENABLE = 1, ///< 559 }; 560 561 /// @brief 562 enum CONSTANTS_TYPE 563 { 564 COMMAND_LENGTH = 1, ///< 565 REGISTER_OFFSET = 0x22200, ///< 566 }; 567 568 /// @brief Explicit member initialization function BCS_SWCTRLBCS_SWCTRL569 BCS_SWCTRL() 570 { 571 DW0.Value = 0x0; 572 //DW0.Common.Disable256Bctypegeneration = DISABLE_256B_CTYPE_GENERATION_EN; 573 //DW0.Common.ForceEnable4bitCCSupdate = FORCE_ENABLE_4_BIT_CCS_UPDATE_DISABLE; 574 //DW0.Common.Mask = 0x0; 575 } 576 }; 577 578 //! 579 //! \brief XY_FAST_COPY_BLT 580 //! \details 581 //! This BLT instruction performs a color source copy where the only 582 //! operands involved are a color source and destination of the same bit 583 //! width. The source and destination surfaces CANNOT overlap. The hardware 584 //! assumes this whenever this Fast_Copy command is given to it. For 585 //! overlapping Blits, use the traditional XY_SRC_COPY_BLT command (for 586 //! overlap determination, read the description given in the XY_SRC_COPY_BLT 587 //! command). Note that this command does not support Clipping operations. 588 //! This new blit command will happen in large numbers, consecutively, 589 //! possibly an entire batch will comprise only new blit commands Legacy 590 //! commands and new blit command will not be interspersed. If they are, 591 //! they will be separated by implied HW flush: Whenever there is a 592 //! transition between this new Fast Blit command and the Legacy Blit 593 //! commands (2D BLT instructions other than XY_BLOCK_COPY_BLT, 594 //! XY_FAST_COPY_BLT and XY_FAST_COLOR_BLT), the HW will impose an automatic 595 //! flush BEFORE the execution (at the beginning) of the next blitter 596 //! command. New blit command can use any combination of memory surface type 597 //! - linear, tiledX, tiledY, and the tiling information is conveyed as part 598 //! of the new Fast Copy command. The Fast Copy Blit supports the new 64KB 599 //! Tiling defined for SKL.The starting pixel of Fast Copy blit for both 600 //! source and destination should be on an OWord boundary. 601 //! Note that when two sequential fast copy blits have different source 602 //! surfaces, but their destinations refer to the same destination surfaces 603 //! and therefore destinations overlap it is imperative that a Flush be 604 //! inserted between the two blits. 605 //! 606 607 struct XY_FAST_COPY_BLT_CMD 608 { 609 union 610 { 611 struct 612 { 613 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH 614 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 12) ; //!< Reserved 615 uint32_t DestinationTilingMethod : __CODEGEN_BITFIELD(13, 14) ; //!< DESTINATION_TILING_METHOD 616 uint32_t Reserved15 : __CODEGEN_BITFIELD(15, 19) ; //!< Reserved 617 uint32_t SourceTilingMethod : __CODEGEN_BITFIELD(20, 21) ; //!< SOURCE_TILING_METHOD 618 uint32_t InstructionTargetOpcode : __CODEGEN_BITFIELD(22, 28) ; //!< INSTRUCTION_TARGETOPCODE 619 uint32_t Client : __CODEGEN_BITFIELD(29, 31) ; //!< CLIENT 620 }; 621 uint32_t Value; 622 } DW0; 623 union 624 { 625 struct 626 { 627 uint32_t DestinationPitch : __CODEGEN_BITFIELD( 0, 15) ; //!< Destination Pitch 628 uint32_t Reserved48 : __CODEGEN_BITFIELD(16, 23) ; //!< Reserved 629 uint32_t ColorDepth : __CODEGEN_BITFIELD(24, 26) ; //!< COLOR_DEPTH 630 uint32_t Reserved59 : __CODEGEN_BITFIELD(27, 29) ; //!< Reserved 631 uint32_t TileYTypeForDestination : __CODEGEN_BITFIELD(30, 30) ; //!< TILE_Y_TYPE_FOR_DESTINATION 632 uint32_t TileYTypeForSource : __CODEGEN_BITFIELD(31, 31) ; //!< TILE_Y_TYPE_FOR_SOURCE 633 }; 634 uint32_t Value; 635 } DW1; 636 union 637 { 638 struct 639 { 640 uint32_t DestinationX1CoordinateLeft : __CODEGEN_BITFIELD( 0, 15) ; //!< Destination X1 Coordinate (Left) 641 uint32_t DestinationY1CoordinateTop : __CODEGEN_BITFIELD(16, 31) ; //!< Destination Y1 Coordinate (Top) 642 }; 643 uint32_t Value; 644 } DW2; 645 union 646 { 647 struct 648 { 649 uint32_t DestinationX2CoordinateRight : __CODEGEN_BITFIELD( 0, 15) ; //!< Destination X2 Coordinate (Right) 650 uint32_t DestinationY2CoordinateBottom : __CODEGEN_BITFIELD(16, 31) ; //!< Destination Y2 Coordinate (Bottom) 651 }; 652 uint32_t Value; 653 } DW3; 654 union 655 { 656 struct 657 { 658 uint64_t DestinationBaseAddress ; //!< Destination Base Address 659 }; 660 uint32_t Value[2]; 661 } DW4_5; 662 union 663 { 664 struct 665 { 666 uint32_t SourceX1CoordinateLeft : __CODEGEN_BITFIELD( 0, 15) ; //!< Source X1 Coordinate (Left) 667 uint32_t SourceY1CoordinateTop : __CODEGEN_BITFIELD(16, 31) ; //!< Source Y1 Coordinate (Top) 668 }; 669 uint32_t Value; 670 } DW6; 671 union 672 { 673 struct 674 { 675 uint32_t SourcePitch : __CODEGEN_BITFIELD( 0, 15) ; //!< Source Pitch 676 uint32_t Reserved240 : __CODEGEN_BITFIELD(16, 31) ; //!< Reserved 677 }; 678 uint32_t Value; 679 } DW7; 680 union 681 { 682 struct 683 { 684 uint64_t SourceBaseAddress ; //!< Source Base Address 685 }; 686 uint32_t Value[2]; 687 } DW8_9; 688 689 //! \name Local enumerations 690 691 //! \brief DESTINATION_TILING_METHOD 692 //! \details 693 //! SW is required to flush the HW before changing the polarity of these 694 //! bits for subsequent blits. 695 enum DESTINATION_TILING_METHOD 696 { 697 DESTINATION_TILING_METHOD_LINEAR_TILINGDISABLED = 0, //!< No additional details 698 DESTINATION_TILING_METHOD_LEGACYTILE_X = 1, //!< No additional details 699 DESTINATION_TILING_METHOD_TILE_Y = 2, //!< Choosing between 'Legacy Tile-Y' or the 'New 4K Tile-YF' can be done in DWord 1, Bit[30]. 700 DESTINATION_TILING_METHOD_64KBTILING = 3, //!< No additional details 701 }; 702 703 //! \brief SOURCE_TILING_METHOD 704 //! \details 705 //! SW is required to flush the HW before changing the polarity of these 706 //! bits for subsequent blits. 707 enum SOURCE_TILING_METHOD 708 { 709 SOURCE_TILING_METHOD_LINEAR_TILINGDISABLED = 0, //!< No additional details 710 SOURCE_TILING_METHOD_LEGACYTILE_X = 1, //!< No additional details 711 SOURCE_TILING_METHOD_TILE_Y = 2, //!< Choosing between 'Legacy Tile-Y' or the 'New 4K Tile-YF' can be done in DWord 1, Bit[31]. 712 SOURCE_TILING_METHOD_64KBTILING = 3, //!< No additional details 713 }; 714 715 enum INSTRUCTION_TARGETOPCODE 716 { 717 INSTRUCTION_TARGETOPCODE_UNNAMED66 = 66, //!< No additional details 718 }; 719 720 enum CLIENT 721 { 722 CLIENT_2DPROCESSOR = 2, //!< No additional details 723 }; 724 725 enum COLOR_DEPTH 726 { 727 COLOR_DEPTH_8BITCOLOR = 0, //!< No additional details 728 COLOR_DEPTH_16BITCOLOR_565 = 1, //!< No additional details 729 COLOR_DEPTH_32BITCOLOR = 3, //!< No additional details 730 COLOR_DEPTH_64BITCOLOR_FOR64KBTILING = 4, //!< No additional details 731 COLOR_DEPTH_128BITCOLOR_FOR64KBTILING = 5, //!< No additional details 732 }; 733 734 //! \brief TILE_Y_TYPE_FOR_DESTINATION 735 //! \details 736 //! Destination being Tile-Y can be selected in DWord 0, Bit[14:13]. 737 enum TILE_Y_TYPE_FOR_DESTINATION 738 { 739 TILE_Y_TYPE_FOR_DESTINATION_NEW4KTILE_YF = 1, //!< No additional details 740 }; 741 742 //! \brief TILE_Y_TYPE_FOR_SOURCE 743 //! \details 744 //! Source being Tile-Y can be selected in DWord 0, Bit[21:20]. 745 enum TILE_Y_TYPE_FOR_SOURCE 746 { 747 TILE_Y_TYPE_FOR_SOURCE_NEW4KTILE_YF = 1, //!< No additional details 748 }; 749 750 //! \name Initializations 751 752 //! \brief Explicit member initialization function XY_FAST_COPY_BLT_CMDXY_FAST_COPY_BLT_CMD753 XY_FAST_COPY_BLT_CMD() 754 { 755 DW0.Value = 0x50800008; 756 //DW0.DwordLength = GetOpLength(dwSize); 757 //DW0.DestinationTilingMethod = DESTINATION_TILING_METHOD_LINEAR_TILINGDISABLED; 758 //DW0.SourceTilingMethod = SOURCE_TILING_METHOD_LINEAR_TILINGDISABLED; 759 //DW0.InstructionTargetOpcode = INSTRUCTION_TARGETOPCODE_UNNAMED66; 760 //DW0.Client = CLIENT_2DPROCESSOR; 761 762 DW1.Value = 0x00000000; 763 //DW1.ColorDepth = COLOR_DEPTH_8BITCOLOR; 764 //DW1.TileYTypeForDestination = 0; 765 //DW1.TileYTypeForSource = 0; 766 767 DW2.Value = 0x00000000; 768 769 DW3.Value = 0x00000000; 770 771 DW4_5.Value[0] = DW4_5.Value[1] = 0x00000000; 772 773 DW6.Value = 0x00000000; 774 775 DW7.Value = 0x00000000; 776 777 DW8_9.Value[0] = DW8_9.Value[1] = 0x00000000; 778 779 } 780 781 782 static const size_t dwSize = 10; 783 static const size_t byteSize = 40; 784 }; 785 786 MEDIA_CLASS_DEFINE_END(mhw__blt__xe2_hpm__Cmd) 787 }; 788 } // namespace xe2_hpm 789 } // namespace blt 790 } // namespace mhw 791 #pragma pack() 792 793 #endif // __MHW_BLT_HWCMD_XE2_HPM__NEXT_H__ 794