Debian Codegraph @

media_driver/agnostic/gen11/hw/mhw_mi_hwcmd_g11_X.h

raw
1 /*
2 * Copyright (c) 2017, 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_mi_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 #ifndef __MHW_MI_HWCMD_G11_X_H__
29 #define __MHW_MI_HWCMD_G11_X_H__
30
31 #pragma once
32
33 #include <cstdint>
34 #include <cstddef>
35
36 #pragma pack(1)
37
38 class mhw_mi_g11_X
39 {
40 public:
41 // Internal Macros
42 #define __CODEGEN_MAX(_a, _b) (((_a) > (_b)) ? (_a) : (_b))
43 #define __CODEGEN_BITFIELD(l, h) (h) - (l) + 1
44 #define __CODEGEN_OP_LENGTH_BIAS 2
45 #define __CODEGEN_OP_LENGTH(x) (uint32_t)((__CODEGEN_MAX(x, __CODEGEN_OP_LENGTH_BIAS)) - __CODEGEN_OP_LENGTH_BIAS)
46
47 static uint32_t GetOpLength(uint32_t uiLength) { return __CODEGEN_OP_LENGTH(uiLength); }
48
49 //!
50 //! \brief MI_BATCH_BUFFER_END
51 //! \details
52 //! The MI_BATCH_BUFFER_END command is used to terminate the execution of
53 //! commands stored in a batch buffer initiated using a
54 //! MI_BATCH_BUFFER_START command.
55 //!
56 struct MI_BATCH_BUFFER_END_CMD
57 {
58 union
59 {
60 //!< DWORD 0
61 struct
62 {
63 uint32_t EndContext : __CODEGEN_BITFIELD( 0, 0) ; //!< End Context
64 uint32_t Reserved1 : __CODEGEN_BITFIELD( 1, 22) ; //!< Reserved
65 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
66 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
67 };
68 uint32_t Value;
69 } DW0;
70
71 //! \name Local enumerations
72
73 enum MI_COMMAND_OPCODE
74 {
75 MI_COMMAND_OPCODE_MIBATCHBUFFEREND = 10, //!< No additional details
76 };
77
78 enum COMMAND_TYPE
79 {
80 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
81 };
82
83 //! \name Initializations
84
85 //! \brief Explicit member initialization function
86 MI_BATCH_BUFFER_END_CMD();
87
88 static const size_t dwSize = 1;
89 static const size_t byteSize = 4;
90 };
91
92 //!
93 //! \brief MI_NOOP
94 //! \details
95 //! The MI_NOOP command basically performs a "no operation" in the command
96 //! stream and is typically used to pad the command stream (e.g., in order
97 //! to pad out a batch buffer to a QWord boundary). However, there is one
98 //! minor (optional) function this command can perform - a 22-bit value can
99 //! be loaded into the MI NOPID register. This provides a general-purpose
100 //! command stream tagging ("breadcrumb") mechanism (e.g., to provide
101 //! sequencing information for a subsequent breakpoint interrupt).
102 //!
103 struct MI_NOOP_CMD
104 {
105 union
106 {
107 //!< DWORD 0
108 struct
109 {
110 uint32_t IdentificationNumber : __CODEGEN_BITFIELD( 0, 21) ; //!< Identification Number
111 uint32_t IdentificationNumberRegisterWriteEnable : __CODEGEN_BITFIELD(22, 22) ; //!< IDENTIFICATION_NUMBER_REGISTER_WRITE_ENABLE
112 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
113 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
114 };
115 uint32_t Value;
116 } DW0;
117
118 //! \name Local enumerations
119
120 //! \brief IDENTIFICATION_NUMBER_REGISTER_WRITE_ENABLE
121 //! \details
122 //! This field enables the value in the Identification Number field to be
123 //! written into the MI NOPID register. If disabled, that register is
124 //! unmodified - making this command an effective "no operation" function.
125 enum IDENTIFICATION_NUMBER_REGISTER_WRITE_ENABLE
126 {
127 IDENTIFICATION_NUMBER_REGISTER_WRITE_ENABLE_WRITETHENOPIDREGISTER = 1, //!< No additional details
128 };
129
130 enum MI_COMMAND_OPCODE
131 {
132 MI_COMMAND_OPCODE_MINOOP = 0, //!< No additional details
133 };
134
135 enum COMMAND_TYPE
136 {
137 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
138 };
139
140 //! \name Initializations
141
142 //! \brief Explicit member initialization function
143 MI_NOOP_CMD();
144
145 static const size_t dwSize = 1;
146 static const size_t byteSize = 4;
147 };
148
149 //!
150 //! \brief MI_ARB_CHECK
151 //! \details
152 //! The command allows software to add preemption points in the ring buffer.
153 //! The command streamer will preempt in the case arbitration is enabled,
154 //! there is a pending execution list and this command is currently being
155 //! parsed.
156 //!
157 //! This instruction cannot be placed in a batch buffer.
158 //!
159 struct MI_ARB_CHECK_CMD
160 {
161 union
162 {
163 //!< DWORD 0
164 struct
165 {
166 uint32_t Reserved0 : __CODEGEN_BITFIELD( 0, 22) ; //!< Reserved
167 uint32_t MiInstructionOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_INSTRUCTION_OPCODE
168 uint32_t MiInstructionType : __CODEGEN_BITFIELD(29, 31) ; //!< MI_INSTRUCTION_TYPE
169 };
170 uint32_t Value;
171 } DW0;
172
173 //! \name Local enumerations
174
175 enum MI_INSTRUCTION_OPCODE
176 {
177 MI_INSTRUCTION_OPCODE_MIARBCHECK = 5, //!< No additional details
178 };
179
180 enum MI_INSTRUCTION_TYPE
181 {
182 MI_INSTRUCTION_TYPE_MIINSTRUCTION = 0, //!< No additional details
183 };
184
185 //! \name Initializations
186
187 //! \brief Explicit member initialization function
188 MI_ARB_CHECK_CMD();
189
190 static const size_t dwSize = 1;
191 static const size_t byteSize = 4;
192 };
193
194 //!
195 //! \brief MI_LOAD_REGISTER_IMM
196 //! \details
197 //! The MI_LOAD_REGISTER_IMM command requests a write of up to a DWord
198 //! constant supplied in the command to the specified Register Offset (i.e.,
199 //! offset into Memory-Mapped Register Range).
200 //! Any offset that is to a destination outside of the GT core will allow
201 //! the parser to continue once the cycle is at the GT boundry and not
202 //! destination. Any other address will ensure the destination is updated
203 //! prior to parsing the next command
204 //!
205 //! When executed from a non-privileged batch buffer, MMIO writes are only
206 //! allowed to the registers listed in User Mode Non-Privileged Registers
207 //! for the corresponding engine, any writes targeting the register not
208 //! listed in the User Mode Non-Privileged Register will convert this
209 //! command to a NOOP.
210 //!
211 //! The following addresses should NOT be used for LRIs:
212 //!
213 //! 0x8800 - 0x88FF
214 //!
215 //! >= 0xC0000
216 //!
217 //!
218 //!
219 //! Limited LRI cycles to the Display Engine (0x40000-0xBFFFF) are allowed,
220 //! but must be spaced to allow only one pending at a time. This can be done
221 //! by issuing an SRM to the same address immediately after each LRI.
222 //!
223 struct MI_LOAD_REGISTER_IMM_CMD
224 {
225 union
226 {
227 //!< DWORD 0
228 struct
229 {
230 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
231 uint32_t ByteWriteDisables : __CODEGEN_BITFIELD( 8, 11) ; //!< Byte Write Disables
232 uint32_t Reserved12 : __CODEGEN_BITFIELD(12, 18) ; //!< Reserved
233 uint32_t AddCsMmioStartOffset : __CODEGEN_BITFIELD(19, 19) ; //!< ADD_CS_MMIO_START_OFFSET
234 uint32_t Reserved20 : __CODEGEN_BITFIELD(20, 22) ; //!< Reserved
235 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
236 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
237 };
238 uint32_t Value;
239 } DW0;
240 union
241 {
242 //!< DWORD 1
243 struct
244 {
245 uint32_t Reserved32 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
246 uint32_t RegisterOffset : __CODEGEN_BITFIELD( 2, 22) ; //!< Register Offset
247 uint32_t Reserved55 : __CODEGEN_BITFIELD(23, 31) ; //!< Reserved
248 };
249 uint32_t Value;
250 } DW1;
251 union
252 {
253 //!< DWORD 2
254 struct
255 {
256 uint32_t DataDword ; //!< Data DWord
257 };
258 uint32_t Value;
259 } DW2;
260
261 //! \name Local enumerations
262
263 //! \brief ADD_CS_MMIO_START_OFFSET
264 //! \details
265 //! <p>This bit controls the functionality of the "Register Address" field
266 //! in the command.</p>
267 enum ADD_CS_MMIO_START_OFFSET
268 {
269 ADD_CS_MMIO_START_OFFSET_UNNAMED0 = 0, //!< "Register Address" field in the command is absolute and not an offset from the executing command streamer MMIO start offset..
270 ADD_CS_MMIO_START_OFFSET_UNNAMED1 = 1, //!< "Register Address" field in the command is treated as an offset from the executing Command Streamer’s MMIO start offset. Bits [22:2] of the "Register Address" are considered as dword offset to be added to the MMIO start offset of the corresponding command streamer. However, during context restore bits [11:2] of the "Register Address" are considered as dword offset to be added to the MMIO start offset of the corresponding command streamer. Command executed from Ring Buffer or Batch BufferExample: MI_LOAD_REGISTER_IMMEDIATE, ADD_CS_MMIO_START_OFFSET: true, Data:0xABCD, Register Address: 0x00_2000The above command when executed on RenderCS will result in a write to MMIO offset 0x00_4000 (0x00_2000 + 0x00_2000) instead to 0x00_2000. Note that RenderCS MMIO start offset is 0x2000. Table below shows the result of this command executed by various command streamers.<div>
271 };
272
273 enum MI_COMMAND_OPCODE
274 {
275 MI_COMMAND_OPCODE_MILOADREGISTERIMM = 34, //!< No additional details
276 };
277
278 enum COMMAND_TYPE
279 {
280 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
281 };
282
283 //! \name Initializations
284
285 //! \brief Explicit member initialization function
286 MI_LOAD_REGISTER_IMM_CMD();
287
288 static const size_t dwSize = 3;
289 static const size_t byteSize = 12;
290 };
291
292 //!
293 //! \brief MI_LOAD_REGISTER_MEM
294 //! \details
295 //! The MI_LOAD_REGISTER_MEM command requests from a memory location and
296 //! stores that DWord to a register.
297 //!
298 //! The command temporarily halts commands that will cause cycles down the
299 //! 3D pipeline.
300 //!
301 //! The following addresses should NOT be used for MMIO writes:
302 //!
303 //! 0x8800 - 0x88FF
304 //!
305 //! >= 0xC0000
306 //!
307 //!
308 //!
309 //! Limited MMIO writes cycles to the Display Engine 0x40000-0xBFFFF) are
310 //! allowed, but must be spaced to allow only one pending at a time. This
311 //! can be done by issuing an SRM to the same address immediately after each
312 //! MMIO write.
313 //!
314 //! This command should not be used within a non-privilege batch buffer to
315 //! access global virtual space, doing so will be treated as privilege
316 //! access violation. Refer "User Mode Privilege Command" in
317 //! MI_BATCH_BUFFER_START command section to know HW behavior on
318 //! encountering privilege access violation.
319 //!
320 //! This command is not allowed to update the privilege register range when
321 //! executed from a non-privilege batch buffer.
322 //!
323 struct MI_LOAD_REGISTER_MEM_CMD
324 {
325 union
326 {
327 //!< DWORD 0
328 struct
329 {
330 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
331 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 18) ; //!< Reserved
332 uint32_t AddCsMmioStartOffset : __CODEGEN_BITFIELD(19, 19) ; //!< ADD_CS_MMIO_START_OFFSET
333 uint32_t Reserved20 : __CODEGEN_BITFIELD(20, 20) ; //!< Reserved
334 uint32_t AsyncModeEnable : __CODEGEN_BITFIELD(21, 21) ; //!< Async Mode Enable
335 uint32_t UseGlobalGtt : __CODEGEN_BITFIELD(22, 22) ; //!< Use Global GTT
336 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
337 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
338 };
339 uint32_t Value;
340 } DW0;
341 union
342 {
343 //!< DWORD 1
344 struct
345 {
346 uint32_t Reserved32 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
347 uint32_t RegisterAddress : __CODEGEN_BITFIELD( 2, 22) ; //!< Register Address
348 uint32_t Reserved55 : __CODEGEN_BITFIELD(23, 31) ; //!< Reserved
349 };
350 uint32_t Value;
351 } DW1;
352 union
353 {
354 //!< DWORD 2..3
355 struct
356 {
357 uint64_t Reserved64 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
358 uint64_t MemoryAddress : __CODEGEN_BITFIELD( 2, 63) ; //!< Memory Address
359 };
360 uint32_t Value[2];
361 } DW2_3;
362
363 //! \name Local enumerations
364
365 //! \brief ADD_CS_MMIO_START_OFFSET
366 //! \details
367 //! This bit controls the functionality of the "Register Address" field in
368 //! the command.
369 enum ADD_CS_MMIO_START_OFFSET
370 {
371 ADD_CS_MMIO_START_OFFSET_UNNAMED0 = 0, //!< "Register Address" field in the command is absolute and not an offset from the executing command streamer MMIO start offset.
372 ADD_CS_MMIO_START_OFFSET_UNNAMED1 = 1, //!< "Register Address" field in the command is treated as an offset from the executing Command Streamer’s MMIO start offset.Bits [22:2] of the "Register Address" are considered as dword offset to be added to the MMIO start offset of the corresponding command streamer.Example: MI_LOAD_REGISTER_MEM, ADD_CS_MMIO_START_OFFSET: true, Memory Address:0xABCD, Register Address: 0x1C_0030The above command when executed on RenderCS will result in a write to MMIO offset 0x1C_2030 (0x00_2000 + 0x1C_0030) instead to 0x1C_0030. Note that RenderCS MMIO start offset is 0x2000.
373 };
374
375 enum MI_COMMAND_OPCODE
376 {
377 MI_COMMAND_OPCODE_MILOADREGISTERMEM = 41, //!< No additional details
378 };
379
380 enum COMMAND_TYPE
381 {
382 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
383 };
384
385 //! \name Initializations
386
387 //! \brief Explicit member initialization function
388 MI_LOAD_REGISTER_MEM_CMD();
389
390 static const size_t dwSize = 4;
391 static const size_t byteSize = 16;
392 };
393
394 //!
395 //! \brief MI_LOAD_REGISTER_REG
396 //! \details
397 //! The MI_LOAD_REGISTER_REG command reads from a source register location
398 //! and writes that value to a destination register location.
399 //! Any offset that is to a destination outside of the GT core will allow
400 //! the parser to continue once the cycle is at the GT boundry and not
401 //! destination.  Any other address will ensure the destination is updated
402 //! prior to parsing the next command
403 //!
404 //! The command temporarily halts commands that will cause cycles down the
405 //! 3D pipeline.
406 //!
407 //! Destination register with mask implemented (Ex: some
408 //! registers have bits [31:16] as mask bits and bits[15:0] as data) will
409 //! not get updated unless the value read from source register has the bits
410 //! corresponding to the mask bits set. Note that any mask implemented
411 //! register when read returns "0" for the bits corresponding to mask
412 //! location. When the source and destination are mask implemented
413 //! registers, destination register will not get updated with the source
414 //! register contents.
415 //!
416 //! This command is not allowed to update the privilege register range when
417 //! executed from a non-privilege batch buffer.
418 //!
419 struct MI_LOAD_REGISTER_REG_CMD
420 {
421 union
422 {
423 //!< DWORD 0
424 struct
425 {
426 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
427 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 17) ; //!< Reserved
428 uint32_t AddCsMmioStartOffsetSource : __CODEGEN_BITFIELD(18, 18) ; //!< ADD_CS_MMIO_START_OFFSET_SOURCE
429 uint32_t AddCsMmioStartOffsetDestination : __CODEGEN_BITFIELD(19, 19) ; //!< ADD_CS_MMIO_START_OFFSET_DESTINATION
430 uint32_t Reserved20 : __CODEGEN_BITFIELD(20, 22) ; //!< Reserved
431 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
432 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
433 };
434 uint32_t Value;
435 } DW0;
436 union
437 {
438 //!< DWORD 1
439 struct
440 {
441 uint32_t Reserved32 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
442 uint32_t SourceRegisterAddress : __CODEGEN_BITFIELD( 2, 22) ; //!< Source Register Address
443 uint32_t Reserved55 : __CODEGEN_BITFIELD(23, 31) ; //!< Reserved
444 };
445 uint32_t Value;
446 } DW1;
447 union
448 {
449 //!< DWORD 2
450 struct
451 {
452 uint32_t Reserved64 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
453 uint32_t DestinationRegisterAddress : __CODEGEN_BITFIELD( 2, 22) ; //!< Destination Register Address
454 uint32_t Reserved87 : __CODEGEN_BITFIELD(23, 31) ; //!< Reserved
455 };
456 uint32_t Value;
457 } DW2;
458
459 //! \name Local enumerations
460
461 //! \brief ADD_CS_MMIO_START_OFFSET_SOURCE
462 //! \details
463 //! <p>This bit controls the functionality of the "Register Address Source"
464 //! field in the command.</p>
465 enum ADD_CS_MMIO_START_OFFSET_SOURCE
466 {
467 ADD_CS_MMIO_START_OFFSET_SOURCE_UNNAMED0 = 0, //!< "Register Address" field in the command is absolute and not an offset from the executing command streamer MMIO start offset.
468 ADD_CS_MMIO_START_OFFSET_SOURCE_UNNAMED1 = 1, //!< "Source Register Address" field in the command is treated as an offset from the executing Command Streamer’s MMIO start offset. Bits [22:2] of the "Source Register Address" are considered as dword offset to be added to the MMIO start offset of the corresponding command streamer.Example: MI_LOAD_REGISTER_REGISTER_REG, DEST_ADD_CS_MMIO_START_OFFSET: false, SRC_ADD_CS_MMIO_START_OFFSET:true, Source Register Address:0x1C_0130, Destination Register Address: 0x1C_0030The above command when executed on RenderCS will result in a MMIO read from 0x1C _2130 instead of read from 0x1C_0130 and write to MMIO offset 0x1C_0030. Note that RenderCS MMIO start offset is 0x2000.
469 };
470
471 //! \brief ADD_CS_MMIO_START_OFFSET_DESTINATION
472 //! \details
473 //! <p>This bit controls the functionality of the "Register Address
474 //! Destination" field in the command.</p>
475 enum ADD_CS_MMIO_START_OFFSET_DESTINATION
476 {
477 ADD_CS_MMIO_START_OFFSET_DESTINATION_UNNAMED0 = 0, //!< "Destination Register Address" field in the command is absolute and not an offset from the executing command streamer MMIO start offset.
478 ADD_CS_MMIO_START_OFFSET_DESTINATION_UNNAMED1 = 1, //!< "Destination Register Address" field in the command is treated as an offset from the executing Command Streamer’s MMIO start offset. Bits [22:2] of the "Destination Register Address" are considered as dword offset to be added to the MMIO start offset of the corresponding command streamer.Example: MI_LOAD_REGISTER_REGISTER_REG, DEST_ADD_CS_MMIO_START_OFFSET: true, SRC_ADD_CS_MMIO_START_OFFSET:true, Source Register Address:0x1C_0130, Destination Register Address: 0x1C_0030The above command when executed on RenderCS will result in a MMIO read from 0x1C_2130 (0x00_2000 + 0x1C_0130) and write to MMIO offset 0x1C_2030 (0x00_2000 + 0x1C_0030) instead of read from 0x1C_0130 and write to 0x1C_0030. Note that RenderCS MMIO start offset is 0x2000.
479 };
480
481 enum MI_COMMAND_OPCODE
482 {
483 MI_COMMAND_OPCODE_MILOADREGISTERREG = 42, //!< No additional details
484 };
485
486 enum COMMAND_TYPE
487 {
488 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
489 };
490
491 //! \name Initializations
492
493 //! \brief Explicit member initialization function
494 MI_LOAD_REGISTER_REG_CMD();
495
496 static const size_t dwSize = 3;
497 static const size_t byteSize = 12;
498 };
499
500 //!
501 //! \brief MI_STORE_REGISTER_MEM
502 //! \details
503 //! The MI_STORE_REGISTER_MEM command requests a register read from a
504 //! specified memory mapped register location in the device and store of
505 //! that DWord to memory. The register address is specified along with the
506 //! command to perform the read.
507 //!
508 //!
509 //! The command temporarily halts command execution.
510 //!
511 //! The memory address for the write is snooped on the host bus.
512 //!
513 //! This command should not be used from within a "non-privilege" batch
514 //! buffer to access global virtual space. doing so will be treated as
515 //! privilege access violation. Refer "User Mode Privilege Command" in
516 //! MI_BATCH_BUFFER_START command section to know HW behavior on
517 //! encountering privilege access violation. This command can be used within
518 //! ring buffers and/or "privilege" batch buffers to access global virtual
519 //! space.
520 //!
521 //! This command will cause undefined data to be written to memory if given
522 //! register addresses for the PGTBL_CTL_0 or FENCE registers.
523 //!
524 //!
525 //!
526 struct MI_STORE_REGISTER_MEM_CMD
527 {
528 union
529 {
530 //!< DWORD 0
531 struct
532 {
533 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
534 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 18) ; //!< Reserved
535 uint32_t AddCsMmioStartOffset : __CODEGEN_BITFIELD(19, 19) ; //!< ADD_CS_MMIO_START_OFFSET
536 uint32_t Reserved20 : __CODEGEN_BITFIELD(20, 21) ; //!< Reserved
537 uint32_t UseGlobalGtt : __CODEGEN_BITFIELD(22, 22) ; //!< Use Global GTT
538 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
539 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
540 };
541 uint32_t Value;
542 } DW0;
543 union
544 {
545 //!< DWORD 1
546 struct
547 {
548 uint32_t Reserved32 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
549 uint32_t RegisterAddress : __CODEGEN_BITFIELD( 2, 22) ; //!< Register Address
550 uint32_t Reserved55 : __CODEGEN_BITFIELD(23, 31) ; //!< Reserved
551 };
552 uint32_t Value;
553 } DW1;
554 union
555 {
556 //!< DWORD 2..3
557 struct
558 {
559 uint64_t Reserved64 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
560 uint64_t MemoryAddress : __CODEGEN_BITFIELD( 2, 63) ; //!< Memory Address
561 };
562 uint32_t Value[2];
563 } DW2_3;
564
565 //! \name Local enumerations
566
567 //! \brief ADD_CS_MMIO_START_OFFSET
568 //! \details
569 //! <p>This bit controls the functionality of the "Register Address" field
570 //! in the command.</p>
571 enum ADD_CS_MMIO_START_OFFSET
572 {
573 ADD_CS_MMIO_START_OFFSET_UNNAMED0 = 0, //!< "Register Address" field in the command is absolute and not an offset from the executing command streamer MMIO start offset.
574 ADD_CS_MMIO_START_OFFSET_UNNAMED1 = 1, //!< "Register Address" field in the command is treated as an offset from the executing Command Streamer’s MMIO start offset. Bits [22:2] of the "Register Address" are considered as dword offset to be added to the MMIO start offset of the corresponding command streamer.Example: MI_STORE_REGISTER_MEM, ADD_CS_MMIO_START_OFFSET: true, Memory Address:0xABCD, Register Address: 0x1C_0030The above command when executed on RenderCS will result in updating the memory address with the content of the MMIO offset 0x1C_2030 (0x00_2000 + 0x1C_0030) instead to 0x1C_0030. Note that RenderCS MMIO start offset is 0x2000.
575 };
576
577 enum MI_COMMAND_OPCODE
578 {
579 MI_COMMAND_OPCODE_MISTOREREGISTERMEM = 36, //!< No additional details
580 };
581
582 enum COMMAND_TYPE
583 {
584 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
585 };
586
587 //! \name Initializations
588
589 //! \brief Explicit member initialization function
590 MI_STORE_REGISTER_MEM_CMD();
591
592 static const size_t dwSize = 4;
593 static const size_t byteSize = 16;
594 };
595
596 //!
597 //! \brief MI_BATCH_BUFFER_START
598 //! \details
599 //! The MI_BATCH_BUFFER_START command is used to initiate the execution of
600 //! commands stored in a batch buffer. For restrictions on the location of
601 //! batch buffers, see Batch Buffers in the Device Programming Interface
602 //! chapter of MI Functions. The batch buffer can be specified as privileged
603 //! or non-privileged, determining the operations considered valid when
604 //! initiated from within the buffer and any attached (chained) batch
605 //! buffers. See Batch Buffer Protection in the Device Programming Interface
606 //! chapter of MI Functions. 
607 //!
608 //! A batch buffer initiated with this command must end either with a
609 //! MI_BATCH_BUFFER_END command or by chaining to another batch buffer with
610 //! an MI_BATCH_BUFFER_START command.
611 //! It is essential that the address location beyond the current page be
612 //! populated inside the GTT. HW performs over-fetch of the command
613 //! addresses and any over-fetch requires a valid TLB entry. A single extra
614 //! page beyond the batch buffer is sufficient.
615 //!
616 //!
617 //!
618 struct MI_BATCH_BUFFER_START_CMD
619 {
620 union
621 {
622 //!< DWORD 0
623 struct
624 {
625 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
626 uint32_t AddressSpaceIndicator : __CODEGEN_BITFIELD( 8, 8) ; //!< ADDRESS_SPACE_INDICATOR
627 uint32_t Reserved9 : __CODEGEN_BITFIELD( 9, 21) ; //!< Reserved
628 uint32_t SecondLevelBatchBuffer : __CODEGEN_BITFIELD(22, 22) ; //!< SECOND_LEVEL_BATCH_BUFFER
629 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
630 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
631 };
632 uint32_t Value;
633 } DW0;
634 union
635 {
636 //!< DWORD 1..2
637 struct
638 {
639 uint64_t Reserved32 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
640 uint64_t BatchBufferStartAddress : __CODEGEN_BITFIELD( 2, 63) ; //!< Batch Buffer Start Address
641 };
642 uint32_t Value[2];
643 } DW1_2;
644
645 //! \name Local enumerations
646
647 //! \brief ADDRESS_SPACE_INDICATOR
648 //! \details
649 //! <p>Batch buffers accessed via PPGTT are considered as non-privileged.
650 //! Certain operations (e.g., MI_STORE_DATA_IMM commands to GGTT memory) are
651 //! prohibited within non-privileged buffers. More details mentioned in User
652 //! Mode Privileged command section. When MI_BATCH_BUFFER_START command is
653 //! executed from within a batch buffer (i.e., is a "chained" or "second
654 //! level" batch buffer command), the current active batch buffer's "Address
655 //! Space Indicator" and this field determine the "Address Space Indicator"
656 //! of the next buffer in the chain.</p>
657 //! <ul>
658 //! <li>Chained or Second level batch buffer can be in GGTT or PPGTT if the
659 //! parent batch buffer is in GGTT.</li>
660 //! <li>Chained or Second level batch buffer can only be in PPGTT if the
661 //! parent batch buffer is in PPGTT. This is enforced by Hardware.</li>
662 //! </ul>
663 enum ADDRESS_SPACE_INDICATOR
664 {
665 ADDRESS_SPACE_INDICATOR_GGTT = 0, //!< This batch buffer is located in GGTT memory and is privileged.
666 ADDRESS_SPACE_INDICATOR_PPGTT = 1, //!< This batch buffer is located in PPGTT memory and is Non-Privileged.
667 };
668
669 //! \brief SECOND_LEVEL_BATCH_BUFFER
670 //! \details
671 //! <p>The command streamer contains three storage elements; one for the
672 //! ring head address, one for the batch head address, and one for the
673 //! second level batch head address. When performing batch buffer chaining,
674 //! hardware simply updates the head pointer of the first level batch
675 //! address storage. There is no stack in hardware. When this bit is set,
676 //! hardware uses the 2nd level batch head address storage element. Upon
677 //! MI_BATCH_BUFFER_END, it will automatically return to the first level
678 //! batch buffer address. This allows hardware to mimic a simple 3-level
679 //! stack.</p>
680 enum SECOND_LEVEL_BATCH_BUFFER
681 {
682 SECOND_LEVEL_BATCH_BUFFER_FIRSTLEVELBATCH = 0, //!< Place the batch buffer address in the 1st (traditional) level batch address storage element.
683 SECOND_LEVEL_BATCH_BUFFER_SECONDLEVELBATCH = 1, //!< Place the batch buffer address in the second-level batch address storage element.
684 };
685
686 enum MI_COMMAND_OPCODE
687 {
688 MI_COMMAND_OPCODE_MIBATCHBUFFERSTART = 49, //!< No additional details
689 };
690
691 enum COMMAND_TYPE
692 {
693 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
694 };
695
696 //! \name Initializations
697
698 //! \brief Explicit member initialization function
699 MI_BATCH_BUFFER_START_CMD();
700
701 static const size_t dwSize = 3;
702 static const size_t byteSize = 12;
703 };
704
705 //!
706 //! \brief MI_SET_PREDICATE
707 //! \details
708 //! This command sets the Predication Check for the subsequent commands in
709 //! the command buffer except for MI_SET_PREDICATE itself. Render Command
710 //! Streamer NOOPs the following commands based on the PREDICATE_ENABLE from
711 //! MI_SET_PREDICATE, MI_SET_PREDICATE_RESULT and MI_SET_PREDICATE_RESULT_2
712 //! status. Resource Streamer doesn't take any action of parsing
713 //! MI_SET_PREDICATE, this command is similar to any other command which is
714 //! not meant for resource streamer.
715 //!
716 //! Executing MI_SET_PREDICATE command sets PREDICATE_ENABLE bits in MI_MODE
717 //! register, MI_MODE register gets render context save restored.
718 //!
719 //! MI_SET_PREDICATE predication scope must be confined within a Batch
720 //! Buffer to set of commands.
721 //! MI_SET_PREDICATE with Predicate Enable Must always have a
722 //! corresponding MI_SET_PREDICATE with Predicate Disable within the same
723 //! Batch Buffer.
724 //! MI_ARB_CHK command must be programmed outside the Predication Scope of
725 //! MI_SET_PREDICATE.
726 //! MI_SET_PREDICATE Predication Scope must not involve any RC6 triggering
727 //! events.
728 //!
729 //!
730 //! Only the following command(s) can be programmed between the
731 //! MI_SET_PREDICATE command enabled for predication: 3DSTATE_URB_VS
732 //! 3DSTATE_URB_HS 3DSTATE_URB_DS 3DSTATE_URB_GS
733 //! 3DSTATE_PUSH_CONSTANT_ALLOC_VS 3DSTATE_PUSH_CONSTANT_ALLOC_HS
734 //! 3DSTATE_PUSH_CONSTANT_ALLOC_DS 3DSTATE_PUSH_CONSTANT_ALLOC_GS
735 //! 3DSTATE_PUSH_CONSTANT_ALLOC_PS MI_LOAD_REGISTER_IMM MEDIA_VFE_STATE
736 //! MEDIA_OBJECT MEDIA_OBJJECT_WALKER MEDIA_INTERFACE_DESCRIPTOR_LOAD
737 //! 3DSTATE_WM_HZ_OP MI_STORE_DATA_IMM
738 //!
739 struct MI_SET_PREDICATE_CMD
740 {
741 union
742 {
743 //!< DWORD 0
744 struct
745 {
746 uint32_t PredicateEnable : __CODEGEN_BITFIELD( 0, 3) ; //!< PREDICATE_ENABLE
747 uint32_t Reserved4 : __CODEGEN_BITFIELD( 4, 22) ; //!< Reserved
748 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
749 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
750 };
751 uint32_t Value;
752 } DW0;
753
754 //! \name Local enumerations
755
756 //! \brief PREDICATE_ENABLE
757 //! \details
758 //! This field sets the predication logic in render command streamer when
759 //! parsed. Predicate Disable is the default mode of operation.
760 enum PREDICATE_ENABLE
761 {
762 PREDICATE_ENABLE_NOOPNEVER = 0, //!< Predication is Disabled and RCS will process commands as usual.
763 PREDICATE_ENABLE_NOOPONRESULT2CLEAR = 1, //!< Following Commands will be NOOPED by RCS only if the MI_PREDICATE_RESULT_2 is clear.
764 PREDICATE_ENABLE_NOOPONRESULT2SET = 2, //!< Following Commands will be NOOPED by RCS only if the MI_PREDICATE_RESULT_2 is set.
765 PREDICATE_ENABLE_NOOPONRESULTCLEAR = 3, //!< Following Commands will be NOOPED by RCS only if the MI_PREDICATE_RESULT is clear.
766 PREDICATE_ENABLE_NOOPONRESULTSET = 4, //!< Following Commands will be NOOPED by RCS only if the MI_PREDICATE_RESULT is set.
767 PREDICATE_ENABLE_NOOPINRENDERCS = 11, //!< When RenderCS parses MI_SET_PREDICATE command with "Predicate Enable" set to "NOOP in RenderCS", RenderCS NOOP’s all the subsequent commands parsed unconditionally until the predication is disabled/modified using MI_SET_PREDICATE command. Other command streamers (non RenderCS) on parsing MI_SET_PREDICATE command with "Predicate Enable" set to "NOOP in RenderCS" don’t take any action and is equivalent to parsing MI_NOOP command.
768 PREDICATE_ENABLE_NOOPINPOSITIONCS = 12, //!< When PositionCS parses MI_SET_PREDICATE command with "Predicate Enable" set to "NOOP in PositionCS", PositionCS NOOP’s all the subsequent commands parsed unconditionally until the predication is disabled/modified using MI_SET_PREDICATE command. Other command streamers (non PositionCS) on parsing MI_SET_PREDICATE command with "Predicate Enable" set to "NOOP in PositionCS" don’t take any action and is equivalent to parsing MI_NOOP command.
769 PREDICATE_ENABLE_NOOPALWAYS = 15, //!< Following Commands will be NOOPED by RCS unconditionally.
770 };
771
772 enum MI_COMMAND_OPCODE
773 {
774 MI_COMMAND_OPCODE_MISETPREDICATE = 1, //!< No additional details
775 };
776
777 enum COMMAND_TYPE
778 {
779 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
780 };
781
782 //! \name Initializations
783
784 //! \brief Explicit member initialization function
785 MI_SET_PREDICATE_CMD();
786
787 static const size_t dwSize = 1;
788 static const size_t byteSize = 4;
789 };
790
791 //!
792 //! \brief MI_COPY_MEM_MEM
793 //! \details
794 //! The MI_COPY_MEM_MEM command reads a DWord from memory and stores the
795 //! value of that DWord to back to memory. The source and destination
796 //! addresses are specified in the command. The command temporarily halts
797 //! command execution.
798 //!
799 //! This command should not be used within a "non-privileged" batch buffer
800 //! to access global virtual space; doing so will be treated as privilege
801 //! access violation. Refer to the "User Mode Privilege Command" in
802 //! MI_BATCH_BUFFER_START command section to learn more about HW behavior on
803 //! encountering a privilege access violation.
804 //!
805 //! This command can be used within ring buffers and/or privilege batch
806 //! buffers to access global virtual space.
807 //!
808 struct MI_COPY_MEM_MEM_CMD
809 {
810 union
811 {
812 //!< DWORD 0
813 struct
814 {
815 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
816 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 20) ; //!< Reserved
817 uint32_t UseGlobalGttDestination : __CODEGEN_BITFIELD(21, 21) ; //!< USE_GLOBAL_GTT_DESTINATION
818 uint32_t UseGlobalGttSource : __CODEGEN_BITFIELD(22, 22) ; //!< USE_GLOBAL_GTT_SOURCE
819 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
820 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
821 };
822 uint32_t Value;
823 } DW0;
824 union
825 {
826 //!< DWORD 1..2
827 struct
828 {
829 uint64_t Reserved32 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
830 uint64_t DestinationMemoryAddress : __CODEGEN_BITFIELD( 2, 63) ; //!< Destination Memory Address
831 };
832 uint32_t Value[2];
833 } DW1_2;
834 union
835 {
836 //!< DWORD 3..4
837 struct
838 {
839 uint64_t Reserved96 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
840 uint64_t SourceMemoryAddress : __CODEGEN_BITFIELD( 2, 63) ; //!< Source Memory Address
841 };
842 uint32_t Value[2];
843 } DW3_4;
844
845 //! \name Local enumerations
846
847 //! \brief USE_GLOBAL_GTT_DESTINATION
848 //! \details
849 //! It is allowed for this bit to be set when executing this command from a
850 //! privileged (secure) batch buffer or ring buffer. This bit must be clear
851 //! when programmed from within a non-privileged batch buffer. This bit must
852 //! be 1 if the Per Process GTT Enable bit is clear.
853 enum USE_GLOBAL_GTT_DESTINATION
854 {
855 USE_GLOBAL_GTT_DESTINATION_PERPROCESSGRAPHICSADDRESS = 0, //!< No additional details
856 USE_GLOBAL_GTT_DESTINATION_GLOBALGRAPHICSADDRESS = 1, //!< This command will use the global GTT to translate the Address and this command must be executing from a privileged (secure) batch buffer.
857 };
858
859 //! \brief USE_GLOBAL_GTT_SOURCE
860 //! \details
861 //! It is allowed for this bit to be set when executing this command from a
862 //! privileged (secure) batch buffer or ring buffer. This bit must be clear
863 //! when programmed from within a non-privileged batch buffer. This bit must
864 //! be 1 if the Per Process GTT Enable bit is clear.
865 enum USE_GLOBAL_GTT_SOURCE
866 {
867 USE_GLOBAL_GTT_SOURCE_PERPROCESSGRAPHICSADDRESS = 0, //!< No additional details
868 USE_GLOBAL_GTT_SOURCE_GLOBALGRAPHICSADDRESS = 1, //!< This command will use the global GTT to translate the Address and this command must be executing from a privileged (secure) batch buffer.
869 };
870
871 enum MI_COMMAND_OPCODE
872 {
873 MI_COMMAND_OPCODE_MIMEMTOMEM = 46, //!< No additional details
874 };
875
876 enum COMMAND_TYPE
877 {
878 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
879 };
880
881 //! \name Initializations
882
883 //! \brief Explicit member initialization function
884 MI_COPY_MEM_MEM_CMD();
885
886 static const size_t dwSize = 5;
887 static const size_t byteSize = 20;
888 };
889
890 //!
891 //! \brief MI_STORE_DATA_IMM
892 //! \details
893 //! The MI_STORE_DATA_IMM command requests a write of the QWord constant
894 //! supplied in the packet to the specified Memory Address. As the write
895 //! targets a System Memory Address, the write operation is coherent with
896 //! the CPU cache (i.e., the processor cache is snooped).
897 //!
898 //! This command supports writing to multiple consecutive dwords or qwords
899 //! memory locations from the starting address.
900 //!
901 //! This command should not be used within a "non-privilege" batch buffer
902 //! to access global virtual space, doing so will be treated as privilege
903 //! access violation. Refer "User Mode Privilege Command" in
904 //! MI_BATCH_BUFFER_START command section to know HW behavior on
905 //! encountering privilege access violation. This command can be used within
906 //! ring buffers and/or privilege batch buffers to access global virtual
907 //! space.
908 //! This command can be used for general software synchronization through
909 //! variables in cacheable memory (i.e., where software does not need to
910 //! poll un-cached memory or device registers).
911 //! This command simply initiates the write operation with command
912 //! execution proceeding normally. Although the write operation is
913 //! guaranteed to complete eventually, there is no mechanism to synchronize
914 //! command execution with the completion (or even initiation) of these
915 //! operations.
916 //!
917 //!
918 //!
919 struct MI_STORE_DATA_IMM_CMD
920 {
921 union
922 {
923 //!< DWORD 0
924 struct
925 {
926 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 9) ; //!< DWORD_LENGTH
927 uint32_t Reserved10 : __CODEGEN_BITFIELD(10, 20) ; //!< Reserved
928 uint32_t StoreQword : __CODEGEN_BITFIELD(21, 21) ; //!< Store Qword
929 uint32_t UseGlobalGtt : __CODEGEN_BITFIELD(22, 22) ; //!< Use Global GTT
930 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
931 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
932 };
933 uint32_t Value;
934 } DW0;
935 union
936 {
937 //!< DWORD 1..2
938 struct
939 {
940 uint64_t CoreModeEnable : __CODEGEN_BITFIELD( 0, 0) ; //!< Core Mode Enable
941 uint64_t Reserved33 : __CODEGEN_BITFIELD( 1, 1) ; //!< Reserved
942 uint64_t Address : __CODEGEN_BITFIELD( 2, 63) ; //!< Address
943 };
944 uint32_t Value[2];
945 } DW1_2;
946 union
947 {
948 //!< DWORD 3
949 struct
950 {
951 uint32_t DataDword0 ; //!< Data DWord 0
952 };
953 uint32_t Value;
954 } DW3;
955 union
956 {
957 //!< DWORD 4
958 struct
959 {
960 uint32_t DataDword1 ; //!< Data DWord 1
961 };
962 uint32_t Value;
963 } DW4;
964
965 //! \name Local enumerations
966
967 enum MI_COMMAND_OPCODE
968 {
969 MI_COMMAND_OPCODE_MISTOREDATAIMM = 32, //!< No additional details
970 };
971
972 enum COMMAND_TYPE
973 {
974 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
975 };
976
977 //! \name Initializations
978
979 //! \brief Explicit member initialization function
980 MI_STORE_DATA_IMM_CMD();
981
982 static const size_t dwSize = 5;
983 static const size_t byteSize = 20;
984 };
985
986 //!
987 //! \brief MI_SEMAPHORE_SIGNAL
988 //! \details
989 //! This command is used to signal the target engine stating the memory
990 //! semaphore update occurrence to one of its contexts with Target Context
991 //! ID. MI_SEMPHORE_SIGNAL and MI_SEMAPHORE_WAIT together replace the
992 //! MI_SEMAPHORE_MBOX command on BDW. MI_ATOMIC (non-posted) command will be
993 //! programmed prior to this command to update the semaphore data in memory.
994 //!
995 //! Bellow programming notes must be followed while programming
996 //! MI_SEMAPHORE_SIGNAL for POCS. MI_SEMAPHOR_SIGNAL command in POCS command
997 //! sequence may be used to signal RCS but not any other command streamer
998 //! (VCS, VECS, BCS). Semaphore signal received by POCS will never be
999 //! forwarded to GUC. Only RCS can semaphore signal POCS and no other
1000 //! command streamer must signal POCS. Semaphore signal received by RCS from
1001 //! POCS will never get forwarded to GUC.
1002 //!
1003 //! Post-Sync operation bit must not be set when Target Engine Select is
1004 //! set to RCS.
1005 //!
1006 struct MI_SEMAPHORE_SIGNAL_CMD
1007 {
1008 union
1009 {
1010 //!< DWORD 0
1011 struct
1012 {
1013 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
1014 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 14) ; //!< Reserved
1015 uint32_t TargetEngineSelect : __CODEGEN_BITFIELD(15, 18) ; //!< TARGET_ENGINE_SELECT
1016 uint32_t Reserved19 : __CODEGEN_BITFIELD(19, 22) ; //!< Reserved
1017 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
1018 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
1019 };
1020 uint32_t Value;
1021 } DW0;
1022 union
1023 {
1024 //!< DWORD 1
1025 struct
1026 {
1027 uint32_t TargetContextId ; //!< Target Context ID
1028 };
1029 uint32_t Value;
1030 } DW1;
1031
1032 //! \name Local enumerations
1033
1034 //! \brief TARGET_ENGINE_SELECT
1035 //! \details
1036 //! This field selects the target engine to which SIGNAL will be send to.
1037 enum TARGET_ENGINE_SELECT
1038 {
1039 TARGET_ENGINE_SELECT_RCS = 0, //!< No additional details
1040 TARGET_ENGINE_SELECT_VCS0 = 1, //!< No additional details
1041 TARGET_ENGINE_SELECT_BCS = 2, //!< No additional details
1042 TARGET_ENGINE_SELECT_VECS = 3, //!< No additional details
1043 TARGET_ENGINE_SELECT_VCS1 = 4, //!< No additional details
1044 TARGET_ENGINE_SELECT_VCS2 = 6, //!< No additional details
1045 TARGET_ENGINE_SELECT_VCS3 = 7, //!< No additional details
1046 TARGET_ENGINE_SELECT_VCS4 = 8, //!< No additional details
1047 TARGET_ENGINE_SELECT_VCS5 = 9, //!< No additional details
1048 TARGET_ENGINE_SELECT_VCS6 = 10, //!< No additional details
1049 TARGET_ENGINE_SELECT_VCS7 = 11, //!< No additional details
1050 TARGET_ENGINE_SELECT_VECS1 = 12, //!< No additional details
1051 TARGET_ENGINE_SELECT_VECS2 = 13, //!< No additional details
1052 TARGET_ENGINE_SELECT_VECS3 = 14, //!< No additional details
1053 };
1054
1055 enum MI_COMMAND_OPCODE
1056 {
1057 MI_COMMAND_OPCODE_MISEMAPHORESIGNAL = 27, //!< No additional details
1058 };
1059
1060 enum COMMAND_TYPE
1061 {
1062 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
1063 };
1064
1065 //! \name Initializations
1066
1067 //! \brief Explicit member initialization function
1068 MI_SEMAPHORE_SIGNAL_CMD();
1069
1070 static const size_t dwSize = 2;
1071 static const size_t byteSize = 8;
1072 };
1073
1074 //!
1075 //! \brief MI_SEMAPHORE_WAIT
1076 //! \details
1077 //!
1078 //! This command supports memory based Semaphore WAIT. Memory based
1079 //! semaphores will be used for synchronization between the Producer and the
1080 //! Consumer contexts. Producer and Consumer Contexts could be running on
1081 //! different engines or on the same engine inside GT. Producer Context
1082 //! implements a Signal and Consumer context implements a Wait.
1083 //! Command Streamer on parsing this command fetches data from the Semaphore
1084 //! Address mentioned in this command and compares it with the inline
1085 //! Semaphore Data Dword.
1086 //!
1087 //! If comparison passes, the command streamer moves to the next command.
1088 //!
1089 //! If comparison fails Command streamer switches out the context. Context
1090 //! switch can be inhibited by setting "Inhibit Synchronous Context Switch"
1091 //! in CTXT_SR_CTL register.
1092 //!
1093 //! If "Inhibit Synchronous context Switch" is enabled and comparison fails,
1094 //! Command Streamer evaluates the Compare Operation based on the Wait Mode
1095 //! until the compare operation is true or Wait is canceled by SW.
1096 //!
1097 //! CS generates semaphore wait interrupt to the scheduler when
1098 //! MI_SEMAPHORE_WAIT command is un-successful and when "Inhibit Synchronous
1099 //! Context Switch" is set. Scheduler can use this interrupt to preempt the
1100 //! context waiting on semaphore wait.
1101 //!
1102 //!
1103 //!
1104 //!
1105 //! MI_SEMAPHORE_WAIT command also supports register based Semaphore WAIT.
1106 //! Command Streamer on parsing this command fetches data from the MMIO
1107 //! offset mentioned in this command and compares it with the inline
1108 //! Semaphore Data Dword. This functionality is supported when "Register
1109 //! Poll" bit is set in the command header. In register poll mode of
1110 //! operation "Wait Mode" supported is always Poll mode and no Signal mode
1111 //! is supported.
1112 //!
1113 //! If comparison passes, the command streamer moves to the next command.
1114 //!
1115 //! Unlike in Memory based semaphore, there is no context switch on an
1116 //! un-successful semaphore wait in "Register Poll" mode, however preemption
1117 //! is supported on unsuccessful semaphore wait in "Register Poll" mode.
1118 //! Semaphore wait interrupt is not generated by default on wait
1119 //! un-successful in "Register Poll" mode. However interrupt generation can
1120 //! be enabled by setting debug mode bit "Semaphore Interrupt Enable in
1121 //! Register Poll Mode" in specified register.
1122 //!
1123 //! Also unlike in Memory based semaphore, generation of an interrupt for a
1124 //! semaphore wait in "Register Poll" mode is not dependent on the value of
1125 //! bit "Inhibit Synchronous Context Switch" in register "CTXT_SR_CTL"
1126 //!
1127 //! Register Poll mode of Semaphore Wait command operation is non-privileged
1128 //! and will be supported from PPGTT batch buffers.
1129 //!
1130 //! HW will trigger Render DOP CG on semaphore wait unsuccessful by default
1131 //! and can be disabled if not desired by programming "Register
1132 //! Poll Mode Semaphore Wait Event IDLE message Disable" bit in "INSTPM"
1133 //! register. Note that Render DOP CG will not be triggered on register
1134 //! semaphore wait un-successfull from INDIRECT_CTX pointer or
1135 //! BB_PER_CTX_PTR buffers.
1136 //!
1137 //! MI_SEMAPHORE_WAIT command must be always programmed with "Wait Mode" set
1138 //! to "Polling Mode" Or MI_SEMAPHORE_WAIT command with "Wait Mode" set to
1139 //! "Polling Mode" can be programmed when "Semaphore Wait Event IDLE message
1140 //! Disable" bit in "RC_PSMI_CTRL" register is set to disable Idle messaging
1141 //! on unsuccessful MI_SEMPAHORE_WAIT.
1142 //!
1143 struct MI_SEMAPHORE_WAIT_CMD
1144 {
1145 union
1146 {
1147 //!< DWORD 0
1148 struct
1149 {
1150 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
1151 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 11) ; //!< Reserved
1152 uint32_t CompareOperation : __CODEGEN_BITFIELD(12, 14) ; //!< COMPARE_OPERATION
1153 uint32_t WaitMode : __CODEGEN_BITFIELD(15, 15) ; //!< WAIT_MODE
1154 uint32_t RegisterPollMode : __CODEGEN_BITFIELD(16, 16) ; //!< REGISTER_POLL_MODE
1155 uint32_t Reserved17 : __CODEGEN_BITFIELD(17, 21) ; //!< Reserved
1156 uint32_t MemoryType : __CODEGEN_BITFIELD(22, 22) ; //!< MEMORY_TYPE
1157 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
1158 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
1159 };
1160 uint32_t Value;
1161 } DW0;
1162 union
1163 {
1164 //!< DWORD 1
1165 struct
1166 {
1167 uint32_t SemaphoreDataDword ; //!< Semaphore Data Dword
1168 };
1169 uint32_t Value;
1170 } DW1;
1171 union
1172 {
1173 //!< DWORD 2..3
1174 struct
1175 {
1176 uint64_t Reserved64 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
1177 uint64_t SemaphoreAddress : __CODEGEN_BITFIELD( 2, 63) ; //!< Semaphore Address
1178 };
1179 uint32_t Value[2];
1180 } DW2_3;
1181
1182 //! \name Local enumerations
1183
1184 //! \brief COMPARE_OPERATION
1185 //! \details
1186 //! This field specifies the operation that will be executed to create the
1187 //! result that will either allow the context to continue or wait.
1188 enum COMPARE_OPERATION
1189 {
1190 COMPARE_OPERATION_SADGREATERTHANSDD = 0, //!< If Indirect fetched data is greater than inline data then continue.
1191 COMPARE_OPERATION_SADGREATERTHANOREQUALSDD = 1, //!< If Indirect fetched data is greater than or equal to inline data then continue.
1192 COMPARE_OPERATION_SADLESSTHANSDD = 2, //!< If Indirect fetched data is less than inline data then continue.
1193 COMPARE_OPERATION_SADLESSTHANOREQUALSDD = 3, //!< If Indirect fetched data is less than or equal to inline data then continue.
1194 COMPARE_OPERATION_SADEQUALSDD = 4, //!< If Indirect fetched data is equalto inline data then continue.
1195 COMPARE_OPERATION_SADNOTEQUALSDD = 5, //!< If Indirect fetched data is not equal to inline data then continue.
1196 };
1197
1198 //! \brief WAIT_MODE
1199 //! \details
1200 //! This bit specifies the WAIT behavior when the semaphore comparison fails
1201 //! and before the context is switched out.
1202 enum WAIT_MODE
1203 {
1204 WAIT_MODE_SIGNALMODE = 0, //!< In this mode HW will reacquire the semaphore data from memory on receiving SIGNAL with the same Context ID.
1205 WAIT_MODE_POLLINGMODE = 1, //!< In this mode HW periodically reads the semaphore data from memory for comparison until it is context switched out. Periodicity will be mentioned in a SEMA_WAIT_POLL register.
1206 };
1207
1208 //! \brief REGISTER_POLL_MODE
1209 //! \details
1210 //! <p>This field control the seamphore wait behavior of polling from memory
1211 //! vs MMIO register.</p>
1212 enum REGISTER_POLL_MODE
1213 {
1214 REGISTER_POLL_MODE_MEMORYPOLL = 0, //!< In this mode HW will functional as in regular mode and checks for semaphore data in memory.
1215 REGISTER_POLL_MODE_REGISTERPOLL = 1, //!< In this mode HW periodically reads the semaphore data from MMIO register instead of memory for comparison until the condition is satisfied. Periodicity will be mentioned in a SEMA_WAIT_POLL register.When operating in register poll mode, DW2 "Semaphore Address" (bits 22:2) carries the register MMIO offset to be polled.In register poll mode "Memory Type" field of this command are ignored by HW. 
1216 };
1217
1218 //! \brief MEMORY_TYPE
1219 //! \details
1220 //! This bit will be ignored and treated as if clear when executing from a
1221 //! non-privileged batch buffer. It is allowed for this bit to be clear when
1222 //! executing this command from a privileged (secure) batch buffer. This bit
1223 //! <i>must</i> be 1 if the <b>Per Process GTT Enable</b> bit is clear.
1224 enum MEMORY_TYPE
1225 {
1226 MEMORY_TYPE_PERPROCESSGRAPHICSADDRESS = 0, //!< No additional details
1227 MEMORY_TYPE_GLOBALGRAPHICSADDRESS = 1, //!< This command will use the global GTT to translate the Address and this command must beexecuting from a privileged (secure) batch buffer.
1228 };
1229
1230 enum MI_COMMAND_OPCODE
1231 {
1232 MI_COMMAND_OPCODE_MISEMAPHOREWAIT = 28, //!< No additional details
1233 };
1234
1235 enum COMMAND_TYPE
1236 {
1237 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
1238 };
1239
1240 //! \name Initializations
1241
1242 //! \brief Explicit member initialization function
1243 MI_SEMAPHORE_WAIT_CMD();
1244
1245 static const size_t dwSize = 4;
1246 static const size_t byteSize = 16;
1247 };
1248
1249 //!
1250 //! \brief MI_CONDITIONAL_BATCH_BUFFER_END
1251 //! \details
1252 //! The MI_CONDITIONAL_BATCH_BUFFER_END command is used to conditionally
1253 //! terminate the execution of commands stored in a batch buffer initiated
1254 //! using a MI_BATCH_BUFFER_START command. Termination of second level batch
1255 //! buffer due to this command will also terminate the parent/first level
1256 //! batch buffer.
1257 //!
1258 //!
1259 struct MI_CONDITIONAL_BATCH_BUFFER_END_CMD
1260 {
1261 union
1262 {
1263 //!< DWORD 0
1264 struct
1265 {
1266 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
1267 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 18) ; //!< Reserved
1268 uint32_t CompareMaskMode : __CODEGEN_BITFIELD(19, 19) ; //!< COMPARE_MASK_MODE
1269 uint32_t Reserved20 : __CODEGEN_BITFIELD(20, 20) ; //!< Reserved
1270 uint32_t CompareSemaphore : __CODEGEN_BITFIELD(21, 21) ; //!< COMPARE_SEMAPHORE
1271 uint32_t UseGlobalGtt : __CODEGEN_BITFIELD(22, 22) ; //!< USE_GLOBAL_GTT
1272 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
1273 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
1274 };
1275 uint32_t Value;
1276 } DW0;
1277 union
1278 {
1279 //!< DWORD 1
1280 struct
1281 {
1282 uint32_t CompareDataDword ; //!< Compare Data Dword
1283 };
1284 uint32_t Value;
1285 } DW1;
1286 union
1287 {
1288 //!< DWORD 2..3
1289 struct
1290 {
1291 uint64_t Reserved64 : __CODEGEN_BITFIELD( 0, 2) ; //!< Reserved
1292 uint64_t CompareAddress : __CODEGEN_BITFIELD( 3, 63) ; //!< Compare Address
1293 };
1294 uint32_t Value[2];
1295 } DW2_3;
1296
1297 //! \name Local enumerations
1298
1299 //! \brief COMPARE_MASK_MODE
1300 //! \details
1301 //! When "Compare Mask Mode" is enabled, "Compare Address" must be qword
1302 //! aligned.
1303 enum COMPARE_MASK_MODE
1304 {
1305 COMPARE_MASK_MODE_COMPAREMASKMODEDISABLED = 0, //!< Compare address points to Dword in memory consisting of Data Dword(DW0). HW will compare Data Dword(DW0) against Semaphore Data Dword.
1306 COMPARE_MASK_MODE_COMPAREMASKMODEENABLED = 1, //!< Compare address points to Qword in memory consisting of compare Mask (DW0) and Data Dword(DW1). HW will do AND operation on Mask(DW0) with Data Dword(DW1) and then compare the result against Semaphore Data Dword.
1307 };
1308
1309 //! \brief COMPARE_SEMAPHORE
1310 //! \details
1311 //! <p>If set, the value from the Compare Data Dword is compared to the
1312 //! value from the Compare Address in memory. If the value at Compare
1313 //! Address is greater than the Compare Data Dword, execution of current
1314 //! command buffer should continue. If clear, the parser will continue to
1315 //! the next command and not exit the batch buffer.</p>
1316 enum COMPARE_SEMAPHORE
1317 {
1318 COMPARE_SEMAPHORE_UNNAMED0 = 0, //!< No additional details
1319 };
1320
1321 //! \brief USE_GLOBAL_GTT
1322 //! \details
1323 //! If set, this command will use the global GTT to translate the <b>Compare
1324 //! Address</b> and this command must be executing from a privileged
1325 //! (secure) batch buffer. If clear, the PPGTT will be used to translate the
1326 //! <b>Compare Address</b>.
1327 enum USE_GLOBAL_GTT
1328 {
1329 USE_GLOBAL_GTT_UNNAMED0 = 0, //!< No additional details
1330 };
1331
1332 enum MI_COMMAND_OPCODE
1333 {
1334 MI_COMMAND_OPCODE_MICONDITIONALBATCHBUFFEREND = 54, //!< No additional details
1335 };
1336
1337 enum COMMAND_TYPE
1338 {
1339 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
1340 };
1341
1342 //! \name Initializations
1343
1344 //! \brief Explicit member initialization function
1345 MI_CONDITIONAL_BATCH_BUFFER_END_CMD();
1346
1347 static const size_t dwSize = 4;
1348 static const size_t byteSize = 16;
1349 };
1350
1351 //!
1352 //! \brief MI_ATOMIC
1353 //! \details
1354 //! MI_ATOMIC is used to carry atomic operation on data in graphics memory.
1355 //! Atomic operations are supported on data granularity of 4B, 8B and 16B.
1356 //! The atomic operation leads to a read-modify-write operation on the data
1357 //! in graphics memory with the option of returning value. The data in
1358 //! graphics memory is modified by doing arithmetic and logical operation
1359 //! with the inline/indirect data provided with the MI_ATOMIC command.
1360 //! Inline/Indirect provided in the command can be one or two operands based
1361 //! on the atomic operation. Ex: Atomic-Compare operation needs two operands
1362 //! while Atomic-Add operation needs single operand and Atomic-increment
1363 //! requires no operand. Refer "Atomics" sub-section of "L3 Cache and URB"
1364 //! section for detailed atomic operations supported. Atomic
1365 //! operations can be enabled to return value by setting "Return Data
1366 //! Control" field in the command, return data is stored to CS_GPR
1367 //! registers.
1368 //! CS_GPR4/5 registers are updated with memory Return Data based on the
1369 //! "Data Size". Each GPR register is qword in size and occupies two MMIO
1370 //! registers.
1371 //! Note: Any references to CS_GPR registers in the command should be
1372 //! understood as the CS_GPR registers belonging to the corresponding
1373 //! engines *CS_GPR registers.
1374 //!
1375 //!
1376 //! Indirect Source Operands:
1377 //!
1378 //! Operand1 is sourced from [CS_GPR1, CS_GPR0]
1379 //!
1380 //! Operand2 is sourced from [CS_GPR3, CS_GPR2]
1381 //!
1382 //! Read return Data is stored in [CS_GPR_5, CS_GPR4]
1383 //!
1384 //! When "Data Size" is DWORD lower dword of CS_GPR4 (Qword) is updated with
1385 //! the dword data returned from memory. When "Data Size" is QWORD only
1386 //! CS_GPR4 (Qword) is updated with the qword data returned from memory.
1387 //! When the data size is OCTWORD CS_GPR4/5 are updated with the OCTWORD
1388 //! data returned from memory. CS_GPR4 is loaded with lower qword returned
1389 //! from memory and CS_GPR5 is loaded with upper qword returned from memory.
1390 //!
1391 //! When Inline Data mode is not set, Dwords 3..10 must not be included as
1392 //! part of the command. Dword Length field in the header must be programmed
1393 //! accordingly.
1394 //! When Inline Data Mode is set, Dwords3..10 must be included based on the
1395 //! Data Size field of the header. Both Operand-1 and Operand-2 dwords must
1396 //! be programmed based on the Data Size field. Operand-2 must be programmed
1397 //! to 0x0 if the atomic operation doesn't require it. Dword Length field in
1398 //! the header must be programmed accordingly.
1399 //!
1400 //!
1401 //!
1402 struct MI_ATOMIC_CMD
1403 {
1404 union
1405 {
1406 //!< DWORD 0
1407 struct
1408 {
1409 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
1410 uint32_t AtomicOpcode : __CODEGEN_BITFIELD( 8, 15) ; //!< ATOMIC OPCODE
1411 uint32_t ReturnDataControl : __CODEGEN_BITFIELD(16, 16) ; //!< Return Data Control
1412 uint32_t CsStall : __CODEGEN_BITFIELD(17, 17) ; //!< CS STALL
1413 uint32_t InlineData : __CODEGEN_BITFIELD(18, 18) ; //!< Inline Data
1414 uint32_t DataSize : __CODEGEN_BITFIELD(19, 20) ; //!< DATA_SIZE
1415 uint32_t Reserved21 : __CODEGEN_BITFIELD(21, 21) ; //!< Reserved
1416 uint32_t MemoryType : __CODEGEN_BITFIELD(22, 22) ; //!< MEMORY_TYPE
1417 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
1418 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
1419 };
1420 uint32_t Value;
1421 } DW0;
1422 union
1423 {
1424 //!< DWORD 1
1425 struct
1426 {
1427 uint32_t Reserved32 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
1428 uint32_t MemoryAddress : __CODEGEN_BITFIELD( 2, 31) ; //!< Memory Address
1429 };
1430 uint32_t Value;
1431 } DW1;
1432 union
1433 {
1434 //!< DWORD 2
1435 struct
1436 {
1437 uint32_t MemoryAddressHigh : __CODEGEN_BITFIELD( 0, 15) ; //!< Memory Address High
1438 uint32_t Reserved80 : __CODEGEN_BITFIELD(16, 31) ; //!< Reserved
1439 };
1440 uint32_t Value;
1441 } DW2;
1442 union
1443 {
1444 //!< DWORD 3
1445 struct
1446 {
1447 uint32_t Operand1DataDword0 ; //!< Operand1 Data Dword 0
1448 };
1449 uint32_t Value;
1450 } DW3;
1451 union
1452 {
1453 //!< DWORD 4
1454 struct
1455 {
1456 uint32_t Operand2DataDword0 ; //!< Operand2 Data Dword 0
1457 };
1458 uint32_t Value;
1459 } DW4;
1460 union
1461 {
1462 //!< DWORD 5
1463 struct
1464 {
1465 uint32_t Operand1DataDword1 ; //!< Operand1 Data Dword 1
1466 };
1467 uint32_t Value;
1468 } DW5;
1469 union
1470 {
1471 //!< DWORD 6
1472 struct
1473 {
1474 uint32_t Operand2DataDword1 ; //!< Operand2 Data Dword 1
1475 };
1476 uint32_t Value;
1477 } DW6;
1478 union
1479 {
1480 //!< DWORD 7
1481 struct
1482 {
1483 uint32_t Operand1DataDword2 ; //!< Operand1 Data Dword 2
1484 };
1485 uint32_t Value;
1486 } DW7;
1487 union
1488 {
1489 //!< DWORD 8
1490 struct
1491 {
1492 uint32_t Operand2DataDword2 ; //!< Operand2 Data Dword 2
1493 };
1494 uint32_t Value;
1495 } DW8;
1496 union
1497 {
1498 //!< DWORD 9
1499 struct
1500 {
1501 uint32_t Operand1DataDword3 ; //!< Operand1 Data Dword 3
1502 };
1503 uint32_t Value;
1504 } DW9;
1505 union
1506 {
1507 //!< DWORD 10
1508 struct
1509 {
1510 uint32_t Operand2DataDword3 ; //!< Operand2 Data Dword 3
1511 };
1512 uint32_t Value;
1513 } DW10;
1514
1515 //! \name Local enumerations
1516
1517 //! \brief DATA_SIZE
1518 //! \details
1519 //! This field indicates the size of the operand in dword/qword/octword on
1520 //! which atomic operation will be performed. Data size must match with the
1521 //! Atomic Opcode. Operation Data size could be 4B, 8B or 16B
1522 enum DATA_SIZE
1523 {
1524 DATA_SIZE_DWORD = 0, //!< Operand size used by Atomic Operation is DWORD.
1525 DATA_SIZE_QWORD = 1, //!< Operand Size used by Atomic Operation is QWORD.
1526 DATA_SIZE_OCTWORD = 2, //!< Operand Size used by Atomic Operation is OCTWORD.
1527 };
1528
1529 //! \brief MEMORY_TYPE
1530 //! \details
1531 //! This bit will be ignored and treated as if clear when executing from a
1532 //! non-privileged batch buffer. It is allowed for this bit to be clear when
1533 //! executing this command from a privileged (secure) batch buffer. This bit
1534 //! must be 1 if the <b>Per Process GTT Enable</b> bit is clear.
1535 enum MEMORY_TYPE
1536 {
1537 MEMORY_TYPE_PERPROCESSGRAPHICSADDRESS = 0, //!< No additional details
1538 MEMORY_TYPE_GLOBALGRAPHICSADDRESS = 1, //!< This command will use the global GTT to translate the Address and this command must be executing from a privileged (secure) batch buffer.
1539 };
1540
1541 enum MI_COMMAND_OPCODE
1542 {
1543 MI_COMMAND_OPCODE_MIATOMIC = 47, //!< No additional details
1544 };
1545
1546 enum COMMAND_TYPE
1547 {
1548 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
1549 };
1550
1551 //! \name Initializations
1552
1553 //! \brief Explicit member initialization function
1554 MI_ATOMIC_CMD();
1555
1556 static const size_t dwSize = 11;
1557 static const size_t byteSize = 44;
1558 };
1559
1560 //!
1561 //! \brief MI_MATH
1562 //! \details
1563 //! The MI_MATH command allows software to send instructions to the ALU in
1564 //! the Command Streamer. This command is the means by which the ALU is
1565 //! accessed. ALU instructions form the data payload of the MI_MATH command.
1566 //! An ALU instruction takes one DWord in size. The MI_MATH DWord Length is
1567 //! programmed based on the number of ALU instructions included, limited
1568 //! only by the max DWord Length supported. When the command streamer parses
1569 //! an MI_MATH command, it sends the included ALU instructions to the ALU.
1570 //! The ALU processes any instruction in a single clock. See the ALU section
1571 //! for more details.
1572 //!
1573 struct MI_MATH_CMD
1574 {
1575 union
1576 {
1577 //!< DWORD 0
1578 struct
1579 {
1580 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
1581 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 22) ; //!< Reserved
1582 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
1583 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
1584 };
1585 uint32_t Value;
1586 } DW0;
1587
1588 //! \name Local enumerations
1589
1590 enum MI_COMMAND_OPCODE
1591 {
1592 MI_COMMAND_OPCODE_MIMATH = 26, //!< No additional details
1593 };
1594
1595 enum COMMAND_TYPE
1596 {
1597 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
1598 };
1599
1600 //! \name Initializations
1601
1602 //! \brief Explicit member initialization function
1603 MI_MATH_CMD();
1604
1605 static const size_t dwSize = 1;
1606 static const size_t byteSize = 4;
1607 };
1608
1609 //!
1610 //! \brief MI_FLUSH_DW
1611 //! \details
1612 //! The MI_FLUSH_DW command is used to perform an internal "flush"
1613 //! operation. The parser pauses on an internal flush until all drawing
1614 //! engines have completed any pending operations. In addition, this command
1615 //! can also be used to:Flush any dirty data to memory. Invalidate the TLB
1616 //! cache inside the hardware Usage note: After this command is completed
1617 //! with a Store DWord enabled, CPU access to graphics memory will be
1618 //! coherent (assuming the Render Cache flush is not inhibited).
1619 //!
1620 struct MI_FLUSH_DW_CMD
1621 {
1622 union
1623 {
1624 //!< DWORD 0
1625 struct
1626 {
1627 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 5) ; //!< DWORD_LENGTH
1628 uint32_t Reserved6 : __CODEGEN_BITFIELD( 6, 6) ; //!< Reserved
1629 uint32_t VideoPipelineCacheInvalidate : __CODEGEN_BITFIELD( 7, 7) ; //!< Video Pipeline Cache invalidate
1630 uint32_t NotifyEnable : __CODEGEN_BITFIELD( 8, 8) ; //!< Notify Enable
1631 uint32_t FlushLlc : __CODEGEN_BITFIELD( 9, 9) ; //!< Flush LLC
1632 uint32_t Reserved10 : __CODEGEN_BITFIELD(10, 13) ; //!< Reserved
1633 uint32_t PostSyncOperation : __CODEGEN_BITFIELD(14, 15) ; //!< POST_SYNC_OPERATION
1634 uint32_t Reserved16 : __CODEGEN_BITFIELD(16, 17) ; //!< Reserved
1635 uint32_t TlbInvalidate : __CODEGEN_BITFIELD(18, 18) ; //!< TLB Invalidate
1636 uint32_t Reserved19 : __CODEGEN_BITFIELD(19, 20) ; //!< Reserved
1637 uint32_t StoreDataIndex : __CODEGEN_BITFIELD(21, 21) ; //!< Store Data Index
1638 uint32_t Reserved22 : __CODEGEN_BITFIELD(22, 22) ; //!< Reserved
1639 uint32_t MiCommandOpcode : __CODEGEN_BITFIELD(23, 28) ; //!< MI_COMMAND_OPCODE
1640 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
1641 };
1642 uint32_t Value;
1643 } DW0;
1644 union
1645 {
1646 //!< DWORD 1..2
1647 struct
1648 {
1649 uint64_t Reserved32 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
1650 uint64_t DestinationAddressType : __CODEGEN_BITFIELD( 2, 2) ; //!< DESTINATION_ADDRESS_TYPE
1651 uint64_t Address : __CODEGEN_BITFIELD( 3, 47) ; //!< Address
1652 uint64_t Reserved80 : __CODEGEN_BITFIELD(48, 63) ; //!< Reserved
1653 };
1654 uint32_t Value[2];
1655 } DW1_2;
1656 union
1657 {
1658 //!< DWORD 3..4
1659 struct
1660 {
1661 uint64_t ImmediateData ; //!< Immediate Data
1662 };
1663 uint32_t Value[2];
1664 } DW3_4;
1665
1666 //! \name Local enumerations
1667
1668 //! \brief POST_SYNC_OPERATION
1669 //! \details
1670 //! BitFieldDesc
1671 enum POST_SYNC_OPERATION
1672 {
1673 POST_SYNC_OPERATION_NOWRITE = 0, //!< No write occurs as a result of this instruction. This can be used to implement a "trap" operation, etc.
1674 POST_SYNC_OPERATION_WRITEIMMEDIATEDATA = 1, //!< HW implicitly detects the Data size to be Qword or Dword to be written to memory based on the command dword length programmed . When Dword Length indicates Qword, Writes the QWord containing Immediate Data Low, High DWs to the Destination Address . When Dword Length indicates Dword, Writes the DWord containing Immediate Data Low to the Destination Address
1675 POST_SYNC_OPERATION_UNNAMED3 = 3, //!< Write the TIMESTAMP register to the Destination Address. The upper 28 bits of the TIMESTAMP register are tied to '0'.
1676 };
1677
1678 enum MI_COMMAND_OPCODE
1679 {
1680 MI_COMMAND_OPCODE_MIFLUSHDW = 38, //!< No additional details
1681 };
1682
1683 enum COMMAND_TYPE
1684 {
1685 COMMAND_TYPE_MICOMMAND = 0, //!< No additional details
1686 };
1687
1688 //! \brief DESTINATION_ADDRESS_TYPE
1689 //! \details
1690 //! Defines address space of Destination Address
1691 enum DESTINATION_ADDRESS_TYPE
1692 {
1693 DESTINATION_ADDRESS_TYPE_PPGTT = 0, //!< Use PPGTT address space for DW write
1694 DESTINATION_ADDRESS_TYPE_GGTT = 1, //!< Use GGTT address space for DW write
1695 };
1696
1697 //! \name Initializations
1698
1699 //! \brief Explicit member initialization function
1700 MI_FLUSH_DW_CMD();
1701
1702 static const size_t dwSize = 5;
1703 static const size_t byteSize = 20;
1704 };
1705
1706 //!
1707 //! \brief PIPE_CONTROL
1708 //! \details
1709 //! The PIPE_CONTROL command is used to effect the synchronization described
1710 //! above.
1711 //!
1712 //! SW must follow below programming restrictions when
1713 //! programming PIPECONTROL command ifor POCS:
1714 //!
1715 //!
1716 //! Write cache flush bits must not be set (Render Target Cache Flush
1717 //! Enable, DC Flush Enable, Depth Cache Flush Enable )
1718 //!
1719 //! Post Sync Operations must not be set to "Write PS Depth Count"
1720 //!
1721 //! "Stall at Pixel Scoreboard" must not be set
1722 //!
1723 //! "Notify Enable" must not be set.
1724 //!
1725 //! "Depth Stall Enable" must not be set.
1726 //!
1727 //! "Generic Media State Clear" must not be set.
1728 //!
1729 //! "PSD Sync Enable" must not be set.
1730 //!
1731 struct PIPE_CONTROL_CMD
1732 {
1733 union
1734 {
1735 //!< DWORD 0
1736 struct
1737 {
1738 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
1739 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 15) ; //!< Reserved
1740 uint32_t Command3DSubOpcode : __CODEGEN_BITFIELD(16, 23) ; //!< _3D_COMMAND_SUB_OPCODE
1741 uint32_t Command3DOpcode : __CODEGEN_BITFIELD(24, 26) ; //!< _3D_COMMAND_OPCODE
1742 uint32_t CommandSubtype : __CODEGEN_BITFIELD(27, 28) ; //!< COMMAND_SUBTYPE
1743 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
1744 };
1745 uint32_t Value;
1746 } DW0;
1747 union
1748 {
1749 //!< DWORD 1
1750 struct
1751 {
1752 uint32_t DepthCacheFlushEnable : __CODEGEN_BITFIELD( 0, 0) ; //!< DEPTH_CACHE_FLUSH_ENABLE
1753 uint32_t StallAtPixelScoreboard : __CODEGEN_BITFIELD( 1, 1) ; //!< STALL_AT_PIXEL_SCOREBOARD
1754 uint32_t StateCacheInvalidationEnable : __CODEGEN_BITFIELD( 2, 2) ; //!< State Cache Invalidation Enable
1755 uint32_t ConstantCacheInvalidationEnable : __CODEGEN_BITFIELD( 3, 3) ; //!< Constant Cache Invalidation Enable
1756 uint32_t VfCacheInvalidationEnable : __CODEGEN_BITFIELD( 4, 4) ; //!< VF Cache Invalidation Enable
1757 uint32_t DcFlushEnable : __CODEGEN_BITFIELD( 5, 5) ; //!< DC Flush Enable
1758 uint32_t Reserved38 : __CODEGEN_BITFIELD( 6, 6) ; //!< Reserved
1759 uint32_t PipeControlFlushEnable : __CODEGEN_BITFIELD( 7, 7) ; //!< Pipe Control Flush Enable
1760 uint32_t NotifyEnable : __CODEGEN_BITFIELD( 8, 8) ; //!< Notify Enable
1761 uint32_t IndirectStatePointersDisable : __CODEGEN_BITFIELD( 9, 9) ; //!< Indirect State Pointers Disable
1762 uint32_t TextureCacheInvalidationEnable : __CODEGEN_BITFIELD(10, 10) ; //!< Texture Cache Invalidation Enable
1763 uint32_t InstructionCacheInvalidateEnable : __CODEGEN_BITFIELD(11, 11) ; //!< Instruction Cache Invalidate Enable
1764 uint32_t RenderTargetCacheFlushEnable : __CODEGEN_BITFIELD(12, 12) ; //!< RENDER_TARGET_CACHE_FLUSH_ENABLE
1765 uint32_t DepthStallEnable : __CODEGEN_BITFIELD(13, 13) ; //!< DEPTH_STALL_ENABLE
1766 uint32_t PostSyncOperation : __CODEGEN_BITFIELD(14, 15) ; //!< POST_SYNC_OPERATION
1767 uint32_t GenericMediaStateClear : __CODEGEN_BITFIELD(16, 16) ; //!< Generic Media State Clear
1768 uint32_t PsdSyncEnable : __CODEGEN_BITFIELD(17, 17) ; //!< PSD Sync Enable
1769 uint32_t TlbInvalidate : __CODEGEN_BITFIELD(18, 18) ; //!< TLB Invalidate
1770 uint32_t GlobalSnapshotCountReset : __CODEGEN_BITFIELD(19, 19) ; //!< GLOBAL_SNAPSHOT_COUNT_RESET
1771 uint32_t CommandStreamerStallEnable : __CODEGEN_BITFIELD(20, 20) ; //!< Command Streamer Stall Enable
1772 uint32_t StoreDataIndex : __CODEGEN_BITFIELD(21, 21) ; //!< Store Data Index
1773 uint32_t Reserved54 : __CODEGEN_BITFIELD(22, 22) ; //!< Reserved
1774 uint32_t LriPostSyncOperation : __CODEGEN_BITFIELD(23, 23) ; //!< LRI_POST_SYNC_OPERATION
1775 uint32_t DestinationAddressType : __CODEGEN_BITFIELD(24, 24) ; //!< DESTINATION_ADDRESS_TYPE
1776 uint32_t Reserved57 : __CODEGEN_BITFIELD(25, 25) ; //!< Reserved
1777 uint32_t FlushLlc : __CODEGEN_BITFIELD(26, 26) ; //!< Flush LLC
1778 uint32_t Reserved59 : __CODEGEN_BITFIELD(27, 27) ; //!< Reserved
1779 uint32_t TileCacheFlushEnable : __CODEGEN_BITFIELD(28, 28) ; //!< TILE_CACHE_FLUSH_ENABLE
1780 uint32_t Reserved61 : __CODEGEN_BITFIELD(29, 31) ; //!< Reserved
1781 };
1782 uint32_t Value;
1783 } DW1;
1784 union
1785 {
1786 //!< DWORD 2
1787 struct
1788 {
1789 uint32_t Reserved64 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
1790 uint32_t Address : __CODEGEN_BITFIELD( 2, 31) ; //!< Address
1791 };
1792 uint32_t Value;
1793 } DW2;
1794 union
1795 {
1796 //!< DWORD 3
1797 struct
1798 {
1799 uint32_t AddressHigh ; //!< Address High
1800 };
1801 uint32_t Value;
1802 } DW3;
1803 union
1804 {
1805 //!< DWORD 4..5
1806 struct
1807 {
1808 uint64_t ImmediateData ; //!< Immediate Data
1809 };
1810 uint32_t Value[2];
1811 } DW4_5;
1812
1813 //! \name Local enumerations
1814
1815 enum _3D_COMMAND_SUB_OPCODE
1816 {
1817 _3D_COMMAND_SUB_OPCODE_PIPECONTROL = 0, //!< No additional details
1818 };
1819
1820 enum _3D_COMMAND_OPCODE
1821 {
1822 _3D_COMMAND_OPCODE_PIPECONTROL = 2, //!< No additional details
1823 };
1824
1825 enum COMMAND_SUBTYPE
1826 {
1827 COMMAND_SUBTYPE_GFXPIPE3D = 3, //!< No additional details
1828 };
1829
1830 enum COMMAND_TYPE
1831 {
1832 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
1833 };
1834
1835 //! \brief DEPTH_CACHE_FLUSH_ENABLE
1836 //! \details
1837 //! Setting this bit enables flushing (i.e. writing back the dirty lines to
1838 //! memory and invalidating the tags) of depth related caches. This bit
1839 //! applies to HiZ cache, Stencil cache and depth cache.
1840 enum DEPTH_CACHE_FLUSH_ENABLE
1841 {
1842 DEPTH_CACHE_FLUSH_ENABLE_FLUSHDISABLED = 0, //!< Depth relates caches (HiZ, Stencil and Depth) are NOT flushed.
1843 DEPTH_CACHE_FLUSH_ENABLE_FLUSHENABLED = 1, //!< Depth relates caches (HiZ, Stencil and Depth) are flushed.
1844 };
1845
1846 //! \brief STALL_AT_PIXEL_SCOREBOARD
1847 //! \details
1848 //! Defines the behavior of PIPE_CONTROL command at the pixel scoreboard.
1849 enum STALL_AT_PIXEL_SCOREBOARD
1850 {
1851 STALL_AT_PIXEL_SCOREBOARD_DISABLE = 0, //!< Stall at the pixel scoreboard is disabled.
1852 STALL_AT_PIXEL_SCOREBOARD_ENABLE = 1, //!< Stall at the pixel scoreboard is enabled.
1853 };
1854
1855 //! \brief RENDER_TARGET_CACHE_FLUSH_ENABLE
1856 //! \details
1857 //! <p>Setting this bit will force Render Cache to be flushed to memory
1858 //! prior to this synchronization point completing. This bit must be set for
1859 //! all write fence sync operations to assure that results from operations
1860 //! initiated prior to this command are visible in memory once software
1861 //! observes this synchronization.</p>
1862 enum RENDER_TARGET_CACHE_FLUSH_ENABLE
1863 {
1864 RENDER_TARGET_CACHE_FLUSH_ENABLE_DISABLEFLUSH = 0, //!< Render Target Cache is NOT flushed.
1865 RENDER_TARGET_CACHE_FLUSH_ENABLE_ENABLEFLUSH = 1, //!< Render Target Cache is flushed.
1866 };
1867
1868 //! \brief DEPTH_STALL_ENABLE
1869 //! \details
1870 //! <p>This bit must be set when obtaining a "visible pixel" count to
1871 //! preclude the possible inclusion in the PS_DEPTH_COUNT value written to
1872 //! memory of some fraction of pixels from objects initiated after the
1873 //! PIPE_CONTROL command.</p>
1874 enum DEPTH_STALL_ENABLE
1875 {
1876 DEPTH_STALL_ENABLE_DISABLE = 0, //!< 3D pipeline will not stall subsequent primitives at the Depth Test stage.
1877 DEPTH_STALL_ENABLE_ENABLE = 1, //!< 3D pipeline will stall any subsequent primitives at the Depth Test stage until the Sync and Post-Sync operations complete.
1878 };
1879
1880 //! \brief POST_SYNC_OPERATION
1881 //! \details
1882 //! This field specifies an optional action to be taken upon completion of
1883 //! the synchronization operation.
1884 enum POST_SYNC_OPERATION
1885 {
1886 POST_SYNC_OPERATION_NOWRITE = 0, //!< No write occurs as a result of this instruction. This can be used to implement a "trap" operation, etc.
1887 POST_SYNC_OPERATION_WRITEIMMEDIATEDATA = 1, //!< Write the QWord containing Immediate Data Low, High DWs to the Destination Address
1888 POST_SYNC_OPERATION_WRITEPSDEPTHCOUNT = 2, //!< Write the 64-bit PS_DEPTH_COUNT register to the Destination Address
1889 POST_SYNC_OPERATION_WRITETIMESTAMP = 3, //!< Write the 64-bit TIMESTAMP register(i.e. "Reported Timestamp Count" 0x2358 for render pipe) to the Destination Address.
1890 };
1891
1892 //! \brief GLOBAL_SNAPSHOT_COUNT_RESET
1893 //! \details
1894 //! <p>This debug mode bit must not be exercised on any product.</p>
1895 enum GLOBAL_SNAPSHOT_COUNT_RESET
1896 {
1897 GLOBAL_SNAPSHOT_COUNT_RESET_DONTRESET = 0, //!< Do not reset the snapshot counts or Statistics Counters.
1898 GLOBAL_SNAPSHOT_COUNT_RESET_RESET = 1, //!< Reset the snapshot count in Gen4 for all the units and reset the Statistics Counters except as noted above.
1899 };
1900
1901 //! \brief LRI_POST_SYNC_OPERATION
1902 //! \details
1903 //! This bit caues a post sync operation with an LRI (Load Register
1904 //! Immediate) operation. If this bit is set then the Post-Sync Operation
1905 //! field must be cleared.
1906 enum LRI_POST_SYNC_OPERATION
1907 {
1908 LRI_POST_SYNC_OPERATION_NOLRIOPERATION = 0, //!< No LRI operation occurs as a result of this instruction. The Post-Sync Operation field is valid and may be used to specify an operation.
1909 LRI_POST_SYNC_OPERATION_MMIOWRITEIMMEDIATEDATA = 1, //!< Write the DWord contained in Immediate Data Low (DW3) to the MMIO offset specifed in the Address field.
1910 };
1911
1912 //! \brief DESTINATION_ADDRESS_TYPE
1913 //! \details
1914 //! Defines address space of Destination Address
1915 enum DESTINATION_ADDRESS_TYPE
1916 {
1917 DESTINATION_ADDRESS_TYPE_PPGTT = 0, //!< Use PPGTT address space for DW write
1918 DESTINATION_ADDRESS_TYPE_GGTT = 1, //!< Use GGTT address space for DW write
1919 };
1920
1921 //! \brief TILE_CACHE_FLUSH_ENABLE
1922 //! \details
1923 //! <p>Setting this bit will force Tile Cache (contains both color and depth
1924 //! data) to be flushed to memory prior to this synchronization point
1925 //! completing. This bit must be set for all write fence sync operations to
1926 //! assure that results from operations initiated prior to this command are
1927 //! visible in memory once software observes this synchronization.</p>
1928 //! <p></p>
1929 enum TILE_CACHE_FLUSH_ENABLE
1930 {
1931 TILE_CACHE_FLUSH_ENABLE_UNNAMED0 = 0, //!< Tile Cache is not flushed.
1932 TILE_CACHE_FLUSH_ENABLE_UNNAMED1 = 1, //!< Tile cache is flushed.
1933 };
1934
1935 //! \name Initializations
1936
1937 //! \brief Explicit member initialization function
1938 PIPE_CONTROL_CMD();
1939
1940 static const size_t dwSize = 6;
1941 static const size_t byteSize = 24;
1942 };
1943
1944 //!
1945 //! \brief MFX_WAIT
1946 //! \details
1947 //! This command can be considered the same as an MI_NOOP except that the
1948 //! command parser will not parse the next command until the following
1949 //! happens AVC or VC1 BSD mode: The command will stall the parser until
1950 //! completion of the BSD object
1951 //! IT, encoder, and MPEG2 BSD mode: The command will stall the parser
1952 //! until the object package is sent down the pipelineThis command should be
1953 //! used to ensure the preemption enable window occurs during the time the
1954 //! object command is being executed down the pipeline.
1955 //!
1956 //!
1957 struct MFX_WAIT_CMD
1958 {
1959 union
1960 {
1961 //!< DWORD 0
1962 struct
1963 {
1964 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 5) ; //!< DWORD_LENGTH
1965 uint32_t Reserved6 : __CODEGEN_BITFIELD( 6, 7) ; //!< Reserved
1966 uint32_t MfxSyncControlFlag : __CODEGEN_BITFIELD( 8, 8) ; //!< MFX Sync Control Flag
1967 uint32_t Reserved9 : __CODEGEN_BITFIELD( 9, 15) ; //!< Reserved
1968 uint32_t SubOpcode : __CODEGEN_BITFIELD(16, 26) ; //!< SUB_OPCODE
1969 uint32_t CommandSubtype : __CODEGEN_BITFIELD(27, 28) ; //!< COMMAND_SUBTYPE
1970 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
1971 };
1972 uint32_t Value;
1973 } DW0;
1974
1975 //! \name Local enumerations
1976
1977 enum SUB_OPCODE
1978 {
1979 SUB_OPCODE_MFXWAIT = 0, //!< No additional details
1980 };
1981
1982 enum COMMAND_SUBTYPE
1983 {
1984 COMMAND_SUBTYPE_MFXSINGLEDW = 1, //!< No additional details
1985 };
1986
1987 enum COMMAND_TYPE
1988 {
1989 COMMAND_TYPE_PARALLELVIDEOPIPE = 3, //!< No additional details
1990 };
1991
1992 //! \name Initializations
1993
1994 //! \brief Explicit member initialization function
1995 MFX_WAIT_CMD();
1996
1997 static const size_t dwSize = 1;
1998 static const size_t byteSize = 4;
1999 };
2000
2001 //!
2002 //! \brief MEDIA_STATE_FLUSH
2003 //! \details
2004 //! This command updates the Message Gateway state. In particular, it
2005 //! updates the state for a selected Interface Descriptor.
2006 //!
2007 //! This command can be considered same as a MI_Flush except that only media
2008 //! parser will get flushed instead of the entire 3D/media render pipeline.
2009 //! The command should be programmed prior to new Media state, curbe and/or
2010 //! interface descriptor commands when switching to a new context or
2011 //! programming new state for the same context. With this command, pipelined
2012 //! state change is allowed for the media pipe.
2013 //!
2014 //! Be cautious when using this command when child_present flag in the media
2015 //! state is enabled. This is because that CURBE state as well as Interface
2016 //! Descriptor state are shared between root threads and child threads.
2017 //! Changing these states while child threads are generated on the fly may
2018 //! cause unexpected behavior. Combining with MI_ARB_ON/OFF command, it is
2019 //! possible to support interruptability with the following command sequence
2020 //! where interrupt may be allowed only when MI_ARB_ON_OFF is ON:
2021 //!
2022 //! <pre>MEDIA_STATE_FLUSH
2023 //! VFE_STATE VFE will hold CS if watermark isn't met
2024 //! MI_ARB_OFF There must be at least one VFE command before this one
2025 //! MEDIA_OBJECT ... MI_ARB_ON</pre>
2026 //!
2027 struct MEDIA_STATE_FLUSH_CMD
2028 {
2029 union
2030 {
2031 //!< DWORD 0
2032 struct
2033 {
2034 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 15) ; //!< DWORD_LENGTH
2035 uint32_t Subopcode : __CODEGEN_BITFIELD(16, 23) ; //!< SUBOPCODE
2036 uint32_t MediaCommandOpcode : __CODEGEN_BITFIELD(24, 26) ; //!< MEDIA_COMMAND_OPCODE
2037 uint32_t Pipeline : __CODEGEN_BITFIELD(27, 28) ; //!< PIPELINE
2038 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
2039 };
2040 uint32_t Value;
2041 } DW0;
2042 union
2043 {
2044 //!< DWORD 1
2045 struct
2046 {
2047 uint32_t InterfaceDescriptorOffset : __CODEGEN_BITFIELD( 0, 5) ; //!< Interface Descriptor Offset
2048 uint32_t Reserved38 : __CODEGEN_BITFIELD( 6, 6) ; //!< Reserved
2049 uint32_t FlushToGo : __CODEGEN_BITFIELD( 7, 7) ; //!< Flush to GO
2050 uint32_t Reserved40 : __CODEGEN_BITFIELD( 8, 31) ; //!< Reserved
2051 };
2052 uint32_t Value;
2053 } DW1;
2054
2055 //! \name Local enumerations
2056
2057 enum SUBOPCODE
2058 {
2059 SUBOPCODE_MEDIASTATEFLUSHSUBOP = 4, //!< No additional details
2060 };
2061
2062 enum MEDIA_COMMAND_OPCODE
2063 {
2064 MEDIA_COMMAND_OPCODE_MEDIASTATEFLUSH = 0, //!< No additional details
2065 };
2066
2067 enum PIPELINE
2068 {
2069 PIPELINE_MEDIA = 2, //!< No additional details
2070 };
2071
2072 enum COMMAND_TYPE
2073 {
2074 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
2075 };
2076
2077 //! \name Initializations
2078
2079 //! \brief Explicit member initialization function
2080 MEDIA_STATE_FLUSH_CMD();
2081
2082 static const size_t dwSize = 2;
2083 static const size_t byteSize = 8;
2084 };
2085
2086 };
2087
2088 #pragma pack()
2089
2090 #endif // __MHW_MI_HWCMD_G11_X_H__