Debian Codegraph @

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