File: GmmCommonExt.h

package info (click to toggle)
intel-gmmlib 20.4.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,524 kB
  • sloc: cpp: 52,910; ansic: 5,587; makefile: 6
file content (617 lines) | stat: -rw-r--r-- 22,067 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
/*==============================================================================
Copyright(c) 2017 Intel Corporation

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files(the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and / or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
============================================================================*/

#pragma once

//===========================================================================
// Macros to be defined for GMM Lib DLL
//===========================================================================
#ifdef GMM_LIB_DLL                                      /* To be defined by Clients if GMMlib needs to be in DLL/so */

#define GMM_INLINE_VIRTUAL              virtual

#define GMM_VIRTUAL                     virtual

#define GMM_INLINE_EXPORTED                                            /* Macro To avoid inlining of exported member functions in ClientÂ’s code in DLL mode*/

#ifdef _WIN32

    #ifdef GMM_LIB_DLL_EXPORTS
        #define GMM_LIB_API                     __declspec(dllexport)   /* Macro to define GMM Lib DLL exports */
    #else
        #define GMM_LIB_API                     __declspec(dllimport)       /* Macro to define GMM Lib DLL imports */
    #endif  /* GMM_LIB_DLL_EXPORTS */

#else // Linux
    #ifdef GMM_LIB_DLL_EXPORTS
        #define GMM_LIB_API                     __attribute__ ((visibility ("default")))
    #else
        #define GMM_LIB_API
    #endif
#endif

#else // !GMM_LIB_DLL

#define GMM_INLINE_VIRTUAL
#define GMM_VIRTUAL
#define GMM_LIB_API
#define GMM_INLINE_EXPORTED __inline

#endif  /* GMM_LIB_DLL */


#define INCLUDE_CpuSwizzleBlt_c_AS_HEADER
#include "../../../Utility/CpuSwizzleBlt/CpuSwizzleBlt.c"
extern const SWIZZLE_DESCRIPTOR INTEL_64KB_UNDEFINED_8bpp;
extern const SWIZZLE_DESCRIPTOR INTEL_64KB_UNDEFINED_16_32bpp;
extern const SWIZZLE_DESCRIPTOR INTEL_64KB_UNDEFINED_64_128bpp;

// Set packing alignment
#pragma pack(push, 8)

#define GMM_STDCALL             __stdcall   // GMM function calling convention
#define GMM_NO_FENCE_REG        0xDEADBEEF
#define GMM_MAX_DISPLAYS        3

#if defined __linux__
typedef void* HANDLE;
#endif

//===========================================================================
// typedef:
//      GMM_GFX_ADDRESS/etc.
//
// Description:
//     The GMM GfxAddr/Size and related types and casting functions.
//----------------------------------------------------------------------------
// Always use x64 (D3D11.2 Tiled Resources needs >32 bit gfx address space)
typedef uint64_t  GMM_GFX_ADDRESS, GMM_GFX_SIZE_T, GMM_VOIDPTR64;
#define GMM_GFX_ADDRESS_MAX ((GMM_GFX_ADDRESS) 0xffffffffffffffff)

typedef uint32_t GMM_GLOBAL_GFX_ADDRESS, GMM_GLOBAL_GFX_SIZE_T;
#define GMM_GLOBAL_GFX_ADDRESS_MAX ((GMM_GLOBAL_GFX_ADDRESS) 0xffffffff)

#ifdef _DEBUG
    #define GMM_GFX_ADDRESS_CAST(x)     \
    (                                   \
        ((x) <= GMM_GFX_ADDRESS_MAX) ?  \
            1 : __debugbreak(),         \
        (GMM_GFX_ADDRESS)(x)            \
    )
    #define GMM_GFX_SIZE_T_CAST GMM_GFX_ADDRESS_CAST

    #define GMM_GLOBAL_GFX_ADDRESS_CAST(x)      \
    (                                           \
        ((x) <= GMM_GLOBAL_GFX_ADDRESS_MAX) ?   \
            1 : __debugbreak(),                 \
        (GMM_GLOBAL_GFX_ADDRESS)(x)             \
    )
    #define GMM_GLOBAL_GFX_SIZE_T_CAST GMM_GLOBAL_GFX_ADDRESS_CAST
#else
    #define GMM_GFX_ADDRESS_CAST(x)         ((GMM_GFX_ADDRESS)(x))
    #define GMM_GFX_SIZE_T_CAST(x)          ((GMM_GFX_SIZE_T)(x))
    #define GMM_GLOBAL_GFX_ADDRESS_CAST(x)  ((GMM_GLOBAL_GFX_ADDRESS)(x))
    #define GMM_GLOBAL_GFX_SIZE_T_CAST(x)   ((GMM_GLOBAL_GFX_SIZE_T)(x))
#endif


#define GMM_GFX_ADDRESS_CANONIZE(a)     (((int64_t)(a) << (64 - 48)) >> (64 - 48)) // TODO(Minor): When GMM adds platform-dependent VA size caps, change from 48.
#define GMM_GFX_ADDRESS_DECANONIZE(a)   ((uint64_t)(a) & (((uint64_t) 1 << 48) - 1)) // "

#define GMM_BIT_RANGE(endbit, startbit)     ((endbit)-(startbit)+1)
#define GMM_BIT(bit)                        (1)

//===========================================================================
// typedef:
//      GMM_STATUS_ENUM
//
// Description:
//     Decribes GMM lib function return values
//----------------------------------------------------------------------------
typedef enum GMM_STATUS_ENUM
{
    GMM_SUCCESS,
    GMM_ERROR,
    GMM_INVALIDPARAM,
    GMM_OUT_OF_MEMORY,
} GMM_STATUS;

//===========================================================================
// typedef:
//      GMM_CLIENT
//
// Description:
//     Decribes who is linking GMM lib. Allow Kernel mode driver to detect
//     origin of resource allocations.
//----------------------------------------------------------------------------
typedef enum GMM_CLIENT_ENUM
{
    GMM_KMD_VISTA = 0,
    GMM_OGL_VISTA = 1,
    GMM_D3D9_VISTA = 2,
    GMM_D3D10_VISTA = 3,
    GMM_XP = 4,
    GMM_D3D12_VISTA = 5,
    GMM_OCL_VISTA = 6,
    GMM_VK_VISTA = 7,
    GMM_EXCITE_VISTA = 8,
    GMM_UNDEFINED_CLIENT = 9,
}GMM_CLIENT;

// Macros related to GMM_CLIENT Enum
#define USE_KMT_API(ClientType)         ((ClientType == GMM_OGL_VISTA) || (ClientType == GMM_OCL_VISTA) || (ClientType == GMM_VK_VISTA) || (ClientType == GMM_EXCITE_VISTA))
#define USE_DX12_API(ClientType)        (ClientType == GMM_D3D12_VISTA)
#define USE_DX_API(ClientType)          ((ClientType == GMM_D3D12_VISTA) || (GMM_D3D10_VISTA) || (GMM_D3D9_VISTA))

#define GET_GMM_CLIENT_TYPE(pContext, ClientType)   \
if(pContext)                                        \
{                                                   \
    ClientType = pContext->GetClientType();         \
}                                                   \
else                                                \
{                                                   \
    ClientType = GMM_UNDEFINED_CLIENT;              \
}                                                   \

//===========================================================================
// typedef:
//     GMM_TEXTURE_LAYOUT
//
// Description:
//     This enum details HW tile walk (i.e. X or Y walk)
//---------------------------------------------------------------------------
typedef enum GMM_TEXTURE_LAYOUT_REC
{
    GMM_2D_LAYOUT_BELOW = 0, // <- This should stay zero to be the default for all surfaces (including 3D, etc), since texture layout can be queried for 3D/etc surfaces. TODO: Is that querying proper behavior?!
    GMM_2D_LAYOUT_RIGHT = 1,
}GMM_TEXTURE_LAYOUT;

//===========================================================================
// typedef:
//     GMM_TILE_TYPE_ENUM
//
// Description:
//     This enum details tile walk (i.e. X or Y walk, or not tiled)
//---------------------------------------------------------------------------
typedef enum GMM_TILE_TYPE_ENUM
{
    GMM_TILED_X,
    GMM_TILED_Y,
    GMM_TILED_W,
    GMM_NOT_TILED
}GMM_TILE_TYPE;

//===========================================================================
// typedef:
//     GMM_E2E_COMPRESSION_TYPE_ENUM
//
// Description:
//     This enum details compression type (i.e. render or media compressed, or uncompressed )
//---------------------------------------------------------------------------
typedef enum GMM_E2E_COMPRESSION_TYPE_ENUM
{
    GMM_UNCOMPRESSED,
    GMM_RENDER_COMPRESSED,
    GMM_MEDIA_COMPRESSED
}GMM_E2E_COMPRESSION_TYPE;

//===========================================================================
// typedef:
//     GMM_CPU_CACHE_TYPE_ENUM
//
// Description:
//     This enum details the type of cacheable attributes for the memory
//---------------------------------------------------------------------------
typedef enum GMM_CPU_CACHE_TYPE_ENUM
{
    GMM_NOTCACHEABLE,
    GMM_CACHEABLE
}GMM_CPU_CACHE_TYPE;

//===========================================================================
// typedef:
//     GMM_GPU_CACHE_SETTINGS
//
// Description:
//     This struct details the type of cacheable attributes for the memory
//---------------------------------------------------------------------------
typedef struct GMM_GPU_CACHE_SETTINGS_REC
{
    uint32_t ELLC           : 1; // Gen7.5+
    uint32_t Age            : 2; // Gen7.5+
    uint32_t WriteThrough   : 1; // Gen7.5+
    uint32_t GFDT           : 1; // Gen6,7 (Graphics Flush Data Type)
    uint32_t L3             : 1; // Gen7+
    uint32_t LLC            : 1; // Gen6+
    uint32_t UsePteSettings : 1; // Gen6+
}GMM_GPU_CACHE_SETTINGS;

//===========================================================================
// typedef:
//     GMM_CACHE_SIZE
//
// Description:
//     This struct details the size of the L3 and EDram caches
//---------------------------------------------------------------------------
typedef struct GMM_CACHE_SIZES_REC
{
    GMM_GFX_SIZE_T TotalL3Cache;  // L3 Cache Size in Bytes
    GMM_GFX_SIZE_T TotalLLCCache; // LLC Cache Size in Bytes
    GMM_GFX_SIZE_T TotalEDRAM;    // eDRAM Size in Bytes
} GMM_CACHE_SIZES;

//------------------------------------------------------------------------
// GMM Legacy Flags
//------------------------------------------------------------------------

// GMM_TILE_W & GMM_TILE_X & GMM_TILE_Y are for internal use. Clients should use GMM_TILE_TYPE_ENUM
#define GMM_TILE_W               (__BIT(1))     // Tile W type
#define GMM_TILE_X               (__BIT(2))     // Tile X type
#define GMM_TILE_Y               (__BIT(3))     // Tile Y type

#if !defined(GHAL3D_ULT)
#define GMM_LINEAR               (__BIT(4))     // Linear type
#define GMM_TILED                (GMM_TILE_W | GMM_TILE_X | GMM_TILE_Y) // Tiled bit
#endif
#define GMM_HEAP_EXTERNAL_SYNC   (__BIT(7))     // Indicates GMM_HEAP should not use its internal sync protection.
#define GMM_UTILIZEFENCE         (__BIT(8))
#define GMM_NOT_OS_ADDR          0xA1B3C5D7

//===========================================================================
// typedef:
//     GMM_TILE_INFO
//
// Description:
//     This structure represents a tile type
//--------------------------------------------------------------------------
typedef struct GMM_TILE_INFO_REC
{
    uint32_t   LogicalTileWidth;       // width of tile in bytes
    uint32_t   LogicalTileHeight;      // Height of tile in rows [texels]
    uint32_t   LogicalTileDepth;       // Depth of tile
    uint32_t   LogicalSize;            // Size of the tile in bytes
    uint32_t   MaxPitch;               // Maximum pitch in bytes
    uint32_t   MaxMipTailStartWidth;   // Max mip tail start width in pixels
    uint32_t   MaxMipTailStartHeight;  // Max mip tail start height in rows
    uint32_t   MaxMipTailStartDepth;   // Max mip tail start depth in slices
} GMM_TILE_INFO;

//===========================================================================
// typedef:
//        GMM_CUBE_FACE_REC
//
// Description:
//     ENUM detailing cube map faces
//---------------------------------------------------------------------------
typedef enum GMM_CUBE_FACE_ENUM
{
   __GMM_CUBE_FACE_POS_X,
   __GMM_CUBE_FACE_NEG_X,
   __GMM_CUBE_FACE_POS_Y,
   __GMM_CUBE_FACE_NEG_Y,
   __GMM_CUBE_FACE_POS_Z,
   __GMM_CUBE_FACE_NEG_Z,
   __GMM_MAX_CUBE_FACE,
   __GMM_NO_CUBE_MAP,
} GMM_CUBE_FACE_ENUM;

//===========================================================================
// typedef:
//        GMM_YUV_PLANE_REC
//
// Description:
//
//--------------------------------------------------------------------------
typedef enum GMM_YUV_PLANE_ENUM
{
    GMM_NO_PLANE     = 0,
    GMM_PLANE_Y      = 1,
    GMM_PLANE_U      = 2,
    GMM_PLANE_V      = 3,
    GMM_MAX_PLANE    = 4,
    // GmmLib internal use only
    GMM_PLANE_3D_Y0  = 0,
    GMM_PLANE_3D_Y1  = 1,
    GMM_PLANE_3D_UV0 = 2,
    GMM_PLANE_3D_UV1 = 3
    // No internal use >= GMM_MAX_PLANE!
}GMM_YUV_PLANE;

//===========================================================================
// typedef:
//        GMM_RESOURCE_TYPE
//
// Description:
//     This enum describe type of resource requested
//---------------------------------------------------------------------------
typedef enum GMM_RESOURCE_TYPE_ENUM
{
    RESOURCE_INVALID,

    // User-mode use
    RESOURCE_1D,
    RESOURCE_2D,
    RESOURCE_3D,
    RESOURCE_CUBE,
    RESOURCE_SCRATCH,
    RESOURCE_BUFFER,

    //Kernel-mode use only
    RESOURCE_KMD_CHECK_START,
    RESOURCE_PRIMARY,
    RESOURCE_SHADOW,
    RESOURCE_STAGING,
    RESOURCE_CURSOR,
    RESOURCE_FBC,
    RESOURCE_PWR_CONTEXT,
    RESOURCE_PERF_DATA_QUEUE,
    RESOURCE_KMD_BUFFER,
    RESOURCE_HW_CONTEXT,
    RESOURCE_TAG_PAGE,
    RESOURCE_NNDI,
    RESOURCE_HARDWARE_MBM,
    RESOURCE_OVERLAY_DMA,
    RESOURCE_OVERLAY_INTERMEDIATE_SURFACE,
    RESOURCE_GTT_TRANSFER_REGION,
    RESOURCE_GLOBAL_BUFFER,
    RESOURCE_GDI,
    RESOURCE_NULL_CONTEXT_INDIRECT_STATE,
    RESOURCE_GFX_CLIENT_BUFFER,
    RESOURCE_KMD_CHECK_END,
    RESOURCE_SEGMENT,
    RESOURCE_IFFS_MAPTOGTT,
#if _WIN32
    RESOURCE_WGBOX_ENCODE_STATE,
    RESOURCE_WGBOX_ENCODE_DISPLAY,
    RESOURCE_WGBOX_ENCODE_REFERENCE,
    RESOURCE_WGBOX_ENCODE_TFD,
#endif
    // only used for allocation of context specific SVM Present kernels buffer
    RESOURCE_SVM_KERNELS_BUFFER,

    GMM_MAX_HW_RESOURCE_TYPE
} GMM_RESOURCE_TYPE;

//===========================================================================
// typedef:
//      GMM_RESOURCE_FORMAT
//
// Description:
//      Enumeration of GMM supported resource formats.
//---------------------------------------------------------------------------
typedef enum GMM_RESOURCE_FORMAT_ENUM
{
    GMM_FORMAT_INVALID = 0, // <-- This stays zero! (For boolean and valid range checks.)

    #define GMM_FORMAT(Name, bpe, Width, Height, Depth, IsRT, IsASTC, RcsSurfaceFormat, AuxL1eFormat, Availability) \
        GMM_FORMAT_##Name, \
        GMM_FORMAT_##Name##_TYPE = GMM_FORMAT_##Name, // TODO(Minor): Remove _TYPE suffix from every GMM_FORMAT_ reference throughout driver and delete this aliasing. (And remove the \ from the line above.)
    #include "GmmFormatTable.h"

    GMM_RESOURCE_FORMATS
} GMM_RESOURCE_FORMAT;
C_ASSERT(GMM_FORMAT_INVALID == 0); // GMM_FORMAT_INVALID needs to stay zero--How did it end-up not...?
// Legacy GMM Aliases...
#define GMM_FORMAT_UYVY     GMM_FORMAT_YCRCB_SWAPY
#define GMM_FORMAT_VYUY     GMM_FORMAT_YCRCB_SWAPUVY
#define GMM_FORMAT_YUY2     GMM_FORMAT_YCRCB_NORMAL
#define GMM_FORMAT_YVYU     GMM_FORMAT_YCRCB_SWAPUV


//===========================================================================
// typedef:
//      GMM_SURFACESTATE_FORMAT
//
// Description:
//      Enumeration of RCS SURFACE_STATE.Formats.
//---------------------------------------------------------------------------
typedef enum GMM_SURFACESTATE_FORMAT_ENUM
{
    GMM_SURFACESTATE_FORMAT_INVALID = -1, // Can't use zero since that's an actual enum value.

    #define GMM_FORMAT_INCLUDE_SURFACESTATE_FORMATS_ONLY
    #define GMM_FORMAT(Name, bpe, Width, Height, Depth, IsRT, IsASTC, RcsSurfaceFormat, AuxL1eFormat, Availability) \
        GMM_SURFACESTATE_FORMAT_##Name = RcsSurfaceFormat,
    #include "GmmFormatTable.h"
} GMM_SURFACESTATE_FORMAT;

typedef enum GMM_E2ECOMP_FORMAT_ENUM
{
    GMM_E2ECOMP_FORMAT_INVALID = 0,
    GMM_E2ECOMP_FORMAT_RGB64,       //1h - Reserved
    GMM_E2ECOMP_FORMAT_RGB32,       //2h - Reserved

    GMM_E2ECOMP_MIN_FORMAT = GMM_E2ECOMP_FORMAT_RGB32,

    GMM_E2ECOMP_FORMAT_YUY2,       //3h
    GMM_E2ECOMP_FORMAT_YCRCB_SWAPUV = GMM_E2ECOMP_FORMAT_YUY2,
    GMM_E2ECOMP_FORMAT_YCRCB_SWAPUVY = GMM_E2ECOMP_FORMAT_YUY2,
    GMM_E2ECOMP_FORMAT_YCRCB_SWAPY = GMM_E2ECOMP_FORMAT_YUY2,

    GMM_E2ECOMP_FORMAT_Y410,       //4h

    GMM_E2ECOMP_FORMAT_Y210,       //5h
    GMM_E2ECOMP_FORMAT_Y216 = GMM_E2ECOMP_FORMAT_Y210,

    GMM_E2ECOMP_FORMAT_Y416,       //6h
    GMM_E2ECOMP_FORMAT_P010,       //7h
    GMM_E2ECOMP_FORMAT_P016,       //8h
    GMM_E2ECOMP_FORMAT_AYUV,       //9h

    GMM_E2ECOMP_FORMAT_ARGB8b,     //Ah
    GMM_E2ECOMP_FORMAT_RGB5A1 = GMM_E2ECOMP_FORMAT_ARGB8b,
    GMM_E2ECOMP_FORMAT_RGBA4 = GMM_E2ECOMP_FORMAT_ARGB8b,
    GMM_E2ECOMP_FORMAT_B5G6R5 = GMM_E2ECOMP_FORMAT_ARGB8b,

    GMM_E2ECOMP_FORMAT_SWAPY,      //Bh
    GMM_E2ECOMP_FORMAT_SWAPUV,     //Ch
    GMM_E2ECOMP_FORMAT_SWAPUVY,    //Dh
    GMM_E2ECOMP_FORMAT_RGB10b,     //Eh  --Which media format is it?
    GMM_E2ECOMP_FORMAT_NV12,       //Fh

    GMM_E2ECOMP_FORMAT_RGBAFLOAT16,            //0x10h

    GMM_E2ECOMP_FORMAT_R32G32B32A32_FLOAT,     //0x11h
    GMM_E2ECOMP_FORMAT_R32G32B32A32_SINT,      //0x12h
    GMM_E2ECOMP_FORMAT_R32G32B32A32_UINT,      //0x13h
    GMM_E2ECOMP_FORMAT_R16G16B16A16_UNORM,     //0x14h
    GMM_E2ECOMP_FORMAT_R16G16B16A16_SNORM,     //0x15h
    GMM_E2ECOMP_FORMAT_R16G16B16A16_SINT,      //0x16h
    GMM_E2ECOMP_FORMAT_R16G16B16A16_UINT,      //0x17h

    GMM_E2ECOMP_FORMAT_R10G10B10A2_UNORM,      //0x18h
    GMM_E2ECOMP_FORMAT_RGB10A2 = GMM_E2ECOMP_FORMAT_R10G10B10A2_UNORM,

    GMM_E2ECOMP_FORMAT_R10G10B10FLOAT_A2_UNORM,    //0x19h
    GMM_E2ECOMP_FORMAT_R10G10B10A2_UINT,       //0x1Ah
    GMM_E2ECOMP_FORMAT_R8G8B8A8_SNORM,         //0x1Bh
    GMM_E2ECOMP_FORMAT_R8G8B8A8_SINT,          //0x1Ch
    GMM_E2ECOMP_FORMAT_R8G8B8A8_UINT,          //0x1Dh

    GMM_E2ECOMP_FORMAT_R11G11B10_FLOAT,        //0x1Eh
    GMM_E2ECOMP_FORMAT_RG11B10 = GMM_E2ECOMP_FORMAT_R11G11B10_FLOAT,

    GMM_E2ECOMP_MAX_FORMAT = GMM_E2ECOMP_FORMAT_R11G11B10_FLOAT,    //should always be equal to last format encoding

    GMM_E2ECOMP_FORMAT_RGBA = GMM_E2ECOMP_FORMAT_INVALID,
    GMM_E2ECOMP_FORMAT_R = GMM_E2ECOMP_FORMAT_INVALID,
    GMM_E2ECOMP_FORMAT_RG = GMM_E2ECOMP_FORMAT_INVALID,

} GMM_E2ECOMP_FORMAT;

//===========================================================================
// typedef:
//     GMM_TILE_WALK
//
// Description:
//     This enum details HW tile walk (i.e. X or Y walk), used to program the
//     hardware.
//---------------------------------------------------------------------------
typedef enum GMM_TILE_WALK_REC
{
    GMM_HW_TILED_X_WALK     = 0,
    GMM_HW_TILED_Y_WALK     = 1,
    GMM_HW_TILED_W_WALK     = 2,
    GMM_HW_TILED_YF_WALK    = 3,
    GMM_HW_TILED_YS_WALK    = 4,
    GMM_HW_NOT_TILED        = 5
} GMM_TILE_WALK;

//===========================================================================
// typedef:
//      GMM_DISPLAY_FRAME_ENUM
//
// Description:
//      This enum details the type of display frame (for S3D resources).
//---------------------------------------------------------------------------
typedef enum GMM_DISPLAY_FRAME_ENUM
{
    GMM_DISPLAY_BASE        = 0,   // Legacy non-S3D display resource
    GMM_DISPLAY_L           = GMM_DISPLAY_BASE,
    GMM_DISPLAY_R           = 1,
    GMM_DISPLAY_BLANK_AREA  = 2,
    GMM_DISPLAY_FRAME_MAX
} GMM_DISPLAY_FRAME;

//===========================================================================
// typedef:
//        GMM_REQ_OFFSET_INFO
//
// Description:
//     This structure is used to request offset information to a surface mip
//     level or video plane.
//---------------------------------------------------------------------------
typedef struct GMM_REQ_OFFSET_INFO_REC
{
    uint32_t               ReqRender       :1;
    uint32_t               ReqLock         :1;
    uint32_t               ReqStdLayout    :1;
    uint32_t               Reserved        :29;

    uint32_t               ArrayIndex;
    uint32_t               MipLevel;
    uint32_t               Slice;
    GMM_CUBE_FACE_ENUM  CubeFace;
    GMM_YUV_PLANE       Plane;

    GMM_DISPLAY_FRAME   Frame;

    struct
    {
        union
        {
            uint32_t               Offset;
            GMM_GFX_SIZE_T      Offset64;
        };
        uint32_t               Pitch;
        union
        {
            uint32_t               Mip0SlicePitch;
            uint32_t               Gen9PlusSlicePitch;
        };
    }                   Lock;

    struct
    {
        union
        {
            uint32_t               Offset;
            GMM_GFX_SIZE_T      Offset64;
        };
        uint32_t               XOffset;
        uint32_t               YOffset;
        uint32_t               ZOffset;
    }                   Render;

    struct
    {
        GMM_GFX_SIZE_T      Offset;
        GMM_GFX_SIZE_T      TileRowPitch;
        GMM_GFX_SIZE_T      TileDepthPitch;
    }                   StdLayout;

}GMM_REQ_OFFSET_INFO;

//===========================================================================
// typedef:
//     GMM_HW_COMMAND_STREAMER
//
// Description: Enumeration to allow callers to specify a command streamer.
//
//---------------------------------------------------------------------------
typedef enum GMM_HW_COMMAND_STREAMER_ENUM
{
    GMM_HW_COMMAND_STREAMER_NULL = 0, // <-- This stays zero.
    GMM_CS,      // Render Command Streamer
    GMM_BCS,     // Blitter (BLT) Command Streamer
    GMM_VCS,     // Video Codec (MFX) Command Streamer
    GMM_VECS,    // Video Enhancement (VEBOX) Command Streamer
    GMM_VCS2,    // Video Codec (MFX) Command Streamer 2
    GMM_COMPUTE, // Compute Only Command Streamer
    GMM_PICS,    // Pinning Command Streamer
    GMM_CAPTURE, // Capture Command Streamer
    GMM_HW_COMMAND_STREAMERS // <-- This stays last.
} GMM_HW_COMMAND_STREAMER;

// Reset packing alignment to project default
#pragma pack(pop)