1 /*
2  * Copyright (C) 2018-2021 Intel Corporation
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  */
7 
8 #pragma once
9 
10 #include "shared/source/aub_mem_dump/aub_header.h"
11 
12 #include <cstdint>
13 
14 #ifndef WIN32
15 #pragma pack(4)
16 #else
17 #pragma pack(push, 4)
18 #endif
19 
20 struct CmdServicesMemTraceVersion {
21     union {
22         AubCmdHdr Header;
23         struct {
24             uint32_t dwordCount : 16;
25             uint32_t instructionSubOpcode : 7;
26             uint32_t instructionOpcode : 6;
27             uint32_t instructionType : 3;
28         };
29     };
30     uint32_t memtraceFileVersion;
31     struct {
32         uint32_t metal : 3;
33         uint32_t stepping : 5;
34         uint32_t device : 8;
35         uint32_t csxSwizzling : 2;
36         uint32_t recordingMethod : 2;
37         uint32_t pch : 8;
38         uint32_t captureTool : 4;
39     };
40     uint32_t primaryVersion;
41     uint32_t secondaryVersion;
42     char commandLine[4];
getCommandLineLengthCmdServicesMemTraceVersion43     int32_t getCommandLineLength() const {
44         return getPacketSize() - (5);
45     }
getPacketSizeCmdServicesMemTraceVersion46     int32_t getPacketSize() const {
47         return dwordCount + 1;
48     }
getLengthBiasCmdServicesMemTraceVersion49     int32_t getLengthBias() const {
50         return 1;
51     }
getBaseLengthCmdServicesMemTraceVersion52     uint32_t getBaseLength() const {
53         return 4;
54     }
matchesHeaderCmdServicesMemTraceVersion55     bool matchesHeader() const {
56         if (instructionType != 0x7)
57             return false;
58         if (instructionOpcode != 0x2e)
59             return false;
60         if (instructionSubOpcode != 0xe)
61             return false;
62         return true;
63     }
setHeaderCmdServicesMemTraceVersion64     void setHeader() {
65         instructionType = 0x7;
66         instructionOpcode = 0x2e;
67         instructionSubOpcode = 0xe;
68     }
typeCmdServicesMemTraceVersion69     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceVersion70     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceVersion71     static uint32_t subOpcode() { return 0xe; }
72     struct CaptureToolValues {
73         enum { GenKmdCapture = 1,
74                Aubload = 0,
75                Amber = 3,
76                Ghal3DUlt = 2,
77                AubDump = 4 };
78     };
79     struct DeviceValues {
80         enum {
81             Blc = 2,
82             Il = 5,
83             Glk = 17,
84             Skl = 12,
85             Hsw = 9,
86             Bxt = 14,
87             Sbr = 6,
88             Cnl = 15,
89             Ivb = 7,
90             Chv = 13,
91             El = 4,
92             Ctg = 3,
93             Lrb2 = 8,
94             Bwr = 0,
95             Vlv = 10,
96             Cln = 1,
97             Kbl = 16,
98             Bdw = 11,
99             Icllp = 19,
100             Tgllp = 22,
101             Cfl = 24,
102             Lkf = 25,
103             Ehl = 28,
104             Dg1 = 30,
105             Adls = 37,
106             XeHP_SDV = 29,
107             Adlp = 34,
108             Dg2 = 36,
109             Pvc = 39,
110         };
111     };
112     struct RecordingMethodValues {
113         enum { Phy = 1,
114                Gfx = 0 };
115     };
116     struct CsxSwizzlingValues {
117         enum { Disabled = 0,
118                Enabled = 1 };
119     };
120     struct PchValues {
121         enum { LynxPoint = 4,
122                CougarPoint = 2,
123                PantherPoint = 3,
124                Default = 0,
125                IbexPeak = 1 };
126     };
127     struct SteppingValues {
128         enum {
129             N = 13,
130             O = 14,
131             L = 11,
132             M = 12,
133             B = 1,
134             C = 2,
135             A = 0,
136             F = 5,
137             G = 6,
138             D = 3,
139             E = 4,
140             Z = 25,
141             X = 23,
142             Y = 24,
143             R = 17,
144             S = 18,
145             P = 15,
146             Q = 16,
147             V = 21,
148             W = 22,
149             T = 19,
150             U = 20,
151             J = 9,
152             K = 10,
153             H = 7,
154             I = 8
155         };
156     };
157 };
158 
159 struct CmdServicesMemTraceRegisterCompare {
160     union {
161         AubCmdHdr Header;
162         struct {
163             uint32_t dwordCount : 16;
164             uint32_t instructionSubOpcode : 7;
165             uint32_t instructionOpcode : 6;
166             uint32_t instructionType : 3;
167         };
168     };
169     uint32_t registerOffset;
170     struct {
171         uint32_t noReadExpect : 1;
172         uint32_t : 15;
173         uint32_t registerSize : 4;
174         uint32_t : 8;
175         uint32_t registerSpace : 4;
176     };
177     uint32_t readMaskLow;
178     uint32_t readMaskHigh;
179     uint32_t data[1];
getDataLengthCmdServicesMemTraceRegisterCompare180     int32_t getDataLength() const {
181         return getPacketSize() - (5);
182     }
getPacketSizeCmdServicesMemTraceRegisterCompare183     int32_t getPacketSize() const {
184         return dwordCount + 1;
185     }
getLengthBiasCmdServicesMemTraceRegisterCompare186     int32_t getLengthBias() const {
187         return 1;
188     }
getBaseLengthCmdServicesMemTraceRegisterCompare189     uint32_t getBaseLength() const {
190         return 4;
191     }
matchesHeaderCmdServicesMemTraceRegisterCompare192     bool matchesHeader() const {
193         if (instructionType != 0x7)
194             return false;
195         if (instructionOpcode != 0x2e)
196             return false;
197         if (instructionSubOpcode != 0x1)
198             return false;
199         return true;
200     }
setHeaderCmdServicesMemTraceRegisterCompare201     void setHeader() {
202         instructionType = 0x7;
203         instructionOpcode = 0x2e;
204         instructionSubOpcode = 0x1;
205     }
typeCmdServicesMemTraceRegisterCompare206     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceRegisterCompare207     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceRegisterCompare208     static uint32_t subOpcode() { return 0x1; }
209     struct RegisterSpaceValues {
210         enum { MchBar = 1,
211                Mmio = 0,
212                VtdBar = 5,
213                PciConfig = 2,
214                IO = 4,
215                AzaliaBar = 3 };
216     };
217     struct RegisterSizeValues {
218         enum { Qword = 3,
219                Dword = 2,
220                Word = 1,
221                Byte = 0 };
222     };
223     struct NoReadExpectValues {
224         enum { ReadExpect = 0,
225                ReadWithoutExpect = 1 };
226     };
227 };
228 
229 struct CmdServicesMemTraceRegisterPoll {
230     union {
231         AubCmdHdr Header;
232         struct {
233             uint32_t dwordCount : 16;
234             uint32_t instructionSubOpcode : 7;
235             uint32_t instructionOpcode : 6;
236             uint32_t instructionType : 3;
237         };
238     };
239     uint32_t registerOffset;
240     struct {
241         uint32_t : 1;
242         uint32_t timeoutAction : 1;
243         uint32_t pollNotEqual : 1;
244         uint32_t : 1;
245         uint32_t operationType : 4;
246         uint32_t : 8;
247         uint32_t registerSize : 4;
248         uint32_t : 8;
249         uint32_t registerSpace : 4;
250     };
251     uint32_t pollMaskLow;
252     uint32_t pollMaskHigh;
253     uint32_t data[1];
getDataLengthCmdServicesMemTraceRegisterPoll254     int32_t getDataLength() const {
255         return getPacketSize() - (5);
256     }
getPacketSizeCmdServicesMemTraceRegisterPoll257     int32_t getPacketSize() const {
258         return dwordCount + 1;
259     }
getLengthBiasCmdServicesMemTraceRegisterPoll260     int32_t getLengthBias() const {
261         return 1;
262     }
getBaseLengthCmdServicesMemTraceRegisterPoll263     uint32_t getBaseLength() const {
264         return 4;
265     }
matchesHeaderCmdServicesMemTraceRegisterPoll266     bool matchesHeader() const {
267         if (instructionType != 0x7)
268             return false;
269         if (instructionOpcode != 0x2e)
270             return false;
271         if (instructionSubOpcode != 0x2)
272             return false;
273         return true;
274     }
setHeaderCmdServicesMemTraceRegisterPoll275     void setHeader() {
276         instructionType = 0x7;
277         instructionOpcode = 0x2e;
278         instructionSubOpcode = 0x2;
279     }
typeCmdServicesMemTraceRegisterPoll280     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceRegisterPoll281     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceRegisterPoll282     static uint32_t subOpcode() { return 0x2; }
283     struct OperationTypeValues {
284         enum { Normal = 0,
285                InterlacedCrc = 1 };
286     };
287     struct RegisterSpaceValues {
288         enum { MchBar = 1,
289                Mmio = 0,
290                VtdBar = 5,
291                PciConfig = 2,
292                IO = 4,
293                AzaliaBar = 3 };
294     };
295     struct TimeoutActionValues {
296         enum { Abort = 0,
297                Ignore = 1 };
298     };
299     struct RegisterSizeValues {
300         enum { Qword = 3,
301                Dword = 2,
302                Word = 1,
303                Byte = 0 };
304     };
305 };
306 
307 struct CmdServicesMemTraceRegisterWrite {
308     union {
309         AubCmdHdr Header;
310         struct {
311             uint32_t dwordCount : 16;
312             uint32_t instructionSubOpcode : 7;
313             uint32_t instructionOpcode : 6;
314             uint32_t instructionType : 3;
315         };
316     };
317     uint32_t registerOffset;
318     struct {
319         uint32_t : 4;
320         uint32_t messageSourceId : 4;
321         uint32_t : 8;
322         uint32_t registerSize : 4;
323         uint32_t : 8;
324         uint32_t registerSpace : 4;
325     };
326     uint32_t writeMaskLow;
327     uint32_t writeMaskHigh;
328     uint32_t data[1];
getDataLengthCmdServicesMemTraceRegisterWrite329     int32_t getDataLength() const {
330         return getPacketSize() - (5);
331     }
getPacketSizeCmdServicesMemTraceRegisterWrite332     int32_t getPacketSize() const {
333         return dwordCount + 1;
334     }
getLengthBiasCmdServicesMemTraceRegisterWrite335     int32_t getLengthBias() const {
336         return 1;
337     }
getBaseLengthCmdServicesMemTraceRegisterWrite338     uint32_t getBaseLength() const {
339         return 4;
340     }
matchesHeaderCmdServicesMemTraceRegisterWrite341     bool matchesHeader() const {
342         if (instructionType != 0x7)
343             return false;
344         if (instructionOpcode != 0x2e)
345             return false;
346         if (instructionSubOpcode != 0x3)
347             return false;
348         return true;
349     }
setHeaderCmdServicesMemTraceRegisterWrite350     void setHeader() {
351         instructionType = 0x7;
352         instructionOpcode = 0x2e;
353         instructionSubOpcode = 0x3;
354     }
typeCmdServicesMemTraceRegisterWrite355     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceRegisterWrite356     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceRegisterWrite357     static uint32_t subOpcode() { return 0x3; }
358     struct MessageSourceIdValues {
359         enum { Workaround = 4,
360                Gt = 2,
361                Ia = 0,
362                Me = 1,
363                Pch = 3 };
364     };
365     struct RegisterSpaceValues {
366         enum { MchBar = 1,
367                Mmio = 0,
368                VtdBar = 5,
369                PciConfig = 2,
370                IO = 4,
371                AzaliaBar = 3 };
372     };
373     struct RegisterSizeValues {
374         enum { Qword = 3,
375                Dword = 2,
376                Word = 1,
377                Byte = 0 };
378     };
379 };
380 
381 struct CmdServicesMemTraceMemoryCompare {
382     union {
383         AubCmdHdr Header;
384         struct {
385             uint32_t dwordCount : 16;
386             uint32_t instructionSubOpcode : 7;
387             uint32_t instructionOpcode : 6;
388             uint32_t instructionType : 3;
389         };
390     };
391     uint32_t address;
392     uint32_t addressHigh;
393     struct {
394         uint32_t noReadExpect : 1;
395         uint32_t repeatMemory : 1;
396         uint32_t tiling : 2;
397         uint32_t : 2;
398         uint32_t crcCompare : 1;
399         uint32_t compareOperation : 1;
400         uint32_t : 12;
401         uint32_t dataTypeHint : 8;
402         uint32_t addressSpace : 4;
403     };
404     uint32_t dataSizeInBytes;
405     uint32_t data[1];
getDataLengthCmdServicesMemTraceMemoryCompare406     int32_t getDataLength() const {
407         return getPacketSize() - (5);
408     }
getPacketSizeCmdServicesMemTraceMemoryCompare409     int32_t getPacketSize() const {
410         return dwordCount + 1;
411     }
getLengthBiasCmdServicesMemTraceMemoryCompare412     int32_t getLengthBias() const {
413         return 1;
414     }
getBaseLengthCmdServicesMemTraceMemoryCompare415     uint32_t getBaseLength() const {
416         return 4;
417     }
matchesHeaderCmdServicesMemTraceMemoryCompare418     bool matchesHeader() const {
419         if (instructionType != 0x7)
420             return false;
421         if (instructionOpcode != 0x2e)
422             return false;
423         if (instructionSubOpcode != 0x4)
424             return false;
425         return true;
426     }
setHeaderCmdServicesMemTraceMemoryCompare427     void setHeader() {
428         instructionType = 0x7;
429         instructionOpcode = 0x2e;
430         instructionSubOpcode = 0x4;
431     }
typeCmdServicesMemTraceMemoryCompare432     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceMemoryCompare433     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceMemoryCompare434     static uint32_t subOpcode() { return 0x4; }
435     struct RepeatMemoryValues {
436         enum { NoRepeat = 0,
437                Repeat = 1 };
438     };
439     struct DataTypeHintValues {
440         enum {
441             TraceInterfaceDescriptor = 29,
442             TraceCommandBufferPrimary = 39,
443             TraceRemap = 37,
444             TraceVertexShaderState = 16,
445             TraceSfViewport = 23,
446             TraceMediaObjectIndirectData = 36,
447             Trace1DMap = 10,
448             TraceVolumeMap = 9,
449             TraceVldState = 30,
450             TraceBatchBufferPrimary = 42,
451             TraceSamplerDefaultColor = 28,
452             TraceClipViewport = 22,
453             TraceStripsFansState = 19,
454             TraceNotype = 0,
455             TraceAudioLinkTable = 46,
456             TraceGeometryShaderState = 17,
457             TraceConstantBuffer = 11,
458             TraceBatchBufferBlt = 43,
459             TraceBinBuffer = 2,
460             TraceIndexBuffer = 13,
461             Trace2DMap = 6,
462             TraceCubeMap = 7,
463             TraceVfeState = 31,
464             TraceDepthStencilState = 33,
465             TraceBatchBufferMfx = 44,
466             TraceRenderSurfaceState = 35,
467             TraceWindowerIzState = 20,
468             TraceCommandBufferMfx = 41,
469             TraceBatchBuffer = 1,
470             TraceCcViewport = 24,
471             TraceColorCalcState = 21,
472             TraceCommandBuffer = 38,
473             TraceAudioData = 47,
474             TraceSlowStateBuffer = 4,
475             TraceAudioCommandBuffer = 45,
476             TraceCommandBufferBlt = 40,
477             TraceKernelInstructions = 26,
478             TraceConstantUrbEntry = 12,
479             TraceBlendState = 32,
480             TraceIndirectStateBuffer = 8,
481             TraceClipperState = 18,
482             TraceSamplerState = 25,
483             TraceBindingTableState = 34,
484             TraceBinPointerList = 3,
485             TraceVertexBufferState = 5,
486             TraceScratchSpace = 27
487         };
488     };
489     struct TilingValues {
490         enum { NoTiling = 0,
491                WTiling = 3,
492                YTiling = 2,
493                XTiling = 1 };
494     };
495     struct CrcCompareValues {
496         enum { Crc = 1,
497                NoCrc = 0 };
498     };
499     struct NoReadExpectValues {
500         enum { ReadExpect = 0,
501                ReadWithoutExpect = 1 };
502     };
503     struct AddressSpaceValues {
504         enum {
505             TraceGttEntry = 4,
506             TraceNonapetureGttGfx = 7,
507             TraceLocal = 1,
508             TracePml4Entry = 10,
509             TraceGttGfx = 0,
510             TraceNonlocal = 2,
511             TraceGttPdEntry = 3,
512             TracePpgttEntry = 6,
513             TracePpgttGfx = 5,
514             TracePpgttPdEntry = 9,
515             TracePhysicalPdpEntry = 8
516         };
517     };
518     struct CompareOperationValues {
519         enum {
520             CompareNotEqual = 1,
521             CompareEqual = 0
522         };
523     };
524 };
525 
526 struct CmdServicesMemTraceMemoryPoll {
527     union {
528         AubCmdHdr Header;
529         struct {
530             uint32_t dwordCount : 16;
531             uint32_t instructionSubOpcode : 7;
532             uint32_t instructionOpcode : 6;
533             uint32_t instructionType : 3;
534         };
535     };
536     uint32_t address;
537     uint32_t addressHigh;
538     struct {
539         uint32_t pollNotEqual : 1;
540         uint32_t : 1;
541         uint32_t tiling : 2;
542         uint32_t dataSize : 2;
543         uint32_t : 2;
544         uint32_t timeoutAction : 1;
545         uint32_t : 11;
546         uint32_t dataTypeHint : 8;
547         uint32_t addressSpace : 4;
548     };
549     uint32_t pollMaskLow;
550     uint32_t pollMaskHigh;
551     uint32_t data[1];
getDataLengthCmdServicesMemTraceMemoryPoll552     int32_t getDataLength() const {
553         return getPacketSize() - (6);
554     }
getPacketSizeCmdServicesMemTraceMemoryPoll555     int32_t getPacketSize() const {
556         return dwordCount + 1;
557     }
getLengthBiasCmdServicesMemTraceMemoryPoll558     int32_t getLengthBias() const {
559         return 1;
560     }
getBaseLengthCmdServicesMemTraceMemoryPoll561     uint32_t getBaseLength() const {
562         return 5;
563     }
matchesHeaderCmdServicesMemTraceMemoryPoll564     bool matchesHeader() const {
565         if (instructionType != 0x7)
566             return false;
567         if (instructionOpcode != 0x2e)
568             return false;
569         if (instructionSubOpcode != 0x5)
570             return false;
571         return true;
572     }
setHeaderCmdServicesMemTraceMemoryPoll573     void setHeader() {
574         instructionType = 0x7;
575         instructionOpcode = 0x2e;
576         instructionSubOpcode = 0x5;
577     }
typeCmdServicesMemTraceMemoryPoll578     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceMemoryPoll579     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceMemoryPoll580     static uint32_t subOpcode() { return 0x5; }
581     struct DataTypeHintValues {
582         enum {
583             TraceInterfaceDescriptor = 29,
584             TraceCommandBufferPrimary = 39,
585             TraceRemap = 37,
586             TraceVertexShaderState = 16,
587             TraceSfViewport = 23,
588             TraceMediaObjectIndirectData = 36,
589             Trace1DMap = 10,
590             TraceVolumeMap = 9,
591             TraceVldState = 30,
592             TraceBatchBufferPrimary = 42,
593             TraceSamplerDefaultColor = 28,
594             TraceClipViewport = 22,
595             TraceStripsFansState = 19,
596             TraceNotype = 0,
597             TraceAudioLinkTable = 46,
598             TraceGeometryShaderState = 17,
599             TraceConstantBuffer = 11,
600             TraceBatchBufferBlt = 43,
601             TraceBinBuffer = 2,
602             TraceIndexBuffer = 13,
603             Trace2DMap = 6,
604             TraceCubeMap = 7,
605             TraceVfeState = 31,
606             TraceDepthStencilState = 33,
607             TraceBatchBufferMfx = 44,
608             TraceRenderSurfaceState = 35,
609             TraceWindowerIzState = 20,
610             TraceCommandBufferMfx = 41,
611             TraceBatchBuffer = 1,
612             TraceCcViewport = 24,
613             TraceColorCalcState = 21,
614             TraceCommandBuffer = 38,
615             TraceAudioData = 47,
616             TraceSlowStateBuffer = 4,
617             TraceAudioCommandBuffer = 45,
618             TraceCommandBufferBlt = 40,
619             TraceKernelInstructions = 26,
620             TraceConstantUrbEntry = 12,
621             TraceBlendState = 32,
622             TraceIndirectStateBuffer = 8,
623             TraceClipperState = 18,
624             TraceSamplerState = 25,
625             TraceBindingTableState = 34,
626             TraceBinPointerList = 3,
627             TraceVertexBufferState = 5,
628             TraceScratchSpace = 27
629         };
630     };
631     struct DataSizeValues {
632         enum { Qword = 3,
633                Dword = 2,
634                Word = 1,
635                Byte = 0 };
636     };
637     struct TilingValues {
638         enum { NoTiling = 0,
639                WTiling = 3,
640                YTiling = 2,
641                XTiling = 1 };
642     };
643     struct TimeoutActionValues {
644         enum { Abort = 0,
645                Ignore = 1 };
646     };
647     struct AddressSpaceValues {
648         enum {
649             TraceGttEntry = 4,
650             TraceNonapetureGttGfx = 7,
651             TraceLocal = 1,
652             TracePml4Entry = 10,
653             TraceGttGfx = 0,
654             TraceNonlocal = 2,
655             TraceGttPdEntry = 3,
656             TracePpgttEntry = 6,
657             TracePpgttGfx = 5,
658             TracePpgttPdEntry = 9,
659             TracePhysicalPdpEntry = 8
660         };
661     };
662 };
663 
664 struct CmdServicesMemTraceMemoryWrite {
665     union {
666         AubCmdHdr Header;
667         struct {
668             uint32_t dwordCount : 16;
669             uint32_t instructionSubOpcode : 7;
670             uint32_t instructionOpcode : 6;
671             uint32_t instructionType : 3;
672         };
673     };
674     uint64_t address;
getAddressLengthCmdServicesMemTraceMemoryWrite675     int32_t getAddressLength() const {
676         return 2 - (1) + 1;
677     }
678     struct {
679         uint32_t frontDoorAccess : 1;
680         uint32_t repeatMemory : 1;
681         uint32_t tiling : 2;
682         uint32_t : 16;
683         uint32_t dataTypeHint : 8;
684         uint32_t addressSpace : 4;
685     };
686     uint32_t dataSizeInBytes;
687     uint32_t data[1];
getDataLengthCmdServicesMemTraceMemoryWrite688     int32_t getDataLength() const {
689         return getPacketSize() - (5);
690     }
getPacketSizeCmdServicesMemTraceMemoryWrite691     int32_t getPacketSize() const {
692         return dwordCount + 1;
693     }
getLengthBiasCmdServicesMemTraceMemoryWrite694     int32_t getLengthBias() const {
695         return 1;
696     }
getBaseLengthCmdServicesMemTraceMemoryWrite697     uint32_t getBaseLength() const {
698         return 4;
699     }
matchesHeaderCmdServicesMemTraceMemoryWrite700     bool matchesHeader() const {
701         if (instructionType != 0x7)
702             return false;
703         if (instructionOpcode != 0x2e)
704             return false;
705         if (instructionSubOpcode != 0x6)
706             return false;
707         return true;
708     }
setHeaderCmdServicesMemTraceMemoryWrite709     void setHeader() {
710         instructionType = 0x7;
711         instructionOpcode = 0x2e;
712         instructionSubOpcode = 0x6;
713     }
typeCmdServicesMemTraceMemoryWrite714     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceMemoryWrite715     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceMemoryWrite716     static uint32_t subOpcode() { return 0x6; }
717     struct RepeatMemoryValues {
718         enum { NoRepeat = 0,
719                Repeat = 1 };
720     };
721     struct DataTypeHintValues {
722         enum {
723             TraceVertexBufferState = 5,
724             TraceCommandBufferPrimary = 39,
725             TraceVertexShaderState = 16,
726             TraceExtendedRootTableEntry = 52,
727             TraceClipViewport = 22,
728             Trace1DMap = 10,
729             TraceBatchBufferPrimary = 42,
730             TraceClipperState = 18,
731             TraceLogicalRingContextVecs = 51,
732             TraceRingContextVcs = 57,
733             TraceLri = 59,
734             TraceBlendState = 32,
735             TraceBinBuffer = 2,
736             TraceSlowStateBuffer = 4,
737             TraceRemap = 37,
738             TraceDepthStencilState = 33,
739             TraceAudioData = 47,
740             TraceDummyGgttEntry = 62,
741             TraceWindowerIzState = 20,
742             Trace2DMap = 6,
743             TraceBindingTableState = 34,
744             TraceGucProcessDescriptor = 60,
745             TraceIndirectStateBuffer = 8,
746             TraceConstantBuffer = 11,
747             TraceMediaObjectIndirectData = 36,
748             TraceStripsFansState = 19,
749             TraceBatchBuffer = 1,
750             TraceLogicalRingContextVcs = 50,
751             TraceSfViewport = 23,
752             TraceCommandBufferBlt = 40,
753             TraceRingContextBcs = 56,
754             TraceCcViewport = 24,
755             TraceLogicalRingContextCcs = 64,
756             TraceIndexBuffer = 13,
757             TraceScratchSpace = 27,
758             TraceGucContextDescriptor = 61,
759             TraceBatchBufferMfx = 44,
760             TraceCommandBufferMfx = 41,
761             TraceBatchBufferBlt = 43,
762             TraceSamplerState = 25,
763             TraceRingContextRcs = 55,
764             TraceAudioLinkTable = 46,
765             TraceRenderSurfaceState = 35,
766             TraceSamplerDefaultColor = 28,
767             TraceVldState = 30,
768             TraceVfeState = 31,
769             TraceExtendedContextTableEntry = 53,
770             TraceLogicalRingContextRcs = 48,
771             TraceInterfaceDescriptor = 29,
772             TraceConstantUrbEntry = 12,
773             TraceCommandBuffer = 38,
774             TracePasidTableEntry = 54,
775             TraceBinPointerList = 3,
776             TraceRingContextVecs = 58,
777             TraceNotype = 0,
778             TraceGeometryShaderState = 17,
779             TraceAudioCommandBuffer = 45,
780             TraceColorCalcState = 21,
781             TraceKernelInstructions = 26,
782             TraceVolumeMap = 9,
783             TraceCubeMap = 7,
784             TraceLogicalRingContextBcs = 49,
785             TracePpgttLevel1 = 65,
786             TracePpgttLevel2 = 66,
787             TracePpgttLevel3 = 67,
788             TracePpgttLevel4 = 68
789         };
790     };
791     struct TilingValues {
792         enum { NoTiling = 0,
793                WTiling = 3,
794                YTiling = 2,
795                XTiling = 1 };
796     };
797     struct AddressSpaceValues {
798         enum {
799             TraceGttEntry = 4,
800             TraceNonapetureGttGfx = 7,
801             TraceLocal = 1,
802             TracePml4Entry = 10,
803             TraceGttGfx = 0,
804             TraceNonlocal = 2,
805             TraceGttPdEntry = 3,
806             TracePpgttEntry = 6,
807             TracePpgttGfx = 5,
808             TracePpgttPdEntry = 9,
809             TracePowerContext = 11,
810             TracePhysicalPdpEntry = 8
811         };
812     };
813 };
814 
815 struct CmdServicesMemTraceMemoryWriteDiscontiguous {
816     union {
817         AubCmdHdr Header;
818         struct {
819             uint32_t dwordCount : 16;
820             uint32_t instructionSubOpcode : 7;
821             uint32_t instructionOpcode : 6;
822             uint32_t instructionType : 3;
823         };
824     };
825     struct {
826         uint32_t frontDoorAccess : 1;
827         uint32_t repeatMemory : 1;
828         uint32_t tiling : 2;
829         uint32_t numberOfAddressDataPairs : 16;
830         uint32_t dataTypeHint : 8;
831         uint32_t addressSpace : 4;
832     };
833     struct {
834         uint64_t address;
835         uint32_t dataSizeInBytes;
836     } Dword_2_To_190[63];
getDword2To190LengthCmdServicesMemTraceMemoryWriteDiscontiguous837     int32_t getDword2To190Length() const {
838         return 190 - (2) + 1;
839     }
840     uint32_t data[1];
getDataLengthCmdServicesMemTraceMemoryWriteDiscontiguous841     int32_t getDataLength() const {
842         return getPacketSize() - (191);
843     }
getPacketSizeCmdServicesMemTraceMemoryWriteDiscontiguous844     int32_t getPacketSize() const {
845         return dwordCount + 1;
846     }
getLengthBiasCmdServicesMemTraceMemoryWriteDiscontiguous847     int32_t getLengthBias() const {
848         return 1;
849     }
getBaseLengthCmdServicesMemTraceMemoryWriteDiscontiguous850     uint32_t getBaseLength() const {
851         return 190;
852     }
matchesHeaderCmdServicesMemTraceMemoryWriteDiscontiguous853     bool matchesHeader() const {
854         if (instructionType != 0x7)
855             return false;
856         if (instructionOpcode != 0x2e)
857             return false;
858         if (instructionSubOpcode != 0xb)
859             return false;
860         return true;
861     }
setHeaderCmdServicesMemTraceMemoryWriteDiscontiguous862     void setHeader() {
863         instructionType = 0x7;
864         instructionOpcode = 0x2e;
865         instructionSubOpcode = 0xb;
866     }
typeCmdServicesMemTraceMemoryWriteDiscontiguous867     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceMemoryWriteDiscontiguous868     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceMemoryWriteDiscontiguous869     static uint32_t subOpcode() { return 0xb; }
870     struct RepeatMemoryValues {
871         enum { NoRepeat = 0,
872                Repeat = 1 };
873     };
874     struct DataTypeHintValues {
875         enum {
876             TraceVertexBufferState = 5,
877             TraceCommandBufferPrimary = 39,
878             TraceRingContextBcs = 56,
879             TraceExtendedRootTableEntry = 52,
880             TraceClipViewport = 22,
881             Trace1DMap = 10,
882             TraceBatchBufferPrimary = 42,
883             TraceClipperState = 18,
884             TraceRingContextVcs = 57,
885             TraceVolumeMap = 9,
886             TraceBlendState = 32,
887             TraceSlowStateBuffer = 4,
888             TraceRemap = 37,
889             TraceDepthStencilState = 33,
890             TraceAudioData = 47,
891             TraceColorCalcState = 21,
892             TraceWindowerIzState = 20,
893             Trace2DMap = 6,
894             TraceBindingTableState = 34,
895             TraceIndirectStateBuffer = 8,
896             TraceConstantBuffer = 11,
897             TraceMediaObjectIndirectData = 36,
898             TraceStripsFansState = 19,
899             TraceBatchBuffer = 1,
900             TraceSfViewport = 23,
901             TraceCommandBufferBlt = 40,
902             TraceBinBuffer = 2,
903             TraceCcViewport = 24,
904             TraceIndexBuffer = 13,
905             TraceScratchSpace = 27,
906             TraceLogicalRingContextVecs = 51,
907             TraceBatchBufferMfx = 44,
908             TraceCommandBufferMfx = 41,
909             TraceBatchBufferBlt = 43,
910             TraceSamplerState = 25,
911             TraceRingContextRcs = 55,
912             TraceAudioLinkTable = 46,
913             TraceRenderSurfaceState = 35,
914             TraceSamplerDefaultColor = 28,
915             TraceVldState = 30,
916             TraceVfeState = 31,
917             TraceExtendedContextTableEntry = 53,
918             TraceLogicalRingContextRcs = 48,
919             TraceInterfaceDescriptor = 29,
920             TraceConstantUrbEntry = 12,
921             TraceCommandBuffer = 38,
922             TraceVertexShaderState = 16,
923             TraceBinPointerList = 3,
924             TraceRingContextVecs = 58,
925             TraceNotype = 0,
926             TraceGeometryShaderState = 17,
927             TraceAudioCommandBuffer = 45,
928             TraceLogicalRingContextVcs = 50,
929             TraceKernelInstructions = 26,
930             TracePasidTableEntry = 54,
931             TraceCubeMap = 7,
932             TraceLogicalRingContextBcs = 49
933         };
934     };
935     struct TilingValues {
936         enum { NoTiling = 0,
937                WTiling = 3,
938                YTiling = 2,
939                XTiling = 1 };
940     };
941     struct AddressSpaceValues {
942         enum {
943             TraceGttEntry = 4,
944             TraceNonapetureGttGfx = 7,
945             TraceLocal = 1,
946             TracePml4Entry = 10,
947             TraceGttGfx = 0,
948             TraceNonlocal = 2,
949             TraceGttPdEntry = 3,
950             TracePpgttEntry = 6,
951             TracePpgttGfx = 5,
952             TracePpgttPdEntry = 9,
953             TracePowerContext = 11,
954             TracePhysicalPdpEntry = 8
955         };
956     };
957 };
958 
959 struct CmdServicesMemTraceFrameBegin {
960     union {
961         AubCmdHdr Header;
962         struct {
963             uint32_t dwordCount : 16;
964             uint32_t instructionSubOpcode : 7;
965             uint32_t instructionOpcode : 6;
966             uint32_t instructionType : 3;
967         };
968     };
969     struct {
970         uint32_t frameNumber : 16;
971         uint32_t : 16;
972     };
getPacketSizeCmdServicesMemTraceFrameBegin973     int32_t getPacketSize() const {
974         return dwordCount + 1;
975     }
getLengthBiasCmdServicesMemTraceFrameBegin976     int32_t getLengthBias() const {
977         return 1;
978     }
getBaseLengthCmdServicesMemTraceFrameBegin979     uint32_t getBaseLength() const {
980         return 1;
981     }
matchesHeaderCmdServicesMemTraceFrameBegin982     bool matchesHeader() const {
983         if (instructionType != 0x7)
984             return false;
985         if (instructionOpcode != 0x2e)
986             return false;
987         if (instructionSubOpcode != 0x7)
988             return false;
989         return true;
990     }
setHeaderCmdServicesMemTraceFrameBegin991     void setHeader() {
992         instructionType = 0x7;
993         instructionOpcode = 0x2e;
994         instructionSubOpcode = 0x7;
995     }
typeCmdServicesMemTraceFrameBegin996     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceFrameBegin997     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceFrameBegin998     static uint32_t subOpcode() { return 0x7; }
999 };
1000 
1001 struct CmdServicesMemTraceComment {
1002     union {
1003         AubCmdHdr Header;
1004         struct {
1005             uint32_t dwordCount : 16;
1006             uint32_t instructionSubOpcode : 7;
1007             uint32_t instructionOpcode : 6;
1008             uint32_t instructionType : 3;
1009         };
1010     };
1011     struct {
1012         uint32_t syncOnComment : 1;
1013         uint32_t syncOnSimulatorDisplay : 1;
1014         uint32_t : 30;
1015     };
1016     char comment[4];
getCommentLengthCmdServicesMemTraceComment1017     int32_t getCommentLength() const {
1018         return getPacketSize() - (2);
1019     }
getPacketSizeCmdServicesMemTraceComment1020     int32_t getPacketSize() const {
1021         return dwordCount + 1;
1022     }
getLengthBiasCmdServicesMemTraceComment1023     int32_t getLengthBias() const {
1024         return 1;
1025     }
getBaseLengthCmdServicesMemTraceComment1026     uint32_t getBaseLength() const {
1027         return 1;
1028     }
matchesHeaderCmdServicesMemTraceComment1029     bool matchesHeader() const {
1030         if (instructionType != 0x7)
1031             return false;
1032         if (instructionOpcode != 0x2e)
1033             return false;
1034         if (instructionSubOpcode != 0x8)
1035             return false;
1036         return true;
1037     }
setHeaderCmdServicesMemTraceComment1038     void setHeader() {
1039         instructionType = 0x7;
1040         instructionOpcode = 0x2e;
1041         instructionSubOpcode = 0x8;
1042     }
typeCmdServicesMemTraceComment1043     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceComment1044     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceComment1045     static uint32_t subOpcode() { return 0x8; }
1046 };
1047 
1048 struct CmdServicesMemTraceDelay {
1049     union {
1050         AubCmdHdr Header;
1051         struct {
1052             uint32_t dwordCount : 16;
1053             uint32_t instructionSubOpcode : 7;
1054             uint32_t instructionOpcode : 6;
1055             uint32_t instructionType : 3;
1056         };
1057     };
1058     uint32_t time;
getPacketSizeCmdServicesMemTraceDelay1059     int32_t getPacketSize() const {
1060         return dwordCount + 1;
1061     }
getLengthBiasCmdServicesMemTraceDelay1062     int32_t getLengthBias() const {
1063         return 1;
1064     }
getBaseLengthCmdServicesMemTraceDelay1065     uint32_t getBaseLength() const {
1066         return 1;
1067     }
matchesHeaderCmdServicesMemTraceDelay1068     bool matchesHeader() const {
1069         if (instructionType != 0x7)
1070             return false;
1071         if (instructionOpcode != 0x2e)
1072             return false;
1073         if (instructionSubOpcode != 0x9)
1074             return false;
1075         return true;
1076     }
setHeaderCmdServicesMemTraceDelay1077     void setHeader() {
1078         instructionType = 0x7;
1079         instructionOpcode = 0x2e;
1080         instructionSubOpcode = 0x9;
1081     }
typeCmdServicesMemTraceDelay1082     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceDelay1083     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceDelay1084     static uint32_t subOpcode() { return 0x9; }
1085 };
1086 
1087 struct CmdServicesMemTraceMemoryDump {
1088     union {
1089         AubCmdHdr Header;
1090         struct {
1091             uint32_t dwordCount : 16;
1092             uint32_t instructionSubOpcode : 7;
1093             uint32_t instructionOpcode : 6;
1094             uint32_t instructionType : 3;
1095         };
1096     };
1097     uint32_t physicalAddressDwordLow;
1098     uint32_t physicalAddressDwordHigh;
1099     uint32_t stride;
1100     uint32_t width;
1101     uint32_t height;
1102     struct {
1103         uint32_t addressSpace : 2;
1104         uint32_t : 2;
1105         uint32_t tiling : 2;
1106         uint32_t : 26;
1107     };
1108     char filename[4];
getFilenameLengthCmdServicesMemTraceMemoryDump1109     int32_t getFilenameLength() const {
1110         return getPacketSize() - (7);
1111     }
getPacketSizeCmdServicesMemTraceMemoryDump1112     int32_t getPacketSize() const {
1113         return dwordCount + 1;
1114     }
getLengthBiasCmdServicesMemTraceMemoryDump1115     int32_t getLengthBias() const {
1116         return 1;
1117     }
getBaseLengthCmdServicesMemTraceMemoryDump1118     uint32_t getBaseLength() const {
1119         return 5;
1120     }
matchesHeaderCmdServicesMemTraceMemoryDump1121     bool matchesHeader() const {
1122         if (instructionType != 0x7)
1123             return false;
1124         if (instructionOpcode != 0x2e)
1125             return false;
1126         if (instructionSubOpcode != 0xa)
1127             return false;
1128         return true;
1129     }
setHeaderCmdServicesMemTraceMemoryDump1130     void setHeader() {
1131         instructionType = 0x7;
1132         instructionOpcode = 0x2e;
1133         instructionSubOpcode = 0xa;
1134     }
typeCmdServicesMemTraceMemoryDump1135     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceMemoryDump1136     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceMemoryDump1137     static uint32_t subOpcode() { return 0xa; }
1138     struct TilingValues {
1139         enum { NoTiling = 0,
1140                WTiling = 3,
1141                YTiling = 2,
1142                XTiling = 1 };
1143     };
1144     struct AddressSpaceValues {
1145         enum { TraceGttGfx = 0,
1146                TraceLocal = 1 };
1147     };
1148 };
1149 
1150 struct CmdServicesMemTraceTestPhaseMarker {
1151     union {
1152         AubCmdHdr Header;
1153         struct {
1154             uint32_t dwordCount : 16;
1155             uint32_t instructionSubOpcode : 7;
1156             uint32_t instructionOpcode : 6;
1157             uint32_t instructionType : 3;
1158         };
1159     };
1160     struct {
1161         uint32_t toolSpecificSubPhase : 12;
1162         uint32_t beginTestPhase : 4;
1163         uint32_t : 16;
1164     };
getPacketSizeCmdServicesMemTraceTestPhaseMarker1165     int32_t getPacketSize() const {
1166         return dwordCount + 1;
1167     }
getLengthBiasCmdServicesMemTraceTestPhaseMarker1168     int32_t getLengthBias() const {
1169         return 1;
1170     }
getBaseLengthCmdServicesMemTraceTestPhaseMarker1171     uint32_t getBaseLength() const {
1172         return 1;
1173     }
matchesHeaderCmdServicesMemTraceTestPhaseMarker1174     bool matchesHeader() const {
1175         if (instructionType != 0x7)
1176             return false;
1177         if (instructionOpcode != 0x2e)
1178             return false;
1179         if (instructionSubOpcode != 0xc)
1180             return false;
1181         return true;
1182     }
setHeaderCmdServicesMemTraceTestPhaseMarker1183     void setHeader() {
1184         instructionType = 0x7;
1185         instructionOpcode = 0x2e;
1186         instructionSubOpcode = 0xc;
1187     }
typeCmdServicesMemTraceTestPhaseMarker1188     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceTestPhaseMarker1189     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceTestPhaseMarker1190     static uint32_t subOpcode() { return 0xc; }
1191     struct BeginTestPhaseValues {
1192         enum { PollForTestCompletion = 8,
1193                SetupPhase = 2,
1194                DispatchPhase = 3,
1195                VerificationPhase = 10,
1196                MemoryInitializationPhase = 0,
1197                ExecutePhase = 4 };
1198     };
1199 };
1200 
1201 struct CmdServicesMemTraceMemoryContinuousRegion {
1202     union {
1203         AubCmdHdr Header;
1204         struct {
1205             uint32_t dwordCount : 16;
1206             uint32_t instructionSubOpcode : 7;
1207             uint32_t instructionOpcode : 6;
1208             uint32_t instructionType : 3;
1209         };
1210     };
1211     uint64_t address;
getAddressLengthCmdServicesMemTraceMemoryContinuousRegion1212     int32_t getAddressLength() const {
1213         return 2 - (1) + 1;
1214     }
1215     uint64_t regionSize;
getRegionSizeLengthCmdServicesMemTraceMemoryContinuousRegion1216     int32_t getRegionSizeLength() const {
1217         return 4 - (3) + 1;
1218     }
getPacketSizeCmdServicesMemTraceMemoryContinuousRegion1219     int32_t getPacketSize() const {
1220         return dwordCount + 1;
1221     }
getLengthBiasCmdServicesMemTraceMemoryContinuousRegion1222     int32_t getLengthBias() const {
1223         return 1;
1224     }
getBaseLengthCmdServicesMemTraceMemoryContinuousRegion1225     uint32_t getBaseLength() const {
1226         return 4;
1227     }
matchesHeaderCmdServicesMemTraceMemoryContinuousRegion1228     bool matchesHeader() const {
1229         if (instructionType != 0x7)
1230             return false;
1231         if (instructionOpcode != 0x2e)
1232             return false;
1233         if (instructionSubOpcode != 0xd)
1234             return false;
1235         return true;
1236     }
setHeaderCmdServicesMemTraceMemoryContinuousRegion1237     void setHeader() {
1238         instructionType = 0x7;
1239         instructionOpcode = 0x2e;
1240         instructionSubOpcode = 0xd;
1241     }
typeCmdServicesMemTraceMemoryContinuousRegion1242     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceMemoryContinuousRegion1243     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceMemoryContinuousRegion1244     static uint32_t subOpcode() { return 0xd; }
1245 };
1246 
1247 struct CmdServicesMemTracePredicate {
1248     union {
1249         AubCmdHdr Header;
1250         struct {
1251             uint32_t dwordCount : 16;
1252             uint32_t instructionSubOpcode : 7;
1253             uint32_t instructionOpcode : 6;
1254             uint32_t instructionType : 3;
1255         };
1256     };
1257     struct {
1258         uint32_t predicateState : 1;
1259         uint32_t target : 4;
1260         uint32_t : 27;
1261     };
getPacketSizeCmdServicesMemTracePredicate1262     int32_t getPacketSize() const {
1263         return dwordCount + 1;
1264     }
getLengthBiasCmdServicesMemTracePredicate1265     int32_t getLengthBias() const {
1266         return 1;
1267     }
getBaseLengthCmdServicesMemTracePredicate1268     uint32_t getBaseLength() const {
1269         return 4;
1270     }
matchesHeaderCmdServicesMemTracePredicate1271     bool matchesHeader() const {
1272         if (instructionType != 0x7)
1273             return false;
1274         if (instructionOpcode != 0x2e)
1275             return false;
1276         if (instructionSubOpcode != 0xf)
1277             return false;
1278         return true;
1279     }
setHeaderCmdServicesMemTracePredicate1280     void setHeader() {
1281         instructionType = 0x7;
1282         instructionOpcode = 0x2e;
1283         instructionSubOpcode = 0xf;
1284     }
typeCmdServicesMemTracePredicate1285     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTracePredicate1286     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTracePredicate1287     static uint32_t subOpcode() { return 0xf; }
1288     struct PredicateStateValues {
1289         enum { Disabled = 0,
1290                Enabled = 1 };
1291     };
1292     struct TargetValues {
1293         enum {
1294             Fpgarunlist = 8,
1295             Simulator = 0,
1296             Pipe = 1,
1297             Silicon = 4,
1298             Uncore = 6,
1299             Emulator = 3,
1300             Pipe2D = 7,
1301             Fpgamedia = 5,
1302             Pipegt = 2
1303         };
1304     };
1305 };
1306 
1307 struct CmdServicesMemTraceDumpCompress {
1308     union {
1309         AubCmdHdr Header;
1310         struct {
1311             uint32_t dwordCount : 16;
1312             uint32_t instructionSubOpcode : 7;
1313             uint32_t instructionOpcode : 6;
1314             uint32_t instructionType : 3;
1315         };
1316     };
1317     uint64_t surfaceAddress;
getSurfaceAddressCmdServicesMemTraceDumpCompress1318     uint64_t getSurfaceAddress() const {
1319         return getMisalignedUint64(&this->surfaceAddress);
1320     }
setSurfaceAddressCmdServicesMemTraceDumpCompress1321     void setSurfaceAddress(const uint64_t surfaceAddress) {
1322         setMisalignedUint64(&this->surfaceAddress, surfaceAddress);
1323     }
getSurfaceAddressLengthCmdServicesMemTraceDumpCompress1324     int getSurfaceAddressLength() const {
1325         return 2 - (1) + 1;
1326     }
1327     uint32_t surfaceWidth;
1328     uint32_t surfaceHeight;
1329     uint32_t surfacePitch;
1330     struct {
1331         uint32_t surfaceFormat : 12;
1332         uint32_t dumpType : 3;
1333         uint32_t : 1;
1334         uint32_t surfaceTilingType : 3;
1335         uint32_t : 3;
1336         uint32_t surfaceType : 3;
1337         uint32_t : 3;
1338         uint32_t tiledResourceMode : 2;
1339         uint32_t : 1;
1340         uint32_t useClearValue : 1;
1341     };
1342     uint64_t auxSurfaceAddress;
getAuxSurfaceAddressLengthCmdServicesMemTraceDumpCompress1343     int getAuxSurfaceAddressLength() const {
1344         return 8 - (7) + 1;
1345     }
1346     uint32_t auxSurfaceWidth;
1347     uint32_t auxSurfaceHeight;
1348     uint32_t auxSurfacePitch;
1349     struct {
1350         uint32_t auxSurfaceQPitch : 17;
1351         uint32_t : 4;
1352         uint32_t auxSurfaceTilingType : 3;
1353         uint32_t : 8;
1354     };
1355     struct {
1356         uint32_t blockWidth : 8;
1357         uint32_t blockHeight : 8;
1358         uint32_t blockDepth : 8;
1359         uint32_t mode : 1;
1360         uint32_t algorithm : 3;
1361         uint32_t : 4;
1362     };
1363     uint32_t tileWidth;
1364     uint32_t tileHeight;
1365     uint32_t tileDepth;
1366     uint32_t clearColorRed;
1367     uint32_t clearColorGreen;
1368     uint32_t clearColorBlue;
1369     uint32_t clearColorAlpha;
1370     struct {
1371         uint32_t gttType : 2;
1372         uint32_t clearColorType : 1;
1373         uint32_t : 29;
1374     };
1375     uint32_t directoryHandle;
1376     uint64_t clearColorAddress;
getClearColorAddressLengthCmdServicesMemTraceDumpCompress1377     int getClearColorAddressLength() const {
1378         return 24 - (23) + 1;
1379     }
getPacketSizeCmdServicesMemTraceDumpCompress1380     int32_t getPacketSize() const {
1381         return dwordCount + 1;
1382     }
getLengthBiasCmdServicesMemTraceDumpCompress1383     int32_t getLengthBias() const {
1384         return 1;
1385     }
getBaseLengthCmdServicesMemTraceDumpCompress1386     uint32_t getBaseLength() const {
1387         return 19;
1388     }
matchesHeaderCmdServicesMemTraceDumpCompress1389     bool matchesHeader() const {
1390         if (instructionType != 0x7)
1391             return false;
1392         if (instructionOpcode != 0x2e)
1393             return false;
1394         if (instructionSubOpcode != 0x10)
1395             return false;
1396         return true;
1397     }
setHeaderCmdServicesMemTraceDumpCompress1398     void setHeader() {
1399         instructionType = 0x7;
1400         instructionOpcode = 0x2e;
1401         instructionSubOpcode = 0x10;
1402     }
typeCmdServicesMemTraceDumpCompress1403     static uint32_t type() { return 0x7; }
opcodeCmdServicesMemTraceDumpCompress1404     static uint32_t opcode() { return 0x2e; }
subOpcodeCmdServicesMemTraceDumpCompress1405     static uint32_t subOpcode() { return 0x10; }
1406     struct GttTypeValues {
1407         enum { Ppgtt = 1,
1408                Ggtt = 0 };
1409     };
1410     struct SurfaceTilingTypeValues {
1411         enum { YmajorS = 4,
1412                Xmajor = 2,
1413                YmajorF = 5,
1414                Linear = 0,
1415                Wmajor = 1,
1416                Ymajor = 3 };
1417     };
1418     struct ModeValues {
1419         enum { Horizontal = 1,
1420                Vertical = 0 };
1421     };
1422     struct ClearColorTypeValues {
1423         enum { Immediate = 0,
1424                Address = 1 };
1425     };
1426     struct SurfaceTypeValues {
1427         enum {
1428             SurftypeCube = 3,
1429             SurftypeStrbuf = 5,
1430             SurftypeBuffer = 4,
1431             Surftype3D = 2,
1432             Surftype2D = 1,
1433             Surftype1D = 0,
1434             SurftypeNull = 6
1435         };
1436     };
1437     struct AlgorithmValues {
1438         enum { Uncompressed = 4,
1439                Astc = 1,
1440                Lossless = 2,
1441                Media = 0,
1442                Msaa = 3 };
1443     };
1444     struct AuxSurfaceTilingTypeValues {
1445         enum { YmajorS = 4,
1446                Xmajor = 2,
1447                YmajorF = 5,
1448                Linear = 0,
1449                Wmajor = 1,
1450                Ymajor = 3 };
1451     };
1452     struct DumpTypeValues {
1453         enum { Bin = 1,
1454                Png = 4,
1455                Bmp = 0,
1456                Bmp32 = 2,
1457                Tre = 3 };
1458     };
1459     struct TiledResourceModeValues {
1460         enum { TrmodeNone = 0,
1461                TrmodeYf = 1,
1462                TrmodeYs = 2 };
1463     };
1464 };
1465 #ifndef WIN32
1466 #pragma pack()
1467 #else
1468 #pragma pack(pop)
1469 #endif
1470