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