Debian Codegraph @

media_driver/agnostic/gen11/hw/mhw_render_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_render_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_RENDER_HWCMD_G11_X_H__
29 #define __MHW_RENDER_HWCMD_G11_X_H__
30
31 #pragma once
32
33 #include <cstdint>
34 #include <cstddef>
35
36 #pragma pack(1)
37
38 class mhw_render_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 MEDIA_OBJECT
51 //! \details
52 //!
53 //!
54 struct MEDIA_OBJECT_CMD
55 {
56 union
57 {
58 //!< DWORD 0
59 struct
60 {
61 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 14) ; //!< DWORD_LENGTH
62 uint32_t Reserved15 : __CODEGEN_BITFIELD(15, 15) ; //!< Reserved
63 uint32_t MediaCommandSubOpcode : __CODEGEN_BITFIELD(16, 23) ; //!< MEDIA_COMMAND_SUB_OPCODE
64 uint32_t MediaCommandOpcode : __CODEGEN_BITFIELD(24, 26) ; //!< MEDIA_COMMAND_OPCODE
65 uint32_t MediaCommandPipeline : __CODEGEN_BITFIELD(27, 28) ; //!< MEDIA_COMMAND_PIPELINE
66 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
67 };
68 uint32_t Value;
69 } DW0;
70 union
71 {
72 //!< DWORD 1
73 struct
74 {
75 uint32_t InterfaceDescriptorOffset : __CODEGEN_BITFIELD( 0, 5) ; //!< Interface Descriptor Offset
76 uint32_t Reserved38 : __CODEGEN_BITFIELD( 6, 31) ; //!< Reserved
77 };
78 uint32_t Value;
79 } DW1;
80 union
81 {
82 //!< DWORD 2
83 struct
84 {
85 uint32_t IndirectDataLength : __CODEGEN_BITFIELD( 0, 16) ; //!< Indirect Data Length
86 uint32_t SubsliceDestinationSelect : __CODEGEN_BITFIELD(17, 18) ; //!< SUBSLICE_DESTINATION_SELECT
87 uint32_t SliceDestinationSelect : __CODEGEN_BITFIELD(19, 20) ; //!< SLICE_DESTINATION_SELECT
88 uint32_t Reserved85 : __CODEGEN_BITFIELD(21, 21) ; //!< Reserved
89 uint32_t ForceDestination : __CODEGEN_BITFIELD(22, 22) ; //!< Force Destination
90 uint32_t Reserved87 : __CODEGEN_BITFIELD(23, 23) ; //!< Reserved
91 uint32_t ThreadSynchronization : __CODEGEN_BITFIELD(24, 24) ; //!< THREAD_SYNCHRONIZATION
92 uint32_t SliceDestinationSelectMsbs : __CODEGEN_BITFIELD(25, 26) ; //!< Slice Destination Select MSBs
93 uint32_t Reserved91 : __CODEGEN_BITFIELD(27, 31) ; //!< Reserved
94 };
95 uint32_t Value;
96 } DW2;
97 union
98 {
99 //!< DWORD 3
100 struct
101 {
102 uint32_t IndirectDataStartAddress ; //!< Indirect Data Start Address
103 };
104 uint32_t Value;
105 } DW3;
106 union
107 {
108 //!< DWORD 4
109 struct
110 {
111 uint32_t XPosition : __CODEGEN_BITFIELD( 0, 8) ; //!< X Position
112 uint32_t Reserved137 : __CODEGEN_BITFIELD( 9, 15) ; //!< Reserved
113 uint32_t YPosition : __CODEGEN_BITFIELD(16, 24) ; //!< Y Position
114 uint32_t Reserved153 : __CODEGEN_BITFIELD(25, 31) ; //!< Reserved
115 };
116 uint32_t Value;
117 } DW4;
118 union
119 {
120 //!< DWORD 5
121 struct
122 {
123 uint32_t Reserved160 : __CODEGEN_BITFIELD( 0, 15) ; //!< Reserved
124 uint32_t BlockColor : __CODEGEN_BITFIELD(16, 23) ; //!< Block Color
125 uint32_t Reserved184 : __CODEGEN_BITFIELD(24, 31) ; //!< Reserved
126 };
127 uint32_t Value;
128 } DW5;
129
130 //! \name Local enumerations
131
132 enum MEDIA_COMMAND_SUB_OPCODE
133 {
134 MEDIA_COMMAND_SUB_OPCODE_MEDIAOBJECTSUBOP = 0, //!< No additional details
135 };
136
137 enum MEDIA_COMMAND_OPCODE
138 {
139 MEDIA_COMMAND_OPCODE_MEDIAOBJECT = 1, //!< No additional details
140 };
141
142 enum MEDIA_COMMAND_PIPELINE
143 {
144 MEDIA_COMMAND_PIPELINE_MEDIA = 2, //!< No additional details
145 };
146
147 enum COMMAND_TYPE
148 {
149 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
150 };
151
152 //! \brief SUBSLICE_DESTINATION_SELECT
153 //! \details
154 //! This field selects the SubSlice that this thread must be sent to.
155 //! Ignored if <b>Force Destination</b> = 0
156 enum SUBSLICE_DESTINATION_SELECT
157 {
158 SUBSLICE_DESTINATION_SELECT_SUBSLICE0 = 0, //!< No additional details
159 SUBSLICE_DESTINATION_SELECT_SUBSLICE1 = 1, //!< No additional details
160 SUBSLICE_DESTINATION_SELECT_SUBSLICE2 = 2, //!< No additional details
161 SUBSLICE_DESTINATION_SELECT_SUBSLICE3 = 3, //!< No additional details
162 };
163
164 //! \brief SLICE_DESTINATION_SELECT
165 //! \details
166 //! This bit along with the subslice destination select determines the slice
167 //! that this thread must be sent to. Ignored if <b>Force Destination</b> =
168 //! 0, or if product only has 1 slice.
169 enum SLICE_DESTINATION_SELECT
170 {
171 SLICE_DESTINATION_SELECT_SLICE0 = 0, //!< No additional details
172 SLICE_DESTINATION_SELECT_SLICE1 = 1, //!< Cannot be used in products without a Slice 1.
173 SLICE_DESTINATION_SELECT_SLICE2 = 2, //!< Cannot be used in products without a Slice 2.
174 };
175
176 //! \brief THREAD_SYNCHRONIZATION
177 //! \details
178 //! This field when set indicates that the dispatch of the thread originated
179 //! from this command is based on the "spawn root thread" message.
180 enum THREAD_SYNCHRONIZATION
181 {
182 THREAD_SYNCHRONIZATION_NOTHREADSYNCHRONIZATION = 0, //!< No additional details
183 THREAD_SYNCHRONIZATION_THREADDISPATCHISSYNCHRONIZEDBYTHESPAWNROOTTHREADMESSAGE = 1, //!< No additional details
184 };
185
186 //! \name Initializations
187
188 //! \brief Explicit member initialization function
189 MEDIA_OBJECT_CMD();
190
191 static const size_t dwSize = 6;
192 static const size_t byteSize = 24;
193 };
194
195 //!
196 //! \brief PIPELINE_SELECT
197 //! \details
198 //! The PIPELINE_SELECT command is used to specify which GPE pipeline is to
199 //! be considered the 'current' active pipeline. Issuing
200 //! 3D-pipeline-specific commands when the Media pipeline is selected, or
201 //! vice versa, is UNDEFINED.
202 //!
203 //! Issuing 3D-pipeline-specific commands when the GPGPU pipeline is
204 //! selected, or vice versa, is UNDEFINED.
205 //!
206 //! Programming common non pipeline commands (e.g., STATE_BASE_ADDRESS) is
207 //! allowed in all pipeline modes.
208 //!
209 //! Software must ensure all the write caches are flushed through a stalling
210 //! PIPE_CONTROL command followed by another PIPE_CONTROL command to
211 //! invalidate read only caches prior to programming MI_PIPELINE_SELECT
212 //! command to change the Pipeline Select Mode. Example: ... Workload-3Dmode
213 //! PIPE_CONTROL (CS Stall, Depth Cache Flush Enable, Render Target Cache
214 //! Flush Enable, DC Flush Enable) PIPE_CONTROL (Constant Cache Invalidate,
215 //! Texture Cache Invalidate, Instruction Cache Invalidate, State Cache
216 //! invalidate) PIPELINE_SELECT ( GPGPU)
217 //!
218 //! This command must be followed by a PIPE_CONTROL with CS Stall bit
219 //! set.
220 //!
221 struct PIPELINE_SELECT_CMD
222 {
223 union
224 {
225 //!< DWORD 0
226 struct
227 {
228 uint32_t PipelineSelection : __CODEGEN_BITFIELD( 0, 1) ; //!< PIPELINE_SELECTION
229 uint32_t RenderSliceCommonPowerGateEnable : __CODEGEN_BITFIELD( 2, 2) ; //!< RENDER_SLICE_COMMON_POWER_GATE_ENABLE
230 uint32_t RenderSamplerPowerGateEnable : __CODEGEN_BITFIELD( 3, 3) ; //!< RENDER_SAMPLER_POWER_GATE_ENABLE
231 uint32_t MediaSamplerDopClockGateEnable : __CODEGEN_BITFIELD( 4, 4) ; //!< MEDIA_SAMPLER_DOP_CLOCK_GATE_ENABLE
232 uint32_t ForceMediaAwake : __CODEGEN_BITFIELD( 5, 5) ; //!< FORCE_MEDIA_AWAKE
233 uint32_t MediaSamplerPowerClockGateDisable : __CODEGEN_BITFIELD( 6, 6) ; //!< Media Sampler Power Clock Gate Disable
234 uint32_t Reserved7 : __CODEGEN_BITFIELD( 7, 7) ; //!< Reserved
235 uint32_t MaskBits : __CODEGEN_BITFIELD( 8, 15) ; //!< Mask Bits
236 uint32_t Command3DSubOpcode : __CODEGEN_BITFIELD(16, 23) ; //!< _3D_COMMAND_SUB_OPCODE
237 uint32_t Command3DOpcode : __CODEGEN_BITFIELD(24, 26) ; //!< _3D_COMMAND_OPCODE
238 uint32_t CommandSubtype : __CODEGEN_BITFIELD(27, 28) ; //!< COMMAND_SUBTYPE
239 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
240 };
241 uint32_t Value;
242 } DW0;
243
244 //! \name Local enumerations
245
246 //! \brief PIPELINE_SELECTION
247 //! \details
248 //! Mask bits [9:8] has to be set for HW to look at this field when
249 //! PIPELINE_SELECT command is parsed. Setting only one of the mask bit [9]
250 //! or [8] is illegal.
251 enum PIPELINE_SELECTION
252 {
253 PIPELINE_SELECTION_3D = 0, //!< 3D pipeline is selected
254 PIPELINE_SELECTION_MEDIA = 1, //!< Media pipeline is selected (Includes HD optical disc playback, HD video playback, and generic media workloads)
255 PIPELINE_SELECTION_GPGPU = 2, //!< GPGPU pipeline is selected
256 };
257
258 //! \brief RENDER_SLICE_COMMON_POWER_GATE_ENABLE
259 //! \details
260 //! Mask bit [10] has to be set for HW to look at this field when
261 //! PIPELINE_SELECT command is parsed.
262 enum RENDER_SLICE_COMMON_POWER_GATE_ENABLE
263 {
264 RENDER_SLICE_COMMON_POWER_GATE_ENABLE_DISABLED = 0, //!< Command Streamer sends message to PM to disable render slice common Power Gating.
265 RENDER_SLICE_COMMON_POWER_GATE_ENABLE_ENABLED = 1, //!< Command Streamer sends message to PM to enable render slice common Power Gating.
266 };
267
268 //! \brief RENDER_SAMPLER_POWER_GATE_ENABLE
269 //! \details
270 //! Mask bit [11] has to be set for HW to look at this field when
271 //! PIPELINE_SELECT command is parsed.
272 enum RENDER_SAMPLER_POWER_GATE_ENABLE
273 {
274 RENDER_SAMPLER_POWER_GATE_ENABLE_DISABLED = 0, //!< Command Streamer sends message to PM to disable render sampler Power Gating.
275 RENDER_SAMPLER_POWER_GATE_ENABLE_ENABLED = 1, //!< Command Streamer sends message to PM to enable render sampler Power Gating.
276 };
277
278 //! \brief MEDIA_SAMPLER_DOP_CLOCK_GATE_ENABLE
279 //! \details
280 //! Mask bit [12] has to be set for HW to look at this field when
281 //! PIPELINE_SELECT command is parsed.
282 enum MEDIA_SAMPLER_DOP_CLOCK_GATE_ENABLE
283 {
284 MEDIA_SAMPLER_DOP_CLOCK_GATE_ENABLE_DISABLED = 0, //!< Command Streamer sends message to PM to disable sampler DOP Clock Gating.
285 MEDIA_SAMPLER_DOP_CLOCK_GATE_ENABLE_ENABLED = 1, //!< Command Streamer sends message to PM to enable media sampler DOP Clock Gating.
286 };
287
288 //! \brief FORCE_MEDIA_AWAKE
289 //! \details
290 //! Mask bit [13] has to be set for HW to look at this field when
291 //! PIPELINE_SELECT command is parsed.
292 //!
293 //! Example for usage model:
294 //!
295 //! <b>RCS Ring Buffer</b>:
296 //! <b>PIPELINE_SELECT (Force Media Awake set to '1')</b>
297 //! MI_SEMPAHORE_SINGAL (Signal context id 0xABC to Render Command
298 //! Streamer)
299 //! <b>PIPELINE_SELECT (Force Media Awake set to '0')</b>
300 //! <b>MI_BATCH_BUFFER_START</b>
301 //! STATE Commands ..
302 //! …………
303 //! <b>PIPELINE_SELECT (Force Media Awake set to '1')</b>
304 //! MI_LOAD_REGISTER_IMM (Load register 0x23XX in render command
305 //! streamer with data 0xFFF)
306 //! <b>PIPELINE_SELECT (Force Media Awake set to '0')</b>
307 //! …………
308 //! <b>MI_BATCH_BUFFER_END</b>
309 enum FORCE_MEDIA_AWAKE
310 {
311 FORCE_MEDIA_AWAKE_DISABLED = 0, //!< Command streamer sends message to PM to disable force awake of media engine (next instructions do not require the media engine to be awake). Command streamer waits for acknowledge from PM before parsing the next command.
312 FORCE_MEDIA_AWAKE_ENABLED = 1, //!< Command streamer sends message to PM to force awake media engine (next instructions require media engine awake). Command streamer waits for acknowledge from PM before parsing the next command.
313 };
314
315 enum _3D_COMMAND_SUB_OPCODE
316 {
317 _3D_COMMAND_SUB_OPCODE_PIPELINESELECT = 4, //!< No additional details
318 };
319
320 enum _3D_COMMAND_OPCODE
321 {
322 _3D_COMMAND_OPCODE_GFXPIPENONPIPELINED = 1, //!< No additional details
323 };
324
325 enum COMMAND_SUBTYPE
326 {
327 COMMAND_SUBTYPE_GFXPIPESINGLEDW = 1, //!< No additional details
328 };
329
330 enum COMMAND_TYPE
331 {
332 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
333 };
334
335 //! \name Initializations
336
337 //! \brief Explicit member initialization function
338 PIPELINE_SELECT_CMD();
339
340 static const size_t dwSize = 1;
341 static const size_t byteSize = 4;
342 };
343
344 //!
345 //! \brief STATE_BASE_ADDRESS
346 //! \details
347 //! The STATE_BASE_ADDRESS command sets the base pointers for subsequent
348 //! state, instruction, and media indirect object accesses by the GPE.
349 //! For more information see the Base Address Utilization table in the
350 //! Memory Access Indirection narrative topic.
351 //!
352 //! The following commands must be reissued following any change to the base
353 //! addresses: 3DSTATE_CC_POINTERS
354 //! 3DSTATE_BINDING_TABLE_POINTERS
355 //! 3DSTATE_SAMPLER_STATE_POINTERS
356 //! 3DSTATE_VIEWPORT_STATE_POINTERS
357 //! MEDIA_STATE_POINTERS
358 //! Execution of this command causes a full pipeline flush, thus its use
359 //! should be minimized for higher performance.
360 //!
361 //! SW must always program PIPE_CONTROL with "CS Stall" and "Render Target
362 //! Cache Flush Enable" set before programming STATE_BASE_ADDRESS command
363 //! for GPGPU workloads i.e when pipeline select is GPGPU via
364 //! PIPELINE_SELECT command. This is required to achieve better GPGPU
365 //! preemption latencies in certain workload programming sequences. If
366 //! programming PIPE_CONTROL has performance implications then preemption
367 //! latencies can be traded off against performance by not implementing this
368 //! programming note.
369 //!
370 //! This command must be followed by a PIPE_CONTROL with CS Stall bit
371 //! set.,
372 //!
373 struct STATE_BASE_ADDRESS_CMD
374 {
375 union
376 {
377 //!< DWORD 0
378 struct
379 {
380 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
381 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 15) ; //!< Reserved
382 uint32_t Command3DSubOpcode : __CODEGEN_BITFIELD(16, 23) ; //!< _3D_COMMAND_SUB_OPCODE
383 uint32_t Command3DOpcode : __CODEGEN_BITFIELD(24, 26) ; //!< _3D_COMMAND_OPCODE
384 uint32_t CommandSubtype : __CODEGEN_BITFIELD(27, 28) ; //!< COMMAND_SUBTYPE
385 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
386 };
387 uint32_t Value;
388 } DW0;
389 union
390 {
391 //!< DWORD 1..2
392 struct
393 {
394 uint64_t GeneralStateBaseAddressModifyEnable : __CODEGEN_BITFIELD( 0, 0) ; //!< GENERAL_STATE_BASE_ADDRESS_MODIFY_ENABLE
395 uint64_t Reserved33 : __CODEGEN_BITFIELD( 1, 3) ; //!< Reserved
396 uint64_t GeneralStateMemoryObjectControlState : __CODEGEN_BITFIELD( 4, 10) ; //!< General State Memory Object Control State
397 uint64_t Reserved43 : __CODEGEN_BITFIELD(11, 11) ; //!< Reserved
398 uint64_t GeneralStateBaseAddress : __CODEGEN_BITFIELD(12, 63) ; //!< General State Base Address
399 };
400 uint32_t Value[2];
401 } DW1_2;
402 union
403 {
404 //!< DWORD 3
405 struct
406 {
407 uint32_t Reserved96 : __CODEGEN_BITFIELD( 0, 15) ; //!< Reserved
408 uint32_t StatelessDataPortAccessMemoryObjectControlState : __CODEGEN_BITFIELD(16, 22) ; //!< Stateless Data Port Access Memory Object Control State
409 uint32_t Reserved119 : __CODEGEN_BITFIELD(23, 31) ; //!< Reserved
410 };
411 uint32_t Value;
412 } DW3;
413 union
414 {
415 //!< DWORD 4..5
416 struct
417 {
418 uint64_t SurfaceStateBaseAddressModifyEnable : __CODEGEN_BITFIELD( 0, 0) ; //!< SURFACE_STATE_BASE_ADDRESS_MODIFY_ENABLE
419 uint64_t Reserved129 : __CODEGEN_BITFIELD( 1, 3) ; //!< Reserved
420 uint64_t SurfaceStateMemoryObjectControlState : __CODEGEN_BITFIELD( 4, 10) ; //!< Surface State Memory Object Control State
421 uint64_t Reserved139 : __CODEGEN_BITFIELD(11, 11) ; //!< Reserved
422 uint64_t SurfaceStateBaseAddress : __CODEGEN_BITFIELD(12, 63) ; //!< Surface State Base Address
423 };
424 uint32_t Value[2];
425 } DW4_5;
426 union
427 {
428 //!< DWORD 6..7
429 struct
430 {
431 uint64_t DynamicStateBaseAddressModifyEnable : __CODEGEN_BITFIELD( 0, 0) ; //!< DYNAMIC_STATE_BASE_ADDRESS_MODIFY_ENABLE
432 uint64_t Reserved193 : __CODEGEN_BITFIELD( 1, 3) ; //!< Reserved
433 uint64_t DynamicStateMemoryObjectControlState : __CODEGEN_BITFIELD( 4, 10) ; //!< Dynamic State Memory Object Control State
434 uint64_t Reserved203 : __CODEGEN_BITFIELD(11, 11) ; //!< Reserved
435 uint64_t DynamicStateBaseAddress : __CODEGEN_BITFIELD(12, 63) ; //!< Dynamic State Base Address
436 };
437 uint32_t Value[2];
438 } DW6_7;
439 union
440 {
441 //!< DWORD 8..9
442 struct
443 {
444 uint64_t IndirectObjectBaseAddressModifyEnable : __CODEGEN_BITFIELD( 0, 0) ; //!< INDIRECT_OBJECT_BASE_ADDRESS_MODIFY_ENABLE
445 uint64_t Reserved257 : __CODEGEN_BITFIELD( 1, 3) ; //!< Reserved
446 uint64_t IndirectObjectMemoryObjectControlState : __CODEGEN_BITFIELD( 4, 10) ; //!< Indirect Object Memory Object Control State
447 uint64_t Reserved267 : __CODEGEN_BITFIELD(11, 11) ; //!< Reserved
448 uint64_t IndirectObjectBaseAddress : __CODEGEN_BITFIELD(12, 63) ; //!< Indirect Object Base Address
449 };
450 uint32_t Value[2];
451 } DW8_9;
452 union
453 {
454 //!< DWORD 10..11
455 struct
456 {
457 uint64_t InstructionBaseAddressModifyEnable : __CODEGEN_BITFIELD( 0, 0) ; //!< INSTRUCTION_BASE_ADDRESS_MODIFY_ENABLE
458 uint64_t Reserved321 : __CODEGEN_BITFIELD( 1, 3) ; //!< Reserved
459 uint64_t InstructionMemoryObjectControlState : __CODEGEN_BITFIELD( 4, 10) ; //!< Instruction Memory Object Control State
460 uint64_t Reserved331 : __CODEGEN_BITFIELD(11, 11) ; //!< Reserved
461 uint64_t InstructionBaseAddress : __CODEGEN_BITFIELD(12, 63) ; //!< Instruction Base Address
462 };
463 uint32_t Value[2];
464 } DW10_11;
465 union
466 {
467 //!< DWORD 12
468 struct
469 {
470 uint32_t GeneralStateBufferSizeModifyEnable : __CODEGEN_BITFIELD( 0, 0) ; //!< GENERAL_STATE_BUFFER_SIZE_MODIFY_ENABLE
471 uint32_t Reserved385 : __CODEGEN_BITFIELD( 1, 11) ; //!< Reserved
472 uint32_t GeneralStateBufferSize : __CODEGEN_BITFIELD(12, 31) ; //!< General State Buffer Size
473 };
474 uint32_t Value;
475 } DW12;
476 union
477 {
478 //!< DWORD 13
479 struct
480 {
481 uint32_t DynamicStateBufferSizeModifyEnable : __CODEGEN_BITFIELD( 0, 0) ; //!< DYNAMIC_STATE_BUFFER_SIZE_MODIFY_ENABLE
482 uint32_t Reserved417 : __CODEGEN_BITFIELD( 1, 11) ; //!< Reserved
483 uint32_t DynamicStateBufferSize : __CODEGEN_BITFIELD(12, 31) ; //!< Dynamic State Buffer Size
484 };
485 uint32_t Value;
486 } DW13;
487 union
488 {
489 //!< DWORD 14
490 struct
491 {
492 uint32_t IndirectObjectBufferSizeModifyEnable : __CODEGEN_BITFIELD( 0, 0) ; //!< INDIRECT_OBJECT_BUFFER_SIZE_MODIFY_ENABLE
493 uint32_t Reserved449 : __CODEGEN_BITFIELD( 1, 11) ; //!< Reserved
494 uint32_t IndirectObjectBufferSize : __CODEGEN_BITFIELD(12, 31) ; //!< Indirect Object Buffer Size
495 };
496 uint32_t Value;
497 } DW14;
498 union
499 {
500 //!< DWORD 15
501 struct
502 {
503 uint32_t InstructionBufferSizeModifyEnable : __CODEGEN_BITFIELD( 0, 0) ; //!< INSTRUCTION_BUFFER_SIZE_MODIFY_ENABLE
504 uint32_t Reserved481 : __CODEGEN_BITFIELD( 1, 11) ; //!< Reserved
505 uint32_t InstructionBufferSize : __CODEGEN_BITFIELD(12, 31) ; //!< Instruction Buffer Size
506 };
507 uint32_t Value;
508 } DW15;
509 union
510 {
511 //!< DWORD 16..17
512 struct
513 {
514 uint64_t BindlessSurfaceStateBaseAddressModifyEnable : __CODEGEN_BITFIELD( 0, 0) ; //!< BINDLESS_SURFACE_STATE_BASE_ADDRESS_MODIFY_ENABLE
515 uint64_t Reserved513 : __CODEGEN_BITFIELD( 1, 3) ; //!< Reserved
516 uint64_t BindlessSurfaceStateMemoryObjectControlState : __CODEGEN_BITFIELD( 4, 10) ; //!< Bindless Surface State Memory Object Control State
517 uint64_t Reserved523 : __CODEGEN_BITFIELD(11, 11) ; //!< Reserved
518 uint64_t BindlessSurfaceStateBaseAddress : __CODEGEN_BITFIELD(12, 63) ; //!< Bindless Surface State Base Address
519 };
520 uint32_t Value[2];
521 } DW16_17;
522 union
523 {
524 //!< DWORD 18
525 struct
526 {
527 uint32_t Reserved576 : __CODEGEN_BITFIELD( 0, 11) ; //!< Reserved
528 uint32_t BindlessSurfaceStateSize : __CODEGEN_BITFIELD(12, 31) ; //!< Bindless Surface State Size
529 };
530 uint32_t Value;
531 } DW18;
532 union
533 {
534 //!< DWORD 19..20
535 struct
536 {
537 uint64_t BindlessSamplerStateBaseAddressModifyEnable : __CODEGEN_BITFIELD( 0, 0) ; //!< BINDLESS_SAMPLER_STATE_BASE_ADDRESS_MODIFY_ENABLE
538 uint64_t Reserved609 : __CODEGEN_BITFIELD( 1, 3) ; //!< Reserved
539 uint64_t BindlessSamplerStateMemoryObjectControlState : __CODEGEN_BITFIELD( 4, 10) ; //!< Bindless Sampler State Memory Object Control State
540 uint64_t Reserved619 : __CODEGEN_BITFIELD(11, 11) ; //!< Reserved
541 uint64_t BindlessSamplerStateBaseAddress : __CODEGEN_BITFIELD(12, 63) ; //!< Bindless Sampler State Base Address
542 };
543 uint32_t Value[2];
544 } DW19_20;
545 union
546 {
547 //!< DWORD 21
548 struct
549 {
550 uint32_t Reserved672 : __CODEGEN_BITFIELD( 0, 11) ; //!< Reserved
551 uint32_t BindlessSamplerStateBufferSize : __CODEGEN_BITFIELD(12, 31) ; //!< Bindless Sampler State Buffer Size
552 };
553 uint32_t Value;
554 } DW21;
555
556 //! \name Local enumerations
557
558 enum _3D_COMMAND_SUB_OPCODE
559 {
560 _3D_COMMAND_SUB_OPCODE_STATEBASEADDRESS = 1, //!< No additional details
561 };
562
563 enum _3D_COMMAND_OPCODE
564 {
565 _3D_COMMAND_OPCODE_GFXPIPENONPIPELINED = 1, //!< No additional details
566 };
567
568 enum COMMAND_SUBTYPE
569 {
570 COMMAND_SUBTYPE_GFXPIPECOMMON = 0, //!< No additional details
571 };
572
573 enum COMMAND_TYPE
574 {
575 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
576 };
577
578 //! \brief GENERAL_STATE_BASE_ADDRESS_MODIFY_ENABLE
579 //! \details
580 //! <p>The other fields in this DWord and the following DWord are updated
581 //! only when this bit is set.</p>
582 enum GENERAL_STATE_BASE_ADDRESS_MODIFY_ENABLE
583 {
584 GENERAL_STATE_BASE_ADDRESS_MODIFY_ENABLE_DISABLE = 0, //!< Ignore the updated address.
585 GENERAL_STATE_BASE_ADDRESS_MODIFY_ENABLE_ENABLE = 1, //!< Modify the address.
586 };
587
588 //! \brief SURFACE_STATE_BASE_ADDRESS_MODIFY_ENABLE
589 //! \details
590 //! The other fields in this DWord and the following DWord are updated only
591 //! when this bit is set.
592 enum SURFACE_STATE_BASE_ADDRESS_MODIFY_ENABLE
593 {
594 SURFACE_STATE_BASE_ADDRESS_MODIFY_ENABLE_DISABLE = 0, //!< Ignore the updated address.
595 SURFACE_STATE_BASE_ADDRESS_MODIFY_ENABLE_ENABLE = 1, //!< Modify the address.
596 };
597
598 //! \brief DYNAMIC_STATE_BASE_ADDRESS_MODIFY_ENABLE
599 //! \details
600 //! The other fields in this DWord and the following DWord are updated only
601 //! when this bit is set.
602 enum DYNAMIC_STATE_BASE_ADDRESS_MODIFY_ENABLE
603 {
604 DYNAMIC_STATE_BASE_ADDRESS_MODIFY_ENABLE_DISABLE = 0, //!< Ignore the updated address.
605 DYNAMIC_STATE_BASE_ADDRESS_MODIFY_ENABLE_ENABLE = 1, //!< Modify the address.
606 };
607
608 //! \brief INDIRECT_OBJECT_BASE_ADDRESS_MODIFY_ENABLE
609 //! \details
610 //! <p>The other fields in this DWord and the following DWord are updated
611 //! only when this bit is set.</p>
612 enum INDIRECT_OBJECT_BASE_ADDRESS_MODIFY_ENABLE
613 {
614 INDIRECT_OBJECT_BASE_ADDRESS_MODIFY_ENABLE_DISABLE = 0, //!< Ignore the updated address.
615 INDIRECT_OBJECT_BASE_ADDRESS_MODIFY_ENABLE_ENABLE = 1, //!< Modify the address.
616 };
617
618 //! \brief INSTRUCTION_BASE_ADDRESS_MODIFY_ENABLE
619 //! \details
620 //! <p>The other fields in this DWord and the following DWord are updated
621 //! only when this bit is set.</p>
622 enum INSTRUCTION_BASE_ADDRESS_MODIFY_ENABLE
623 {
624 INSTRUCTION_BASE_ADDRESS_MODIFY_ENABLE_DISABLE = 0, //!< Ignore the updated address.
625 INSTRUCTION_BASE_ADDRESS_MODIFY_ENABLE_ENABLE = 1, //!< Modify the address.
626 };
627
628 //! \brief GENERAL_STATE_BUFFER_SIZE_MODIFY_ENABLE
629 //! \details
630 //! The bound in this DWord is updated only when this bit is set.
631 enum GENERAL_STATE_BUFFER_SIZE_MODIFY_ENABLE
632 {
633 GENERAL_STATE_BUFFER_SIZE_MODIFY_ENABLE_DISABLE = 0, //!< Ignore the updated bound.
634 GENERAL_STATE_BUFFER_SIZE_MODIFY_ENABLE_ENABLE = 1, //!< Modify the updated bound.
635 };
636
637 //! \brief DYNAMIC_STATE_BUFFER_SIZE_MODIFY_ENABLE
638 //! \details
639 //! FormatDesc
640 enum DYNAMIC_STATE_BUFFER_SIZE_MODIFY_ENABLE
641 {
642 DYNAMIC_STATE_BUFFER_SIZE_MODIFY_ENABLE_DISABLE = 0, //!< Ignore the updated bound.
643 DYNAMIC_STATE_BUFFER_SIZE_MODIFY_ENABLE_ENABLE = 1, //!< Modify the updated bound.
644 };
645
646 //! \brief INDIRECT_OBJECT_BUFFER_SIZE_MODIFY_ENABLE
647 //! \details
648 //! FormatDesc
649 enum INDIRECT_OBJECT_BUFFER_SIZE_MODIFY_ENABLE
650 {
651 INDIRECT_OBJECT_BUFFER_SIZE_MODIFY_ENABLE_DISABLE = 0, //!< Ignore the updated bound.
652 INDIRECT_OBJECT_BUFFER_SIZE_MODIFY_ENABLE_ENABLE = 1, //!< Modify the updated bound.
653 };
654
655 //! \brief INSTRUCTION_BUFFER_SIZE_MODIFY_ENABLE
656 //! \details
657 //! FormatDesc
658 enum INSTRUCTION_BUFFER_SIZE_MODIFY_ENABLE
659 {
660 INSTRUCTION_BUFFER_SIZE_MODIFY_ENABLE_DISABLE = 0, //!< Ignore the updated bound.
661 };
662
663 //! \brief BINDLESS_SURFACE_STATE_BASE_ADDRESS_MODIFY_ENABLE
664 //! \details
665 //! <p>The other fields in this DWord and the following two DWords are
666 //! updated only when this bit is set.</p>
667 enum BINDLESS_SURFACE_STATE_BASE_ADDRESS_MODIFY_ENABLE
668 {
669 BINDLESS_SURFACE_STATE_BASE_ADDRESS_MODIFY_ENABLE_DISABLE = 0, //!< Ignore the updated address
670 BINDLESS_SURFACE_STATE_BASE_ADDRESS_MODIFY_ENABLE_ENABLE = 1, //!< Modify the address
671 };
672
673 //! \brief BINDLESS_SAMPLER_STATE_BASE_ADDRESS_MODIFY_ENABLE
674 //! \details
675 //! <p>The other fields in this DWord and the following two DWords are
676 //! updated only when this bit is set.</p>
677 enum BINDLESS_SAMPLER_STATE_BASE_ADDRESS_MODIFY_ENABLE
678 {
679 BINDLESS_SAMPLER_STATE_BASE_ADDRESS_MODIFY_ENABLE_DISABLE = 0, //!< Ignore the updated address
680 BINDLESS_SAMPLER_STATE_BASE_ADDRESS_MODIFY_ENABLE_ENABLE = 1, //!< Modify the address
681 };
682
683 //! \name Initializations
684
685 //! \brief Explicit member initialization function
686 STATE_BASE_ADDRESS_CMD();
687
688 static const size_t dwSize = 22;
689 static const size_t byteSize = 88;
690 };
691
692 //!
693 //! \brief MEDIA_VFE_STATE
694 //! \details
695 //! A stalling PIPE_CONTROL is required before MEDIA_VFE_STATE unless the
696 //! only bits that are changed are scoreboard related: Scoreboard Enable,
697 //! Scoreboard Type, Scoreboard Mask, Scoreboard * Delta. For these
698 //! scoreboard related states, a MEDIA_STATE_FLUSH is sufficient.
699 //!
700 //! MEDIA_STATE_FLUSH (optional, only if barrier dependency is needed)
701 //!
702 //! MEDIA_INTERFACE_DESCRIPTOR_LOAD (optional)
703 //!
704 //!
705 //!
706 struct MEDIA_VFE_STATE_CMD
707 {
708 union
709 {
710 //!< DWORD 0
711 struct
712 {
713 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 15) ; //!< DWORD_LENGTH
714 uint32_t Subopcode : __CODEGEN_BITFIELD(16, 23) ; //!< SUBOPCODE
715 uint32_t MediaCommandOpcode : __CODEGEN_BITFIELD(24, 26) ; //!< MEDIA_COMMAND_OPCODE
716 uint32_t Pipeline : __CODEGEN_BITFIELD(27, 28) ; //!< PIPELINE
717 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
718 };
719 uint32_t Value;
720 } DW0;
721 union
722 {
723 //!< DWORD 1
724 struct
725 {
726 uint32_t PerThreadScratchSpace : __CODEGEN_BITFIELD( 0, 3) ; //!< Per Thread Scratch Space
727 uint32_t StackSize : __CODEGEN_BITFIELD( 4, 7) ; //!< Stack Size
728 uint32_t Reserved40 : __CODEGEN_BITFIELD( 8, 9) ; //!< Reserved
729 uint32_t ScratchSpaceBasePointer : __CODEGEN_BITFIELD(10, 31) ; //!< Scratch Space Base Pointer
730 };
731 uint32_t Value;
732 } DW1;
733 union
734 {
735 //!< DWORD 2
736 struct
737 {
738 uint32_t ScratchSpaceBasePointerHigh : __CODEGEN_BITFIELD( 0, 15) ; //!< Scratch Space Base Pointer High
739 uint32_t Reserved80 : __CODEGEN_BITFIELD(16, 31) ; //!< Reserved
740 };
741 uint32_t Value;
742 } DW2;
743 union
744 {
745 //!< DWORD 3
746 struct
747 {
748 uint32_t Reserved96 : __CODEGEN_BITFIELD( 0, 1) ; //!< Reserved
749 uint32_t DispatchLoadBalance : __CODEGEN_BITFIELD( 2, 2) ; //!< DISPATCH_LOAD_BALANCE
750 uint32_t Reserved99 : __CODEGEN_BITFIELD( 3, 5) ; //!< Reserved
751 uint32_t DisableSlice0Subslice2 : __CODEGEN_BITFIELD( 6, 6) ; //!< Disable Slice 0 Subslice 2
752 uint32_t Reserved103 : __CODEGEN_BITFIELD( 7, 7) ; //!< Reserved
753 uint32_t NumberOfUrbEntries : __CODEGEN_BITFIELD( 8, 15) ; //!< Number of URB Entries
754 uint32_t MaximumNumberOfThreads : __CODEGEN_BITFIELD(16, 31) ; //!< Maximum Number of Threads
755 };
756 uint32_t Value;
757 } DW3;
758 union
759 {
760 //!< DWORD 4
761 struct
762 {
763 uint32_t MaximumNumberOfDualSubslices : __CODEGEN_BITFIELD( 0, 7) ; //!< Maximum Number of Dual-Subslices
764 uint32_t Reserved136 : __CODEGEN_BITFIELD( 8, 31) ; //!< Reserved
765 };
766 uint32_t Value;
767 } DW4;
768 union
769 {
770 //!< DWORD 5
771 struct
772 {
773 uint32_t CurbeAllocationSize : __CODEGEN_BITFIELD( 0, 15) ; //!< CURBE Allocation Size
774 uint32_t UrbEntryAllocationSize : __CODEGEN_BITFIELD(16, 31) ; //!< URB Entry Allocation Size
775 };
776 uint32_t Value;
777 } DW5;
778 union
779 {
780 //!< DWORD 6
781 struct
782 {
783 uint32_t Reserved192 ; //!< Reserved
784 };
785 uint32_t Value;
786 } DW6;
787 union
788 {
789 //!< DWORD 7
790 struct
791 {
792 uint32_t Reserved224 ; //!< Reserved
793 };
794 uint32_t Value;
795 } DW7;
796 union
797 {
798 //!< DWORD 8
799 struct
800 {
801 uint32_t Reserved256 ; //!< Reserved
802 };
803 uint32_t Value;
804 } DW8;
805
806 //! \name Local enumerations
807
808 enum SUBOPCODE
809 {
810 SUBOPCODE_MEDIAVFESTATESUBOP = 0, //!< No additional details
811 };
812
813 enum MEDIA_COMMAND_OPCODE
814 {
815 MEDIA_COMMAND_OPCODE_MEDIAVFESTATE = 0, //!< No additional details
816 };
817
818 enum PIPELINE
819 {
820 PIPELINE_MEDIA = 2, //!< No additional details
821 };
822
823 enum COMMAND_TYPE
824 {
825 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
826 };
827
828 //! \brief DISPATCH_LOAD_BALANCE
829 //! \details
830 //! This bit determines how media threads are dispatched between the various
831 //! dual subslices.  GPGPU threads are not impacted by this bit.
832 enum DISPATCH_LOAD_BALANCE
833 {
834 DISPATCH_LOAD_BALANCE_LEASTLOADED = 0, //!< When this value is used the threads are sent to the least loaded dual subslice of all active dual subslices. If media with groups is being used then each group is kept in the same dual subslice.
835 DISPATCH_LOAD_BALANCE_COLORLSB = 1, //!< When this value is used the threads are split into two groups depending on the LSB of the color value for media threads.  One group will be sent to even dual subslices and the other to odd dual subslices.  The least loaded active dual subslice available will selected for threads in that group.  This allows color to be used to separate workloads with different operations to get better cache coherency.If media with groups is being used then each group is kept in the same dual subslices.
836 };
837
838 //! \name Initializations
839
840 //! \brief Explicit member initialization function
841 MEDIA_VFE_STATE_CMD();
842
843 static const size_t dwSize = 9;
844 static const size_t byteSize = 36;
845 };
846
847 //!
848 //! \brief MEDIA_CURBE_LOAD
849 //!
850 struct MEDIA_CURBE_LOAD_CMD
851 {
852 union
853 {
854 //!< DWORD 0
855 struct
856 {
857 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 15) ; //!< DWORD_LENGTH
858 uint32_t Subopcode : __CODEGEN_BITFIELD(16, 23) ; //!< SUBOPCODE
859 uint32_t MediaCommandOpcode : __CODEGEN_BITFIELD(24, 26) ; //!< MEDIA_COMMAND_OPCODE
860 uint32_t Pipeline : __CODEGEN_BITFIELD(27, 28) ; //!< PIPELINE
861 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
862 };
863 uint32_t Value;
864 } DW0;
865 union
866 {
867 //!< DWORD 1
868 struct
869 {
870 uint32_t Reserved32 ; //!< Reserved
871 };
872 uint32_t Value;
873 } DW1;
874 union
875 {
876 //!< DWORD 2
877 struct
878 {
879 uint32_t CurbeTotalDataLength : __CODEGEN_BITFIELD( 0, 16) ; //!< CURBE Total Data Length
880 uint32_t Reserved81 : __CODEGEN_BITFIELD(17, 31) ; //!< Reserved
881 };
882 uint32_t Value;
883 } DW2;
884 union
885 {
886 //!< DWORD 3
887 struct
888 {
889 uint32_t CurbeDataStartAddress ; //!< CURBE Data Start Address
890 };
891 uint32_t Value;
892 } DW3;
893
894 //! \name Local enumerations
895
896 enum SUBOPCODE
897 {
898 SUBOPCODE_MEDIACURBELOADSUBOP = 1, //!< No additional details
899 };
900
901 enum MEDIA_COMMAND_OPCODE
902 {
903 MEDIA_COMMAND_OPCODE_MEDIACURBELOAD = 0, //!< No additional details
904 };
905
906 enum PIPELINE
907 {
908 PIPELINE_MEDIA = 2, //!< No additional details
909 };
910
911 enum COMMAND_TYPE
912 {
913 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
914 };
915
916 //! \name Initializations
917
918 //! \brief Explicit member initialization function
919 MEDIA_CURBE_LOAD_CMD();
920
921 static const size_t dwSize = 4;
922 static const size_t byteSize = 16;
923 };
924
925 //!
926 //! \brief MEDIA_INTERFACE_DESCRIPTOR_LOAD
927 //! \details
928 //! A Media_State_Flush should be used before this command to ensure that
929 //! the temporary Interface Descriptor storage is cleared.
930 //!
931 struct MEDIA_INTERFACE_DESCRIPTOR_LOAD_CMD
932 {
933 union
934 {
935 //!< DWORD 0
936 struct
937 {
938 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 15) ; //!< DWORD_LENGTH
939 uint32_t Subopcode : __CODEGEN_BITFIELD(16, 23) ; //!< SUBOPCODE
940 uint32_t MediaCommandOpcode : __CODEGEN_BITFIELD(24, 26) ; //!< MEDIA_COMMAND_OPCODE
941 uint32_t Pipeline : __CODEGEN_BITFIELD(27, 28) ; //!< PIPELINE
942 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
943 };
944 uint32_t Value;
945 } DW0;
946 union
947 {
948 //!< DWORD 1
949 struct
950 {
951 uint32_t Reserved32 ; //!< Reserved
952 };
953 uint32_t Value;
954 } DW1;
955 union
956 {
957 //!< DWORD 2
958 struct
959 {
960 uint32_t InterfaceDescriptorTotalLength : __CODEGEN_BITFIELD( 0, 16) ; //!< Interface Descriptor Total Length
961 uint32_t Reserved81 : __CODEGEN_BITFIELD(17, 31) ; //!< Reserved
962 };
963 uint32_t Value;
964 } DW2;
965 union
966 {
967 //!< DWORD 3
968 struct
969 {
970 uint32_t InterfaceDescriptorDataStartAddress ; //!< Interface Descriptor Data Start Address
971 };
972 uint32_t Value;
973 } DW3;
974
975 //! \name Local enumerations
976
977 enum SUBOPCODE
978 {
979 SUBOPCODE_MEDIAINTERFACEDESCRIPTORLOADSUBOP = 2, //!< No additional details
980 };
981
982 enum MEDIA_COMMAND_OPCODE
983 {
984 MEDIA_COMMAND_OPCODE_MEDIAINTERFACEDESCRIPTORLOAD = 0, //!< No additional details
985 };
986
987 enum PIPELINE
988 {
989 PIPELINE_MEDIA = 2, //!< No additional details
990 };
991
992 enum COMMAND_TYPE
993 {
994 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
995 };
996
997 //! \name Initializations
998
999 //! \brief Explicit member initialization function
1000 MEDIA_INTERFACE_DESCRIPTOR_LOAD_CMD();
1001
1002 static const size_t dwSize = 4;
1003 static const size_t byteSize = 16;
1004 };
1005
1006 //!
1007 //! \brief MEDIA_OBJECT_WALKER
1008 //! \details
1009 //!
1010 //!
1011 struct MEDIA_OBJECT_WALKER_CMD
1012 {
1013 union
1014 {
1015 //!< DWORD 0
1016 struct
1017 {
1018 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 14) ; //!< DWORD_LENGTH
1019 uint32_t Reserved15 : __CODEGEN_BITFIELD(15, 15) ; //!< Reserved
1020 uint32_t Subopcode : __CODEGEN_BITFIELD(16, 23) ; //!< SUBOPCODE
1021 uint32_t MediaCommandOpcode : __CODEGEN_BITFIELD(24, 26) ; //!< MEDIA_COMMAND_OPCODE
1022 uint32_t Pipeline : __CODEGEN_BITFIELD(27, 28) ; //!< PIPELINE
1023 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
1024 };
1025 uint32_t Value;
1026 } DW0;
1027 union
1028 {
1029 //!< DWORD 1
1030 struct
1031 {
1032 uint32_t InterfaceDescriptorOffset : __CODEGEN_BITFIELD( 0, 5) ; //!< Interface Descriptor Offset
1033 uint32_t Reserved38 : __CODEGEN_BITFIELD( 6, 31) ; //!< Reserved
1034 };
1035 uint32_t Value;
1036 } DW1;
1037 union
1038 {
1039 //!< DWORD 2
1040 struct
1041 {
1042 uint32_t IndirectDataLength : __CODEGEN_BITFIELD( 0, 16) ; //!< Indirect Data Length
1043 uint32_t Reserved81 : __CODEGEN_BITFIELD(17, 21) ; //!< Reserved
1044 uint32_t MaskedDispatch : __CODEGEN_BITFIELD(22, 23) ; //!< MASKED_DISPATCH
1045 uint32_t ThreadSynchronization : __CODEGEN_BITFIELD(24, 24) ; //!< THREAD_SYNCHRONIZATION
1046 uint32_t Reserved89 : __CODEGEN_BITFIELD(25, 31) ; //!< Reserved
1047 };
1048 uint32_t Value;
1049 } DW2;
1050 union
1051 {
1052 //!< DWORD 3
1053 struct
1054 {
1055 uint32_t IndirectDataStartAddress ; //!< Indirect Data Start Address
1056 };
1057 uint32_t Value;
1058 } DW3;
1059 union
1060 {
1061 //!< DWORD 4
1062 struct
1063 {
1064 uint32_t Reserved128 ; //!< Reserved
1065 };
1066 uint32_t Value;
1067 } DW4;
1068 union
1069 {
1070 //!< DWORD 5
1071 struct
1072 {
1073 uint32_t Reserved160 : __CODEGEN_BITFIELD( 0, 7) ; //!< Reserved
1074 uint32_t GroupIdLoopSelect : __CODEGEN_BITFIELD( 8, 31) ; //!< GROUP_ID_LOOP_SELECT
1075 };
1076 uint32_t Value;
1077 } DW5;
1078 union
1079 {
1080 //!< DWORD 6
1081 struct
1082 {
1083 uint32_t Reserved192 : __CODEGEN_BITFIELD( 0, 7) ; //!< Reserved
1084 uint32_t MidLoopUnitX : __CODEGEN_BITFIELD( 8, 9) ; //!< Mid-Loop Unit X
1085 uint32_t Reserved202 : __CODEGEN_BITFIELD(10, 11) ; //!< Reserved
1086 uint32_t LocalMidLoopUnitY : __CODEGEN_BITFIELD(12, 13) ; //!< Local Mid-Loop Unit Y
1087 uint32_t Reserved206 : __CODEGEN_BITFIELD(14, 15) ; //!< Reserved
1088 uint32_t MiddleLoopExtraSteps : __CODEGEN_BITFIELD(16, 20) ; //!< Middle Loop Extra Steps
1089 uint32_t Reserved213 : __CODEGEN_BITFIELD(21, 23) ; //!< Reserved
1090 uint32_t ColorCountMinusOne : __CODEGEN_BITFIELD(24, 31) ; //!< Color Count Minus One
1091 };
1092 uint32_t Value;
1093 } DW6;
1094 union
1095 {
1096 //!< DWORD 7
1097 struct
1098 {
1099 uint32_t LocalLoopExecCount : __CODEGEN_BITFIELD( 0, 11) ; //!< Local Loop Exec Count
1100 uint32_t Reserved236 : __CODEGEN_BITFIELD(12, 15) ; //!< Reserved
1101 uint32_t GlobalLoopExecCount : __CODEGEN_BITFIELD(16, 27) ; //!< Global Loop Exec Count
1102 uint32_t Reserved252 : __CODEGEN_BITFIELD(28, 31) ; //!< Reserved
1103 };
1104 uint32_t Value;
1105 } DW7;
1106 union
1107 {
1108 //!< DWORD 8
1109 struct
1110 {
1111 uint32_t BlockResolutionX : __CODEGEN_BITFIELD( 0, 10) ; //!< Block Resolution X
1112 uint32_t Reserved267 : __CODEGEN_BITFIELD(11, 15) ; //!< Reserved
1113 uint32_t BlockResolutionY : __CODEGEN_BITFIELD(16, 26) ; //!< Block Resolution Y
1114 uint32_t Reserved283 : __CODEGEN_BITFIELD(27, 31) ; //!< Reserved
1115 };
1116 uint32_t Value;
1117 } DW8;
1118 union
1119 {
1120 //!< DWORD 9
1121 struct
1122 {
1123 uint32_t LocalStartX : __CODEGEN_BITFIELD( 0, 10) ; //!< Local Start X
1124 uint32_t Reserved299 : __CODEGEN_BITFIELD(11, 15) ; //!< Reserved
1125 uint32_t LocalStartY : __CODEGEN_BITFIELD(16, 26) ; //!< Local Start Y
1126 uint32_t Reserved315 : __CODEGEN_BITFIELD(27, 31) ; //!< Reserved
1127 };
1128 uint32_t Value;
1129 } DW9;
1130 union
1131 {
1132 //!< DWORD 10
1133 struct
1134 {
1135 uint32_t Reserved320 ; //!< Reserved
1136 };
1137 uint32_t Value;
1138 } DW10;
1139 union
1140 {
1141 //!< DWORD 11
1142 struct
1143 {
1144 uint32_t LocalOuterLoopStrideX : __CODEGEN_BITFIELD( 0, 11) ; //!< Local Outer Loop Stride X
1145 uint32_t Reserved364 : __CODEGEN_BITFIELD(12, 15) ; //!< Reserved
1146 uint32_t LocalOuterLoopStrideY : __CODEGEN_BITFIELD(16, 27) ; //!< Local Outer Loop Stride Y
1147 uint32_t Reserved380 : __CODEGEN_BITFIELD(28, 31) ; //!< Reserved
1148 };
1149 uint32_t Value;
1150 } DW11;
1151 union
1152 {
1153 //!< DWORD 12
1154 struct
1155 {
1156 uint32_t LocalInnerLoopUnitX : __CODEGEN_BITFIELD( 0, 11) ; //!< Local Inner Loop Unit X
1157 uint32_t Reserved396 : __CODEGEN_BITFIELD(12, 15) ; //!< Reserved
1158 uint32_t LocalInnerLoopUnitY : __CODEGEN_BITFIELD(16, 27) ; //!< Local Inner Loop Unit Y
1159 uint32_t Reserved412 : __CODEGEN_BITFIELD(28, 31) ; //!< Reserved
1160 };
1161 uint32_t Value;
1162 } DW12;
1163 union
1164 {
1165 //!< DWORD 13
1166 struct
1167 {
1168 uint32_t GlobalResolutionX : __CODEGEN_BITFIELD( 0, 10) ; //!< Global Resolution X
1169 uint32_t Reserved427 : __CODEGEN_BITFIELD(11, 15) ; //!< Reserved
1170 uint32_t GlobalResolutionY : __CODEGEN_BITFIELD(16, 26) ; //!< Global Resolution Y
1171 uint32_t Reserved443 : __CODEGEN_BITFIELD(27, 31) ; //!< Reserved
1172 };
1173 uint32_t Value;
1174 } DW13;
1175 union
1176 {
1177 //!< DWORD 14
1178 struct
1179 {
1180 uint32_t GlobalStartX : __CODEGEN_BITFIELD( 0, 11) ; //!< Global Start X
1181 uint32_t Reserved460 : __CODEGEN_BITFIELD(12, 15) ; //!< Reserved
1182 uint32_t GlobalStartY : __CODEGEN_BITFIELD(16, 27) ; //!< Global Start Y
1183 uint32_t Reserved476 : __CODEGEN_BITFIELD(28, 31) ; //!< Reserved
1184 };
1185 uint32_t Value;
1186 } DW14;
1187 union
1188 {
1189 //!< DWORD 15
1190 struct
1191 {
1192 uint32_t GlobalOuterLoopStrideX : __CODEGEN_BITFIELD( 0, 11) ; //!< Global Outer Loop Stride X
1193 uint32_t Reserved492 : __CODEGEN_BITFIELD(12, 15) ; //!< Reserved
1194 uint32_t GlobalOuterLoopStrideY : __CODEGEN_BITFIELD(16, 27) ; //!< Global Outer Loop Stride Y
1195 uint32_t Reserved508 : __CODEGEN_BITFIELD(28, 31) ; //!< Reserved
1196 };
1197 uint32_t Value;
1198 } DW15;
1199 union
1200 {
1201 //!< DWORD 16
1202 struct
1203 {
1204 uint32_t GlobalInnerLoopUnitX : __CODEGEN_BITFIELD( 0, 11) ; //!< Global Inner Loop Unit X
1205 uint32_t Reserved524 : __CODEGEN_BITFIELD(12, 15) ; //!< Reserved
1206 uint32_t GlobalInnerLoopUnitY : __CODEGEN_BITFIELD(16, 27) ; //!< Global Inner Loop Unit Y
1207 uint32_t Reserved540 : __CODEGEN_BITFIELD(28, 31) ; //!< Reserved
1208 };
1209 uint32_t Value;
1210 } DW16;
1211
1212 //! \name Local enumerations
1213
1214 enum SUBOPCODE
1215 {
1216 SUBOPCODE_MEDIAOBJECTWALKERSUBOP = 3, //!< No additional details
1217 };
1218
1219 enum MEDIA_COMMAND_OPCODE
1220 {
1221 MEDIA_COMMAND_OPCODE_MEDIAOBJECTWALKER = 1, //!< No additional details
1222 };
1223
1224 enum PIPELINE
1225 {
1226 PIPELINE_MEDIA = 2, //!< No additional details
1227 };
1228
1229 enum COMMAND_TYPE
1230 {
1231 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
1232 };
1233
1234 //! \brief MASKED_DISPATCH
1235 //! \details
1236 //! Enable the masking of the dispatch of individual threads based on a
1237 //! bitmask read from CURBE, and specifies the pitch of the CURBE surface.
1238 //! If enabled, CURBE will not be used for thread payload.
1239 enum MASKED_DISPATCH
1240 {
1241 MASKED_DISPATCH_UNNAMED0 = 0, //!< Masked Dispatch Disabled
1242 MASKED_DISPATCH_UNNAMED1 = 1, //!< Masked Dispatch with 128-bit pitch in CURBE
1243 MASKED_DISPATCH_UNNAMED2 = 2, //!< Masked Dispatch with 256-bit pitch in CURBE
1244 MASKED_DISPATCH_UNNAMED3 = 3, //!< Masked Dispatch with 512-bit pitch in CURBE
1245 };
1246
1247 //! \brief THREAD_SYNCHRONIZATION
1248 //! \details
1249 //! This field when set indicates that the dispatch of the thread originated
1250 //! from this command is based on the "spawn root thread" message.
1251 enum THREAD_SYNCHRONIZATION
1252 {
1253 THREAD_SYNCHRONIZATION_NOTHREADSYNCHRONIZATION = 0, //!< No additional details
1254 THREAD_SYNCHRONIZATION_THREADDISPATCHISSYNCHRONIZEDBYTHESPAWNROOTTHREADMESSAGE = 1, //!< No additional details
1255 };
1256
1257 //! \brief GROUP_ID_LOOP_SELECT
1258 //! \details
1259 //! This bit field chooses which of the nested loops of the walker are used
1260 //! to identify threads which share a group id and therefore a shared
1261 //! barrier and SLM. The programmer must ensure that each group will fit
1262 //! into a single subslice. When barriers are enabled every group must have
1263 //! the same number of threads matching the number specified in the
1264 //! Interface Descriptor.
1265 enum GROUP_ID_LOOP_SELECT
1266 {
1267 GROUP_ID_LOOP_SELECT_NOGROUPS = 0, //!< Groups are not created, barriers and SLM are not allocated
1268 GROUP_ID_LOOP_SELECT_COLORGROUPS = 1, //!< Each complete iteration of the Color loop defines a group, the group id is the concatenation of the Outer global, Inner global, Outer local, Mid local and Inner local loop execution counts.
1269 GROUP_ID_LOOP_SELECT_INNERLOCALGROUPS = 2, //!< Each complete iteration of the Inner local loop and Color loop defines a group, the group id is the concatenation of the Outer global loop to the Mid local loop execution counts.
1270 GROUP_ID_LOOP_SELECT_MIDLOCALGROUPS = 3, //!< Each complete iteration of the Mid local loop and lower loops defines a group, the group id is the concatenation of the Outer global loop to the Outer local loop execution counts.
1271 GROUP_ID_LOOP_SELECT_OUTERLOCALGROUPS = 4, //!< Each complete iteration of the Outer local loop and lower loops defines a group, the group id is the concatenation of the Outer global loop and the Inner global loop execution counts.
1272 GROUP_ID_LOOP_SELECT_INNERGLOBALGROUPS = 5, //!< Each complete iteration of the Inner global loop and lower loops defines a group, the group id is the Outer global loop execution count.
1273 };
1274
1275 //! \name Initializations
1276
1277 //! \brief Explicit member initialization function
1278 MEDIA_OBJECT_WALKER_CMD();
1279
1280 static const size_t dwSize = 17;
1281 static const size_t byteSize = 68;
1282 };
1283
1284 //!
1285 //! \brief GPGPU_WALKER
1286 //! \details
1287 //! If the threads spawned by this command are required to observe memory
1288 //! writes performed by threads spawned from a previous command, software
1289 //! must precede this command with a command that performs a memory flush
1290 //! (e.g., MI_FLUSH).
1291 //!
1292 struct GPGPU_WALKER_CMD
1293 {
1294 union
1295 {
1296 //!< DWORD 0
1297 struct
1298 {
1299 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
1300 uint32_t PredicateEnable : __CODEGEN_BITFIELD( 8, 8) ; //!< Predicate Enable
1301 uint32_t Reserved9 : __CODEGEN_BITFIELD( 9, 9) ; //!< Reserved
1302 uint32_t IndirectParameterEnable : __CODEGEN_BITFIELD(10, 10) ; //!< Indirect Parameter Enable
1303 uint32_t Reserved11 : __CODEGEN_BITFIELD(11, 15) ; //!< Reserved
1304 uint32_t Subopcode : __CODEGEN_BITFIELD(16, 23) ; //!< SUBOPCODE
1305 uint32_t MediaCommandOpcode : __CODEGEN_BITFIELD(24, 26) ; //!< MEDIA_COMMAND_OPCODE
1306 uint32_t Pipeline : __CODEGEN_BITFIELD(27, 28) ; //!< PIPELINE
1307 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
1308 };
1309 uint32_t Value;
1310 } DW0;
1311 union
1312 {
1313 //!< DWORD 1
1314 struct
1315 {
1316 uint32_t InterfaceDescriptorOffset : __CODEGEN_BITFIELD( 0, 5) ; //!< Interface Descriptor Offset
1317 uint32_t Reserved38 : __CODEGEN_BITFIELD( 6, 31) ; //!< Reserved
1318 };
1319 uint32_t Value;
1320 } DW1;
1321 union
1322 {
1323 //!< DWORD 2
1324 struct
1325 {
1326 uint32_t IndirectDataLength : __CODEGEN_BITFIELD( 0, 16) ; //!< Indirect Data Length
1327 uint32_t Reserved81 : __CODEGEN_BITFIELD(17, 31) ; //!< Reserved
1328 };
1329 uint32_t Value;
1330 } DW2;
1331 union
1332 {
1333 //!< DWORD 3
1334 struct
1335 {
1336 uint32_t Reserved96 : __CODEGEN_BITFIELD( 0, 5) ; //!< Reserved
1337 uint32_t IndirectDataStartAddress : __CODEGEN_BITFIELD( 6, 31) ; //!< Indirect Data Start Address
1338 };
1339 uint32_t Value;
1340 } DW3;
1341 union
1342 {
1343 //!< DWORD 4
1344 struct
1345 {
1346 uint32_t ThreadWidthCounterMaximum : __CODEGEN_BITFIELD( 0, 5) ; //!< Thread Width Counter Maximum
1347 uint32_t Reserved134 : __CODEGEN_BITFIELD( 6, 7) ; //!< Reserved
1348 uint32_t ThreadHeightCounterMaximum : __CODEGEN_BITFIELD( 8, 13) ; //!< Thread Height Counter Maximum
1349 uint32_t Reserved142 : __CODEGEN_BITFIELD(14, 15) ; //!< Reserved
1350 uint32_t ThreadDepthCounterMaximum : __CODEGEN_BITFIELD(16, 21) ; //!< Thread Depth Counter Maximum
1351 uint32_t Reserved150 : __CODEGEN_BITFIELD(22, 29) ; //!< Reserved
1352 uint32_t SimdSize : __CODEGEN_BITFIELD(30, 31) ; //!< SIMD_SIZE
1353 };
1354 uint32_t Value;
1355 } DW4;
1356 union
1357 {
1358 //!< DWORD 5
1359 struct
1360 {
1361 uint32_t ThreadGroupIdStartingX ; //!< Thread Group ID Starting X
1362 };
1363 uint32_t Value;
1364 } DW5;
1365 union
1366 {
1367 //!< DWORD 6
1368 struct
1369 {
1370 uint32_t Reserved192 ; //!< Reserved
1371 };
1372 uint32_t Value;
1373 } DW6;
1374 union
1375 {
1376 //!< DWORD 7
1377 struct
1378 {
1379 uint32_t ThreadGroupIdXDimension ; //!< Thread Group ID X Dimension
1380 };
1381 uint32_t Value;
1382 } DW7;
1383 union
1384 {
1385 //!< DWORD 8
1386 struct
1387 {
1388 uint32_t ThreadGroupIdStartingY ; //!< Thread Group ID Starting Y
1389 };
1390 uint32_t Value;
1391 } DW8;
1392 union
1393 {
1394 //!< DWORD 9
1395 struct
1396 {
1397 uint32_t Reserved288 ; //!< Reserved
1398 };
1399 uint32_t Value;
1400 } DW9;
1401 union
1402 {
1403 //!< DWORD 10
1404 struct
1405 {
1406 uint32_t ThreadGroupIdYDimension ; //!< Thread Group ID Y Dimension
1407 };
1408 uint32_t Value;
1409 } DW10;
1410 union
1411 {
1412 //!< DWORD 11
1413 struct
1414 {
1415 uint32_t ThreadGroupIdStartingResumeZ ; //!< Thread Group ID Starting/Resume Z
1416 };
1417 uint32_t Value;
1418 } DW11;
1419 union
1420 {
1421 //!< DWORD 12
1422 struct
1423 {
1424 uint32_t ThreadGroupIdZDimension ; //!< Thread Group ID Z Dimension
1425 };
1426 uint32_t Value;
1427 } DW12;
1428 union
1429 {
1430 //!< DWORD 13
1431 struct
1432 {
1433 uint32_t RightExecutionMask ; //!< Right Execution Mask
1434 };
1435 uint32_t Value;
1436 } DW13;
1437 union
1438 {
1439 //!< DWORD 14
1440 struct
1441 {
1442 uint32_t BottomExecutionMask ; //!< Bottom Execution Mask
1443 };
1444 uint32_t Value;
1445 } DW14;
1446
1447 //! \name Local enumerations
1448
1449 enum SUBOPCODE
1450 {
1451 SUBOPCODE_GPGPUWALKERSUBOP = 5, //!< No additional details
1452 };
1453
1454 enum MEDIA_COMMAND_OPCODE
1455 {
1456 MEDIA_COMMAND_OPCODE_GPGPUWALKER = 1, //!< No additional details
1457 };
1458
1459 enum PIPELINE
1460 {
1461 PIPELINE_MEDIA = 2, //!< No additional details
1462 };
1463
1464 enum COMMAND_TYPE
1465 {
1466 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
1467 };
1468
1469 //! \brief SIMD_SIZE
1470 //! \details
1471 //! This field determines the size of the payload and the number of bits of
1472 //! the execution mask that are expected. The kernel pointed to by the
1473 //! interface descriptor should match the SIMD declared here.
1474 enum SIMD_SIZE
1475 {
1476 SIMD_SIZE_SIMD8 = 0, //!< 8 LSBs of the execution mask are used
1477 SIMD_SIZE_SIMD16 = 1, //!< 16 LSBs used in execution mask
1478 SIMD_SIZE_SIMD32 = 2, //!< 32 bits of execution mask used
1479 };
1480
1481 //! \name Initializations
1482
1483 //! \brief Explicit member initialization function
1484 GPGPU_WALKER_CMD();
1485
1486 static const size_t dwSize = 15;
1487 static const size_t byteSize = 60;
1488 };
1489
1490 //!
1491 //! \brief _3DSTATE_CHROMA_KEY
1492 //! \details
1493 //! The 3DSTATE_CHROMA_KEY instruction is used to program texture
1494 //! color/chroma-key key values. A table containing four set of values is
1495 //! supported. The ChromaKey Index sampler state variable is used to select
1496 //! which table entry is associated with the map. Texture chromakey
1497 //! functions are enabled and controlled via use of the ChromaKey Enable
1498 //! texture sampler state variable.Texture Color Key (keying on a paletted
1499 //! texture index) is not supported.
1500 //!
1501 //! This command must be followed by a PIPE_CONTROL with CS Stall bit
1502 //! set.
1503 //!
1504 struct _3DSTATE_CHROMA_KEY_CMD
1505 {
1506 union
1507 {
1508 //!< DWORD 0
1509 struct
1510 {
1511 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
1512 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 15) ; //!< Reserved
1513 uint32_t Command3DSubOpcode : __CODEGEN_BITFIELD(16, 23) ; //!< _3D_COMMAND_SUB_OPCODE
1514 uint32_t Command3DOpcode : __CODEGEN_BITFIELD(24, 26) ; //!< _3D_COMMAND_OPCODE
1515 uint32_t CommandSubtype : __CODEGEN_BITFIELD(27, 28) ; //!< COMMAND_SUBTYPE
1516 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
1517 };
1518 uint32_t Value;
1519 } DW0;
1520 union
1521 {
1522 //!< DWORD 1
1523 struct
1524 {
1525 uint32_t Reserved32 : __CODEGEN_BITFIELD( 0, 29) ; //!< Reserved
1526 uint32_t ChromakeyTableIndex : __CODEGEN_BITFIELD(30, 31) ; //!< ChromaKey Table Index
1527 };
1528 uint32_t Value;
1529 } DW1;
1530 union
1531 {
1532 //!< DWORD 2
1533 struct
1534 {
1535 uint32_t ChromakeyLowValue ; //!< ChromaKey Low Value
1536 };
1537 uint32_t Value;
1538 } DW2;
1539 union
1540 {
1541 //!< DWORD 3
1542 struct
1543 {
1544 uint32_t ChromakeyHighValue ; //!< ChromaKey High Value
1545 };
1546 uint32_t Value;
1547 } DW3;
1548
1549 //! \name Local enumerations
1550
1551 enum _3D_COMMAND_SUB_OPCODE
1552 {
1553 _3D_COMMAND_SUB_OPCODE_3DSTATECHROMAKEY = 4, //!< No additional details
1554 };
1555
1556 enum _3D_COMMAND_OPCODE
1557 {
1558 _3D_COMMAND_OPCODE_3DSTATENONPIPELINED = 1, //!< No additional details
1559 };
1560
1561 enum COMMAND_SUBTYPE
1562 {
1563 COMMAND_SUBTYPE_GFXPIPE3D = 3, //!< No additional details
1564 };
1565
1566 enum COMMAND_TYPE
1567 {
1568 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
1569 };
1570
1571 //! \name Initializations
1572
1573 //! \brief Explicit member initialization function
1574 _3DSTATE_CHROMA_KEY_CMD();
1575
1576 static const size_t dwSize = 4;
1577 static const size_t byteSize = 16;
1578 };
1579
1580 //!
1581 //! \brief _3DSTATE_SAMPLER_PALETTE_LOAD0
1582 //! \details
1583 //! The 3DSTATE_SAMPLER_PALETTE_LOAD0 instruction is used to load 32-bit
1584 //! values into the first texture palette. The texture palette is used
1585 //! whenever a texture with a paletted format (containing "Px [palette0]")
1586 //! is referenced by the sampler.
1587 //!
1588 //! This instruction is used to load all or a subset of the 256 entries of
1589 //! the first palette. Partial loads always start from the first (index 0)
1590 //! entry.
1591 //!
1592 //! This command must be followed by a PIPE_CONTROL with CS Stall bit
1593 //! set.
1594 //!
1595 struct _3DSTATE_SAMPLER_PALETTE_LOAD0_CMD
1596 {
1597 union
1598 {
1599 //!< DWORD 0
1600 struct
1601 {
1602 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWord Length
1603 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 15) ; //!< Reserved
1604 uint32_t Command3DSubOpcode : __CODEGEN_BITFIELD(16, 23) ; //!< _3D_COMMAND_SUB_OPCODE
1605 uint32_t Command3DOpcode : __CODEGEN_BITFIELD(24, 26) ; //!< _3D_COMMAND_OPCODE
1606 uint32_t CommandSubtype : __CODEGEN_BITFIELD(27, 28) ; //!< COMMAND_SUBTYPE
1607 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
1608 };
1609 uint32_t Value;
1610 } DW0;
1611
1612 //! \name Local enumerations
1613
1614 enum _3D_COMMAND_SUB_OPCODE
1615 {
1616 _3D_COMMAND_SUB_OPCODE_3DSTATESAMPLERPALETTELOAD0 = 2, //!< No additional details
1617 };
1618
1619 enum _3D_COMMAND_OPCODE
1620 {
1621 _3D_COMMAND_OPCODE_3DSTATENONPIPELINED = 1, //!< No additional details
1622 };
1623
1624 enum COMMAND_SUBTYPE
1625 {
1626 COMMAND_SUBTYPE_GFXPIPE3D = 3, //!< No additional details
1627 };
1628
1629 enum COMMAND_TYPE
1630 {
1631 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
1632 };
1633
1634 //! \name Initializations
1635
1636 //! \brief Explicit member initialization function
1637 _3DSTATE_SAMPLER_PALETTE_LOAD0_CMD();
1638
1639 static const size_t dwSize = 1;
1640 static const size_t byteSize = 4;
1641 };
1642
1643 //!
1644 //! \brief _3DSTATE_SAMPLER_PALETTE_LOAD1
1645 //! \details
1646 //! The 3DSTATE_SAMPLER_PALETTE_LOAD1 instruction is used to load 32-bit
1647 //! values into the second texture palette. The second texture palette is
1648 //! used whenever a texture with a paletted format (containing
1649 //! "Px...[palette1]") is referenced by the sampler.This instruction is used
1650 //! to load all or a subset of the 256 entries of the second palette.
1651 //! Partial loads always start from the first (index 0) entry.
1652 //!
1653 //! This command must be followed by a PIPE_CONTROL with CS Stall bit
1654 //! set.
1655 //!
1656 struct _3DSTATE_SAMPLER_PALETTE_LOAD1_CMD
1657 {
1658 union
1659 {
1660 //!< DWORD 0
1661 struct
1662 {
1663 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
1664 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 15) ; //!< Reserved
1665 uint32_t Command3DSubOpcode : __CODEGEN_BITFIELD(16, 23) ; //!< _3D_COMMAND_SUB_OPCODE
1666 uint32_t Command3DOpcode : __CODEGEN_BITFIELD(24, 26) ; //!< _3D_COMMAND_OPCODE
1667 uint32_t CommandSubtype : __CODEGEN_BITFIELD(27, 28) ; //!< COMMAND_SUBTYPE
1668 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
1669 };
1670 uint32_t Value;
1671 } DW0;
1672
1673 //! \name Local enumerations
1674
1675 enum _3D_COMMAND_SUB_OPCODE
1676 {
1677 _3D_COMMAND_SUB_OPCODE_3DSTATESAMPLERPALETTELOAD1 = 12, //!< No additional details
1678 };
1679
1680 enum _3D_COMMAND_OPCODE
1681 {
1682 _3D_COMMAND_OPCODE_3DSTATENONPIPELINED = 1, //!< No additional details
1683 };
1684
1685 enum COMMAND_SUBTYPE
1686 {
1687 COMMAND_SUBTYPE_GFXPIPE3D = 3, //!< No additional details
1688 };
1689
1690 enum COMMAND_TYPE
1691 {
1692 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
1693 };
1694
1695 //! \name Initializations
1696
1697 //! \brief Explicit member initialization function
1698 _3DSTATE_SAMPLER_PALETTE_LOAD1_CMD();
1699
1700 static const size_t dwSize = 1;
1701 static const size_t byteSize = 4;
1702 };
1703
1704 //!
1705 //! \brief PALETTE_ENTRY
1706 //! \details
1707 //!
1708 //!
1709 struct PALETTE_ENTRY_CMD
1710 {
1711 union
1712 {
1713 //!< DWORD 0
1714 struct
1715 {
1716 uint32_t Blue : __CODEGEN_BITFIELD( 0, 7) ; //!< Blue
1717 uint32_t Green : __CODEGEN_BITFIELD( 8, 15) ; //!< Green
1718 uint32_t Red : __CODEGEN_BITFIELD(16, 23) ; //!< Red
1719 uint32_t Alpha : __CODEGEN_BITFIELD(24, 31) ; //!< Alpha
1720 };
1721 uint32_t Value;
1722 } DW0;
1723
1724 //! \name Local enumerations
1725
1726 //! \name Initializations
1727
1728 //! \brief Explicit member initialization function
1729 PALETTE_ENTRY_CMD();
1730
1731 static const size_t dwSize = 1;
1732 static const size_t byteSize = 4;
1733 };
1734
1735 //!
1736 //! \brief STATE_SIP
1737 //! \details
1738 //! The STATE_SIP command specifies the starting instruction location of the
1739 //! System Routine that is shared by all threads in execution.
1740 //!
1741 //! This command must be followed by a PIPE_CONTROL with CS Stall bit
1742 //! set.
1743 //!
1744 struct STATE_SIP_CMD
1745 {
1746 union
1747 {
1748 //!< DWORD 0
1749 struct
1750 {
1751 uint32_t DwordLength : __CODEGEN_BITFIELD( 0, 7) ; //!< DWORD_LENGTH
1752 uint32_t Reserved8 : __CODEGEN_BITFIELD( 8, 15) ; //!< Reserved
1753 uint32_t Command3DSubOpcode : __CODEGEN_BITFIELD(16, 23) ; //!< _3D_COMMAND_SUB_OPCODE
1754 uint32_t Command3DOpcode : __CODEGEN_BITFIELD(24, 26) ; //!< _3D_COMMAND_OPCODE
1755 uint32_t CommandSubtype : __CODEGEN_BITFIELD(27, 28) ; //!< COMMAND_SUBTYPE
1756 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31) ; //!< COMMAND_TYPE
1757 };
1758 uint32_t Value;
1759 } DW0;
1760 union
1761 {
1762 //!< DWORD 1..2
1763 struct
1764 {
1765 uint64_t Reserved32 : __CODEGEN_BITFIELD( 0, 3) ; //!< Reserved
1766 uint64_t SystemInstructionPointer : __CODEGEN_BITFIELD( 4, 63) ; //!< System Instruction Pointer
1767 };
1768 uint32_t Value[2];
1769 } DW1_2;
1770
1771 //! \name Local enumerations
1772
1773 enum _3D_COMMAND_SUB_OPCODE
1774 {
1775 _3D_COMMAND_SUB_OPCODE_STATESIP = 2, //!< No additional details
1776 };
1777
1778 enum _3D_COMMAND_OPCODE
1779 {
1780 _3D_COMMAND_OPCODE_GFXPIPENONPIPELINED = 1, //!< No additional details
1781 };
1782
1783 enum COMMAND_SUBTYPE
1784 {
1785 COMMAND_SUBTYPE_GFXPIPECOMMON = 0, //!< No additional details
1786 };
1787
1788 enum COMMAND_TYPE
1789 {
1790 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
1791 };
1792
1793 //! \name Initializations
1794
1795 //! \brief Explicit member initialization function
1796 STATE_SIP_CMD();
1797
1798 static const size_t dwSize = 3;
1799 static const size_t byteSize = 12;
1800 };
1801
1802 //!
1803 //! \brief STATE_CSR_BASE_ADDRESS
1804 //! \details
1805 //! The STATE_CSR_BASE_ADDRESS command sets the base pointers for EU and L3
1806 //! to Context Save and Restore EU State and SLM for GPGPU mid-thread
1807 //! preemption and URB for high priority preemption.
1808 //!
1809 //! This command must be programmed with allocated memory to the support the
1810 //! size of the context to be saved and restored during a GPGPU mid-thread
1811 //! preemption or a high priority suspend of a 3D context.
1812 //!
1813 struct STATE_CSR_BASE_ADDRESS_CMD
1814 {
1815 union
1816 {
1817 //!< DWORD 0
1818 struct
1819 {
1820 uint32_t DwordLength : __CODEGEN_BITFIELD(0, 7); //!< DWORD_LENGTH
1821 uint32_t Reserved8 : __CODEGEN_BITFIELD(8, 15); //!< Reserved
1822 uint32_t Command3DSubOpcode : __CODEGEN_BITFIELD(16, 23); //!< _3D_COMMAND_SUB_OPCODE
1823 uint32_t Command3DOpcode : __CODEGEN_BITFIELD(24, 26); //!< _3D_COMMAND_OPCODE
1824 uint32_t CommandSubtype : __CODEGEN_BITFIELD(27, 28); //!< COMMAND_SUBTYPE
1825 uint32_t CommandType : __CODEGEN_BITFIELD(29, 31); //!< COMMAND_TYPE
1826 };
1827 uint32_t Value;
1828 } DW0;
1829 union
1830 {
1831 //!< DWORD 1..2
1832 struct
1833 {
1834 uint64_t Reserved32 : __CODEGEN_BITFIELD(0, 11); //!< Reserved
1835 uint64_t CsrBaseAddress : __CODEGEN_BITFIELD(12, 63); //!< CSR Base Address
1836 };
1837 uint32_t Value[2];
1838 } DW1_2;
1839
1840 //! \name Local enumerations
1841
1842 enum _3D_COMMAND_SUB_OPCODE
1843 {
1844 _3D_COMMAND_SUB_OPCODE_STATECSRBASEADDRESS = 4, //!< No additional details
1845 };
1846
1847 enum _3D_COMMAND_OPCODE
1848 {
1849 _3D_COMMAND_OPCODE_GFXPIPENONPIPELINED = 1, //!< No additional details
1850 };
1851
1852 enum COMMAND_SUBTYPE
1853 {
1854 COMMAND_SUBTYPE_GFXPIPECOMMON = 0, //!< No additional details
1855 };
1856
1857 enum COMMAND_TYPE
1858 {
1859 COMMAND_TYPE_GFXPIPE = 3, //!< No additional details
1860 };
1861
1862 //! \name Initializations
1863
1864 //! \brief Explicit member initialization function
1865 STATE_CSR_BASE_ADDRESS_CMD();
1866
1867 static const size_t dwSize = 3;
1868 static const size_t byteSize = 12;
1869 };
1870 };
1871
1872 #pragma pack()
1873
1874 #endif // __MHW_RENDER_HWCMD_G11_X_H__