Debian Codegraph @

media_driver/agnostic/gen11/hw/vdbox/mhw_vdbox_huc_hwcmd_g11_X.h

raw
1 /*
2 * Copyright (c) 2018, 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 //! \file mhw_vdbox_huc_hwcmd_g11_X.h
24 //! \brief Auto-generated constructors for MHW and states.
25 //! \details This file may not be included outside of g11_X as other components
26 //! should use MHW interface to interact with MHW commands and states.
27 //!
28
29 // DO NOT EDIT
30
31 #ifndef __MHW_VDBOX_HUC_HWCMD_G11_X_H__
32 #define __MHW_VDBOX_HUC_HWCMD_G11_X_H__
33
34 #pragma once
35 #include <cstdint>
36 #include <cstddef>
37
38
39 #pragma pack(1)
40
41 class mhw_vdbox_huc_g11_X
42 {
43 public:
44 // Internal Macros
45 #define __CODEGEN_MAX(_a, _b) (((_a) > (_b)) ? (_a) : (_b))
46 #define __CODEGEN_BITFIELD(l, h) (h) - (l) + 1
47 #define __CODEGEN_OP_LENGTH_BIAS 2
48 #define __CODEGEN_OP_LENGTH(x) (uint32_t)((__CODEGEN_MAX(x, __CODEGEN_OP_LENGTH_BIAS)) - __CODEGEN_OP_LENGTH_BIAS)
49
50 static uint32_t GetOpLength(uint32_t uiLength) { return __CODEGEN_OP_LENGTH(uiLength); }
51
52 //!
53 //! \brief MEMORYADDRESSATTRIBUTES
54 //! \details
55 //! This field controls the priority of arbitration used in the GAC/GAM
56 //! pipeline for this surface. It defines the attributes for VDBOX addresses
57 //! on BDW+.
58 //!
59 struct MEMORYADDRESSATTRIBUTES_CMD
60 {
61 union
62 {
63 struct
64 {
65 uint32_t Reserved0 : __CODEGEN_BITFIELD( 0, 0) ; //!< Reserved
66 uint32_t BaseAddressIndexToMemoryObjectControlStateMocsTables : __CODEGEN_BITFIELD( 1, 6) ; //!< Base Address - Index to Memory Object Control State (MOCS) Tables
67 uint32_t BaseAddressArbitrationPriorityControl : __CODEGEN_BITFIELD( 7, 8) ; //!< Base Address - Arbitration Priority Control
68 uint32_t BaseAddressMemoryCompressionEnable : __CODEGEN_BITFIELD( 9, 9) ; //!< Base Address - Memory Compression Enable
69 uint32_t BaseAddressMemoryCompressionMode : __CODEGEN_BITFIELD(10, 10) ; //!< BASE_ADDRESS_MEMORY_COMPRESSION_MODE
70 uint32_t Reserved11 : __CODEGEN_BITFIELD(11, 11) ; //!< Reserved
71 uint32_t BaseAddressRowStoreScratchBufferCacheSelect : __CODEGEN_BITFIELD(12, 12) ; //!< BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT
72 uint32_t BaseAddressTiledResourceMode : __CODEGEN_BITFIELD(13, 14) ; //!< BASE_ADDRESS_TILED_RESOURCE_MODE
73 uint32_t Reserved15 : __CODEGEN_BITFIELD(15, 31) ; //!< Reserved
74 };
75 uint32_t Value;
76 } DW0;
77
78 //! \name Local enumerations
79
80 //! \brief BASE_ADDRESS_MEMORY_COMPRESSION_MODE
81 //! \details
82 //! Distinguishes vertical from horizontal compression. Please refer to
83 //! vol1a Memory Data Formats chapter - section media Memory
84 //! Compression for more details.
85 enum BASE_ADDRESS_MEMORY_COMPRESSION_MODE
86 {
87 BASE_ADDRESS_MEMORY_COMPRESSION_MODE_HORIZONTALCOMPRESSIONMODE = 0, //!< No additional details
88 };
89
90 //! \brief BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT
91 //! \details
92 //! This field controls if the Row Store is going to store inside Media
93 //! Cache (rowstore cache) or to LLC.
94 enum BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT
95 {
96 BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_UNNAMED0 = 0, //!< Buffer going to LLC.
97 BASE_ADDRESS_ROW_STORE_SCRATCH_BUFFER_CACHE_SELECT_UNNAMED1 = 1, //!< Buffer going to Internal Media Storage.
98 };
99
100 //! \brief BASE_ADDRESS_TILED_RESOURCE_MODE
101 //! \details
102 //! For Media Surfaces: This field specifies the tiled resource mode.
103 enum BASE_ADDRESS_TILED_RESOURCE_MODE
104 {
105 BASE_ADDRESS_TILED_RESOURCE_MODE_TRMODENONE = 0, //!< TileY resources
106 BASE_ADDRESS_TILED_RESOURCE_MODE_TRMODETILEYF = 1, //!< 4KB tiled resources
107 BASE_ADDRESS_TILED_RESOURCE_MODE_TRMODETILEYS = 2, //!< 64KB tiled resources
108 };
109
110 //! \name Initializations
111
112 //! \brief Explicit member initialization function
113 MEMORYADDRESSATTRIBUTES_CMD();
114
115 static const size_t dwSize = 1;
116 static const size_t byteSize = 4;
117 };
118
119 //!
120 //! \brief SPLITBASEADDRESS64BYTEALIGNED
121 //! \details
122 //! Specifies a 64-bit (48-bit canonical) 64-byte aligned memory base
123 //! address.
124 //!
125 struct SPLITBASEADDRESS64BYTEALIGNED_CMD
126 {
127 union
128 {
129 struct
130 {
131 uint64_t Reserved0 : __CODEGEN_BITFIELD( 0, 5) ; //!< Reserved
132 uint64_t Graphicsaddress476 : __CODEGEN_BITFIELD( 6, 47) ; //!< GraphicsAddress47-6
133 uint64_t Reserved48 : __CODEGEN_BITFIELD(48, 63) ; //!< Reserved
134 };
135 uint32_t Value[2];
136 } DW0_1;
137
138 //! \name Local enumerations
139
140 //! \name Initializations
141
142 //! \brief Explicit member initialization function
143 SPLITBASEADDRESS64BYTEALIGNED_CMD();
144
145 static const size_t dwSize = 2;
146 static const size_t byteSize = 8;
147 };
148
149 //!
150 //! \brief SPLITBASEADDRESS4KBYTEALIGNED
151 //! \details
152 //! Specifies a 64-bit (48-bit canonical) 4K-byte aligned memory base
153 //! address. GraphicsAddress is a 64-bit value [63:0], but only a portion of
154 //! it is used by hardware. The upper reserved bits are ignored and MBZ.
155 //!
156 struct SPLITBASEADDRESS4KBYTEALIGNED_CMD
157 {
158 union
159 {
160 struct
161 {
162 uint64_t Reserved0 : __CODEGEN_BITFIELD( 0, 11) ; //!< Reserved
163 uint64_t Graphicsaddress4712 : __CODEGEN_BITFIELD(12, 47) ; //!< GraphicsAddress47-12
164 uint64_t Reserved48 : __CODEGEN_BITFIELD(48, 63) ; //!< Reserved
165 };
166 uint32_t Value[2];
167 } DW0_1;
168
169 //! \name Local enumerations
170
171 //! \name Initializations
172
173 //! \brief Explicit member initialization function
174 SPLITBASEADDRESS4KBYTEALIGNED_CMD();
175
176 static const size_t dwSize = 2;
177 static const size_t byteSize = 8;
178 };
179
180 //!
181 //! \brief HUC_PIPE_MODE_SELECT
182 //! \details
183 //! The HUC is selected with the Media Instruction Opcode "Bh" for all HUC
184 //! Commands. Each HUC command has assigned a media instruction command as
185 //! defined in DWord 0, BitField 22:16.
186 //!
187 //! The HUC_PIPE_MODE_SELECT command is responsible for general pipeline
188 //! level configuration that would normally be set once for a single stream
189 //! decode and would not be modified on a frame workload basis.
190 //!
191 struct HUC_PIPE_MODE_SELECT_CMD
192 {
193 union
194 {
195 struct
196 {
197 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 11) ; //!< DWORD_LENGTH
198 uint32_t Reserved12 : __CODEGEN_BITFIELD(12, 15) ; //!< Reserved
199 uint32_t MediaInstructionCommand : __CODEGEN_BITFIELD(16, 22) ; //!< MEDIA_INSTRUCTION_COMMAND
200 uint32_t MediaInstructionOpcode : __CODEGEN_BITFIELD(23, 26) ; //!< MEDIA_INSTRUCTION_OPCODE
201 uint32_t PipelineType : __CODEGEN_BITFIELD(27, 28) ; //!< PIPELINE_TYPE
202 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
203 };
204 uint32_t Value;
205 } DW0;
206 union
207 {
208 struct
209 {
210 uint32_t Reserved32 : __CODEGEN_BITFIELD( 0, 3) ; //!< Reserved
211 uint32_t IndirectStreamOutEnable : __CODEGEN_BITFIELD( 4, 4) ; //!< INDIRECT_STREAM_OUT_ENABLE
212 uint32_t Reserved37 : __CODEGEN_BITFIELD( 5, 31) ; //!< Reserved
213 };
214 uint32_t Value;
215 } DW1;
216 union
217 {
218 struct
219 {
220 uint32_t MediaSoftResetCounterPer1000Clocks ; //!< MEDIA_SOFT_RESET_COUNTER_PER_1000_CLOCKS
221 };
222 uint32_t Value;
223 } DW2;
224
225 //! \name Local enumerations
226
227 enum MEDIA_INSTRUCTION_COMMAND
228 {
229 MEDIA_INSTRUCTION_COMMAND_HUCPIPEMODESELECT = 0, //!< No additional details
230 };
231
232 //! \brief MEDIA_INSTRUCTION_OPCODE
233 //! \details
234 //! Codec/Engine Name = HUP = Bh
235 enum MEDIA_INSTRUCTION_OPCODE
236 {
237 MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME = 11, //!< No additional details
238 };
239
240 enum PIPELINE_TYPE
241 {
242 PIPELINE_TYPE_UNNAMED2 = 2, //!< No additional details
243 };
244
245 enum COMMAND_TYPE
246 {
247 COMMAND_TYPE_PARALLELVIDEOPIPE = 3, //!< No additional details
248 };
249
250 //! \brief INDIRECT_STREAM_OUT_ENABLE
251 //! \details
252 //! Enables the bitstream to be written out to memory immediately following
253 //! the output of the bit stream. The memory buffer is addressed through
254 //! the HuC Indirect Stream Out ObjectBase Address.
255 enum INDIRECT_STREAM_OUT_ENABLE
256 {
257 INDIRECT_STREAM_OUT_ENABLE_DISABLEINDIRECTSTREAMOUT = 0, //!< No additional details
258 INDIRECT_STREAM_OUT_ENABLE_ENABLEINDIRECTSTREAMOUT = 1, //!< No additional details
259 };
260
261 //! \brief MEDIA_SOFT_RESET_COUNTER_PER_1000_CLOCKS
262 //! \details
263 //! In decoder modes, this counter value specifies the number of clocks (per
264 //! 1000) of GAC inactivity
265 //! before a media soft-reset is applied to the HCP and HuC. If counter
266 //! value is set to 0, the media
267 //! soft-reset feature is disabled and no reset will occur.
268 //! In encoder modes, this counter must be set to 0 to disable media
269 //! soft reset. This feature is not
270 //! supported for the encoder.
271 enum MEDIA_SOFT_RESET_COUNTER_PER_1000_CLOCKS
272 {
273 MEDIA_SOFT_RESET_COUNTER_PER_1000_CLOCKS_DISABLE = 0, //!< No additional details
274 };
275
276 //! \name Initializations
277
278 //! \brief Explicit member initialization function
279 HUC_PIPE_MODE_SELECT_CMD();
280
281 static const size_t dwSize = 3;
282 static const size_t byteSize = 12;
283 };
284
285 //!
286 //! \brief HUC_IMEM_STATE
287 //! \details
288 //! The HUC is selected with the Media Instruction Opcode "Bh" for all HUC
289 //! Commands. Each HUC command has assigned a media instruction command as
290 //! defined in DWord 0, BitField 22:16.
291 //!
292 //! The HUC_IMEM_STATE command is used to fetch the HUC firmware from the
293 //! WOPCM region and load it into the HUC 96KB L2 storage RAM. The
294 //! HUC_IMEM_STATE specifies the firmware's offset in WOPCM which is a cache
295 //! line aligned 32-bit offset address. The firmware, code and data segment
296 //! size should always be less than 96KB. If its greater than 96KB then the
297 //! firmware should be broken into smaller functions so that there is no
298 //! firmware straddling case.
299 //! When the HUC_IMEM_STATE command is received, the hardware confirms that
300 //! the code has been successfully authenticated by checking the VCR
301 //! provided authentication successful signal. If this signal is asserted,
302 //! the firmware is loaded by the HUC DMA into the 96KB L2 storage RAM. Once
303 //! the firmware is loaded, the VALID IMEM LOADED bit in the HUC_STATUS2
304 //! register is asserted high in the. If the authentication signal is not
305 //! asserted, the DMA aborts the HUC_IMEM_STATE command, the firmware is not
306 //! loaded, and the VALID IMEM LOADED bit remains low.
307 //!
308 struct HUC_IMEM_STATE_CMD
309 {
310 union
311 {
312 struct
313 {
314 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 11) ; //!< DWORD_LENGTH
315 uint32_t Reserved12 : __CODEGEN_BITFIELD(12, 15) ; //!< Reserved
316 uint32_t MediaInstructionCommand : __CODEGEN_BITFIELD(16, 22) ; //!< MEDIA_INSTRUCTION_COMMAND
317 uint32_t MediaInstructionOpcode : __CODEGEN_BITFIELD(23, 26) ; //!< MEDIA_INSTRUCTION_OPCODE
318 uint32_t PipelineType : __CODEGEN_BITFIELD(27, 28) ; //!< PIPELINE_TYPE
319 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
320 };
321 uint32_t Value;
322 } DW0;
323 union
324 {
325 struct
326 {
327 uint32_t Reserved32 ; //!< Reserved
328 };
329 uint32_t Value;
330 } DW1;
331 union
332 {
333 struct
334 {
335 uint32_t Reserved64 ; //!< Reserved
336 };
337 uint32_t Value;
338 } DW2;
339 union
340 {
341 struct
342 {
343 uint32_t Reserved96 ; //!< Reserved
344 };
345 uint32_t Value;
346 } DW3;
347 union
348 {
349 struct
350 {
351 uint32_t HucFirmwareDescriptor : __CODEGEN_BITFIELD( 0, 7) ; //!< HUC_FIRMWARE_DESCRIPTOR
352 uint32_t Reserved136 : __CODEGEN_BITFIELD( 8, 31) ; //!< Reserved
353 };
354 uint32_t Value;
355 } DW4;
356
357 //! \name Local enumerations
358
359 enum MEDIA_INSTRUCTION_COMMAND
360 {
361 MEDIA_INSTRUCTION_COMMAND_HUCIMEMSTATE = 1, //!< No additional details
362 };
363
364 //! \brief MEDIA_INSTRUCTION_OPCODE
365 //! \details
366 //! Codec/Engine Name = HUC = Bh
367 enum MEDIA_INSTRUCTION_OPCODE
368 {
369 MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME = 11, //!< No additional details
370 };
371
372 enum PIPELINE_TYPE
373 {
374 PIPELINE_TYPE_UNNAMED2 = 2, //!< No additional details
375 };
376
377 enum COMMAND_TYPE
378 {
379 COMMAND_TYPE_PARALLELVIDEOPIPE = 3, //!< No additional details
380 };
381
382 //! \brief HUC_FIRMWARE_DESCRIPTOR
383 //! \details
384 //! This field specifies 1 of 255 firmware descriptors which describe
385 //! which firmware is be loaded in the L2 storage RAM. If the firmware
386 //! descriptor is set to zero, the HUC will not load the firmware.
387 enum HUC_FIRMWARE_DESCRIPTOR
388 {
389 HUC_FIRMWARE_DESCRIPTOR_UNNAMED0 = 0, //!< Illegal
390 };
391
392 //! \name Initializations
393
394 //! \brief Explicit member initialization function
395 HUC_IMEM_STATE_CMD();
396
397 static const size_t dwSize = 5;
398 static const size_t byteSize = 20;
399 };
400
401 //!
402 //! \brief HUC_DMEM_STATE
403 //! \details
404 //! The HUC is selected with the Media Instruction Opcode "Bh" for all HUC
405 //! Commands. Each HUC command has assigned a media instruction command as
406 //! defined in DWord 0, BitField 22:16.
407 //!
408 //! The HUC_DMEM_STATE command is used to fetch the HUC data from the
409 //! graphics memory and load it into the HUC 96KB L2 storage RAM. The
410 //! HUC_DMEM_STATE specifies the data source base address in graphics
411 //! memory.
412 //!
413 //! When the HUC_DMEM_STATE command is received, the data is loaded by the
414 //! HUC DMA into the 96KB L2 storage RAM at the location provided in the
415 //! HUC_DMEM_STATE command. This command also specifies the length of the
416 //! data, which is specified in bytes but must be in increments of 64 byte
417 //! cache lines.
418 //!
419 struct HUC_DMEM_STATE_CMD
420 {
421 union
422 {
423 struct
424 {
425 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 11) ; //!< DWORD_LENGTH
426 uint32_t Reserved12 : __CODEGEN_BITFIELD(12, 15) ; //!< Reserved
427 uint32_t MediaInstructionCommand : __CODEGEN_BITFIELD(16, 22) ; //!< MEDIA_INSTRUCTION_COMMAND
428 uint32_t MediaInstructionOpcode : __CODEGEN_BITFIELD(23, 26) ; //!< MEDIA_INSTRUCTION_OPCODE
429 uint32_t PipelineType : __CODEGEN_BITFIELD(27, 28) ; //!< PIPELINE_TYPE
430 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
431 };
432 uint32_t Value;
433 } DW0;
434 SPLITBASEADDRESS64BYTEALIGNED_CMD HucDataSourceBaseAddress; //!< DW1..2, HUC Data Source - Base Address
435 MEMORYADDRESSATTRIBUTES_CMD HucDataSourceAttributes; //!< DW3, HUC Data Source - Attributes
436 union
437 {
438 struct
439 {
440 uint32_t Reserved128 : __CODEGEN_BITFIELD( 0, 5) ; //!< Reserved
441 uint32_t HucDataDestinationBaseAddress : __CODEGEN_BITFIELD( 6, 16) ; //!< HUC Data Destination Base Address
442 uint32_t Reserved145 : __CODEGEN_BITFIELD(17, 31) ; //!< Reserved
443 };
444 uint32_t Value;
445 } DW4;
446 union
447 {
448 struct
449 {
450 uint32_t Reserved160 : __CODEGEN_BITFIELD( 0, 5) ; //!< Reserved
451 uint32_t HucDataLength : __CODEGEN_BITFIELD( 6, 16) ; //!< HUC Data Length
452 uint32_t Reserved177 : __CODEGEN_BITFIELD(17, 31) ; //!< Reserved
453 };
454 uint32_t Value;
455 } DW5;
456
457 //! \name Local enumerations
458
459 enum MEDIA_INSTRUCTION_COMMAND
460 {
461 MEDIA_INSTRUCTION_COMMAND_HUCDMEMSTATE = 2, //!< No additional details
462 };
463
464 //! \brief MEDIA_INSTRUCTION_OPCODE
465 //! \details
466 //! Codec/Engine Name = HUC = Bh
467 enum MEDIA_INSTRUCTION_OPCODE
468 {
469 MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME = 11, //!< No additional details
470 };
471
472 enum PIPELINE_TYPE
473 {
474 PIPELINE_TYPE_UNNAMED2 = 2, //!< No additional details
475 };
476
477 enum COMMAND_TYPE
478 {
479 COMMAND_TYPE_PARALLELVIDEOPIPE = 3, //!< No additional details
480 };
481
482 //! \name Initializations
483
484 //! \brief Explicit member initialization function
485 HUC_DMEM_STATE_CMD();
486
487 static const size_t dwSize = 6;
488 static const size_t byteSize = 24;
489 };
490
491 //!
492 //! \brief HUC_CFG_STATE
493 //! \details
494 //! The HUC is selected with the Media Instruction Opcode "Bh" for all HUC
495 //! Commands. Each HUC command has assigned a media instruction command as
496 //! defined in DWord 0, BitField 22:16.
497 //!
498 //! The HUC_CFG_STATE command is used to force the P24C (MinuteIA) into a
499 //! reset condition as well as forcing it out of a reset condition. This
500 //! command is not normally required since the hardware will handle placing
501 //! the P24C into a reset condition and releasing it from reset, but there
502 //! may be conditions that require a forced reset.
503 //!
504 struct HUC_CFG_STATE_CMD
505 {
506 union
507 {
508 struct
509 {
510 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 11) ; //!< DWORD_LENGTH
511 uint32_t Reserved12 : __CODEGEN_BITFIELD(12, 15) ; //!< Reserved
512 uint32_t MediaInstructionCommand : __CODEGEN_BITFIELD(16, 22) ; //!< MEDIA_INSTRUCTION_COMMAND
513 uint32_t MediaInstructionOpcode : __CODEGEN_BITFIELD(23, 26) ; //!< MEDIA_INSTRUCTION_OPCODE
514 uint32_t PipelineType : __CODEGEN_BITFIELD(27, 28) ; //!< PIPELINE_TYPE
515 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
516 };
517 uint32_t Value;
518 } DW0;
519 union
520 {
521 struct
522 {
523 uint32_t P24CMinuteia : __CODEGEN_BITFIELD( 0, 0) ; //!< P24C_MINUTEIA
524 uint32_t Reserved33 : __CODEGEN_BITFIELD( 1, 31) ; //!< Reserved
525 };
526 uint32_t Value;
527 } DW1;
528
529 //! \name Local enumerations
530
531 enum MEDIA_INSTRUCTION_COMMAND
532 {
533 MEDIA_INSTRUCTION_COMMAND_HUCCFGSTATE = 3, //!< No additional details
534 };
535
536 //! \brief MEDIA_INSTRUCTION_OPCODE
537 //! \details
538 //! Codec/Engine Name = HUC = Bh
539 enum MEDIA_INSTRUCTION_OPCODE
540 {
541 MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME = 11, //!< No additional details
542 };
543
544 enum PIPELINE_TYPE
545 {
546 PIPELINE_TYPE_UNNAMED2 = 2, //!< No additional details
547 };
548
549 enum COMMAND_TYPE
550 {
551 COMMAND_TYPE_PARALLELVIDEOPIPE = 3, //!< No additional details
552 };
553
554 enum P24C_MINUTEIA
555 {
556 P24C_MINUTEIA_NORMALOPERATION = 0, //!< No reset.
557 P24C_MINUTEIA_FORCERESET = 1, //!< No additional details
558 };
559
560 //! \name Initializations
561
562 //! \brief Explicit member initialization function
563 HUC_CFG_STATE_CMD();
564
565 static const size_t dwSize = 2;
566 static const size_t byteSize = 8;
567 };
568
569 //!
570 //! \brief HUC_VIRTUAL_ADDR_REGION
571 //! \details
572 //!
573 //!
574 struct HUC_VIRTUAL_ADDR_REGION_CMD
575 {
576 SPLITBASEADDRESS4KBYTEALIGNED_CMD HucSurfaceBaseAddressVirtualaddrregion015; //!< DW0..2, HUC Surface Base Address (VirtualAddrRegion[0-15])
577 MEMORYADDRESSATTRIBUTES_CMD HucSurfaceVirtualaddrregion015; //!< DW0..2, HUC Surface (VirtualAddrRegion[0-15])
578
579 //! \name Local enumerations
580
581 //! \name Initializations
582
583 //! \brief Explicit member initialization function
584 HUC_VIRTUAL_ADDR_REGION_CMD();
585
586 static const size_t dwSize = 3;
587 static const size_t byteSize = 12;
588 };
589
590 //!
591 //! \brief HUC_VIRTUAL_ADDR_STATE
592 //! \details
593 //! HUC is selected with the Media Instruction Opcode "Bh" for all HUC
594 //! Commands. Each HUC command has assigned a media instruction command as
595 //! defined in DWord 0, BitField 22:16.
596 //!
597 //! The HUC_VIRTUAL_ADDR_STATE command is used to define the 48-bit HUC
598 //! Surface Base Address and HUC Surface for each region.
599 //!
600 struct HUC_VIRTUAL_ADDR_STATE_CMD
601 {
602 union
603 {
604 struct
605 {
606 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 11) ; //!< DWORD_LENGTH
607 uint32_t Reserved12 : __CODEGEN_BITFIELD(12, 15) ; //!< Reserved
608 uint32_t MediaInstructionCommand : __CODEGEN_BITFIELD(16, 22) ; //!< MEDIA_INSTRUCTION_COMMAND
609 uint32_t MediaInstructionOpcode : __CODEGEN_BITFIELD(23, 26) ; //!< MEDIA_INSTRUCTION_OPCODE
610 uint32_t PipelineType : __CODEGEN_BITFIELD(27, 28) ; //!< PIPELINE_TYPE
611 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
612 };
613 uint32_t Value;
614 } DW0;
615 HUC_VIRTUAL_ADDR_REGION_CMD HucVirtualAddressRegion[16]; //!< DW1..48, Huc Virtual Address Region
616
617 //! \name Local enumerations
618
619 enum MEDIA_INSTRUCTION_COMMAND
620 {
621 MEDIA_INSTRUCTION_COMMAND_HUCVIRTUALADDRSTATE = 4, //!< No additional details
622 };
623
624 //! \brief MEDIA_INSTRUCTION_OPCODE
625 //! \details
626 //! Codec/Engine Name = HUC = Bh
627 enum MEDIA_INSTRUCTION_OPCODE
628 {
629 MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME = 11, //!< No additional details
630 };
631
632 enum PIPELINE_TYPE
633 {
634 PIPELINE_TYPE_UNNAMED2 = 2, //!< No additional details
635 };
636
637 enum COMMAND_TYPE
638 {
639 COMMAND_TYPE_PARALLELVIDEOPIPE = 3, //!< No additional details
640 };
641
642 //! \name Initializations
643
644 //! \brief Explicit member initialization function
645 HUC_VIRTUAL_ADDR_STATE_CMD();
646
647 static const size_t dwSize = 49;
648 static const size_t byteSize = 196;
649 };
650
651 //!
652 //! \brief HUC_IND_OBJ_BASE_ADDR_STATE
653 //! \details
654 //! The HUC is selected with the Media Instruction Opcode "Bh" for all HUC
655 //! Commands. Each HUC command has assigned a media instruction command as
656 //! defined in DWord 0, BitField 22:16.
657 //!
658 //! The HUC_IND_OBJ_BASE_ADDR_STATE command is used to define the indirect
659 //! object base address of the stream in graphics memory. This is a frame
660 //! level command.
661 //!
662 struct HUC_IND_OBJ_BASE_ADDR_STATE_CMD
663 {
664 union
665 {
666 struct
667 {
668 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 11) ; //!< DWORD_LENGTH
669 uint32_t Reserved12 : __CODEGEN_BITFIELD(12, 15) ; //!< Reserved
670 uint32_t MediaInstructionCommand : __CODEGEN_BITFIELD(16, 22) ; //!< MEDIA_INSTRUCTION_COMMAND
671 uint32_t MediaInstructionOpcode : __CODEGEN_BITFIELD(23, 26) ; //!< MEDIA_INSTRUCTION_OPCODE
672 uint32_t PipelineType : __CODEGEN_BITFIELD(27, 28) ; //!< PIPELINE_TYPE
673 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
674 };
675 uint32_t Value;
676 } DW0;
677 SPLITBASEADDRESS4KBYTEALIGNED_CMD HucIndirectStreamInObjectbaseAddress; //!< DW1..2, HUC Indirect Stream In ObjectBase Address
678 MEMORYADDRESSATTRIBUTES_CMD HucIndirectStreamInObjectbaseAttributes; //!< DW3, HUC Indirect Stream In ObjectBase Attributes
679 SPLITBASEADDRESS4KBYTEALIGNED_CMD HucIndirectStreamInObjectaccessUpperBound; //!< DW4..5, HUC Indirect Stream In ObjectAccess Upper Bound
680 SPLITBASEADDRESS4KBYTEALIGNED_CMD HucIndirectStreamOutObjectbaseAddress; //!< DW6..7, HUC Indirect Stream Out ObjectBase Address
681 MEMORYADDRESSATTRIBUTES_CMD HucIndirectStreamOutObjectbaseAttributes; //!< DW8, HUC Indirect Stream Out ObjectBase Attributes
682 SPLITBASEADDRESS4KBYTEALIGNED_CMD HucIndirectStreamOutObjectaccessUpperBound; //!< DW9..10, HUC Indirect Stream Out ObjectAccess Upper Bound
683
684 //! \name Local enumerations
685
686 enum MEDIA_INSTRUCTION_COMMAND
687 {
688 MEDIA_INSTRUCTION_COMMAND_HUCINDOBJBASEADDRSTATE = 5, //!< No additional details
689 };
690
691 //! \brief MEDIA_INSTRUCTION_OPCODE
692 //! \details
693 //! Codec/Engine Name = HUC = Bh
694 enum MEDIA_INSTRUCTION_OPCODE
695 {
696 MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME = 11, //!< No additional details
697 };
698
699 enum PIPELINE_TYPE
700 {
701 PIPELINE_TYPE_UNNAMED2 = 2, //!< No additional details
702 };
703
704 enum COMMAND_TYPE
705 {
706 COMMAND_TYPE_PARALLELVIDEOPIPE = 3, //!< No additional details
707 };
708
709 //! \name Initializations
710
711 //! \brief Explicit member initialization function
712 HUC_IND_OBJ_BASE_ADDR_STATE_CMD();
713
714 static const size_t dwSize = 11;
715 static const size_t byteSize = 44;
716 };
717
718 //!
719 //! \brief HUC_STREAM_OBJECT
720 //! \details
721 //! The HUC is selected with the Media Instruction Opcode "Bh" for all HUC
722 //! Commands. Each HUC command has assigned a media instruction command as
723 //! defined in DWord 0, BitField 22:16.
724 //!
725 //! The HUC_STREAM_OBJECT command is used to define the bit stream address
726 //! offset to the Stream Indirect Object base Address and the length of the
727 //! bit stream. The bitstream buffer the HUC operates upon is specified
728 //! through indirect addressing.
729 //!
730 struct HUC_STREAM_OBJECT_CMD
731 {
732 union
733 {
734 struct
735 {
736 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 11) ; //!< DWORD_LENGTH
737 uint32_t Reserved12 : __CODEGEN_BITFIELD(12, 15) ; //!< Reserved
738 uint32_t MediaInstructionCommand : __CODEGEN_BITFIELD(16, 22) ; //!< MEDIA_INSTRUCTION_COMMAND
739 uint32_t MediaInstructionOpcode : __CODEGEN_BITFIELD(23, 26) ; //!< MEDIA_INSTRUCTION_OPCODE
740 uint32_t PipelineType : __CODEGEN_BITFIELD(27, 28) ; //!< PIPELINE_TYPE
741 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
742 };
743 uint32_t Value;
744 } DW0;
745 union
746 {
747 struct
748 {
749 uint32_t IndirectStreamInDataLength ; //!< Indirect Stream In Data Length
750 };
751 uint32_t Value;
752 } DW1;
753 union
754 {
755 struct
756 {
757 uint32_t IndirectStreamInStartAddress : __CODEGEN_BITFIELD( 0, 28) ; //!< Indirect Stream In Start Address
758 uint32_t Reserved93 : __CODEGEN_BITFIELD(29, 30) ; //!< Reserved
759 uint32_t HucProcessing : __CODEGEN_BITFIELD(31, 31) ; //!< HUC_PROCESSING
760 };
761 uint32_t Value;
762 } DW2;
763 union
764 {
765 struct
766 {
767 uint32_t IndirectStreamOutStartAddress : __CODEGEN_BITFIELD( 0, 28) ; //!< Indirect Stream Out Start Address
768 uint32_t Reserved125 : __CODEGEN_BITFIELD(29, 31) ; //!< Reserved
769 };
770 uint32_t Value;
771 } DW3;
772 union
773 {
774 struct
775 {
776 uint32_t StartCodeByte0 : __CODEGEN_BITFIELD( 0, 7) ; //!< Start Code Byte [0]
777 uint32_t StartCodeByte1 : __CODEGEN_BITFIELD( 8, 15) ; //!< Start Code Byte [1]
778 uint32_t StartCodeByte2 : __CODEGEN_BITFIELD(16, 23) ; //!< Start Code Byte [2]
779 uint32_t StartCodeSearchEngine : __CODEGEN_BITFIELD(24, 24) ; //!< START_CODE_SEARCH_ENGINE
780 uint32_t EmulationPreventionByteRemoval : __CODEGEN_BITFIELD(25, 25) ; //!< EMULATION_PREVENTION_BYTE_REMOVAL
781 uint32_t StreamOut : __CODEGEN_BITFIELD(26, 26) ; //!< STREAM_OUT
782 uint32_t Drmlengthmode : __CODEGEN_BITFIELD(27, 28) ; //!< DRMLENGTHMODE
783 uint32_t HucBitstreamEnable : __CODEGEN_BITFIELD(29, 29) ; //!< HUC_BITSTREAM_ENABLE
784 uint32_t Reserved158 : __CODEGEN_BITFIELD(30, 31) ; //!< Reserved
785 };
786 uint32_t Value;
787 } DW4;
788
789 //! \name Local enumerations
790
791 enum MEDIA_INSTRUCTION_COMMAND
792 {
793 MEDIA_INSTRUCTION_COMMAND_HUCSTREAMOBJECT = 32, //!< No additional details
794 };
795
796 //! \brief MEDIA_INSTRUCTION_OPCODE
797 //! \details
798 //! Codec/Engine Name = HUC = Bh
799 enum MEDIA_INSTRUCTION_OPCODE
800 {
801 MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME = 11, //!< No additional details
802 };
803
804 enum PIPELINE_TYPE
805 {
806 PIPELINE_TYPE_UNNAMED2 = 2, //!< No additional details
807 };
808
809 enum COMMAND_TYPE
810 {
811 COMMAND_TYPE_PARALLELVIDEOPIPE = 3, //!< No additional details
812 };
813
814 //! \brief HUC_PROCESSING
815 //! \details
816 //! Disables the HEVC Decoder CABAC engine to prevent it from starting
817 //! while the HuC is processing. Must be set to "1" for HUC processing so
818 //! that the stream is directed to the HuC and not the CABAC engine.
819 enum HUC_PROCESSING
820 {
821 HUC_PROCESSING_DISABLE = 1, //!< No additional details
822 };
823
824 enum START_CODE_SEARCH_ENGINE
825 {
826 START_CODE_SEARCH_ENGINE_DISABLE = 0, //!< Bypass Start Code Search Engine
827 START_CODE_SEARCH_ENGINE_ENABLE = 1, //!< Enables the start code search engine to stop on every third byte start code defined by Start Code Byte [2:0] defined in this DWord.
828 };
829
830 enum EMULATION_PREVENTION_BYTE_REMOVAL
831 {
832 EMULATION_PREVENTION_BYTE_REMOVAL_DISABLE = 0, //!< Bypass Emulation Prevention Byte Removal.
833 EMULATION_PREVENTION_BYTE_REMOVAL_ENABLE = 1, //!< Emulation prevention bytes will be removed after the start code search engine.
834 };
835
836 //! \brief STREAM_OUT
837 //! \details
838 //! Enables the stream output.
839 enum STREAM_OUT
840 {
841 STREAM_OUT_DISABLE = 0, //!< Disable the stream output.
842 STREAM_OUT_ENABLE = 1, //!< Enable the stream output.
843 };
844
845 enum DRMLENGTHMODE
846 {
847 DRMLENGTHMODE_STARTCODEMODE = 0, //!< Stops on a start code
848 DRMLENGTHMODE_LENGTHMODE = 1, //!< Stops after a number of bytes are reached in the length counter
849 };
850
851 //! \brief HUC_BITSTREAM_ENABLE
852 //! \details
853 //! style="color: rgb(0, 0, 0); font-family: Arial, sans-serif;
854 //! line-height: normal;">Enables the bitstream to be sent to the HuC
855 enum HUC_BITSTREAM_ENABLE
856 {
857 HUC_BITSTREAM_ENABLE_DISABLE = 0, //!< No additional details
858 HUC_BITSTREAM_ENABLE_ENABLE = 1, //!< No additional details
859 };
860
861 //! \name Initializations
862
863 //! \brief Explicit member initialization function
864 HUC_STREAM_OBJECT_CMD();
865
866 static const size_t dwSize = 5;
867 static const size_t byteSize = 20;
868 };
869
870 //!
871 //! \brief HUC_START
872 //! \details
873 //! The HUC is selected with the Media Instruction Opcode "Bh" for all HUC
874 //! Commands. Each HUC command has assigned a media instruction command as
875 //! defined in DWord 0, BitField 22:16.
876 //!
877 struct HUC_START_CMD
878 {
879 union
880 {
881 struct
882 {
883 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 11) ; //!< DWORD_LENGTH
884 uint32_t Reserved12 : __CODEGEN_BITFIELD(12, 15) ; //!< Reserved
885 uint32_t MediaInstructionCommand : __CODEGEN_BITFIELD(16, 22) ; //!< MEDIA_INSTRUCTION_COMMAND
886 uint32_t MediaInstructionOpcode : __CODEGEN_BITFIELD(23, 26) ; //!< MEDIA_INSTRUCTION_OPCODE
887 uint32_t PipelineType : __CODEGEN_BITFIELD(27, 28) ; //!< PIPELINE_TYPE
888 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
889 };
890 uint32_t Value;
891 } DW0;
892 union
893 {
894 struct
895 {
896 uint32_t Laststreamobject : __CODEGEN_BITFIELD( 0, 0) ; //!< LASTSTREAMOBJECT
897 uint32_t Reserved33 : __CODEGEN_BITFIELD( 1, 31) ; //!< Reserved
898 };
899 uint32_t Value;
900 } DW1;
901
902 //! \name Local enumerations
903
904 enum MEDIA_INSTRUCTION_COMMAND
905 {
906 MEDIA_INSTRUCTION_COMMAND_HUCSTART = 33, //!< No additional details
907 };
908
909 //! \brief MEDIA_INSTRUCTION_OPCODE
910 //! \details
911 //! Codec/Engine Name = HUC = Bh
912 enum MEDIA_INSTRUCTION_OPCODE
913 {
914 MEDIA_INSTRUCTION_OPCODE_CODECENGINENAME = 11, //!< No additional details
915 };
916
917 enum PIPELINE_TYPE
918 {
919 PIPELINE_TYPE_UNNAMED2 = 2, //!< No additional details
920 };
921
922 enum COMMAND_TYPE
923 {
924 COMMAND_TYPE_PARALLELVIDEOPIPE = 3, //!< No additional details
925 };
926
927 enum LASTSTREAMOBJECT
928 {
929 LASTSTREAMOBJECT_NOTLASTSTREAMOBJECT = 0, //!< Not the last stream object in the workload.
930 LASTSTREAMOBJECT_LASTSTREAMOBJECT = 1, //!< Last stream object in the workload.
931 };
932
933 //! \name Initializations
934
935 //! \brief Explicit member initialization function
936 HUC_START_CMD();
937
938 static const size_t dwSize = 2;
939 static const size_t byteSize = 8;
940 };
941
942 };
943
944 #pragma pack()
945
946 #endif // __MHW_VDBOX_HUC_HWCMD_G11_X_H__