110e230b6Smaya/*
210e230b6Smaya * Copyright (C) 2016 Intel Corporation
310e230b6Smaya *
410e230b6Smaya * Permission is hereby granted, free of charge, to any person obtaining a
510e230b6Smaya * copy of this software and associated documentation files (the "Software"),
610e230b6Smaya * to deal in the Software without restriction, including without limitation
710e230b6Smaya * the rights to use, copy, modify, merge, publish, distribute, sublicense,
810e230b6Smaya * and/or sell copies of the Software, and to permit persons to whom the
910e230b6Smaya * Software is furnished to do so, subject to the following conditions:
1010e230b6Smaya *
1110e230b6Smaya * The above copyright notice and this permission notice (including the next
1210e230b6Smaya * paragraph) shall be included in all copies or substantial portions of the
1310e230b6Smaya * Software.
1410e230b6Smaya *
1510e230b6Smaya * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1610e230b6Smaya * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1710e230b6Smaya * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1810e230b6Smaya * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1910e230b6Smaya * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2010e230b6Smaya * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2110e230b6Smaya * IN THE SOFTWARE.
2210e230b6Smaya */
2310e230b6Smaya
2410e230b6Smaya
2510e230b6Smaya/* Instructions, enums and structures for CNL.
2610e230b6Smaya *
2710e230b6Smaya * This file has been generated, do not hand edit.
2810e230b6Smaya */
2910e230b6Smaya
3010e230b6Smaya#ifndef GEN10_PACK_H
3110e230b6Smaya#define GEN10_PACK_H
3210e230b6Smaya
3310e230b6Smaya#include <stdio.h>
3410e230b6Smaya#include <stdint.h>
3510e230b6Smaya#include <stdbool.h>
3610e230b6Smaya#include <assert.h>
3710e230b6Smaya#include <math.h>
3810e230b6Smaya
3910e230b6Smaya#ifndef __gen_validate_value
4010e230b6Smaya#define __gen_validate_value(x)
4110e230b6Smaya#endif
4210e230b6Smaya
4310e230b6Smaya#ifndef __gen_field_functions
4410e230b6Smaya#define __gen_field_functions
4510e230b6Smaya
4610e230b6Smaya#ifdef NDEBUG
4710e230b6Smaya#define NDEBUG_UNUSED __attribute__((unused))
4810e230b6Smaya#else
4910e230b6Smaya#define NDEBUG_UNUSED
5010e230b6Smaya#endif
5110e230b6Smaya
5210e230b6Smayaunion __gen_value {
5310e230b6Smaya   float f;
5410e230b6Smaya   uint32_t dw;
5510e230b6Smaya};
5610e230b6Smaya
5710e230b6Smayastatic inline uint64_t
5810e230b6Smaya__gen_mbo(uint32_t start, uint32_t end)
5910e230b6Smaya{
6010e230b6Smaya   return (~0ull >> (64 - (end - start + 1))) << start;
6110e230b6Smaya}
6210e230b6Smaya
6310e230b6Smayastatic inline uint64_t
6410e230b6Smaya__gen_uint(uint64_t v, uint32_t start, NDEBUG_UNUSED uint32_t end)
6510e230b6Smaya{
6610e230b6Smaya   __gen_validate_value(v);
6710e230b6Smaya
6810e230b6Smaya#ifndef NDEBUG
6910e230b6Smaya   const int width = end - start + 1;
7010e230b6Smaya   if (width < 64) {
7110e230b6Smaya      const uint64_t max = (1ull << width) - 1;
7210e230b6Smaya      assert(v <= max);
7310e230b6Smaya   }
7410e230b6Smaya#endif
7510e230b6Smaya
7610e230b6Smaya   return v << start;
7710e230b6Smaya}
7810e230b6Smaya
7910e230b6Smayastatic inline uint64_t
8010e230b6Smaya__gen_sint(int64_t v, uint32_t start, uint32_t end)
8110e230b6Smaya{
8210e230b6Smaya   const int width = end - start + 1;
8310e230b6Smaya
8410e230b6Smaya   __gen_validate_value(v);
8510e230b6Smaya
8610e230b6Smaya#ifndef NDEBUG
8710e230b6Smaya   if (width < 64) {
8810e230b6Smaya      const int64_t max = (1ll << (width - 1)) - 1;
8910e230b6Smaya      const int64_t min = -(1ll << (width - 1));
9010e230b6Smaya      assert(min <= v && v <= max);
9110e230b6Smaya   }
9210e230b6Smaya#endif
9310e230b6Smaya
9410e230b6Smaya   const uint64_t mask = ~0ull >> (64 - width);
9510e230b6Smaya
9610e230b6Smaya   return (v & mask) << start;
9710e230b6Smaya}
9810e230b6Smaya
9910e230b6Smayastatic inline uint64_t
10010e230b6Smaya__gen_offset(uint64_t v, NDEBUG_UNUSED uint32_t start, NDEBUG_UNUSED uint32_t end)
10110e230b6Smaya{
10210e230b6Smaya   __gen_validate_value(v);
10310e230b6Smaya#ifndef NDEBUG
10410e230b6Smaya   uint64_t mask = (~0ull >> (64 - (end - start + 1))) << start;
10510e230b6Smaya
10610e230b6Smaya   assert((v & ~mask) == 0);
10710e230b6Smaya#endif
10810e230b6Smaya
10910e230b6Smaya   return v;
11010e230b6Smaya}
11110e230b6Smaya
11210e230b6Smayastatic inline uint32_t
11310e230b6Smaya__gen_float(float v)
11410e230b6Smaya{
11510e230b6Smaya   __gen_validate_value(v);
11610e230b6Smaya   return ((union __gen_value) { .f = (v) }).dw;
11710e230b6Smaya}
11810e230b6Smaya
11910e230b6Smayastatic inline uint64_t
12010e230b6Smaya__gen_sfixed(float v, uint32_t start, uint32_t end, uint32_t fract_bits)
12110e230b6Smaya{
12210e230b6Smaya   __gen_validate_value(v);
12310e230b6Smaya
12410e230b6Smaya   const float factor = (1 << fract_bits);
12510e230b6Smaya
12610e230b6Smaya#ifndef NDEBUG
12710e230b6Smaya   const float max = ((1 << (end - start)) - 1) / factor;
12810e230b6Smaya   const float min = -(1 << (end - start)) / factor;
12910e230b6Smaya   assert(min <= v && v <= max);
13010e230b6Smaya#endif
13110e230b6Smaya
13210e230b6Smaya   const int64_t int_val = llroundf(v * factor);
13310e230b6Smaya   const uint64_t mask = ~0ull >> (64 - (end - start + 1));
13410e230b6Smaya
13510e230b6Smaya   return (int_val & mask) << start;
13610e230b6Smaya}
13710e230b6Smaya
13810e230b6Smayastatic inline uint64_t
13910e230b6Smaya__gen_ufixed(float v, uint32_t start, NDEBUG_UNUSED uint32_t end, uint32_t fract_bits)
14010e230b6Smaya{
14110e230b6Smaya   __gen_validate_value(v);
14210e230b6Smaya
14310e230b6Smaya   const float factor = (1 << fract_bits);
14410e230b6Smaya
14510e230b6Smaya#ifndef NDEBUG
14610e230b6Smaya   const float max = ((1 << (end - start + 1)) - 1) / factor;
14710e230b6Smaya   const float min = 0.0f;
14810e230b6Smaya   assert(min <= v && v <= max);
14910e230b6Smaya#endif
15010e230b6Smaya
15110e230b6Smaya   const uint64_t uint_val = llroundf(v * factor);
15210e230b6Smaya
15310e230b6Smaya   return uint_val << start;
15410e230b6Smaya}
15510e230b6Smaya
15610e230b6Smaya#ifndef __gen_address_type
15710e230b6Smaya#error #define __gen_address_type before including this file
15810e230b6Smaya#endif
15910e230b6Smaya
16010e230b6Smaya#ifndef __gen_user_data
16110e230b6Smaya#error #define __gen_combine_address before including this file
16210e230b6Smaya#endif
16310e230b6Smaya
16410e230b6Smaya#undef NDEBUG_UNUSED
16510e230b6Smaya
16610e230b6Smaya#endif
16710e230b6Smaya
16810e230b6Smaya
16910e230b6Smayaenum GEN10_3D_Color_Buffer_Blend_Factor {
17010e230b6Smaya   BLENDFACTOR_ONE                      =      1,
17110e230b6Smaya   BLENDFACTOR_SRC_COLOR                =      2,
17210e230b6Smaya   BLENDFACTOR_SRC_ALPHA                =      3,
17310e230b6Smaya   BLENDFACTOR_DST_ALPHA                =      4,
17410e230b6Smaya   BLENDFACTOR_DST_COLOR                =      5,
17510e230b6Smaya   BLENDFACTOR_SRC_ALPHA_SATURATE       =      6,
17610e230b6Smaya   BLENDFACTOR_CONST_COLOR              =      7,
17710e230b6Smaya   BLENDFACTOR_CONST_ALPHA              =      8,
17810e230b6Smaya   BLENDFACTOR_SRC1_COLOR               =      9,
17910e230b6Smaya   BLENDFACTOR_SRC1_ALPHA               =     10,
18010e230b6Smaya   BLENDFACTOR_ZERO                     =     17,
18110e230b6Smaya   BLENDFACTOR_INV_SRC_COLOR            =     18,
18210e230b6Smaya   BLENDFACTOR_INV_SRC_ALPHA            =     19,
18310e230b6Smaya   BLENDFACTOR_INV_DST_ALPHA            =     20,
18410e230b6Smaya   BLENDFACTOR_INV_DST_COLOR            =     21,
18510e230b6Smaya   BLENDFACTOR_INV_CONST_COLOR          =     23,
18610e230b6Smaya   BLENDFACTOR_INV_CONST_ALPHA          =     24,
18710e230b6Smaya   BLENDFACTOR_INV_SRC1_COLOR           =     25,
18810e230b6Smaya   BLENDFACTOR_INV_SRC1_ALPHA           =     26,
18910e230b6Smaya};
19010e230b6Smaya
19110e230b6Smayaenum GEN10_3D_Color_Buffer_Blend_Function {
19210e230b6Smaya   BLENDFUNCTION_ADD                    =      0,
19310e230b6Smaya   BLENDFUNCTION_SUBTRACT               =      1,
19410e230b6Smaya   BLENDFUNCTION_REVERSE_SUBTRACT       =      2,
19510e230b6Smaya   BLENDFUNCTION_MIN                    =      3,
19610e230b6Smaya   BLENDFUNCTION_MAX                    =      4,
19710e230b6Smaya};
19810e230b6Smaya
19910e230b6Smayaenum GEN10_3D_Compare_Function {
20010e230b6Smaya   COMPAREFUNCTION_ALWAYS               =      0,
20110e230b6Smaya   COMPAREFUNCTION_NEVER                =      1,
20210e230b6Smaya   COMPAREFUNCTION_LESS                 =      2,
20310e230b6Smaya   COMPAREFUNCTION_EQUAL                =      3,
20410e230b6Smaya   COMPAREFUNCTION_LEQUAL               =      4,
20510e230b6Smaya   COMPAREFUNCTION_GREATER              =      5,
20610e230b6Smaya   COMPAREFUNCTION_NOTEQUAL             =      6,
20710e230b6Smaya   COMPAREFUNCTION_GEQUAL               =      7,
20810e230b6Smaya};
20910e230b6Smaya
21010e230b6Smayaenum GEN10_3D_Logic_Op_Function {
21110e230b6Smaya   LOGICOP_CLEAR                        =      0,
21210e230b6Smaya   LOGICOP_NOR                          =      1,
21310e230b6Smaya   LOGICOP_AND_INVERTED                 =      2,
21410e230b6Smaya   LOGICOP_COPY_INVERTED                =      3,
21510e230b6Smaya   LOGICOP_AND_REVERSE                  =      4,
21610e230b6Smaya   LOGICOP_INVERT                       =      5,
21710e230b6Smaya   LOGICOP_XOR                          =      6,
21810e230b6Smaya   LOGICOP_NAND                         =      7,
21910e230b6Smaya   LOGICOP_AND                          =      8,
22010e230b6Smaya   LOGICOP_EQUIV                        =      9,
22110e230b6Smaya   LOGICOP_NOOP                         =     10,
22210e230b6Smaya   LOGICOP_OR_INVERTED                  =     11,
22310e230b6Smaya   LOGICOP_COPY                         =     12,
22410e230b6Smaya   LOGICOP_OR_REVERSE                   =     13,
22510e230b6Smaya   LOGICOP_OR                           =     14,
22610e230b6Smaya   LOGICOP_SET                          =     15,
22710e230b6Smaya};
22810e230b6Smaya
22910e230b6Smayaenum GEN10_3D_Prim_Topo_Type {
23010e230b6Smaya   _3DPRIM_POINTLIST                    =      1,
23110e230b6Smaya   _3DPRIM_LINELIST                     =      2,
23210e230b6Smaya   _3DPRIM_LINESTRIP                    =      3,
23310e230b6Smaya   _3DPRIM_TRILIST                      =      4,
23410e230b6Smaya   _3DPRIM_TRISTRIP                     =      5,
23510e230b6Smaya   _3DPRIM_TRIFAN                       =      6,
23610e230b6Smaya   _3DPRIM_QUADLIST                     =      7,
23710e230b6Smaya   _3DPRIM_QUADSTRIP                    =      8,
23810e230b6Smaya   _3DPRIM_LINELIST_ADJ                 =      9,
23910e230b6Smaya   _3DPRIM_LINESTRIP_ADJ                =     10,
24010e230b6Smaya   _3DPRIM_TRILIST_ADJ                  =     11,
24110e230b6Smaya   _3DPRIM_TRISTRIP_ADJ                 =     12,
24210e230b6Smaya   _3DPRIM_TRISTRIP_REVERSE             =     13,
24310e230b6Smaya   _3DPRIM_POLYGON                      =     14,
24410e230b6Smaya   _3DPRIM_RECTLIST                     =     15,
24510e230b6Smaya   _3DPRIM_LINELOOP                     =     16,
24610e230b6Smaya   _3DPRIM_POINTLIST_BF                 =     17,
24710e230b6Smaya   _3DPRIM_LINESTRIP_CONT               =     18,
24810e230b6Smaya   _3DPRIM_LINESTRIP_BF                 =     19,
24910e230b6Smaya   _3DPRIM_LINESTRIP_CONT_BF            =     20,
25010e230b6Smaya   _3DPRIM_TRIFAN_NOSTIPPLE             =     22,
25110e230b6Smaya   _3DPRIM_PATCHLIST_1                  =     32,
25210e230b6Smaya   _3DPRIM_PATCHLIST_2                  =     33,
25310e230b6Smaya   _3DPRIM_PATCHLIST_3                  =     34,
25410e230b6Smaya   _3DPRIM_PATCHLIST_4                  =     35,
25510e230b6Smaya   _3DPRIM_PATCHLIST_5                  =     36,
25610e230b6Smaya   _3DPRIM_PATCHLIST_6                  =     37,
25710e230b6Smaya   _3DPRIM_PATCHLIST_7                  =     38,
25810e230b6Smaya   _3DPRIM_PATCHLIST_8                  =     39,
25910e230b6Smaya   _3DPRIM_PATCHLIST_9                  =     40,
26010e230b6Smaya   _3DPRIM_PATCHLIST_10                 =     41,
26110e230b6Smaya   _3DPRIM_PATCHLIST_11                 =     42,
26210e230b6Smaya   _3DPRIM_PATCHLIST_12                 =     43,
26310e230b6Smaya   _3DPRIM_PATCHLIST_13                 =     44,
26410e230b6Smaya   _3DPRIM_PATCHLIST_14                 =     45,
26510e230b6Smaya   _3DPRIM_PATCHLIST_15                 =     46,
26610e230b6Smaya   _3DPRIM_PATCHLIST_16                 =     47,
26710e230b6Smaya   _3DPRIM_PATCHLIST_17                 =     48,
26810e230b6Smaya   _3DPRIM_PATCHLIST_18                 =     49,
26910e230b6Smaya   _3DPRIM_PATCHLIST_19                 =     50,
27010e230b6Smaya   _3DPRIM_PATCHLIST_20                 =     51,
27110e230b6Smaya   _3DPRIM_PATCHLIST_21                 =     52,
27210e230b6Smaya   _3DPRIM_PATCHLIST_22                 =     53,
27310e230b6Smaya   _3DPRIM_PATCHLIST_23                 =     54,
27410e230b6Smaya   _3DPRIM_PATCHLIST_24                 =     55,
27510e230b6Smaya   _3DPRIM_PATCHLIST_25                 =     56,
27610e230b6Smaya   _3DPRIM_PATCHLIST_26                 =     57,
27710e230b6Smaya   _3DPRIM_PATCHLIST_27                 =     58,
27810e230b6Smaya   _3DPRIM_PATCHLIST_28                 =     59,
27910e230b6Smaya   _3DPRIM_PATCHLIST_29                 =     60,
28010e230b6Smaya   _3DPRIM_PATCHLIST_30                 =     61,
28110e230b6Smaya   _3DPRIM_PATCHLIST_31                 =     62,
28210e230b6Smaya   _3DPRIM_PATCHLIST_32                 =     63,
28310e230b6Smaya};
28410e230b6Smaya
28510e230b6Smayaenum GEN10_3D_Stencil_Operation {
28610e230b6Smaya   STENCILOP_KEEP                       =      0,
28710e230b6Smaya   STENCILOP_ZERO                       =      1,
28810e230b6Smaya   STENCILOP_REPLACE                    =      2,
28910e230b6Smaya   STENCILOP_INCRSAT                    =      3,
29010e230b6Smaya   STENCILOP_DECRSAT                    =      4,
29110e230b6Smaya   STENCILOP_INCR                       =      5,
29210e230b6Smaya   STENCILOP_DECR                       =      6,
29310e230b6Smaya   STENCILOP_INVERT                     =      7,
29410e230b6Smaya};
29510e230b6Smaya
29610e230b6Smayaenum GEN10_3D_Vertex_Component_Control {
29710e230b6Smaya   VFCOMP_NOSTORE                       =      0,
29810e230b6Smaya   VFCOMP_STORE_SRC                     =      1,
29910e230b6Smaya   VFCOMP_STORE_0                       =      2,
30010e230b6Smaya   VFCOMP_STORE_1_FP                    =      3,
30110e230b6Smaya   VFCOMP_STORE_1_INT                   =      4,
30210e230b6Smaya   VFCOMP_STORE_PID                     =      7,
30310e230b6Smaya};
30410e230b6Smaya
30510e230b6Smayaenum GEN10_Atomic_OPCODE {
30610e230b6Smaya   MI_ATOMIC_OP_AND                     =      1,
30710e230b6Smaya   MI_ATOMIC_OP_OR                      =      2,
30810e230b6Smaya   MI_ATOMIC_OP_XOR                     =      3,
30910e230b6Smaya   MI_ATOMIC_OP_MOVE                    =      4,
31010e230b6Smaya   MI_ATOMIC_OP_INC                     =      5,
31110e230b6Smaya   MI_ATOMIC_OP_DEC                     =      6,
31210e230b6Smaya   MI_ATOMIC_OP_ADD                     =      7,
31310e230b6Smaya   MI_ATOMIC_OP_SUB                     =      8,
31410e230b6Smaya   MI_ATOMIC_OP_RSUB                    =      9,
31510e230b6Smaya   MI_ATOMIC_OP_IMAX                    =     10,
31610e230b6Smaya   MI_ATOMIC_OP_IMIN                    =     11,
31710e230b6Smaya   MI_ATOMIC_OP_UMAX                    =     12,
31810e230b6Smaya   MI_ATOMIC_OP_UMIN                    =     13,
31910e230b6Smaya   MI_ATOMIC_OP_CMP_WR                  =     14,
32010e230b6Smaya   MI_ATOMIC_OP_PREDEC                  =     15,
32110e230b6Smaya   MI_ATOMIC_OP_AND8B                   =     33,
32210e230b6Smaya   MI_ATOMIC_OP_OR8B                    =     34,
32310e230b6Smaya   MI_ATOMIC_OP_XOR8B                   =     35,
32410e230b6Smaya   MI_ATOMIC_OP_MOVE8B                  =     36,
32510e230b6Smaya   MI_ATOMIC_OP_INC8B                   =     37,
32610e230b6Smaya   MI_ATOMIC_OP_DEC8B                   =     38,
32710e230b6Smaya   MI_ATOMIC_OP_ADD8B                   =     39,
32810e230b6Smaya   MI_ATOMIC_OP_SUB8B                   =     40,
32910e230b6Smaya   MI_ATOMIC_OP_RSUB8B                  =     41,
33010e230b6Smaya   MI_ATOMIC_OP_IMAX8B                  =     42,
33110e230b6Smaya   MI_ATOMIC_OP_IMIN8B                  =     43,
33210e230b6Smaya   MI_ATOMIC_OP_UMAX8B                  =     44,
33310e230b6Smaya   MI_ATOMIC_OP_UMIN8B                  =     45,
33410e230b6Smaya   MI_ATOMIC_OP_CMP_WR8B                =     46,
33510e230b6Smaya   MI_ATOMIC_OP_PREDEC8B                =     47,
33610e230b6Smaya   MI_ATOMIC_OP_CMP_WR16B               =     78,
33710e230b6Smaya};
33810e230b6Smaya
33910e230b6Smayaenum GEN10_Attribute_Component_Format {
34010e230b6Smaya   ACF_DISABLED                         =      0,
34110e230b6Smaya   ACF_XY                               =      1,
34210e230b6Smaya   ACF_XYZ                              =      2,
34310e230b6Smaya   ACF_XYZW                             =      3,
34410e230b6Smaya};
34510e230b6Smaya
34610e230b6Smayaenum GEN10_COMPONENT_ENABLES {
34710e230b6Smaya   CE_NONE                              =      0,
34810e230b6Smaya   CE_X                                 =      1,
34910e230b6Smaya   CE_Y                                 =      2,
35010e230b6Smaya   CE_XY                                =      3,
35110e230b6Smaya   CE_Z                                 =      4,
35210e230b6Smaya   CE_XZ                                =      5,
35310e230b6Smaya   CE_YZ                                =      6,
35410e230b6Smaya   CE_XYZ                               =      7,
35510e230b6Smaya   CE_W                                 =      8,
35610e230b6Smaya   CE_XW                                =      9,
35710e230b6Smaya   CE_YW                                =     10,
35810e230b6Smaya   CE_XYW                               =     11,
35910e230b6Smaya   CE_ZW                                =     12,
36010e230b6Smaya   CE_XZW                               =     13,
36110e230b6Smaya   CE_YZW                               =     14,
36210e230b6Smaya   CE_XYZW                              =     15,
36310e230b6Smaya};
36410e230b6Smaya
36510e230b6Smayaenum GEN10_ShaderChannelSelect {
36610e230b6Smaya   SCS_ZERO                             =      0,
36710e230b6Smaya   SCS_ONE                              =      1,
36810e230b6Smaya   SCS_RED                              =      4,
36910e230b6Smaya   SCS_GREEN                            =      5,
37010e230b6Smaya   SCS_BLUE                             =      6,
37110e230b6Smaya   SCS_ALPHA                            =      7,
37210e230b6Smaya};
37310e230b6Smaya
37410e230b6Smayaenum GEN10_TextureCoordinateMode {
37510e230b6Smaya   TCM_WRAP                             =      0,
37610e230b6Smaya   TCM_MIRROR                           =      1,
37710e230b6Smaya   TCM_CLAMP                            =      2,
37810e230b6Smaya   TCM_CUBE                             =      3,
37910e230b6Smaya   TCM_CLAMP_BORDER                     =      4,
38010e230b6Smaya   TCM_MIRROR_ONCE                      =      5,
38110e230b6Smaya   TCM_HALF_BORDER                      =      6,
38210e230b6Smaya};
38310e230b6Smaya
38410e230b6Smayaenum GEN10_WRAP_SHORTEST_ENABLE {
38510e230b6Smaya   WSE_X                                =      1,
38610e230b6Smaya   WSE_Y                                =      2,
38710e230b6Smaya   WSE_XY                               =      3,
38810e230b6Smaya   WSE_Z                                =      4,
38910e230b6Smaya   WSE_XZ                               =      5,
39010e230b6Smaya   WSE_YZ                               =      6,
39110e230b6Smaya   WSE_XYZ                              =      7,
39210e230b6Smaya   WSE_W                                =      8,
39310e230b6Smaya   WSE_XW                               =      9,
39410e230b6Smaya   WSE_YW                               =     10,
39510e230b6Smaya   WSE_XYW                              =     11,
39610e230b6Smaya   WSE_ZW                               =     12,
39710e230b6Smaya   WSE_XZW                              =     13,
39810e230b6Smaya   WSE_YZW                              =     14,
39910e230b6Smaya   WSE_XYZW                             =     15,
40010e230b6Smaya};
40110e230b6Smaya
40210e230b6Smaya#define GEN10_3DSTATE_CONSTANT_BODY_length     10
40310e230b6Smayastruct GEN10_3DSTATE_CONSTANT_BODY {
40410e230b6Smaya   uint32_t                             ReadLength[4];
40510e230b6Smaya   __gen_address_type                   Buffer[4];
40610e230b6Smaya};
40710e230b6Smaya
40810e230b6Smayastatic inline void
40910e230b6SmayaGEN10_3DSTATE_CONSTANT_BODY_pack(__attribute__((unused)) __gen_user_data *data,
41010e230b6Smaya                                 __attribute__((unused)) void * restrict dst,
41110e230b6Smaya                                 __attribute__((unused)) const struct GEN10_3DSTATE_CONSTANT_BODY * restrict values)
41210e230b6Smaya{
41310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
41410e230b6Smaya
41510e230b6Smaya   dw[0] =
41610e230b6Smaya      __gen_uint(values->ReadLength[0], 0, 15) |
41710e230b6Smaya      __gen_uint(values->ReadLength[1], 16, 31);
41810e230b6Smaya
41910e230b6Smaya   dw[1] =
42010e230b6Smaya      __gen_uint(values->ReadLength[2], 0, 15) |
42110e230b6Smaya      __gen_uint(values->ReadLength[3], 16, 31);
42210e230b6Smaya
42310e230b6Smaya   const uint64_t v2_address =
42410e230b6Smaya      __gen_combine_address(data, &dw[2], values->Buffer[0], 0);
42510e230b6Smaya   dw[2] = v2_address;
42610e230b6Smaya   dw[3] = v2_address >> 32;
42710e230b6Smaya
42810e230b6Smaya   const uint64_t v4_address =
42910e230b6Smaya      __gen_combine_address(data, &dw[4], values->Buffer[1], 0);
43010e230b6Smaya   dw[4] = v4_address;
43110e230b6Smaya   dw[5] = v4_address >> 32;
43210e230b6Smaya
43310e230b6Smaya   const uint64_t v6_address =
43410e230b6Smaya      __gen_combine_address(data, &dw[6], values->Buffer[2], 0);
43510e230b6Smaya   dw[6] = v6_address;
43610e230b6Smaya   dw[7] = v6_address >> 32;
43710e230b6Smaya
43810e230b6Smaya   const uint64_t v8_address =
43910e230b6Smaya      __gen_combine_address(data, &dw[8], values->Buffer[3], 0);
44010e230b6Smaya   dw[8] = v8_address;
44110e230b6Smaya   dw[9] = v8_address >> 32;
44210e230b6Smaya}
44310e230b6Smaya
44410e230b6Smaya#define GEN10_BINDING_TABLE_EDIT_ENTRY_length      1
44510e230b6Smayastruct GEN10_BINDING_TABLE_EDIT_ENTRY {
44610e230b6Smaya   uint64_t                             SurfaceStatePointer;
44710e230b6Smaya   uint32_t                             BindingTableIndex;
44810e230b6Smaya};
44910e230b6Smaya
45010e230b6Smayastatic inline void
45110e230b6SmayaGEN10_BINDING_TABLE_EDIT_ENTRY_pack(__attribute__((unused)) __gen_user_data *data,
45210e230b6Smaya                                    __attribute__((unused)) void * restrict dst,
45310e230b6Smaya                                    __attribute__((unused)) const struct GEN10_BINDING_TABLE_EDIT_ENTRY * restrict values)
45410e230b6Smaya{
45510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
45610e230b6Smaya
45710e230b6Smaya   dw[0] =
45810e230b6Smaya      __gen_offset(values->SurfaceStatePointer, 0, 15) |
45910e230b6Smaya      __gen_uint(values->BindingTableIndex, 16, 23);
46010e230b6Smaya}
46110e230b6Smaya
46210e230b6Smaya#define GEN10_BINDING_TABLE_STATE_length       1
46310e230b6Smayastruct GEN10_BINDING_TABLE_STATE {
46410e230b6Smaya   uint64_t                             SurfaceStatePointer;
46510e230b6Smaya};
46610e230b6Smaya
46710e230b6Smayastatic inline void
46810e230b6SmayaGEN10_BINDING_TABLE_STATE_pack(__attribute__((unused)) __gen_user_data *data,
46910e230b6Smaya                               __attribute__((unused)) void * restrict dst,
47010e230b6Smaya                               __attribute__((unused)) const struct GEN10_BINDING_TABLE_STATE * restrict values)
47110e230b6Smaya{
47210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
47310e230b6Smaya
47410e230b6Smaya   dw[0] =
47510e230b6Smaya      __gen_offset(values->SurfaceStatePointer, 6, 31);
47610e230b6Smaya}
47710e230b6Smaya
47810e230b6Smaya#define GEN10_BLEND_STATE_ENTRY_length         2
47910e230b6Smayastruct GEN10_BLEND_STATE_ENTRY {
48010e230b6Smaya   bool                                 WriteDisableBlue;
48110e230b6Smaya   bool                                 WriteDisableGreen;
48210e230b6Smaya   bool                                 WriteDisableRed;
48310e230b6Smaya   bool                                 WriteDisableAlpha;
48410e230b6Smaya   enum GEN10_3D_Color_Buffer_Blend_Function AlphaBlendFunction;
48510e230b6Smaya   enum GEN10_3D_Color_Buffer_Blend_Factor DestinationAlphaBlendFactor;
48610e230b6Smaya   enum GEN10_3D_Color_Buffer_Blend_Factor SourceAlphaBlendFactor;
48710e230b6Smaya   enum GEN10_3D_Color_Buffer_Blend_Function ColorBlendFunction;
48810e230b6Smaya   enum GEN10_3D_Color_Buffer_Blend_Factor DestinationBlendFactor;
48910e230b6Smaya   enum GEN10_3D_Color_Buffer_Blend_Factor SourceBlendFactor;
49010e230b6Smaya   bool                                 ColorBufferBlendEnable;
49110e230b6Smaya   bool                                 PostBlendColorClampEnable;
49210e230b6Smaya   bool                                 PreBlendColorClampEnable;
49310e230b6Smaya   uint32_t                             ColorClampRange;
49410e230b6Smaya#define COLORCLAMP_UNORM                         0
49510e230b6Smaya#define COLORCLAMP_SNORM                         1
49610e230b6Smaya#define COLORCLAMP_RTFORMAT                      2
49710e230b6Smaya   bool                                 PreBlendSourceOnlyClampEnable;
49810e230b6Smaya   enum GEN10_3D_Logic_Op_Function      LogicOpFunction;
49910e230b6Smaya   bool                                 LogicOpEnable;
50010e230b6Smaya};
50110e230b6Smaya
50210e230b6Smayastatic inline void
50310e230b6SmayaGEN10_BLEND_STATE_ENTRY_pack(__attribute__((unused)) __gen_user_data *data,
50410e230b6Smaya                             __attribute__((unused)) void * restrict dst,
50510e230b6Smaya                             __attribute__((unused)) const struct GEN10_BLEND_STATE_ENTRY * restrict values)
50610e230b6Smaya{
50710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
50810e230b6Smaya
50910e230b6Smaya   dw[0] =
51010e230b6Smaya      __gen_uint(values->WriteDisableBlue, 0, 0) |
51110e230b6Smaya      __gen_uint(values->WriteDisableGreen, 1, 1) |
51210e230b6Smaya      __gen_uint(values->WriteDisableRed, 2, 2) |
51310e230b6Smaya      __gen_uint(values->WriteDisableAlpha, 3, 3) |
51410e230b6Smaya      __gen_uint(values->AlphaBlendFunction, 5, 7) |
51510e230b6Smaya      __gen_uint(values->DestinationAlphaBlendFactor, 8, 12) |
51610e230b6Smaya      __gen_uint(values->SourceAlphaBlendFactor, 13, 17) |
51710e230b6Smaya      __gen_uint(values->ColorBlendFunction, 18, 20) |
51810e230b6Smaya      __gen_uint(values->DestinationBlendFactor, 21, 25) |
51910e230b6Smaya      __gen_uint(values->SourceBlendFactor, 26, 30) |
52010e230b6Smaya      __gen_uint(values->ColorBufferBlendEnable, 31, 31);
52110e230b6Smaya
52210e230b6Smaya   dw[1] =
52310e230b6Smaya      __gen_uint(values->PostBlendColorClampEnable, 0, 0) |
52410e230b6Smaya      __gen_uint(values->PreBlendColorClampEnable, 1, 1) |
52510e230b6Smaya      __gen_uint(values->ColorClampRange, 2, 3) |
52610e230b6Smaya      __gen_uint(values->PreBlendSourceOnlyClampEnable, 4, 4) |
52710e230b6Smaya      __gen_uint(values->LogicOpFunction, 27, 30) |
52810e230b6Smaya      __gen_uint(values->LogicOpEnable, 31, 31);
52910e230b6Smaya}
53010e230b6Smaya
53110e230b6Smaya#define GEN10_BLEND_STATE_length               1
53210e230b6Smayastruct GEN10_BLEND_STATE {
53310e230b6Smaya   uint32_t                             YDitherOffset;
53410e230b6Smaya   uint32_t                             XDitherOffset;
53510e230b6Smaya   bool                                 ColorDitherEnable;
53610e230b6Smaya   enum GEN10_3D_Compare_Function       AlphaTestFunction;
53710e230b6Smaya   bool                                 AlphaTestEnable;
53810e230b6Smaya   bool                                 AlphaToCoverageDitherEnable;
53910e230b6Smaya   bool                                 AlphaToOneEnable;
54010e230b6Smaya   bool                                 IndependentAlphaBlendEnable;
54110e230b6Smaya   bool                                 AlphaToCoverageEnable;
54210e230b6Smaya   /* variable length fields follow */
54310e230b6Smaya};
54410e230b6Smaya
54510e230b6Smayastatic inline void
54610e230b6SmayaGEN10_BLEND_STATE_pack(__attribute__((unused)) __gen_user_data *data,
54710e230b6Smaya                       __attribute__((unused)) void * restrict dst,
54810e230b6Smaya                       __attribute__((unused)) const struct GEN10_BLEND_STATE * restrict values)
54910e230b6Smaya{
55010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
55110e230b6Smaya
55210e230b6Smaya   dw[0] =
55310e230b6Smaya      __gen_uint(values->YDitherOffset, 19, 20) |
55410e230b6Smaya      __gen_uint(values->XDitherOffset, 21, 22) |
55510e230b6Smaya      __gen_uint(values->ColorDitherEnable, 23, 23) |
55610e230b6Smaya      __gen_uint(values->AlphaTestFunction, 24, 26) |
55710e230b6Smaya      __gen_uint(values->AlphaTestEnable, 27, 27) |
55810e230b6Smaya      __gen_uint(values->AlphaToCoverageDitherEnable, 28, 28) |
55910e230b6Smaya      __gen_uint(values->AlphaToOneEnable, 29, 29) |
56010e230b6Smaya      __gen_uint(values->IndependentAlphaBlendEnable, 30, 30) |
56110e230b6Smaya      __gen_uint(values->AlphaToCoverageEnable, 31, 31);
56210e230b6Smaya}
56310e230b6Smaya
56410e230b6Smaya#define GEN10_CC_VIEWPORT_length               2
56510e230b6Smayastruct GEN10_CC_VIEWPORT {
56610e230b6Smaya   float                                MinimumDepth;
56710e230b6Smaya   float                                MaximumDepth;
56810e230b6Smaya};
56910e230b6Smaya
57010e230b6Smayastatic inline void
57110e230b6SmayaGEN10_CC_VIEWPORT_pack(__attribute__((unused)) __gen_user_data *data,
57210e230b6Smaya                       __attribute__((unused)) void * restrict dst,
57310e230b6Smaya                       __attribute__((unused)) const struct GEN10_CC_VIEWPORT * restrict values)
57410e230b6Smaya{
57510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
57610e230b6Smaya
57710e230b6Smaya   dw[0] =
57810e230b6Smaya      __gen_float(values->MinimumDepth);
57910e230b6Smaya
58010e230b6Smaya   dw[1] =
58110e230b6Smaya      __gen_float(values->MaximumDepth);
58210e230b6Smaya}
58310e230b6Smaya
58410e230b6Smaya#define GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_length      2
58510e230b6Smayastruct GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY {
58610e230b6Smaya   float                                Table1XFilterCoefficientn2;
58710e230b6Smaya   float                                Table1YFilterCoefficientn2;
58810e230b6Smaya   float                                Table1XFilterCoefficientn3;
58910e230b6Smaya   float                                Table1YFilterCoefficientn3;
59010e230b6Smaya   float                                Table1XFilterCoefficientn4;
59110e230b6Smaya   float                                Table1YFilterCoefficientn4;
59210e230b6Smaya   float                                Table1XFilterCoefficientn5;
59310e230b6Smaya   float                                Table1YFilterCoefficientn5;
59410e230b6Smaya};
59510e230b6Smaya
59610e230b6Smayastatic inline void
59710e230b6SmayaGEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(__attribute__((unused)) __gen_user_data *data,
59810e230b6Smaya                                            __attribute__((unused)) void * restrict dst,
59910e230b6Smaya                                            __attribute__((unused)) const struct GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY * restrict values)
60010e230b6Smaya{
60110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
60210e230b6Smaya
60310e230b6Smaya   dw[0] =
60410e230b6Smaya      __gen_sfixed(values->Table1XFilterCoefficientn2, 0, 7, 6) |
60510e230b6Smaya      __gen_sfixed(values->Table1YFilterCoefficientn2, 8, 15, 6) |
60610e230b6Smaya      __gen_sfixed(values->Table1XFilterCoefficientn3, 16, 23, 6) |
60710e230b6Smaya      __gen_sfixed(values->Table1YFilterCoefficientn3, 24, 31, 6);
60810e230b6Smaya
60910e230b6Smaya   dw[1] =
61010e230b6Smaya      __gen_sfixed(values->Table1XFilterCoefficientn4, 0, 7, 6) |
61110e230b6Smaya      __gen_sfixed(values->Table1YFilterCoefficientn4, 8, 15, 6) |
61210e230b6Smaya      __gen_sfixed(values->Table1XFilterCoefficientn5, 16, 23, 6) |
61310e230b6Smaya      __gen_sfixed(values->Table1YFilterCoefficientn5, 24, 31, 6);
61410e230b6Smaya}
61510e230b6Smaya
61610e230b6Smaya#define GEN10_CLEAR_COLOR_length               8
61710e230b6Smayastruct GEN10_CLEAR_COLOR {
61810e230b6Smaya   int32_t                              RawClearColorRed;
61910e230b6Smaya   int32_t                              RawClearColorGreen;
62010e230b6Smaya   int32_t                              RawClearColorBlue;
62110e230b6Smaya   int32_t                              RawClearColorAlpha;
62210e230b6Smaya};
62310e230b6Smaya
62410e230b6Smayastatic inline void
62510e230b6SmayaGEN10_CLEAR_COLOR_pack(__attribute__((unused)) __gen_user_data *data,
62610e230b6Smaya                       __attribute__((unused)) void * restrict dst,
62710e230b6Smaya                       __attribute__((unused)) const struct GEN10_CLEAR_COLOR * restrict values)
62810e230b6Smaya{
62910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
63010e230b6Smaya
63110e230b6Smaya   dw[0] =
63210e230b6Smaya      __gen_sint(values->RawClearColorRed, 0, 31);
63310e230b6Smaya
63410e230b6Smaya   dw[1] =
63510e230b6Smaya      __gen_sint(values->RawClearColorGreen, 0, 31);
63610e230b6Smaya
63710e230b6Smaya   dw[2] =
63810e230b6Smaya      __gen_sint(values->RawClearColorBlue, 0, 31);
63910e230b6Smaya
64010e230b6Smaya   dw[3] =
64110e230b6Smaya      __gen_sint(values->RawClearColorAlpha, 0, 31);
64210e230b6Smaya
64310e230b6Smaya   dw[4] = 0;
64410e230b6Smaya
64510e230b6Smaya   dw[5] = 0;
64610e230b6Smaya
64710e230b6Smaya   dw[6] = 0;
64810e230b6Smaya
64910e230b6Smaya   dw[7] = 0;
65010e230b6Smaya}
65110e230b6Smaya
65210e230b6Smaya#define GEN10_COLOR_CALC_STATE_length          6
65310e230b6Smayastruct GEN10_COLOR_CALC_STATE {
65410e230b6Smaya   uint32_t                             AlphaTestFormat;
65510e230b6Smaya#define ALPHATEST_UNORM8                         0
65610e230b6Smaya#define ALPHATEST_FLOAT32                        1
65710e230b6Smaya   bool                                 RoundDisableFunctionDisable;
65810e230b6Smaya   uint32_t                             AlphaReferenceValueAsUNORM8;
65910e230b6Smaya   float                                AlphaReferenceValueAsFLOAT32;
66010e230b6Smaya   float                                BlendConstantColorRed;
66110e230b6Smaya   float                                BlendConstantColorGreen;
66210e230b6Smaya   float                                BlendConstantColorBlue;
66310e230b6Smaya   float                                BlendConstantColorAlpha;
66410e230b6Smaya};
66510e230b6Smaya
66610e230b6Smayastatic inline void
66710e230b6SmayaGEN10_COLOR_CALC_STATE_pack(__attribute__((unused)) __gen_user_data *data,
66810e230b6Smaya                            __attribute__((unused)) void * restrict dst,
66910e230b6Smaya                            __attribute__((unused)) const struct GEN10_COLOR_CALC_STATE * restrict values)
67010e230b6Smaya{
67110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
67210e230b6Smaya
67310e230b6Smaya   dw[0] =
67410e230b6Smaya      __gen_uint(values->AlphaTestFormat, 0, 0) |
67510e230b6Smaya      __gen_uint(values->RoundDisableFunctionDisable, 15, 15);
67610e230b6Smaya
67710e230b6Smaya   dw[1] =
67810e230b6Smaya      __gen_uint(values->AlphaReferenceValueAsUNORM8, 0, 31) |
67910e230b6Smaya      __gen_float(values->AlphaReferenceValueAsFLOAT32);
68010e230b6Smaya
68110e230b6Smaya   dw[2] =
68210e230b6Smaya      __gen_float(values->BlendConstantColorRed);
68310e230b6Smaya
68410e230b6Smaya   dw[3] =
68510e230b6Smaya      __gen_float(values->BlendConstantColorGreen);
68610e230b6Smaya
68710e230b6Smaya   dw[4] =
68810e230b6Smaya      __gen_float(values->BlendConstantColorBlue);
68910e230b6Smaya
69010e230b6Smaya   dw[5] =
69110e230b6Smaya      __gen_float(values->BlendConstantColorAlpha);
69210e230b6Smaya}
69310e230b6Smaya
69410e230b6Smaya#define GEN10_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_length      1
69510e230b6Smayastruct GEN10_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR {
69610e230b6Smaya   uint32_t                             TargetFunctionID;
69710e230b6Smaya   uint32_t                             EndOfThread;
69810e230b6Smaya#define NoTermination                            0
69910e230b6Smaya#define EOT                                      1
70010e230b6Smaya   uint32_t                             ExtendedMessageLength;
70110e230b6Smaya};
70210e230b6Smaya
70310e230b6Smayastatic inline void
70410e230b6SmayaGEN10_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR_pack(__attribute__((unused)) __gen_user_data *data,
70510e230b6Smaya                                                      __attribute__((unused)) void * restrict dst,
70610e230b6Smaya                                                      __attribute__((unused)) const struct GEN10_EXECUTION_UNIT_EXTENDED_MESSAGE_DESCRIPTOR * restrict values)
70710e230b6Smaya{
70810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
70910e230b6Smaya
71010e230b6Smaya   dw[0] =
71110e230b6Smaya      __gen_uint(values->TargetFunctionID, 0, 3) |
71210e230b6Smaya      __gen_uint(values->EndOfThread, 5, 5) |
71310e230b6Smaya      __gen_uint(values->ExtendedMessageLength, 6, 9);
71410e230b6Smaya}
71510e230b6Smaya
71610e230b6Smaya#define GEN10_FILTER_COEFFICIENT_length        1
71710e230b6Smayastruct GEN10_FILTER_COEFFICIENT {
71810e230b6Smaya   float                                FilterCoefficient;
71910e230b6Smaya};
72010e230b6Smaya
72110e230b6Smayastatic inline void
72210e230b6SmayaGEN10_FILTER_COEFFICIENT_pack(__attribute__((unused)) __gen_user_data *data,
72310e230b6Smaya                              __attribute__((unused)) void * restrict dst,
72410e230b6Smaya                              __attribute__((unused)) const struct GEN10_FILTER_COEFFICIENT * restrict values)
72510e230b6Smaya{
72610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
72710e230b6Smaya
72810e230b6Smaya   dw[0] =
72910e230b6Smaya      __gen_sfixed(values->FilterCoefficient, 0, 7, 6);
73010e230b6Smaya}
73110e230b6Smaya
73210e230b6Smaya#define GEN10_FRAMEDELTAQP_length              2
73310e230b6Smayastruct GEN10_FRAMEDELTAQP {
73410e230b6Smaya   int32_t                              FrameDeltaQP[8];
73510e230b6Smaya};
73610e230b6Smaya
73710e230b6Smayastatic inline void
73810e230b6SmayaGEN10_FRAMEDELTAQP_pack(__attribute__((unused)) __gen_user_data *data,
73910e230b6Smaya                        __attribute__((unused)) void * restrict dst,
74010e230b6Smaya                        __attribute__((unused)) const struct GEN10_FRAMEDELTAQP * restrict values)
74110e230b6Smaya{
74210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
74310e230b6Smaya
74410e230b6Smaya   dw[0] =
74510e230b6Smaya      __gen_sint(values->FrameDeltaQP[0], 0, 7) |
74610e230b6Smaya      __gen_sint(values->FrameDeltaQP[1], 8, 15) |
74710e230b6Smaya      __gen_sint(values->FrameDeltaQP[2], 16, 23) |
74810e230b6Smaya      __gen_sint(values->FrameDeltaQP[3], 24, 31);
74910e230b6Smaya
75010e230b6Smaya   dw[1] =
75110e230b6Smaya      __gen_sint(values->FrameDeltaQP[4], 0, 7) |
75210e230b6Smaya      __gen_sint(values->FrameDeltaQP[5], 8, 15) |
75310e230b6Smaya      __gen_sint(values->FrameDeltaQP[6], 16, 23) |
75410e230b6Smaya      __gen_sint(values->FrameDeltaQP[7], 24, 31);
75510e230b6Smaya}
75610e230b6Smaya
75710e230b6Smaya#define GEN10_FRAMEDELTAQPRANGE_length         2
75810e230b6Smayastruct GEN10_FRAMEDELTAQPRANGE {
75910e230b6Smaya   uint32_t                             FrameDeltaQPRange[8];
76010e230b6Smaya};
76110e230b6Smaya
76210e230b6Smayastatic inline void
76310e230b6SmayaGEN10_FRAMEDELTAQPRANGE_pack(__attribute__((unused)) __gen_user_data *data,
76410e230b6Smaya                             __attribute__((unused)) void * restrict dst,
76510e230b6Smaya                             __attribute__((unused)) const struct GEN10_FRAMEDELTAQPRANGE * restrict values)
76610e230b6Smaya{
76710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
76810e230b6Smaya
76910e230b6Smaya   dw[0] =
77010e230b6Smaya      __gen_uint(values->FrameDeltaQPRange[0], 0, 7) |
77110e230b6Smaya      __gen_uint(values->FrameDeltaQPRange[1], 8, 15) |
77210e230b6Smaya      __gen_uint(values->FrameDeltaQPRange[2], 16, 23) |
77310e230b6Smaya      __gen_uint(values->FrameDeltaQPRange[3], 24, 31);
77410e230b6Smaya
77510e230b6Smaya   dw[1] =
77610e230b6Smaya      __gen_uint(values->FrameDeltaQPRange[4], 0, 7) |
77710e230b6Smaya      __gen_uint(values->FrameDeltaQPRange[5], 8, 15) |
77810e230b6Smaya      __gen_uint(values->FrameDeltaQPRange[6], 16, 23) |
77910e230b6Smaya      __gen_uint(values->FrameDeltaQPRange[7], 24, 31);
78010e230b6Smaya}
78110e230b6Smaya
78210e230b6Smaya#define GEN10_GATHER_CONSTANT_ENTRY_length      1
78310e230b6Smayastruct GEN10_GATHER_CONSTANT_ENTRY {
78410e230b6Smaya   uint32_t                             BindingTableIndexOffset;
78510e230b6Smaya   uint32_t                             ChannelMask;
78610e230b6Smaya   uint64_t                             ConstantBufferOffset;
78710e230b6Smaya};
78810e230b6Smaya
78910e230b6Smayastatic inline void
79010e230b6SmayaGEN10_GATHER_CONSTANT_ENTRY_pack(__attribute__((unused)) __gen_user_data *data,
79110e230b6Smaya                                 __attribute__((unused)) void * restrict dst,
79210e230b6Smaya                                 __attribute__((unused)) const struct GEN10_GATHER_CONSTANT_ENTRY * restrict values)
79310e230b6Smaya{
79410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
79510e230b6Smaya
79610e230b6Smaya   dw[0] =
79710e230b6Smaya      __gen_uint(values->BindingTableIndexOffset, 0, 3) |
79810e230b6Smaya      __gen_uint(values->ChannelMask, 4, 7) |
79910e230b6Smaya      __gen_offset(values->ConstantBufferOffset, 8, 15);
80010e230b6Smaya}
80110e230b6Smaya
80210e230b6Smaya#define GEN10_HEVC_ARBITRATION_PRIORITY_length      1
80310e230b6Smayastruct GEN10_HEVC_ARBITRATION_PRIORITY {
80410e230b6Smaya   uint32_t                             Priority;
80510e230b6Smaya#define Highestpriority                          0
80610e230b6Smaya#define Secondhighestpriority                    1
80710e230b6Smaya#define Thirdhighestpriority                     2
80810e230b6Smaya#define Lowestpriority                           3
80910e230b6Smaya};
81010e230b6Smaya
81110e230b6Smayastatic inline void
81210e230b6SmayaGEN10_HEVC_ARBITRATION_PRIORITY_pack(__attribute__((unused)) __gen_user_data *data,
81310e230b6Smaya                                     __attribute__((unused)) void * restrict dst,
81410e230b6Smaya                                     __attribute__((unused)) const struct GEN10_HEVC_ARBITRATION_PRIORITY * restrict values)
81510e230b6Smaya{
81610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
81710e230b6Smaya
81810e230b6Smaya   dw[0] =
81910e230b6Smaya      __gen_uint(values->Priority, 0, 1);
82010e230b6Smaya}
82110e230b6Smaya
82210e230b6Smaya#define GEN10_MEMORYADDRESSATTRIBUTES_length      1
82310e230b6Smayastruct GEN10_MEMORYADDRESSATTRIBUTES {
82410e230b6Smaya   uint32_t                             MOCS;
82510e230b6Smaya   struct GEN10_HEVC_ARBITRATION_PRIORITY ArbitrationPriorityControl;
82610e230b6Smaya   bool                                 MemoryCompressionEnable;
82710e230b6Smaya   uint32_t                             MemoryCompressionMode;
82810e230b6Smaya   uint32_t                             RowStoreScratchBufferCacheSelect;
82910e230b6Smaya   uint32_t                             TiledResourceMode;
83010e230b6Smaya#define TRMODE_NONE                              0
83110e230b6Smaya#define TRMODE_TILEYF                            1
83210e230b6Smaya#define TRMODE_TILEYS                            2
83310e230b6Smaya};
83410e230b6Smaya
83510e230b6Smayastatic inline void
83610e230b6SmayaGEN10_MEMORYADDRESSATTRIBUTES_pack(__attribute__((unused)) __gen_user_data *data,
83710e230b6Smaya                                   __attribute__((unused)) void * restrict dst,
83810e230b6Smaya                                   __attribute__((unused)) const struct GEN10_MEMORYADDRESSATTRIBUTES * restrict values)
83910e230b6Smaya{
84010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
84110e230b6Smaya
84210e230b6Smaya   uint32_t v0_0;
84310e230b6Smaya   GEN10_HEVC_ARBITRATION_PRIORITY_pack(data, &v0_0, &values->ArbitrationPriorityControl);
84410e230b6Smaya
84510e230b6Smaya   dw[0] =
84610e230b6Smaya      __gen_uint(values->MOCS, 1, 6) |
84710e230b6Smaya      __gen_uint(v0_0, 7, 8) |
84810e230b6Smaya      __gen_uint(values->MemoryCompressionEnable, 9, 9) |
84910e230b6Smaya      __gen_uint(values->MemoryCompressionMode, 10, 10) |
85010e230b6Smaya      __gen_uint(values->RowStoreScratchBufferCacheSelect, 12, 12) |
85110e230b6Smaya      __gen_uint(values->TiledResourceMode, 13, 14);
85210e230b6Smaya}
85310e230b6Smaya
85410e230b6Smaya#define GEN10_HCP_PAK_INSERT_OBJECT_INDIRECT_PAYLOAD_length      4
85510e230b6Smayastruct GEN10_HCP_PAK_INSERT_OBJECT_INDIRECT_PAYLOAD {
85610e230b6Smaya   uint32_t                             IndirectPayloadDataSizeinbits;
85710e230b6Smaya   __gen_address_type                   IndirectPayloadBaseAddress;
85810e230b6Smaya   struct GEN10_MEMORYADDRESSATTRIBUTES IndirectPayloadBaseAddress2;
85910e230b6Smaya};
86010e230b6Smaya
86110e230b6Smayastatic inline void
86210e230b6SmayaGEN10_HCP_PAK_INSERT_OBJECT_INDIRECT_PAYLOAD_pack(__attribute__((unused)) __gen_user_data *data,
86310e230b6Smaya                                                  __attribute__((unused)) void * restrict dst,
86410e230b6Smaya                                                  __attribute__((unused)) const struct GEN10_HCP_PAK_INSERT_OBJECT_INDIRECT_PAYLOAD * restrict values)
86510e230b6Smaya{
86610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
86710e230b6Smaya
86810e230b6Smaya   dw[0] =
86910e230b6Smaya      __gen_uint(values->IndirectPayloadDataSizeinbits, 0, 31);
87010e230b6Smaya
87110e230b6Smaya   const uint64_t v1_address =
87210e230b6Smaya      __gen_combine_address(data, &dw[1], values->IndirectPayloadBaseAddress, 0);
87310e230b6Smaya   dw[1] = v1_address;
87410e230b6Smaya   dw[2] = v1_address >> 32;
87510e230b6Smaya
87610e230b6Smaya   GEN10_MEMORYADDRESSATTRIBUTES_pack(data, &dw[3], &values->IndirectPayloadBaseAddress2);
87710e230b6Smaya}
87810e230b6Smaya
87910e230b6Smaya#define GEN10_HCP_REF_LIST_ENTRY_length        1
88010e230b6Smayastruct GEN10_HCP_REF_LIST_ENTRY {
88110e230b6Smaya   uint32_t                             ReferencePicturetbValue;
88210e230b6Smaya   uint32_t                             ListEntry;
88310e230b6Smaya   uint32_t                             ChromaWeightedPrediction;
88410e230b6Smaya#define Default                                  0
88510e230b6Smaya#define Explicit                                 1
88610e230b6Smaya   uint32_t                             LumaWeightedPrediction;
88710e230b6Smaya#define Default                                  0
88810e230b6Smaya#define Explicit                                 1
88910e230b6Smaya   bool                                 LongTermReference;
89010e230b6Smaya   bool                                 FieldPic;
89110e230b6Smaya   bool                                 TopField;
89210e230b6Smaya};
89310e230b6Smaya
89410e230b6Smayastatic inline void
89510e230b6SmayaGEN10_HCP_REF_LIST_ENTRY_pack(__attribute__((unused)) __gen_user_data *data,
89610e230b6Smaya                              __attribute__((unused)) void * restrict dst,
89710e230b6Smaya                              __attribute__((unused)) const struct GEN10_HCP_REF_LIST_ENTRY * restrict values)
89810e230b6Smaya{
89910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
90010e230b6Smaya
90110e230b6Smaya   dw[0] =
90210e230b6Smaya      __gen_uint(values->ReferencePicturetbValue, 0, 7) |
90310e230b6Smaya      __gen_uint(values->ListEntry, 8, 10) |
90410e230b6Smaya      __gen_uint(values->ChromaWeightedPrediction, 11, 11) |
90510e230b6Smaya      __gen_uint(values->LumaWeightedPrediction, 12, 12) |
90610e230b6Smaya      __gen_uint(values->LongTermReference, 13, 13) |
90710e230b6Smaya      __gen_uint(values->FieldPic, 14, 14) |
90810e230b6Smaya      __gen_uint(values->TopField, 15, 15);
90910e230b6Smaya}
91010e230b6Smaya
91110e230b6Smaya#define GEN10_HCP_TILE_POSITION_IN_CTB_length      1
91210e230b6Smayastruct GEN10_HCP_TILE_POSITION_IN_CTB {
91310e230b6Smaya   uint32_t                             CtbPos0i;
91410e230b6Smaya   uint32_t                             CtbPos1i;
91510e230b6Smaya   uint32_t                             CtbPos2i;
91610e230b6Smaya   uint32_t                             CtbPos3i;
91710e230b6Smaya};
91810e230b6Smaya
91910e230b6Smayastatic inline void
92010e230b6SmayaGEN10_HCP_TILE_POSITION_IN_CTB_pack(__attribute__((unused)) __gen_user_data *data,
92110e230b6Smaya                                    __attribute__((unused)) void * restrict dst,
92210e230b6Smaya                                    __attribute__((unused)) const struct GEN10_HCP_TILE_POSITION_IN_CTB * restrict values)
92310e230b6Smaya{
92410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
92510e230b6Smaya
92610e230b6Smaya   dw[0] =
92710e230b6Smaya      __gen_uint(values->CtbPos0i, 0, 7) |
92810e230b6Smaya      __gen_uint(values->CtbPos1i, 8, 15) |
92910e230b6Smaya      __gen_uint(values->CtbPos2i, 16, 23) |
93010e230b6Smaya      __gen_uint(values->CtbPos3i, 24, 31);
93110e230b6Smaya}
93210e230b6Smaya
93310e230b6Smaya#define GEN10_HCP_WEIGHTOFFSET_CHROMA_ENTRY_length      1
93410e230b6Smayastruct GEN10_HCP_WEIGHTOFFSET_CHROMA_ENTRY {
93510e230b6Smaya   int32_t                              DeltaChromaWeightLX0;
93610e230b6Smaya   uint32_t                             ChromaOffsetLX0;
93710e230b6Smaya   int32_t                              DeltaChromaWeightLX1;
93810e230b6Smaya   uint32_t                             ChromaOffsetLX1;
93910e230b6Smaya};
94010e230b6Smaya
94110e230b6Smayastatic inline void
94210e230b6SmayaGEN10_HCP_WEIGHTOFFSET_CHROMA_ENTRY_pack(__attribute__((unused)) __gen_user_data *data,
94310e230b6Smaya                                         __attribute__((unused)) void * restrict dst,
94410e230b6Smaya                                         __attribute__((unused)) const struct GEN10_HCP_WEIGHTOFFSET_CHROMA_ENTRY * restrict values)
94510e230b6Smaya{
94610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
94710e230b6Smaya
94810e230b6Smaya   dw[0] =
94910e230b6Smaya      __gen_sint(values->DeltaChromaWeightLX0, 0, 7) |
95010e230b6Smaya      __gen_uint(values->ChromaOffsetLX0, 8, 15) |
95110e230b6Smaya      __gen_sint(values->DeltaChromaWeightLX1, 16, 23) |
95210e230b6Smaya      __gen_uint(values->ChromaOffsetLX1, 24, 31);
95310e230b6Smaya}
95410e230b6Smaya
95510e230b6Smaya#define GEN10_HCP_WEIGHTOFFSET_LUMA_ENTRY_length      1
95610e230b6Smayastruct GEN10_HCP_WEIGHTOFFSET_LUMA_ENTRY {
95710e230b6Smaya   int32_t                              DeltaLumaWeightLX;
95810e230b6Smaya   uint32_t                             LumaOffsetLX;
95910e230b6Smaya};
96010e230b6Smaya
96110e230b6Smayastatic inline void
96210e230b6SmayaGEN10_HCP_WEIGHTOFFSET_LUMA_ENTRY_pack(__attribute__((unused)) __gen_user_data *data,
96310e230b6Smaya                                       __attribute__((unused)) void * restrict dst,
96410e230b6Smaya                                       __attribute__((unused)) const struct GEN10_HCP_WEIGHTOFFSET_LUMA_ENTRY * restrict values)
96510e230b6Smaya{
96610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
96710e230b6Smaya
96810e230b6Smaya   dw[0] =
96910e230b6Smaya      __gen_sint(values->DeltaLumaWeightLX, 0, 7) |
97010e230b6Smaya      __gen_uint(values->LumaOffsetLX, 8, 15);
97110e230b6Smaya}
97210e230b6Smaya
97310e230b6Smaya#define GEN10_HEVC_VP9_RDOQ_LAMBDA_FIELDS_length      1
97410e230b6Smayastruct GEN10_HEVC_VP9_RDOQ_LAMBDA_FIELDS {
97510e230b6Smaya   uint32_t                             LambdaValue0;
97610e230b6Smaya   uint32_t                             LambdaValue1;
97710e230b6Smaya};
97810e230b6Smaya
97910e230b6Smayastatic inline void
98010e230b6SmayaGEN10_HEVC_VP9_RDOQ_LAMBDA_FIELDS_pack(__attribute__((unused)) __gen_user_data *data,
98110e230b6Smaya                                       __attribute__((unused)) void * restrict dst,
98210e230b6Smaya                                       __attribute__((unused)) const struct GEN10_HEVC_VP9_RDOQ_LAMBDA_FIELDS * restrict values)
98310e230b6Smaya{
98410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
98510e230b6Smaya
98610e230b6Smaya   dw[0] =
98710e230b6Smaya      __gen_uint(values->LambdaValue0, 0, 15) |
98810e230b6Smaya      __gen_uint(values->LambdaValue1, 16, 31);
98910e230b6Smaya}
99010e230b6Smaya
99110e230b6Smaya#define GEN10_HUC_VIRTUAL_ADDR_REGION_length      3
99210e230b6Smayastruct GEN10_HUC_VIRTUAL_ADDR_REGION {
99310e230b6Smaya   __gen_address_type                   Address;
99410e230b6Smaya   struct GEN10_MEMORYADDRESSATTRIBUTES MemoryAddressAttributes;
99510e230b6Smaya};
99610e230b6Smaya
99710e230b6Smayastatic inline void
99810e230b6SmayaGEN10_HUC_VIRTUAL_ADDR_REGION_pack(__attribute__((unused)) __gen_user_data *data,
99910e230b6Smaya                                   __attribute__((unused)) void * restrict dst,
100010e230b6Smaya                                   __attribute__((unused)) const struct GEN10_HUC_VIRTUAL_ADDR_REGION * restrict values)
100110e230b6Smaya{
100210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
100310e230b6Smaya
100410e230b6Smaya   const uint64_t v0_address =
100510e230b6Smaya      __gen_combine_address(data, &dw[0], values->Address, 0);
100610e230b6Smaya   dw[0] = v0_address;
100710e230b6Smaya   dw[1] = v0_address >> 32;
100810e230b6Smaya
100910e230b6Smaya   GEN10_MEMORYADDRESSATTRIBUTES_pack(data, &dw[2], &values->MemoryAddressAttributes);
101010e230b6Smaya}
101110e230b6Smaya
101210e230b6Smaya#define GEN10_IMAGE_STATE_COST_length          2
101310e230b6Smayastruct GEN10_IMAGE_STATE_COST {
101410e230b6Smaya   uint32_t                             MV0Cost;
101510e230b6Smaya   uint32_t                             MV1Cost;
101610e230b6Smaya   uint32_t                             MV2Cost;
101710e230b6Smaya   uint32_t                             MV3Cost;
101810e230b6Smaya   uint32_t                             MV4Cost;
101910e230b6Smaya   uint32_t                             MV5Cost;
102010e230b6Smaya   uint32_t                             MV6Cost;
102110e230b6Smaya   uint32_t                             MV7Cost;
102210e230b6Smaya};
102310e230b6Smaya
102410e230b6Smayastatic inline void
102510e230b6SmayaGEN10_IMAGE_STATE_COST_pack(__attribute__((unused)) __gen_user_data *data,
102610e230b6Smaya                            __attribute__((unused)) void * restrict dst,
102710e230b6Smaya                            __attribute__((unused)) const struct GEN10_IMAGE_STATE_COST * restrict values)
102810e230b6Smaya{
102910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
103010e230b6Smaya
103110e230b6Smaya   dw[0] =
103210e230b6Smaya      __gen_uint(values->MV0Cost, 0, 7) |
103310e230b6Smaya      __gen_uint(values->MV1Cost, 8, 15) |
103410e230b6Smaya      __gen_uint(values->MV2Cost, 16, 23) |
103510e230b6Smaya      __gen_uint(values->MV3Cost, 24, 31);
103610e230b6Smaya
103710e230b6Smaya   dw[1] =
103810e230b6Smaya      __gen_uint(values->MV4Cost, 0, 7) |
103910e230b6Smaya      __gen_uint(values->MV5Cost, 8, 15) |
104010e230b6Smaya      __gen_uint(values->MV6Cost, 16, 23) |
104110e230b6Smaya      __gen_uint(values->MV7Cost, 24, 31);
104210e230b6Smaya}
104310e230b6Smaya
104410e230b6Smaya#define GEN10_INLINE_DATA_DESCRIPTION_FOR_MFD_AVC_BSD_OBJECT_length      3
104510e230b6Smayastruct GEN10_INLINE_DATA_DESCRIPTION_FOR_MFD_AVC_BSD_OBJECT {
104610e230b6Smaya   bool                                 MBErrorConcealmentPSliceWeightPredictionDisableFlag;
104710e230b6Smaya   bool                                 MBErrorConcealmentPSliceMotionVectorsOverrideDisableFlag;
104810e230b6Smaya   bool                                 MBErrorConcealmentBSpatialWeightPredictionDisableFlag;
104910e230b6Smaya   bool                                 MBErrorConcealmentBSpatialMotionVectorsOverrideDisableFlag;
105010e230b6Smaya   uint32_t                             MBErrorConcealmentBSpatialPredictionMode;
105110e230b6Smaya   bool                                 MBHeaderErrorHandling;
105210e230b6Smaya   bool                                 EntropyErrorHandling;
105310e230b6Smaya   bool                                 MPRErrorHandling;
105410e230b6Smaya   bool                                 BSDPrematureCompleteErrorHandling;
105510e230b6Smaya   uint32_t                             ConcealmentPictureID;
105610e230b6Smaya   bool                                 MBErrorConcealmentBTemporalWeightPredictionDisable;
105710e230b6Smaya   bool                                 MBErrorConcealmentBTemporalMotionVectorsOverrideEnable;
105810e230b6Smaya   uint32_t                             MBErrorConcealmentBTemporalPredictionMode;
105910e230b6Smaya   bool                                 IntraPredMode4x48x8LumaErrorControl;
106010e230b6Smaya   bool                                 InitCurrentMBNumber;
106110e230b6Smaya   uint32_t                             ConcealmentMethod;
106210e230b6Smaya   uint32_t                             FirstMBBitOffset;
106310e230b6Smaya   bool                                 LastSlice;
106410e230b6Smaya   bool                                 EmulationPreventionBytePresent;
106510e230b6Smaya   bool                                 FixPrevMBSkipped;
106610e230b6Smaya   uint32_t                             FirstMBByteOffsetofSliceDataorSliceHeader;
106710e230b6Smaya   bool                                 IntraPredictionErrorControl;
106810e230b6Smaya   bool                                 Intra8x84x4PredictionErrorConcealmentControl;
106910e230b6Smaya   uint32_t                             BSliceTemporalInterConcealmentMode;
107010e230b6Smaya   uint32_t                             BSliceSpatialInterConcealmentMode;
107110e230b6Smaya   uint32_t                             BSliceInterDirectTypeConcealmentMode;
107210e230b6Smaya   uint32_t                             BSliceConcealmentMode;
107310e230b6Smaya#define IntraConcealment                         1
107410e230b6Smaya#define InterConcealment                         0
107510e230b6Smaya   uint32_t                             PSliceInterConcealmentMode;
107610e230b6Smaya   uint32_t                             PSliceConcealmentMode;
107710e230b6Smaya#define IntraConcealment                         1
107810e230b6Smaya#define InterConcealment                         0
107910e230b6Smaya   uint32_t                             ConcealmentReferencePictureFieldBit;
108010e230b6Smaya   uint32_t                             ISliceConcealmentMode;
108110e230b6Smaya#define IntraConcealment                         1
108210e230b6Smaya#define InterConcealment                         0
108310e230b6Smaya};
108410e230b6Smaya
108510e230b6Smayastatic inline void
108610e230b6SmayaGEN10_INLINE_DATA_DESCRIPTION_FOR_MFD_AVC_BSD_OBJECT_pack(__attribute__((unused)) __gen_user_data *data,
108710e230b6Smaya                                                          __attribute__((unused)) void * restrict dst,
108810e230b6Smaya                                                          __attribute__((unused)) const struct GEN10_INLINE_DATA_DESCRIPTION_FOR_MFD_AVC_BSD_OBJECT * restrict values)
108910e230b6Smaya{
109010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
109110e230b6Smaya
109210e230b6Smaya   dw[0] =
109310e230b6Smaya      __gen_uint(values->MBErrorConcealmentPSliceWeightPredictionDisableFlag, 0, 0) |
109410e230b6Smaya      __gen_uint(values->MBErrorConcealmentPSliceMotionVectorsOverrideDisableFlag, 1, 1) |
109510e230b6Smaya      __gen_uint(values->MBErrorConcealmentBSpatialWeightPredictionDisableFlag, 3, 3) |
109610e230b6Smaya      __gen_uint(values->MBErrorConcealmentBSpatialMotionVectorsOverrideDisableFlag, 4, 4) |
109710e230b6Smaya      __gen_uint(values->MBErrorConcealmentBSpatialPredictionMode, 6, 7) |
109810e230b6Smaya      __gen_uint(values->MBHeaderErrorHandling, 8, 8) |
109910e230b6Smaya      __gen_uint(values->EntropyErrorHandling, 10, 10) |
110010e230b6Smaya      __gen_uint(values->MPRErrorHandling, 12, 12) |
110110e230b6Smaya      __gen_uint(values->BSDPrematureCompleteErrorHandling, 14, 14) |
110210e230b6Smaya      __gen_uint(values->ConcealmentPictureID, 16, 21) |
110310e230b6Smaya      __gen_uint(values->MBErrorConcealmentBTemporalWeightPredictionDisable, 24, 24) |
110410e230b6Smaya      __gen_uint(values->MBErrorConcealmentBTemporalMotionVectorsOverrideEnable, 25, 25) |
110510e230b6Smaya      __gen_uint(values->MBErrorConcealmentBTemporalPredictionMode, 27, 28) |
110610e230b6Smaya      __gen_uint(values->IntraPredMode4x48x8LumaErrorControl, 29, 29) |
110710e230b6Smaya      __gen_uint(values->InitCurrentMBNumber, 30, 30) |
110810e230b6Smaya      __gen_uint(values->ConcealmentMethod, 31, 31);
110910e230b6Smaya
111010e230b6Smaya   dw[1] =
111110e230b6Smaya      __gen_uint(values->FirstMBBitOffset, 0, 2) |
111210e230b6Smaya      __gen_uint(values->LastSlice, 3, 3) |
111310e230b6Smaya      __gen_uint(values->EmulationPreventionBytePresent, 4, 4) |
111410e230b6Smaya      __gen_uint(values->FixPrevMBSkipped, 7, 7) |
111510e230b6Smaya      __gen_uint(values->FirstMBByteOffsetofSliceDataorSliceHeader, 16, 31);
111610e230b6Smaya
111710e230b6Smaya   dw[2] =
111810e230b6Smaya      __gen_uint(values->IntraPredictionErrorControl, 0, 0) |
111910e230b6Smaya      __gen_uint(values->Intra8x84x4PredictionErrorConcealmentControl, 1, 1) |
112010e230b6Smaya      __gen_uint(values->BSliceTemporalInterConcealmentMode, 4, 6) |
112110e230b6Smaya      __gen_uint(values->BSliceSpatialInterConcealmentMode, 8, 10) |
112210e230b6Smaya      __gen_uint(values->BSliceInterDirectTypeConcealmentMode, 12, 13) |
112310e230b6Smaya      __gen_uint(values->BSliceConcealmentMode, 15, 15) |
112410e230b6Smaya      __gen_uint(values->PSliceInterConcealmentMode, 16, 18) |
112510e230b6Smaya      __gen_uint(values->PSliceConcealmentMode, 23, 23) |
112610e230b6Smaya      __gen_uint(values->ConcealmentReferencePictureFieldBit, 24, 29) |
112710e230b6Smaya      __gen_uint(values->ISliceConcealmentMode, 31, 31);
112810e230b6Smaya}
112910e230b6Smaya
113010e230b6Smaya#define GEN10_INTERFACE_DESCRIPTOR_DATA_length      8
113110e230b6Smayastruct GEN10_INTERFACE_DESCRIPTOR_DATA {
113210e230b6Smaya   uint64_t                             KernelStartPointer;
113310e230b6Smaya   bool                                 SoftwareExceptionEnable;
113410e230b6Smaya   bool                                 MaskStackExceptionEnable;
113510e230b6Smaya   bool                                 IllegalOpcodeExceptionEnable;
113610e230b6Smaya   uint32_t                             FloatingPointMode;
113710e230b6Smaya#define IEEE754                                  0
113810e230b6Smaya#define Alternate                                1
113910e230b6Smaya   uint32_t                             ThreadPriority;
114010e230b6Smaya#define NormalPriority                           0
114110e230b6Smaya#define HighPriority                             1
114210e230b6Smaya   bool                                 SingleProgramFlow;
114310e230b6Smaya   uint32_t                             DenormMode;
114410e230b6Smaya#define Ftz                                      0
114510e230b6Smaya#define SetByKernel                              1
114610e230b6Smaya   bool                                 ThreadPreemptiondisable;
114710e230b6Smaya   uint32_t                             SamplerCount;
114810e230b6Smaya#define Nosamplersused                           0
114910e230b6Smaya#define Between1and4samplersused                 1
115010e230b6Smaya#define Between5and8samplersused                 2
115110e230b6Smaya#define Between9and12samplersused                3
115210e230b6Smaya#define Between13and16samplersused               4
115310e230b6Smaya   uint64_t                             SamplerStatePointer;
115410e230b6Smaya   uint32_t                             BindingTableEntryCount;
115510e230b6Smaya   uint64_t                             BindingTablePointer;
115610e230b6Smaya   uint32_t                             ConstantURBEntryReadOffset;
115710e230b6Smaya   uint32_t                             ConstantURBEntryReadLength;
115810e230b6Smaya   uint32_t                             NumberofThreadsinGPGPUThreadGroup;
115910e230b6Smaya   bool                                 GlobalBarrierEnable;
116010e230b6Smaya   uint32_t                             SharedLocalMemorySize;
116110e230b6Smaya#define Encodes0K                                0
116210e230b6Smaya#define Encodes1K                                1
116310e230b6Smaya#define Encodes2K                                2
116410e230b6Smaya#define Encodes4K                                3
116510e230b6Smaya#define Encodes8K                                4
116610e230b6Smaya#define Encodes16K                               5
116710e230b6Smaya#define Encodes32K                               6
116810e230b6Smaya#define Encodes64K                               7
116910e230b6Smaya   bool                                 BarrierEnable;
117010e230b6Smaya   uint32_t                             RoundingMode;
117110e230b6Smaya#define RTNE                                     0
117210e230b6Smaya#define RU                                       1
117310e230b6Smaya#define RD                                       2
117410e230b6Smaya#define RTZ                                      3
117510e230b6Smaya   uint32_t                             CrossThreadConstantDataReadLength;
117610e230b6Smaya};
117710e230b6Smaya
117810e230b6Smayastatic inline void
117910e230b6SmayaGEN10_INTERFACE_DESCRIPTOR_DATA_pack(__attribute__((unused)) __gen_user_data *data,
118010e230b6Smaya                                     __attribute__((unused)) void * restrict dst,
118110e230b6Smaya                                     __attribute__((unused)) const struct GEN10_INTERFACE_DESCRIPTOR_DATA * restrict values)
118210e230b6Smaya{
118310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
118410e230b6Smaya
118510e230b6Smaya   const uint64_t v0 =
118610e230b6Smaya      __gen_offset(values->KernelStartPointer, 6, 47);
118710e230b6Smaya   dw[0] = v0;
118810e230b6Smaya   dw[1] = v0 >> 32;
118910e230b6Smaya
119010e230b6Smaya   dw[2] =
119110e230b6Smaya      __gen_uint(values->SoftwareExceptionEnable, 7, 7) |
119210e230b6Smaya      __gen_uint(values->MaskStackExceptionEnable, 11, 11) |
119310e230b6Smaya      __gen_uint(values->IllegalOpcodeExceptionEnable, 13, 13) |
119410e230b6Smaya      __gen_uint(values->FloatingPointMode, 16, 16) |
119510e230b6Smaya      __gen_uint(values->ThreadPriority, 17, 17) |
119610e230b6Smaya      __gen_uint(values->SingleProgramFlow, 18, 18) |
119710e230b6Smaya      __gen_uint(values->DenormMode, 19, 19) |
119810e230b6Smaya      __gen_uint(values->ThreadPreemptiondisable, 20, 20);
119910e230b6Smaya
120010e230b6Smaya   dw[3] =
120110e230b6Smaya      __gen_uint(values->SamplerCount, 2, 4) |
120210e230b6Smaya      __gen_offset(values->SamplerStatePointer, 5, 31);
120310e230b6Smaya
120410e230b6Smaya   dw[4] =
120510e230b6Smaya      __gen_uint(values->BindingTableEntryCount, 0, 4) |
120610e230b6Smaya      __gen_offset(values->BindingTablePointer, 5, 15);
120710e230b6Smaya
120810e230b6Smaya   dw[5] =
120910e230b6Smaya      __gen_uint(values->ConstantURBEntryReadOffset, 0, 15) |
121010e230b6Smaya      __gen_uint(values->ConstantURBEntryReadLength, 16, 31);
121110e230b6Smaya
121210e230b6Smaya   dw[6] =
121310e230b6Smaya      __gen_uint(values->NumberofThreadsinGPGPUThreadGroup, 0, 9) |
121410e230b6Smaya      __gen_uint(values->GlobalBarrierEnable, 15, 15) |
121510e230b6Smaya      __gen_uint(values->SharedLocalMemorySize, 16, 20) |
121610e230b6Smaya      __gen_uint(values->BarrierEnable, 21, 21) |
121710e230b6Smaya      __gen_uint(values->RoundingMode, 22, 23);
121810e230b6Smaya
121910e230b6Smaya   dw[7] =
122010e230b6Smaya      __gen_uint(values->CrossThreadConstantDataReadLength, 0, 7);
122110e230b6Smaya}
122210e230b6Smaya
122310e230b6Smaya#define GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_length      4
122410e230b6Smayastruct GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY {
122510e230b6Smaya   float                                Table0XFilterCoefficientn0;
122610e230b6Smaya   float                                Table0YFilterCoefficientn0;
122710e230b6Smaya   float                                Table0XFilterCoefficientn1;
122810e230b6Smaya   float                                Table0YFilterCoefficientn1;
122910e230b6Smaya   float                                Table0XFilterCoefficientn2;
123010e230b6Smaya   float                                Table0YFilterCoefficientn2;
123110e230b6Smaya   float                                Table0XFilterCoefficientn3;
123210e230b6Smaya   float                                Table0YFilterCoefficientn3;
123310e230b6Smaya   float                                Table0XFilterCoefficientn4;
123410e230b6Smaya   float                                Table0YFilterCoefficientn4;
123510e230b6Smaya   float                                Table0XFilterCoefficientn5;
123610e230b6Smaya   float                                Table0YFilterCoefficientn5;
123710e230b6Smaya   float                                Table0XFilterCoefficientn6;
123810e230b6Smaya   float                                Table0YFilterCoefficientn6;
123910e230b6Smaya   float                                Table0XFilterCoefficientn7;
124010e230b6Smaya   float                                Table0YFilterCoefficientn7;
124110e230b6Smaya};
124210e230b6Smaya
124310e230b6Smayastatic inline void
124410e230b6SmayaGEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(__attribute__((unused)) __gen_user_data *data,
124510e230b6Smaya                                          __attribute__((unused)) void * restrict dst,
124610e230b6Smaya                                          __attribute__((unused)) const struct GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY * restrict values)
124710e230b6Smaya{
124810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
124910e230b6Smaya
125010e230b6Smaya   dw[0] =
125110e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn0, 0, 7, 6) |
125210e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn0, 8, 15, 6) |
125310e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn1, 16, 23, 6) |
125410e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn1, 24, 31, 6);
125510e230b6Smaya
125610e230b6Smaya   dw[1] =
125710e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn2, 0, 7, 6) |
125810e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn2, 8, 15, 6) |
125910e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn3, 16, 23, 6) |
126010e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn3, 24, 31, 6);
126110e230b6Smaya
126210e230b6Smaya   dw[2] =
126310e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn4, 0, 7, 6) |
126410e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn4, 8, 15, 6) |
126510e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn5, 16, 23, 6) |
126610e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn5, 24, 31, 6);
126710e230b6Smaya
126810e230b6Smaya   dw[3] =
126910e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn6, 0, 7, 6) |
127010e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn6, 8, 15, 6) |
127110e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn7, 16, 23, 6) |
127210e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn7, 24, 31, 6);
127310e230b6Smaya}
127410e230b6Smaya
127510e230b6Smaya#define GEN10_MFD_MPEG2_BSD_OBJECT_INLINE_DATA_DESCRIPTION_length      2
127610e230b6Smayastruct GEN10_MFD_MPEG2_BSD_OBJECT_INLINE_DATA_DESCRIPTION {
127710e230b6Smaya   uint32_t                             FirstMBBitOffset;
127810e230b6Smaya   bool                                 LastMB;
127910e230b6Smaya   bool                                 LastPicSlice;
128010e230b6Smaya   uint32_t                             SliceConcealmentType;
128110e230b6Smaya   uint32_t                             SliceConcealmentOverride;
128210e230b6Smaya   uint32_t                             MBCount;
128310e230b6Smaya   uint32_t                             SliceVerticalPosition;
128410e230b6Smaya   uint32_t                             SliceHorizontalPosition;
128510e230b6Smaya   uint32_t                             NextSliceHorizontalPosition;
128610e230b6Smaya   uint32_t                             NextSliceVerticalPosition;
128710e230b6Smaya   uint32_t                             QuantizerScaleCode;
128810e230b6Smaya};
128910e230b6Smaya
129010e230b6Smayastatic inline void
129110e230b6SmayaGEN10_MFD_MPEG2_BSD_OBJECT_INLINE_DATA_DESCRIPTION_pack(__attribute__((unused)) __gen_user_data *data,
129210e230b6Smaya                                                        __attribute__((unused)) void * restrict dst,
129310e230b6Smaya                                                        __attribute__((unused)) const struct GEN10_MFD_MPEG2_BSD_OBJECT_INLINE_DATA_DESCRIPTION * restrict values)
129410e230b6Smaya{
129510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
129610e230b6Smaya
129710e230b6Smaya   dw[0] =
129810e230b6Smaya      __gen_uint(values->FirstMBBitOffset, 0, 2) |
129910e230b6Smaya      __gen_uint(values->LastMB, 3, 3) |
130010e230b6Smaya      __gen_uint(values->LastPicSlice, 5, 5) |
130110e230b6Smaya      __gen_uint(values->SliceConcealmentType, 6, 6) |
130210e230b6Smaya      __gen_uint(values->SliceConcealmentOverride, 7, 7) |
130310e230b6Smaya      __gen_uint(values->MBCount, 8, 15) |
130410e230b6Smaya      __gen_uint(values->SliceVerticalPosition, 16, 23) |
130510e230b6Smaya      __gen_uint(values->SliceHorizontalPosition, 24, 31);
130610e230b6Smaya
130710e230b6Smaya   dw[1] =
130810e230b6Smaya      __gen_uint(values->NextSliceHorizontalPosition, 0, 7) |
130910e230b6Smaya      __gen_uint(values->NextSliceVerticalPosition, 8, 16) |
131010e230b6Smaya      __gen_uint(values->QuantizerScaleCode, 24, 28);
131110e230b6Smaya}
131210e230b6Smaya
131310e230b6Smaya#define GEN10_MI_MATH_ALU_INSTRUCTION_length      1
131410e230b6Smayastruct GEN10_MI_MATH_ALU_INSTRUCTION {
131510e230b6Smaya   uint32_t                             Operand2;
131610e230b6Smaya#define MI_ALU_REG0                              0
131710e230b6Smaya#define MI_ALU_REG1                              1
131810e230b6Smaya#define MI_ALU_REG2                              2
131910e230b6Smaya#define MI_ALU_REG3                              3
132010e230b6Smaya#define MI_ALU_REG4                              4
132110e230b6Smaya#define MI_ALU_REG5                              5
132210e230b6Smaya#define MI_ALU_REG6                              6
132310e230b6Smaya#define MI_ALU_REG7                              7
132410e230b6Smaya#define MI_ALU_REG8                              8
132510e230b6Smaya#define MI_ALU_REG9                              9
132610e230b6Smaya#define MI_ALU_REG10                             10
132710e230b6Smaya#define MI_ALU_REG11                             11
132810e230b6Smaya#define MI_ALU_REG12                             12
132910e230b6Smaya#define MI_ALU_REG13                             13
133010e230b6Smaya#define MI_ALU_REG14                             14
133110e230b6Smaya#define MI_ALU_REG15                             15
133210e230b6Smaya#define MI_ALU_SRCA                              32
133310e230b6Smaya#define MI_ALU_SRCB                              33
133410e230b6Smaya#define MI_ALU_ACCU                              49
133510e230b6Smaya#define MI_ALU_ZF                                50
133610e230b6Smaya#define MI_ALU_CF                                51
133710e230b6Smaya   uint32_t                             Operand1;
133810e230b6Smaya#define MI_ALU_REG0                              0
133910e230b6Smaya#define MI_ALU_REG1                              1
134010e230b6Smaya#define MI_ALU_REG2                              2
134110e230b6Smaya#define MI_ALU_REG3                              3
134210e230b6Smaya#define MI_ALU_REG4                              4
134310e230b6Smaya#define MI_ALU_REG5                              5
134410e230b6Smaya#define MI_ALU_REG6                              6
134510e230b6Smaya#define MI_ALU_REG7                              7
134610e230b6Smaya#define MI_ALU_REG8                              8
134710e230b6Smaya#define MI_ALU_REG9                              9
134810e230b6Smaya#define MI_ALU_REG10                             10
134910e230b6Smaya#define MI_ALU_REG11                             11
135010e230b6Smaya#define MI_ALU_REG12                             12
135110e230b6Smaya#define MI_ALU_REG13                             13
135210e230b6Smaya#define MI_ALU_REG14                             14
135310e230b6Smaya#define MI_ALU_REG15                             15
135410e230b6Smaya#define MI_ALU_SRCA                              32
135510e230b6Smaya#define MI_ALU_SRCB                              33
135610e230b6Smaya#define MI_ALU_ACCU                              49
135710e230b6Smaya#define MI_ALU_ZF                                50
135810e230b6Smaya#define MI_ALU_CF                                51
135910e230b6Smaya   uint32_t                             ALUOpcode;
136010e230b6Smaya#define MI_ALU_NOOP                              0
136110e230b6Smaya#define MI_ALU_LOAD                              128
136210e230b6Smaya#define MI_ALU_LOADINV                           1152
136310e230b6Smaya#define MI_ALU_LOAD0                             129
136410e230b6Smaya#define MI_ALU_LOAD1                             1153
136510e230b6Smaya#define MI_ALU_ADD                               256
136610e230b6Smaya#define MI_ALU_SUB                               257
136710e230b6Smaya#define MI_ALU_AND                               258
136810e230b6Smaya#define MI_ALU_OR                                259
136910e230b6Smaya#define MI_ALU_XOR                               260
137010e230b6Smaya#define MI_ALU_STORE                             384
137110e230b6Smaya#define MI_ALU_STOREINV                          1408
137210e230b6Smaya};
137310e230b6Smaya
137410e230b6Smayastatic inline void
137510e230b6SmayaGEN10_MI_MATH_ALU_INSTRUCTION_pack(__attribute__((unused)) __gen_user_data *data,
137610e230b6Smaya                                   __attribute__((unused)) void * restrict dst,
137710e230b6Smaya                                   __attribute__((unused)) const struct GEN10_MI_MATH_ALU_INSTRUCTION * restrict values)
137810e230b6Smaya{
137910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
138010e230b6Smaya
138110e230b6Smaya   dw[0] =
138210e230b6Smaya      __gen_uint(values->Operand2, 0, 9) |
138310e230b6Smaya      __gen_uint(values->Operand1, 10, 19) |
138410e230b6Smaya      __gen_uint(values->ALUOpcode, 20, 31);
138510e230b6Smaya}
138610e230b6Smaya
138710e230b6Smaya#define GEN10_PALETTE_ENTRY_length             1
138810e230b6Smayastruct GEN10_PALETTE_ENTRY {
138910e230b6Smaya   uint32_t                             Blue;
139010e230b6Smaya   uint32_t                             Green;
139110e230b6Smaya   uint32_t                             Red;
139210e230b6Smaya   uint32_t                             Alpha;
139310e230b6Smaya};
139410e230b6Smaya
139510e230b6Smayastatic inline void
139610e230b6SmayaGEN10_PALETTE_ENTRY_pack(__attribute__((unused)) __gen_user_data *data,
139710e230b6Smaya                         __attribute__((unused)) void * restrict dst,
139810e230b6Smaya                         __attribute__((unused)) const struct GEN10_PALETTE_ENTRY * restrict values)
139910e230b6Smaya{
140010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
140110e230b6Smaya
140210e230b6Smaya   dw[0] =
140310e230b6Smaya      __gen_uint(values->Blue, 0, 7) |
140410e230b6Smaya      __gen_uint(values->Green, 8, 15) |
140510e230b6Smaya      __gen_uint(values->Red, 16, 23) |
140610e230b6Smaya      __gen_uint(values->Alpha, 24, 31);
140710e230b6Smaya}
140810e230b6Smaya
140910e230b6Smaya#define GEN10_RENDER_SURFACE_STATE_length     16
141010e230b6Smayastruct GEN10_RENDER_SURFACE_STATE {
141110e230b6Smaya   bool                                 CubeFaceEnablePositiveZ;
141210e230b6Smaya   bool                                 CubeFaceEnableNegativeZ;
141310e230b6Smaya   bool                                 CubeFaceEnablePositiveY;
141410e230b6Smaya   bool                                 CubeFaceEnableNegativeY;
141510e230b6Smaya   bool                                 CubeFaceEnablePositiveX;
141610e230b6Smaya   bool                                 CubeFaceEnableNegativeX;
141710e230b6Smaya   uint32_t                             MediaBoundaryPixelMode;
141810e230b6Smaya#define NORMAL_MODE                              0
141910e230b6Smaya#define PROGRESSIVE_FRAME                        2
142010e230b6Smaya#define INTERLACED_FRAME                         3
142110e230b6Smaya   uint32_t                             RenderCacheReadWriteMode;
142210e230b6Smaya#define WriteOnlyCache                           0
142310e230b6Smaya#define ReadWriteCache                           1
142410e230b6Smaya   bool                                 SamplerL2BypassModeDisable;
142510e230b6Smaya   uint32_t                             VerticalLineStrideOffset;
142610e230b6Smaya   uint32_t                             VerticalLineStride;
142710e230b6Smaya   uint32_t                             TileMode;
142810e230b6Smaya#define LINEAR                                   0
142910e230b6Smaya#define WMAJOR                                   1
143010e230b6Smaya#define XMAJOR                                   2
143110e230b6Smaya#define YMAJOR                                   3
143210e230b6Smaya   uint32_t                             SurfaceHorizontalAlignment;
143310e230b6Smaya#define HALIGN4                                  1
143410e230b6Smaya#define HALIGN8                                  2
143510e230b6Smaya#define HALIGN16                                 3
143610e230b6Smaya   uint32_t                             SurfaceVerticalAlignment;
143710e230b6Smaya#define VALIGN4                                  1
143810e230b6Smaya#define VALIGN8                                  2
143910e230b6Smaya#define VALIGN16                                 3
144010e230b6Smaya   uint32_t                             SurfaceFormat;
144110e230b6Smaya   bool                                 SurfaceArray;
144210e230b6Smaya   uint32_t                             SurfaceType;
144310e230b6Smaya#define SURFTYPE_1D                              0
144410e230b6Smaya#define SURFTYPE_2D                              1
144510e230b6Smaya#define SURFTYPE_3D                              2
144610e230b6Smaya#define SURFTYPE_CUBE                            3
144710e230b6Smaya#define SURFTYPE_BUFFER                          4
144810e230b6Smaya#define SURFTYPE_STRBUF                          5
144910e230b6Smaya#define SURFTYPE_NULL                            7
145010e230b6Smaya   uint32_t                             SurfaceQPitch;
145110e230b6Smaya   float                                BaseMipLevel;
145210e230b6Smaya   uint32_t                             MOCS;
145310e230b6Smaya   uint32_t                             Width;
145410e230b6Smaya   uint32_t                             Height;
145510e230b6Smaya   uint32_t                             SurfacePitch;
145610e230b6Smaya   uint32_t                             TileAddressMappingMode;
145710e230b6Smaya#define Gen9                                     0
145810e230b6Smaya#define Gen10                                    1
145910e230b6Smaya   uint32_t                             Depth;
146010e230b6Smaya   uint32_t                             MultisamplePositionPaletteIndex;
146110e230b6Smaya   uint32_t                             NumberofMultisamples;
146210e230b6Smaya#define MULTISAMPLECOUNT_1                       0
146310e230b6Smaya#define MULTISAMPLECOUNT_2                       1
146410e230b6Smaya#define MULTISAMPLECOUNT_4                       2
146510e230b6Smaya#define MULTISAMPLECOUNT_8                       3
146610e230b6Smaya#define MULTISAMPLECOUNT_16                      4
146710e230b6Smaya   uint32_t                             MultisampledSurfaceStorageFormat;
146810e230b6Smaya#define MSFMT_MSS                                0
146910e230b6Smaya#define MSFMT_DEPTH_STENCIL                      1
147010e230b6Smaya   uint32_t                             RenderTargetViewExtent;
147110e230b6Smaya   uint32_t                             MinimumArrayElement;
147210e230b6Smaya   uint32_t                             RenderTargetAndSampleUnormRotation;
147310e230b6Smaya#define _0DEG                                    0
147410e230b6Smaya#define _90DEG                                   1
147510e230b6Smaya#define _180DEG                                  2
147610e230b6Smaya#define _270DEG                                  3
147710e230b6Smaya   bool                                 ForceNonComparisonReductionType;
147810e230b6Smaya   uint32_t                             MIPCountLOD;
147910e230b6Smaya   uint32_t                             SurfaceMinLOD;
148010e230b6Smaya   uint32_t                             MipTailStartLOD;
148110e230b6Smaya   uint32_t                             CoherencyType;
148210e230b6Smaya#define GPUcoherent                              0
148310e230b6Smaya#define IAcoherent                               1
148410e230b6Smaya   uint32_t                             TiledResourceMode;
148510e230b6Smaya#define NONE                                     0
148610e230b6Smaya#define _4KB                                     1
148710e230b6Smaya#define _64KB                                    2
148810e230b6Smaya#define TILEYF                                   1
148910e230b6Smaya#define TILEYS                                   2
149010e230b6Smaya   bool                                 EWADisableForCube;
149110e230b6Smaya   uint32_t                             YOffset;
149210e230b6Smaya   uint32_t                             XOffset;
149310e230b6Smaya   uint32_t                             AuxiliarySurfaceMode;
149410e230b6Smaya#define AUX_NONE                                 0
149510e230b6Smaya#define AUX_CCS_D                                1
149610e230b6Smaya#define AUX_APPEND                               2
149710e230b6Smaya#define AUX_HIZ                                  3
149810e230b6Smaya#define AUX_CCS_E                                5
149910e230b6Smaya   uint32_t                             YOffsetforUorUVPlane;
150010e230b6Smaya   uint32_t                             AuxiliarySurfacePitch;
150110e230b6Smaya   uint32_t                             AuxiliarySurfaceQPitch;
150210e230b6Smaya   uint32_t                             XOffsetforUorUVPlane;
150310e230b6Smaya   bool                                 SeparateUVPlaneEnable;
150410e230b6Smaya   float                                ResourceMinLOD;
150510e230b6Smaya   enum GEN10_ShaderChannelSelect       ShaderChannelSelectAlpha;
150610e230b6Smaya   enum GEN10_ShaderChannelSelect       ShaderChannelSelectBlue;
150710e230b6Smaya   enum GEN10_ShaderChannelSelect       ShaderChannelSelectGreen;
150810e230b6Smaya   enum GEN10_ShaderChannelSelect       ShaderChannelSelectRed;
150910e230b6Smaya   bool                                 MemoryCompressionEnable;
151010e230b6Smaya   uint32_t                             MemoryCompressionMode;
151110e230b6Smaya#define Horizontal                               0
151210e230b6Smaya#define Vertical                                 1
151310e230b6Smaya   __gen_address_type                   SurfaceBaseAddress;
151410e230b6Smaya   uint32_t                             QuiltWidth;
151510e230b6Smaya   uint32_t                             QuiltHeight;
151610e230b6Smaya   bool                                 ClearValueAddressEnable;
151710e230b6Smaya   __gen_address_type                   AuxiliarySurfaceBaseAddress;
151810e230b6Smaya   uint32_t                             AuxiliaryTableIndexforMediaCompressedSurface;
151910e230b6Smaya   uint32_t                             YOffsetforVPlane;
152010e230b6Smaya   uint32_t                             XOffsetforVPlane;
152110e230b6Smaya   int32_t                              RedClearColor;
152210e230b6Smaya   __gen_address_type                   ClearValueAddress;
152310e230b6Smaya   int32_t                              GreenClearColor;
152410e230b6Smaya   int32_t                              BlueClearColor;
152510e230b6Smaya   int32_t                              AlphaClearColor;
152610e230b6Smaya};
152710e230b6Smaya
152810e230b6Smayastatic inline void
152910e230b6SmayaGEN10_RENDER_SURFACE_STATE_pack(__attribute__((unused)) __gen_user_data *data,
153010e230b6Smaya                                __attribute__((unused)) void * restrict dst,
153110e230b6Smaya                                __attribute__((unused)) const struct GEN10_RENDER_SURFACE_STATE * restrict values)
153210e230b6Smaya{
153310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
153410e230b6Smaya
153510e230b6Smaya   dw[0] =
153610e230b6Smaya      __gen_uint(values->CubeFaceEnablePositiveZ, 0, 0) |
153710e230b6Smaya      __gen_uint(values->CubeFaceEnableNegativeZ, 1, 1) |
153810e230b6Smaya      __gen_uint(values->CubeFaceEnablePositiveY, 2, 2) |
153910e230b6Smaya      __gen_uint(values->CubeFaceEnableNegativeY, 3, 3) |
154010e230b6Smaya      __gen_uint(values->CubeFaceEnablePositiveX, 4, 4) |
154110e230b6Smaya      __gen_uint(values->CubeFaceEnableNegativeX, 5, 5) |
154210e230b6Smaya      __gen_uint(values->MediaBoundaryPixelMode, 6, 7) |
154310e230b6Smaya      __gen_uint(values->RenderCacheReadWriteMode, 8, 8) |
154410e230b6Smaya      __gen_uint(values->SamplerL2BypassModeDisable, 9, 9) |
154510e230b6Smaya      __gen_uint(values->VerticalLineStrideOffset, 10, 10) |
154610e230b6Smaya      __gen_uint(values->VerticalLineStride, 11, 11) |
154710e230b6Smaya      __gen_uint(values->TileMode, 12, 13) |
154810e230b6Smaya      __gen_uint(values->SurfaceHorizontalAlignment, 14, 15) |
154910e230b6Smaya      __gen_uint(values->SurfaceVerticalAlignment, 16, 17) |
155010e230b6Smaya      __gen_uint(values->SurfaceFormat, 18, 27) |
155110e230b6Smaya      __gen_uint(values->SurfaceArray, 28, 28) |
155210e230b6Smaya      __gen_uint(values->SurfaceType, 29, 31);
155310e230b6Smaya
155410e230b6Smaya   dw[1] =
155510e230b6Smaya      __gen_uint(values->SurfaceQPitch, 0, 14) |
155610e230b6Smaya      __gen_ufixed(values->BaseMipLevel, 19, 23, 1) |
155710e230b6Smaya      __gen_uint(values->MOCS, 24, 30);
155810e230b6Smaya
155910e230b6Smaya   dw[2] =
156010e230b6Smaya      __gen_uint(values->Width, 0, 13) |
156110e230b6Smaya      __gen_uint(values->Height, 16, 29);
156210e230b6Smaya
156310e230b6Smaya   dw[3] =
156410e230b6Smaya      __gen_uint(values->SurfacePitch, 0, 17) |
156510e230b6Smaya      __gen_uint(values->TileAddressMappingMode, 20, 20) |
156610e230b6Smaya      __gen_uint(values->Depth, 21, 31);
156710e230b6Smaya
156810e230b6Smaya   dw[4] =
156910e230b6Smaya      __gen_uint(values->MultisamplePositionPaletteIndex, 0, 2) |
157010e230b6Smaya      __gen_uint(values->NumberofMultisamples, 3, 5) |
157110e230b6Smaya      __gen_uint(values->MultisampledSurfaceStorageFormat, 6, 6) |
157210e230b6Smaya      __gen_uint(values->RenderTargetViewExtent, 7, 17) |
157310e230b6Smaya      __gen_uint(values->MinimumArrayElement, 18, 28) |
157410e230b6Smaya      __gen_uint(values->RenderTargetAndSampleUnormRotation, 29, 30) |
157510e230b6Smaya      __gen_uint(values->ForceNonComparisonReductionType, 31, 31);
157610e230b6Smaya
157710e230b6Smaya   dw[5] =
157810e230b6Smaya      __gen_uint(values->MIPCountLOD, 0, 3) |
157910e230b6Smaya      __gen_uint(values->SurfaceMinLOD, 4, 7) |
158010e230b6Smaya      __gen_uint(values->MipTailStartLOD, 8, 11) |
158110e230b6Smaya      __gen_uint(values->CoherencyType, 14, 14) |
158210e230b6Smaya      __gen_uint(values->TiledResourceMode, 18, 19) |
158310e230b6Smaya      __gen_uint(values->EWADisableForCube, 20, 20) |
158410e230b6Smaya      __gen_uint(values->YOffset, 21, 23) |
158510e230b6Smaya      __gen_uint(values->XOffset, 25, 31);
158610e230b6Smaya
158710e230b6Smaya   dw[6] =
158810e230b6Smaya      __gen_uint(values->AuxiliarySurfaceMode, 0, 2) |
158910e230b6Smaya      __gen_uint(values->YOffsetforUorUVPlane, 0, 13) |
159010e230b6Smaya      __gen_uint(values->AuxiliarySurfacePitch, 3, 11) |
159110e230b6Smaya      __gen_uint(values->AuxiliarySurfaceQPitch, 16, 30) |
159210e230b6Smaya      __gen_uint(values->XOffsetforUorUVPlane, 16, 29) |
159310e230b6Smaya      __gen_uint(values->SeparateUVPlaneEnable, 31, 31);
159410e230b6Smaya
159510e230b6Smaya   dw[7] =
159610e230b6Smaya      __gen_ufixed(values->ResourceMinLOD, 0, 11, 8) |
159710e230b6Smaya      __gen_uint(values->ShaderChannelSelectAlpha, 16, 18) |
159810e230b6Smaya      __gen_uint(values->ShaderChannelSelectBlue, 19, 21) |
159910e230b6Smaya      __gen_uint(values->ShaderChannelSelectGreen, 22, 24) |
160010e230b6Smaya      __gen_uint(values->ShaderChannelSelectRed, 25, 27) |
160110e230b6Smaya      __gen_uint(values->MemoryCompressionEnable, 30, 30) |
160210e230b6Smaya      __gen_uint(values->MemoryCompressionMode, 31, 31);
160310e230b6Smaya
160410e230b6Smaya   const uint64_t v8_address =
160510e230b6Smaya      __gen_combine_address(data, &dw[8], values->SurfaceBaseAddress, 0);
160610e230b6Smaya   dw[8] = v8_address;
160710e230b6Smaya   dw[9] = v8_address >> 32;
160810e230b6Smaya
160910e230b6Smaya   const uint64_t v10 =
161010e230b6Smaya      __gen_uint(values->QuiltWidth, 0, 4) |
161110e230b6Smaya      __gen_uint(values->QuiltHeight, 5, 9) |
161210e230b6Smaya      __gen_uint(values->ClearValueAddressEnable, 10, 10) |
161310e230b6Smaya      __gen_uint(values->AuxiliaryTableIndexforMediaCompressedSurface, 21, 31) |
161410e230b6Smaya      __gen_uint(values->YOffsetforVPlane, 32, 45) |
161510e230b6Smaya      __gen_uint(values->XOffsetforVPlane, 48, 61);
161610e230b6Smaya   const uint64_t v10_address =
161710e230b6Smaya      __gen_combine_address(data, &dw[10], values->AuxiliarySurfaceBaseAddress, v10);
161810e230b6Smaya   dw[10] = v10_address;
161910e230b6Smaya   dw[11] = (v10_address >> 32) | (v10 >> 32);
162010e230b6Smaya
162110e230b6Smaya   const uint64_t v12 =
162210e230b6Smaya      __gen_sint(values->RedClearColor, 0, 31) |
162310e230b6Smaya      __gen_sint(values->GreenClearColor, 32, 63);
162410e230b6Smaya   const uint64_t v12_address =
162510e230b6Smaya      __gen_combine_address(data, &dw[12], values->ClearValueAddress, v12);
162610e230b6Smaya   dw[12] = v12_address;
162710e230b6Smaya   dw[13] = (v12_address >> 32) | (v12 >> 32);
162810e230b6Smaya
162910e230b6Smaya   dw[14] =
163010e230b6Smaya      __gen_sint(values->BlueClearColor, 0, 31);
163110e230b6Smaya
163210e230b6Smaya   dw[15] =
163310e230b6Smaya      __gen_sint(values->AlphaClearColor, 0, 31);
163410e230b6Smaya}
163510e230b6Smaya
163610e230b6Smaya#define GEN10_ROUNDINGPRECISIONTABLE_3_BITS_length      1
163710e230b6Smayastruct GEN10_ROUNDINGPRECISIONTABLE_3_BITS {
163810e230b6Smaya   uint32_t                             RoundingPrecision;
163910e230b6Smaya#define _116                                     0
164010e230b6Smaya#define _216                                     1
164110e230b6Smaya#define _316                                     2
164210e230b6Smaya#define _416                                     3
164310e230b6Smaya#define _516                                     4
164410e230b6Smaya#define _616                                     5
164510e230b6Smaya#define _716                                     6
164610e230b6Smaya#define _816                                     7
164710e230b6Smaya};
164810e230b6Smaya
164910e230b6Smayastatic inline void
165010e230b6SmayaGEN10_ROUNDINGPRECISIONTABLE_3_BITS_pack(__attribute__((unused)) __gen_user_data *data,
165110e230b6Smaya                                         __attribute__((unused)) void * restrict dst,
165210e230b6Smaya                                         __attribute__((unused)) const struct GEN10_ROUNDINGPRECISIONTABLE_3_BITS * restrict values)
165310e230b6Smaya{
165410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
165510e230b6Smaya
165610e230b6Smaya   dw[0] =
165710e230b6Smaya      __gen_uint(values->RoundingPrecision, 0, 2);
165810e230b6Smaya}
165910e230b6Smaya
166010e230b6Smaya#define GEN10_SAMPLER_BORDER_COLOR_STATE_length      4
166110e230b6Smayastruct GEN10_SAMPLER_BORDER_COLOR_STATE {
166210e230b6Smaya   float                                BorderColorFloatRed;
166310e230b6Smaya   uint32_t                             BorderColor32bitRed;
166410e230b6Smaya   float                                BorderColorFloatGreen;
166510e230b6Smaya   uint32_t                             BorderColor32bitGreen;
166610e230b6Smaya   float                                BorderColorFloatBlue;
166710e230b6Smaya   uint32_t                             BorderColor32bitBlue;
166810e230b6Smaya   float                                BorderColorFloatAlpha;
166910e230b6Smaya   uint32_t                             BorderColor32bitAlpha;
167010e230b6Smaya};
167110e230b6Smaya
167210e230b6Smayastatic inline void
167310e230b6SmayaGEN10_SAMPLER_BORDER_COLOR_STATE_pack(__attribute__((unused)) __gen_user_data *data,
167410e230b6Smaya                                      __attribute__((unused)) void * restrict dst,
167510e230b6Smaya                                      __attribute__((unused)) const struct GEN10_SAMPLER_BORDER_COLOR_STATE * restrict values)
167610e230b6Smaya{
167710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
167810e230b6Smaya
167910e230b6Smaya   dw[0] =
168010e230b6Smaya      __gen_float(values->BorderColorFloatRed) |
168110e230b6Smaya      __gen_uint(values->BorderColor32bitRed, 0, 31);
168210e230b6Smaya
168310e230b6Smaya   dw[1] =
168410e230b6Smaya      __gen_float(values->BorderColorFloatGreen) |
168510e230b6Smaya      __gen_uint(values->BorderColor32bitGreen, 0, 31);
168610e230b6Smaya
168710e230b6Smaya   dw[2] =
168810e230b6Smaya      __gen_float(values->BorderColorFloatBlue) |
168910e230b6Smaya      __gen_uint(values->BorderColor32bitBlue, 0, 31);
169010e230b6Smaya
169110e230b6Smaya   dw[3] =
169210e230b6Smaya      __gen_float(values->BorderColorFloatAlpha) |
169310e230b6Smaya      __gen_uint(values->BorderColor32bitAlpha, 0, 31);
169410e230b6Smaya}
169510e230b6Smaya
169610e230b6Smaya#define GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_length      4
169710e230b6Smayastruct GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR {
169810e230b6Smaya   int32_t                              BorderColorRedAsS31;
169910e230b6Smaya   uint32_t                             BorderColorRedAsU32;
170010e230b6Smaya   float                                BorderColorRedAsFloat;
170110e230b6Smaya   uint32_t                             BorderColorRedAsU8;
170210e230b6Smaya   uint32_t                             BorderColorGreenAsU8;
170310e230b6Smaya   uint32_t                             BorderColorBlueAsU8;
170410e230b6Smaya   uint32_t                             BorderColorAlphaAsU8;
170510e230b6Smaya   int32_t                              BorderColorGreenAsS31;
170610e230b6Smaya   uint32_t                             BorderColorGreenAsU32;
170710e230b6Smaya   float                                BorderColorGreenAsFloat;
170810e230b6Smaya   int32_t                              BorderColorBlueAsS31;
170910e230b6Smaya   uint32_t                             BorderColorBlueAsU32;
171010e230b6Smaya   float                                BorderColorBlueAsFloat;
171110e230b6Smaya   int32_t                              BorderColorAlphaAsS31;
171210e230b6Smaya   uint32_t                             BorderColorAlphaAsU32;
171310e230b6Smaya   float                                BorderColorAlphaAsFloat;
171410e230b6Smaya};
171510e230b6Smaya
171610e230b6Smayastatic inline void
171710e230b6SmayaGEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR_pack(__attribute__((unused)) __gen_user_data *data,
171810e230b6Smaya                                               __attribute__((unused)) void * restrict dst,
171910e230b6Smaya                                               __attribute__((unused)) const struct GEN10_SAMPLER_INDIRECT_STATE_BORDER_COLOR * restrict values)
172010e230b6Smaya{
172110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
172210e230b6Smaya
172310e230b6Smaya   dw[0] =
172410e230b6Smaya      __gen_sint(values->BorderColorRedAsS31, 0, 31) |
172510e230b6Smaya      __gen_uint(values->BorderColorRedAsU32, 0, 31) |
172610e230b6Smaya      __gen_float(values->BorderColorRedAsFloat) |
172710e230b6Smaya      __gen_uint(values->BorderColorRedAsU8, 0, 7) |
172810e230b6Smaya      __gen_uint(values->BorderColorGreenAsU8, 8, 15) |
172910e230b6Smaya      __gen_uint(values->BorderColorBlueAsU8, 16, 23) |
173010e230b6Smaya      __gen_uint(values->BorderColorAlphaAsU8, 24, 31);
173110e230b6Smaya
173210e230b6Smaya   dw[1] =
173310e230b6Smaya      __gen_sint(values->BorderColorGreenAsS31, 0, 31) |
173410e230b6Smaya      __gen_uint(values->BorderColorGreenAsU32, 0, 31) |
173510e230b6Smaya      __gen_float(values->BorderColorGreenAsFloat);
173610e230b6Smaya
173710e230b6Smaya   dw[2] =
173810e230b6Smaya      __gen_sint(values->BorderColorBlueAsS31, 0, 31) |
173910e230b6Smaya      __gen_uint(values->BorderColorBlueAsU32, 0, 31) |
174010e230b6Smaya      __gen_float(values->BorderColorBlueAsFloat);
174110e230b6Smaya
174210e230b6Smaya   dw[3] =
174310e230b6Smaya      __gen_sint(values->BorderColorAlphaAsS31, 0, 31) |
174410e230b6Smaya      __gen_uint(values->BorderColorAlphaAsU32, 0, 31) |
174510e230b6Smaya      __gen_float(values->BorderColorAlphaAsFloat);
174610e230b6Smaya}
174710e230b6Smaya
174810e230b6Smaya#define GEN10_SAMPLER_STATE_length             4
174910e230b6Smayastruct GEN10_SAMPLER_STATE {
175010e230b6Smaya   uint32_t                             AnisotropicAlgorithm;
175110e230b6Smaya#define LEGACY                                   0
175210e230b6Smaya#define EWAApproximation                         1
175310e230b6Smaya   float                                TextureLODBias;
175410e230b6Smaya   uint32_t                             MinModeFilter;
175510e230b6Smaya#define MAPFILTER_NEAREST                        0
175610e230b6Smaya#define MAPFILTER_LINEAR                         1
175710e230b6Smaya#define MAPFILTER_ANISOTROPIC                    2
175810e230b6Smaya#define MAPFILTER_MONO                           6
175910e230b6Smaya   uint32_t                             MagModeFilter;
176010e230b6Smaya#define MAPFILTER_NEAREST                        0
176110e230b6Smaya#define MAPFILTER_LINEAR                         1
176210e230b6Smaya#define MAPFILTER_ANISOTROPIC                    2
176310e230b6Smaya#define MAPFILTER_MONO                           6
176410e230b6Smaya   uint32_t                             MipModeFilter;
176510e230b6Smaya#define MIPFILTER_NONE                           0
176610e230b6Smaya#define MIPFILTER_NEAREST                        1
176710e230b6Smaya#define MIPFILTER_LINEAR                         3
176810e230b6Smaya   uint32_t                             CoarseLODQualityMode;
176910e230b6Smaya   uint32_t                             LODPreClampMode;
177010e230b6Smaya#define CLAMP_MODE_NONE                          0
177110e230b6Smaya#define CLAMP_MODE_OGL                           2
177210e230b6Smaya   uint32_t                             TextureBorderColorMode;
177310e230b6Smaya#define DX10OGL                                  0
177410e230b6Smaya#define DX9                                      1
177510e230b6Smaya   bool                                 SamplerDisable;
177610e230b6Smaya   uint32_t                             CubeSurfaceControlMode;
177710e230b6Smaya#define PROGRAMMED                               0
177810e230b6Smaya#define OVERRIDE                                 1
177910e230b6Smaya   uint32_t                             ShadowFunction;
178010e230b6Smaya#define PREFILTEROPALWAYS                        0
178110e230b6Smaya#define PREFILTEROPNEVER                         1
178210e230b6Smaya#define PREFILTEROPLESS                          2
178310e230b6Smaya#define PREFILTEROPEQUAL                         3
178410e230b6Smaya#define PREFILTEROPLEQUAL                        4
178510e230b6Smaya#define PREFILTEROPGREATER                       5
178610e230b6Smaya#define PREFILTEROPNOTEQUAL                      6
178710e230b6Smaya#define PREFILTEROPGEQUAL                        7
178810e230b6Smaya   uint32_t                             ChromaKeyMode;
178910e230b6Smaya#define KEYFILTER_KILL_ON_ANY_MATCH              0
179010e230b6Smaya#define KEYFILTER_REPLACE_BLACK                  1
179110e230b6Smaya   uint32_t                             ChromaKeyIndex;
179210e230b6Smaya   bool                                 ChromaKeyEnable;
179310e230b6Smaya   float                                MaxLOD;
179410e230b6Smaya   float                                MinLOD;
179510e230b6Smaya   uint32_t                             LODClampMagnificationMode;
179610e230b6Smaya#define MIPNONE                                  0
179710e230b6Smaya#define MIPFILTER                                1
179810e230b6Smaya   bool                                 Forcegather4Behavior;
179910e230b6Smaya   uint64_t                             BorderColorPointer;
180010e230b6Smaya   enum GEN10_TextureCoordinateMode     TCZAddressControlMode;
180110e230b6Smaya   enum GEN10_TextureCoordinateMode     TCYAddressControlMode;
180210e230b6Smaya   enum GEN10_TextureCoordinateMode     TCXAddressControlMode;
180310e230b6Smaya   bool                                 ReductionTypeEnable;
180410e230b6Smaya   bool                                 NonnormalizedCoordinateEnable;
180510e230b6Smaya   uint32_t                             TrilinearFilterQuality;
180610e230b6Smaya#define FULL                                     0
180710e230b6Smaya#define HIGH                                     1
180810e230b6Smaya#define MED                                      2
180910e230b6Smaya#define LOW                                      3
181010e230b6Smaya   bool                                 RAddressMinFilterRoundingEnable;
181110e230b6Smaya   bool                                 RAddressMagFilterRoundingEnable;
181210e230b6Smaya   bool                                 VAddressMinFilterRoundingEnable;
181310e230b6Smaya   bool                                 VAddressMagFilterRoundingEnable;
181410e230b6Smaya   bool                                 UAddressMinFilterRoundingEnable;
181510e230b6Smaya   bool                                 UAddressMagFilterRoundingEnable;
181610e230b6Smaya   uint32_t                             MaximumAnisotropy;
181710e230b6Smaya#define RATIO21                                  0
181810e230b6Smaya#define RATIO41                                  1
181910e230b6Smaya#define RATIO61                                  2
182010e230b6Smaya#define RATIO81                                  3
182110e230b6Smaya#define RATIO101                                 4
182210e230b6Smaya#define RATIO121                                 5
182310e230b6Smaya#define RATIO141                                 6
182410e230b6Smaya#define RATIO161                                 7
182510e230b6Smaya   uint32_t                             ReductionType;
182610e230b6Smaya#define STD_FILTER                               0
182710e230b6Smaya#define COMPARISON                               1
182810e230b6Smaya#define MINIMUM                                  2
182910e230b6Smaya#define MAXIMUM                                  3
183010e230b6Smaya};
183110e230b6Smaya
183210e230b6Smayastatic inline void
183310e230b6SmayaGEN10_SAMPLER_STATE_pack(__attribute__((unused)) __gen_user_data *data,
183410e230b6Smaya                         __attribute__((unused)) void * restrict dst,
183510e230b6Smaya                         __attribute__((unused)) const struct GEN10_SAMPLER_STATE * restrict values)
183610e230b6Smaya{
183710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
183810e230b6Smaya
183910e230b6Smaya   dw[0] =
184010e230b6Smaya      __gen_uint(values->AnisotropicAlgorithm, 0, 0) |
184110e230b6Smaya      __gen_sfixed(values->TextureLODBias, 1, 13, 8) |
184210e230b6Smaya      __gen_uint(values->MinModeFilter, 14, 16) |
184310e230b6Smaya      __gen_uint(values->MagModeFilter, 17, 19) |
184410e230b6Smaya      __gen_uint(values->MipModeFilter, 20, 21) |
184510e230b6Smaya      __gen_uint(values->CoarseLODQualityMode, 22, 26) |
184610e230b6Smaya      __gen_uint(values->LODPreClampMode, 27, 28) |
184710e230b6Smaya      __gen_uint(values->TextureBorderColorMode, 29, 29) |
184810e230b6Smaya      __gen_uint(values->SamplerDisable, 31, 31);
184910e230b6Smaya
185010e230b6Smaya   dw[1] =
185110e230b6Smaya      __gen_uint(values->CubeSurfaceControlMode, 0, 0) |
185210e230b6Smaya      __gen_uint(values->ShadowFunction, 1, 3) |
185310e230b6Smaya      __gen_uint(values->ChromaKeyMode, 4, 4) |
185410e230b6Smaya      __gen_uint(values->ChromaKeyIndex, 5, 6) |
185510e230b6Smaya      __gen_uint(values->ChromaKeyEnable, 7, 7) |
185610e230b6Smaya      __gen_ufixed(values->MaxLOD, 8, 19, 8) |
185710e230b6Smaya      __gen_ufixed(values->MinLOD, 20, 31, 8);
185810e230b6Smaya
185910e230b6Smaya   dw[2] =
186010e230b6Smaya      __gen_uint(values->LODClampMagnificationMode, 0, 0) |
186110e230b6Smaya      __gen_uint(values->Forcegather4Behavior, 5, 5) |
186210e230b6Smaya      __gen_offset(values->BorderColorPointer, 6, 23);
186310e230b6Smaya
186410e230b6Smaya   dw[3] =
186510e230b6Smaya      __gen_uint(values->TCZAddressControlMode, 0, 2) |
186610e230b6Smaya      __gen_uint(values->TCYAddressControlMode, 3, 5) |
186710e230b6Smaya      __gen_uint(values->TCXAddressControlMode, 6, 8) |
186810e230b6Smaya      __gen_uint(values->ReductionTypeEnable, 9, 9) |
186910e230b6Smaya      __gen_uint(values->NonnormalizedCoordinateEnable, 10, 10) |
187010e230b6Smaya      __gen_uint(values->TrilinearFilterQuality, 11, 12) |
187110e230b6Smaya      __gen_uint(values->RAddressMinFilterRoundingEnable, 13, 13) |
187210e230b6Smaya      __gen_uint(values->RAddressMagFilterRoundingEnable, 14, 14) |
187310e230b6Smaya      __gen_uint(values->VAddressMinFilterRoundingEnable, 15, 15) |
187410e230b6Smaya      __gen_uint(values->VAddressMagFilterRoundingEnable, 16, 16) |
187510e230b6Smaya      __gen_uint(values->UAddressMinFilterRoundingEnable, 17, 17) |
187610e230b6Smaya      __gen_uint(values->UAddressMagFilterRoundingEnable, 18, 18) |
187710e230b6Smaya      __gen_uint(values->MaximumAnisotropy, 19, 21) |
187810e230b6Smaya      __gen_uint(values->ReductionType, 22, 23);
187910e230b6Smaya}
188010e230b6Smaya
188110e230b6Smaya#define GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_length      8
188210e230b6Smayastruct GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS {
188310e230b6Smaya   float                                Table0FilterCoefficient[4];
188410e230b6Smaya   float                                Table1FilterCoefficient0[4];
188510e230b6Smaya   float                                Table1FilterCoefficient1[4];
188610e230b6Smaya};
188710e230b6Smaya
188810e230b6Smayastatic inline void
188910e230b6SmayaGEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS_pack(__attribute__((unused)) __gen_user_data *data,
189010e230b6Smaya                                              __attribute__((unused)) void * restrict dst,
189110e230b6Smaya                                              __attribute__((unused)) const struct GEN10_SAMPLER_STATE_8X8_AVS_COEFFICIENTS * restrict values)
189210e230b6Smaya{
189310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
189410e230b6Smaya
189510e230b6Smaya   dw[0] =
189610e230b6Smaya      __gen_sfixed(values->Table0FilterCoefficient[0], 0, 7, 6) |
189710e230b6Smaya      __gen_sfixed(values->Table0FilterCoefficient[1], 8, 15, 6) |
189810e230b6Smaya      __gen_sfixed(values->Table0FilterCoefficient[2], 16, 23, 6) |
189910e230b6Smaya      __gen_sfixed(values->Table0FilterCoefficient[3], 24, 31, 6) |
190010e230b6Smaya      __gen_sfixed(values->Table1FilterCoefficient0[0], 0, 7, 6) |
190110e230b6Smaya      __gen_sfixed(values->Table1FilterCoefficient1[0], 8, 15, 6);
190210e230b6Smaya
190310e230b6Smaya   dw[1] =
190410e230b6Smaya      __gen_sfixed(values->Table1FilterCoefficient0[1], 0, 7, 6) |
190510e230b6Smaya      __gen_sfixed(values->Table1FilterCoefficient1[1], 8, 15, 6);
190610e230b6Smaya
190710e230b6Smaya   dw[2] =
190810e230b6Smaya      __gen_sfixed(values->Table1FilterCoefficient0[2], 0, 7, 6) |
190910e230b6Smaya      __gen_sfixed(values->Table1FilterCoefficient1[2], 8, 15, 6);
191010e230b6Smaya
191110e230b6Smaya   dw[3] =
191210e230b6Smaya      __gen_sfixed(values->Table1FilterCoefficient0[3], 0, 7, 6) |
191310e230b6Smaya      __gen_sfixed(values->Table1FilterCoefficient1[3], 8, 15, 6);
191410e230b6Smaya
191510e230b6Smaya   dw[4] = 0;
191610e230b6Smaya
191710e230b6Smaya   dw[5] = 0;
191810e230b6Smaya
191910e230b6Smaya   dw[6] = 0;
192010e230b6Smaya
192110e230b6Smaya   dw[7] = 0;
192210e230b6Smaya}
192310e230b6Smaya
192410e230b6Smaya#define GEN10_SCISSOR_RECT_length              2
192510e230b6Smayastruct GEN10_SCISSOR_RECT {
192610e230b6Smaya   uint32_t                             ScissorRectangleXMin;
192710e230b6Smaya   uint32_t                             ScissorRectangleYMin;
192810e230b6Smaya   uint32_t                             ScissorRectangleXMax;
192910e230b6Smaya   uint32_t                             ScissorRectangleYMax;
193010e230b6Smaya};
193110e230b6Smaya
193210e230b6Smayastatic inline void
193310e230b6SmayaGEN10_SCISSOR_RECT_pack(__attribute__((unused)) __gen_user_data *data,
193410e230b6Smaya                        __attribute__((unused)) void * restrict dst,
193510e230b6Smaya                        __attribute__((unused)) const struct GEN10_SCISSOR_RECT * restrict values)
193610e230b6Smaya{
193710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
193810e230b6Smaya
193910e230b6Smaya   dw[0] =
194010e230b6Smaya      __gen_uint(values->ScissorRectangleXMin, 0, 15) |
194110e230b6Smaya      __gen_uint(values->ScissorRectangleYMin, 16, 31);
194210e230b6Smaya
194310e230b6Smaya   dw[1] =
194410e230b6Smaya      __gen_uint(values->ScissorRectangleXMax, 0, 15) |
194510e230b6Smaya      __gen_uint(values->ScissorRectangleYMax, 16, 31);
194610e230b6Smaya}
194710e230b6Smaya
194810e230b6Smaya#define GEN10_SFC_AVS_CHROMA_COEFF_TABLE_BODY_length     64
194910e230b6Smayastruct GEN10_SFC_AVS_CHROMA_COEFF_TABLE_BODY {
195010e230b6Smaya   float                                Table1XFilterCoefficientn2;
195110e230b6Smaya   float                                Table1YFilterCoefficientn2;
195210e230b6Smaya   float                                Table1XFilterCoefficientn3;
195310e230b6Smaya   float                                Table1YFilterCoefficientn3;
195410e230b6Smaya   float                                Table1XFilterCoefficientn4;
195510e230b6Smaya   float                                Table1YFilterCoefficientn4;
195610e230b6Smaya   float                                Table1XFilterCoefficientn5;
195710e230b6Smaya   float                                Table1YFilterCoefficientn5;
195810e230b6Smaya   struct GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY FilterCoefficients[31];
195910e230b6Smaya};
196010e230b6Smaya
196110e230b6Smayastatic inline void
196210e230b6SmayaGEN10_SFC_AVS_CHROMA_COEFF_TABLE_BODY_pack(__attribute__((unused)) __gen_user_data *data,
196310e230b6Smaya                                           __attribute__((unused)) void * restrict dst,
196410e230b6Smaya                                           __attribute__((unused)) const struct GEN10_SFC_AVS_CHROMA_COEFF_TABLE_BODY * restrict values)
196510e230b6Smaya{
196610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
196710e230b6Smaya
196810e230b6Smaya   dw[0] =
196910e230b6Smaya      __gen_sfixed(values->Table1XFilterCoefficientn2, 0, 7, 6) |
197010e230b6Smaya      __gen_sfixed(values->Table1YFilterCoefficientn2, 8, 15, 6) |
197110e230b6Smaya      __gen_sfixed(values->Table1XFilterCoefficientn3, 16, 23, 6) |
197210e230b6Smaya      __gen_sfixed(values->Table1YFilterCoefficientn3, 24, 31, 6);
197310e230b6Smaya
197410e230b6Smaya   dw[1] =
197510e230b6Smaya      __gen_sfixed(values->Table1XFilterCoefficientn4, 0, 7, 6) |
197610e230b6Smaya      __gen_sfixed(values->Table1YFilterCoefficientn4, 8, 15, 6) |
197710e230b6Smaya      __gen_sfixed(values->Table1XFilterCoefficientn5, 16, 23, 6) |
197810e230b6Smaya      __gen_sfixed(values->Table1YFilterCoefficientn5, 24, 31, 6);
197910e230b6Smaya
198010e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[2], &values->FilterCoefficients[0]);
198110e230b6Smaya
198210e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[4], &values->FilterCoefficients[1]);
198310e230b6Smaya
198410e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[6], &values->FilterCoefficients[2]);
198510e230b6Smaya
198610e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[8], &values->FilterCoefficients[3]);
198710e230b6Smaya
198810e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[10], &values->FilterCoefficients[4]);
198910e230b6Smaya
199010e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[12], &values->FilterCoefficients[5]);
199110e230b6Smaya
199210e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[14], &values->FilterCoefficients[6]);
199310e230b6Smaya
199410e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[16], &values->FilterCoefficients[7]);
199510e230b6Smaya
199610e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[18], &values->FilterCoefficients[8]);
199710e230b6Smaya
199810e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[20], &values->FilterCoefficients[9]);
199910e230b6Smaya
200010e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[22], &values->FilterCoefficients[10]);
200110e230b6Smaya
200210e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[24], &values->FilterCoefficients[11]);
200310e230b6Smaya
200410e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[26], &values->FilterCoefficients[12]);
200510e230b6Smaya
200610e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[28], &values->FilterCoefficients[13]);
200710e230b6Smaya
200810e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[30], &values->FilterCoefficients[14]);
200910e230b6Smaya
201010e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[32], &values->FilterCoefficients[15]);
201110e230b6Smaya
201210e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[34], &values->FilterCoefficients[16]);
201310e230b6Smaya
201410e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[36], &values->FilterCoefficients[17]);
201510e230b6Smaya
201610e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[38], &values->FilterCoefficients[18]);
201710e230b6Smaya
201810e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[40], &values->FilterCoefficients[19]);
201910e230b6Smaya
202010e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[42], &values->FilterCoefficients[20]);
202110e230b6Smaya
202210e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[44], &values->FilterCoefficients[21]);
202310e230b6Smaya
202410e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[46], &values->FilterCoefficients[22]);
202510e230b6Smaya
202610e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[48], &values->FilterCoefficients[23]);
202710e230b6Smaya
202810e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[50], &values->FilterCoefficients[24]);
202910e230b6Smaya
203010e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[52], &values->FilterCoefficients[25]);
203110e230b6Smaya
203210e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[54], &values->FilterCoefficients[26]);
203310e230b6Smaya
203410e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[56], &values->FilterCoefficients[27]);
203510e230b6Smaya
203610e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[58], &values->FilterCoefficients[28]);
203710e230b6Smaya
203810e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[60], &values->FilterCoefficients[29]);
203910e230b6Smaya
204010e230b6Smaya   GEN10_CHROMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[62], &values->FilterCoefficients[30]);
204110e230b6Smaya}
204210e230b6Smaya
204310e230b6Smaya#define GEN10_SFC_AVS_LUMA_COEFF_TABLE_BODY_length    128
204410e230b6Smayastruct GEN10_SFC_AVS_LUMA_COEFF_TABLE_BODY {
204510e230b6Smaya   float                                Table0XFilterCoefficientn0;
204610e230b6Smaya   float                                Table0YFilterCoefficientn0;
204710e230b6Smaya   float                                Table0XFilterCoefficientn1;
204810e230b6Smaya   float                                Table0YFilterCoefficientn1;
204910e230b6Smaya   float                                Table0XFilterCoefficientn2;
205010e230b6Smaya   float                                Table0YFilterCoefficientn2;
205110e230b6Smaya   float                                Table0XFilterCoefficientn3;
205210e230b6Smaya   float                                Table0YFilterCoefficientn3;
205310e230b6Smaya   float                                Table0XFilterCoefficientn4;
205410e230b6Smaya   float                                Table0YFilterCoefficientn4;
205510e230b6Smaya   float                                Table0XFilterCoefficientn5;
205610e230b6Smaya   float                                Table0YFilterCoefficientn5;
205710e230b6Smaya   float                                Table0XFilterCoefficientn6;
205810e230b6Smaya   float                                Table0YFilterCoefficientn6;
205910e230b6Smaya   float                                Table0XFilterCoefficientn7;
206010e230b6Smaya   float                                Table0YFilterCoefficientn7;
206110e230b6Smaya   struct GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY FilterCoefficients[31];
206210e230b6Smaya};
206310e230b6Smaya
206410e230b6Smayastatic inline void
206510e230b6SmayaGEN10_SFC_AVS_LUMA_COEFF_TABLE_BODY_pack(__attribute__((unused)) __gen_user_data *data,
206610e230b6Smaya                                         __attribute__((unused)) void * restrict dst,
206710e230b6Smaya                                         __attribute__((unused)) const struct GEN10_SFC_AVS_LUMA_COEFF_TABLE_BODY * restrict values)
206810e230b6Smaya{
206910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
207010e230b6Smaya
207110e230b6Smaya   dw[0] =
207210e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn0, 0, 7, 6) |
207310e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn0, 8, 15, 6) |
207410e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn1, 16, 23, 6) |
207510e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn1, 24, 31, 6);
207610e230b6Smaya
207710e230b6Smaya   dw[1] =
207810e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn2, 0, 7, 6) |
207910e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn2, 8, 15, 6) |
208010e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn3, 16, 23, 6) |
208110e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn3, 24, 31, 6);
208210e230b6Smaya
208310e230b6Smaya   dw[2] =
208410e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn4, 0, 7, 6) |
208510e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn4, 8, 15, 6) |
208610e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn5, 16, 23, 6) |
208710e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn5, 24, 31, 6);
208810e230b6Smaya
208910e230b6Smaya   dw[3] =
209010e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn6, 0, 7, 6) |
209110e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn6, 8, 15, 6) |
209210e230b6Smaya      __gen_sfixed(values->Table0XFilterCoefficientn7, 16, 23, 6) |
209310e230b6Smaya      __gen_sfixed(values->Table0YFilterCoefficientn7, 24, 31, 6);
209410e230b6Smaya
209510e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[4], &values->FilterCoefficients[0]);
209610e230b6Smaya
209710e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[8], &values->FilterCoefficients[1]);
209810e230b6Smaya
209910e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[12], &values->FilterCoefficients[2]);
210010e230b6Smaya
210110e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[16], &values->FilterCoefficients[3]);
210210e230b6Smaya
210310e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[20], &values->FilterCoefficients[4]);
210410e230b6Smaya
210510e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[24], &values->FilterCoefficients[5]);
210610e230b6Smaya
210710e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[28], &values->FilterCoefficients[6]);
210810e230b6Smaya
210910e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[32], &values->FilterCoefficients[7]);
211010e230b6Smaya
211110e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[36], &values->FilterCoefficients[8]);
211210e230b6Smaya
211310e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[40], &values->FilterCoefficients[9]);
211410e230b6Smaya
211510e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[44], &values->FilterCoefficients[10]);
211610e230b6Smaya
211710e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[48], &values->FilterCoefficients[11]);
211810e230b6Smaya
211910e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[52], &values->FilterCoefficients[12]);
212010e230b6Smaya
212110e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[56], &values->FilterCoefficients[13]);
212210e230b6Smaya
212310e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[60], &values->FilterCoefficients[14]);
212410e230b6Smaya
212510e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[64], &values->FilterCoefficients[15]);
212610e230b6Smaya
212710e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[68], &values->FilterCoefficients[16]);
212810e230b6Smaya
212910e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[72], &values->FilterCoefficients[17]);
213010e230b6Smaya
213110e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[76], &values->FilterCoefficients[18]);
213210e230b6Smaya
213310e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[80], &values->FilterCoefficients[19]);
213410e230b6Smaya
213510e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[84], &values->FilterCoefficients[20]);
213610e230b6Smaya
213710e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[88], &values->FilterCoefficients[21]);
213810e230b6Smaya
213910e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[92], &values->FilterCoefficients[22]);
214010e230b6Smaya
214110e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[96], &values->FilterCoefficients[23]);
214210e230b6Smaya
214310e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[100], &values->FilterCoefficients[24]);
214410e230b6Smaya
214510e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[104], &values->FilterCoefficients[25]);
214610e230b6Smaya
214710e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[108], &values->FilterCoefficients[26]);
214810e230b6Smaya
214910e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[112], &values->FilterCoefficients[27]);
215010e230b6Smaya
215110e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[116], &values->FilterCoefficients[28]);
215210e230b6Smaya
215310e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[120], &values->FilterCoefficients[29]);
215410e230b6Smaya
215510e230b6Smaya   GEN10_LUMA_FILTER_COEFFICIENTS_ARRAY_pack(data, &dw[124], &values->FilterCoefficients[30]);
215610e230b6Smaya}
215710e230b6Smaya
215810e230b6Smaya#define GEN10_SFC_AVS_STATE_BODY_length        2
215910e230b6Smayastruct GEN10_SFC_AVS_STATE_BODY {
216010e230b6Smaya   uint32_t                             TransitionAreawith8Pixels;
216110e230b6Smaya   uint32_t                             TransitionAreawith4Pixels;
216210e230b6Smaya   uint32_t                             SharpnessLevel;
216310e230b6Smaya   uint32_t                             MaxDerivative8Pixels;
216410e230b6Smaya   uint32_t                             MaxDerivative4Pixels;
216510e230b6Smaya};
216610e230b6Smaya
216710e230b6Smayastatic inline void
216810e230b6SmayaGEN10_SFC_AVS_STATE_BODY_pack(__attribute__((unused)) __gen_user_data *data,
216910e230b6Smaya                              __attribute__((unused)) void * restrict dst,
217010e230b6Smaya                              __attribute__((unused)) const struct GEN10_SFC_AVS_STATE_BODY * restrict values)
217110e230b6Smaya{
217210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
217310e230b6Smaya
217410e230b6Smaya   dw[0] =
217510e230b6Smaya      __gen_uint(values->TransitionAreawith8Pixels, 0, 2) |
217610e230b6Smaya      __gen_uint(values->TransitionAreawith4Pixels, 4, 6) |
217710e230b6Smaya      __gen_uint(values->SharpnessLevel, 24, 31);
217810e230b6Smaya
217910e230b6Smaya   dw[1] =
218010e230b6Smaya      __gen_uint(values->MaxDerivative8Pixels, 0, 7) |
218110e230b6Smaya      __gen_uint(values->MaxDerivative4Pixels, 16, 23);
218210e230b6Smaya}
218310e230b6Smaya
218410e230b6Smaya#define GEN10_SFC_IEF_STATE_BODY_length       23
218510e230b6Smayastruct GEN10_SFC_IEF_STATE_BODY {
218610e230b6Smaya   uint32_t                             GainFactor;
218710e230b6Smaya   uint32_t                             WeakEdgeThreshold;
218810e230b6Smaya   uint32_t                             StrongEdgeThreshold;
218910e230b6Smaya   float                                R3xCoefficient;
219010e230b6Smaya   float                                R3cCoefficient;
219110e230b6Smaya   uint32_t                             GlobalNoiseEstimation;
219210e230b6Smaya   uint32_t                             NonEdgeWeight;
219310e230b6Smaya   uint32_t                             RegularWeight;
219410e230b6Smaya   uint32_t                             StrongEdgeWeight;
219510e230b6Smaya   float                                R5xCoefficient;
219610e230b6Smaya   float                                R5cxCoefficient;
219710e230b6Smaya   float                                R5cCoefficient;
219810e230b6Smaya   float                                STDSinalpha;
219910e230b6Smaya   float                                STDCosalpha;
220010e230b6Smaya   uint32_t                             Sat_Max;
220110e230b6Smaya   uint32_t                             Hue_Max;
220210e230b6Smaya   float                                S3U;
220310e230b6Smaya   uint32_t                             DiamondMargin;
220410e230b6Smaya   bool                                 VY_STD_Enable;
220510e230b6Smaya   uint32_t                             U_Mid;
220610e230b6Smaya   uint32_t                             V_Mid;
220710e230b6Smaya   int32_t                              Diamond_dv;
220810e230b6Smaya   uint32_t                             Diamond_Th;
220910e230b6Smaya   float                                Diamond_alpha;
221010e230b6Smaya   uint32_t                             HS_margin;
221110e230b6Smaya   int32_t                              Diamond_du;
221210e230b6Smaya   uint32_t                             SkinDetailFactor;
221310e230b6Smaya#define DetailRevealed                           0
221410e230b6Smaya#define NotDetailRevealed                        1
221510e230b6Smaya   uint32_t                             Y_point_1;
221610e230b6Smaya   uint32_t                             Y_point_2;
221710e230b6Smaya   uint32_t                             Y_point_3;
221810e230b6Smaya   uint32_t                             Y_point_4;
221910e230b6Smaya   float                                INV_Margin_VYL;
222010e230b6Smaya   float                                INV_Margin_VYU;
222110e230b6Smaya   uint32_t                             P0L;
222210e230b6Smaya   uint32_t                             P1L;
222310e230b6Smaya   uint32_t                             P2L;
222410e230b6Smaya   uint32_t                             P3L;
222510e230b6Smaya   uint32_t                             B0L;
222610e230b6Smaya   uint32_t                             B1L;
222710e230b6Smaya   uint32_t                             B2L;
222810e230b6Smaya   uint32_t                             B3L;
222910e230b6Smaya   float                                S0L;
223010e230b6Smaya   float                                Y_Slope_2;
223110e230b6Smaya   float                                S1L;
223210e230b6Smaya   float                                S2L;
223310e230b6Smaya   float                                S3L;
223410e230b6Smaya   uint32_t                             P0U;
223510e230b6Smaya   uint32_t                             P1U;
223610e230b6Smaya   float                                Y_Slope1;
223710e230b6Smaya   uint32_t                             P2U;
223810e230b6Smaya   uint32_t                             P3U;
223910e230b6Smaya   uint32_t                             B0U;
224010e230b6Smaya   uint32_t                             B1U;
224110e230b6Smaya   uint32_t                             B2U;
224210e230b6Smaya   uint32_t                             B3U;
224310e230b6Smaya   float                                S0U;
224410e230b6Smaya   float                                S1U;
224510e230b6Smaya   float                                S2U;
224610e230b6Smaya   bool                                 TransformEnable;
224710e230b6Smaya   bool                                 YUVChannelSwap;
224810e230b6Smaya   float                                C0;
224910e230b6Smaya   float                                C1;
225010e230b6Smaya   float                                C2;
225110e230b6Smaya   float                                C3;
225210e230b6Smaya   float                                C4;
225310e230b6Smaya   float                                C5;
225410e230b6Smaya   float                                C6;
225510e230b6Smaya   float                                C7;
225610e230b6Smaya   float                                C8;
225710e230b6Smaya   float                                OffsetIn1;
225810e230b6Smaya   float                                OffsetOut1;
225910e230b6Smaya   float                                OffsetIn2;
226010e230b6Smaya   float                                OffsetOut2;
226110e230b6Smaya   float                                OffsetIn3;
226210e230b6Smaya   float                                OffsetOut3;
226310e230b6Smaya};
226410e230b6Smaya
226510e230b6Smayastatic inline void
226610e230b6SmayaGEN10_SFC_IEF_STATE_BODY_pack(__attribute__((unused)) __gen_user_data *data,
226710e230b6Smaya                              __attribute__((unused)) void * restrict dst,
226810e230b6Smaya                              __attribute__((unused)) const struct GEN10_SFC_IEF_STATE_BODY * restrict values)
226910e230b6Smaya{
227010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
227110e230b6Smaya
227210e230b6Smaya   dw[0] =
227310e230b6Smaya      __gen_uint(values->GainFactor, 0, 5) |
227410e230b6Smaya      __gen_uint(values->WeakEdgeThreshold, 6, 11) |
227510e230b6Smaya      __gen_uint(values->StrongEdgeThreshold, 12, 17) |
227610e230b6Smaya      __gen_ufixed(values->R3xCoefficient, 18, 22, 5) |
227710e230b6Smaya      __gen_ufixed(values->R3cCoefficient, 23, 27, 5);
227810e230b6Smaya
227910e230b6Smaya   dw[1] =
228010e230b6Smaya      __gen_uint(values->GlobalNoiseEstimation, 0, 7) |
228110e230b6Smaya      __gen_uint(values->NonEdgeWeight, 8, 10) |
228210e230b6Smaya      __gen_uint(values->RegularWeight, 11, 13) |
228310e230b6Smaya      __gen_uint(values->StrongEdgeWeight, 14, 16) |
228410e230b6Smaya      __gen_ufixed(values->R5xCoefficient, 17, 21, 5) |
228510e230b6Smaya      __gen_ufixed(values->R5cxCoefficient, 22, 26, 5) |
228610e230b6Smaya      __gen_ufixed(values->R5cCoefficient, 27, 31, 5);
228710e230b6Smaya
228810e230b6Smaya   dw[2] =
228910e230b6Smaya      __gen_sfixed(values->STDSinalpha, 0, 7, 7) |
229010e230b6Smaya      __gen_sfixed(values->STDCosalpha, 8, 15, 7) |
229110e230b6Smaya      __gen_uint(values->Sat_Max, 16, 21) |
229210e230b6Smaya      __gen_uint(values->Hue_Max, 22, 27);
229310e230b6Smaya
229410e230b6Smaya   dw[3] =
229510e230b6Smaya      __gen_sfixed(values->S3U, 0, 10, 8) |
229610e230b6Smaya      __gen_uint(values->DiamondMargin, 12, 14) |
229710e230b6Smaya      __gen_uint(values->VY_STD_Enable, 15, 15) |
229810e230b6Smaya      __gen_uint(values->U_Mid, 16, 23) |
229910e230b6Smaya      __gen_uint(values->V_Mid, 24, 31);
230010e230b6Smaya
230110e230b6Smaya   dw[4] =
230210e230b6Smaya      __gen_sint(values->Diamond_dv, 0, 6) |
230310e230b6Smaya      __gen_uint(values->Diamond_Th, 7, 12) |
230410e230b6Smaya      __gen_ufixed(values->Diamond_alpha, 13, 20, 6) |
230510e230b6Smaya      __gen_uint(values->HS_margin, 21, 23) |
230610e230b6Smaya      __gen_sint(values->Diamond_du, 24, 30) |
230710e230b6Smaya      __gen_uint(values->SkinDetailFactor, 31, 31);
230810e230b6Smaya
230910e230b6Smaya   dw[5] =
231010e230b6Smaya      __gen_uint(values->Y_point_1, 0, 7) |
231110e230b6Smaya      __gen_uint(values->Y_point_2, 8, 15) |
231210e230b6Smaya      __gen_uint(values->Y_point_3, 16, 23) |
231310e230b6Smaya      __gen_uint(values->Y_point_4, 24, 31);
231410e230b6Smaya
231510e230b6Smaya   dw[6] =
231610e230b6Smaya      __gen_ufixed(values->INV_Margin_VYL, 0, 15, 16);
231710e230b6Smaya
231810e230b6Smaya   dw[7] =
231910e230b6Smaya      __gen_ufixed(values->INV_Margin_VYU, 0, 15, 16) |
232010e230b6Smaya      __gen_uint(values->P0L, 16, 23) |
232110e230b6Smaya      __gen_uint(values->P1L, 24, 31);
232210e230b6Smaya
232310e230b6Smaya   dw[8] =
232410e230b6Smaya      __gen_uint(values->P2L, 0, 7) |
232510e230b6Smaya      __gen_uint(values->P3L, 8, 15) |
232610e230b6Smaya      __gen_uint(values->B0L, 16, 23) |
232710e230b6Smaya      __gen_uint(values->B1L, 24, 31);
232810e230b6Smaya
232910e230b6Smaya   dw[9] =
233010e230b6Smaya      __gen_uint(values->B2L, 0, 7) |
233110e230b6Smaya      __gen_uint(values->B3L, 8, 15) |
233210e230b6Smaya      __gen_sfixed(values->S0L, 16, 26, 8) |
233310e230b6Smaya      __gen_ufixed(values->Y_Slope_2, 27, 31, 3);
233410e230b6Smaya
233510e230b6Smaya   dw[10] =
233610e230b6Smaya      __gen_sfixed(values->S1L, 0, 10, 8) |
233710e230b6Smaya      __gen_sfixed(values->S2L, 11, 21, 8);
233810e230b6Smaya
233910e230b6Smaya   dw[11] =
234010e230b6Smaya      __gen_sfixed(values->S3L, 0, 10, 8) |
234110e230b6Smaya      __gen_uint(values->P0U, 11, 18) |
234210e230b6Smaya      __gen_uint(values->P1U, 19, 26) |
234310e230b6Smaya      __gen_ufixed(values->Y_Slope1, 27, 31, 3);
234410e230b6Smaya
234510e230b6Smaya   dw[12] =
234610e230b6Smaya      __gen_uint(values->P2U, 0, 7) |
234710e230b6Smaya      __gen_uint(values->P3U, 8, 15) |
234810e230b6Smaya      __gen_uint(values->B0U, 16, 23) |
234910e230b6Smaya      __gen_uint(values->B1U, 24, 31);
235010e230b6Smaya
235110e230b6Smaya   dw[13] =
235210e230b6Smaya      __gen_uint(values->B2U, 0, 7) |
235310e230b6Smaya      __gen_uint(values->B3U, 8, 15) |
235410e230b6Smaya      __gen_sfixed(values->S0U, 16, 26, 8);
235510e230b6Smaya
235610e230b6Smaya   dw[14] =
235710e230b6Smaya      __gen_sfixed(values->S1U, 0, 10, 8) |
235810e230b6Smaya      __gen_sfixed(values->S2U, 11, 21, 8);
235910e230b6Smaya
236010e230b6Smaya   dw[15] =
236110e230b6Smaya      __gen_uint(values->TransformEnable, 0, 0) |
236210e230b6Smaya      __gen_uint(values->YUVChannelSwap, 1, 1) |
236310e230b6Smaya      __gen_sfixed(values->C0, 3, 15, 10) |
236410e230b6Smaya      __gen_sfixed(values->C1, 16, 28, 10);
236510e230b6Smaya
236610e230b6Smaya   dw[16] =
236710e230b6Smaya      __gen_sfixed(values->C2, 0, 12, 10) |
236810e230b6Smaya      __gen_sfixed(values->C3, 13, 25, 10);
236910e230b6Smaya
237010e230b6Smaya   dw[17] =
237110e230b6Smaya      __gen_sfixed(values->C4, 0, 12, 10) |
237210e230b6Smaya      __gen_sfixed(values->C5, 13, 25, 10);
237310e230b6Smaya
237410e230b6Smaya   dw[18] =
237510e230b6Smaya      __gen_sfixed(values->C6, 0, 12, 10) |
237610e230b6Smaya      __gen_sfixed(values->C7, 13, 25, 10);
237710e230b6Smaya
237810e230b6Smaya   dw[19] =
237910e230b6Smaya      __gen_sfixed(values->C8, 0, 12, 10);
238010e230b6Smaya
238110e230b6Smaya   dw[20] =
238210e230b6Smaya      __gen_sfixed(values->OffsetIn1, 0, 10, 8) |
238310e230b6Smaya      __gen_sfixed(values->OffsetOut1, 11, 21, 8);
238410e230b6Smaya
238510e230b6Smaya   dw[21] =
238610e230b6Smaya      __gen_sfixed(values->OffsetIn2, 0, 10, 8) |
238710e230b6Smaya      __gen_sfixed(values->OffsetOut2, 11, 21, 8);
238810e230b6Smaya
238910e230b6Smaya   dw[22] =
239010e230b6Smaya      __gen_sfixed(values->OffsetIn3, 0, 10, 8) |
239110e230b6Smaya      __gen_sfixed(values->OffsetOut3, 11, 21, 8);
239210e230b6Smaya}
239310e230b6Smaya
239410e230b6Smaya#define GEN10_SFC_LOCK_BODY_length             1
239510e230b6Smayastruct GEN10_SFC_LOCK_BODY {
239610e230b6Smaya   uint32_t                             VESFCPipeSelect;
239710e230b6Smaya   bool                                 PreScaledOutputSurfaceOutputEnable;
239810e230b6Smaya};
239910e230b6Smaya
240010e230b6Smayastatic inline void
240110e230b6SmayaGEN10_SFC_LOCK_BODY_pack(__attribute__((unused)) __gen_user_data *data,
240210e230b6Smaya                         __attribute__((unused)) void * restrict dst,
240310e230b6Smaya                         __attribute__((unused)) const struct GEN10_SFC_LOCK_BODY * restrict values)
240410e230b6Smaya{
240510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
240610e230b6Smaya
240710e230b6Smaya   dw[0] =
240810e230b6Smaya      __gen_uint(values->VESFCPipeSelect, 0, 0) |
240910e230b6Smaya      __gen_uint(values->PreScaledOutputSurfaceOutputEnable, 1, 1);
241010e230b6Smaya}
241110e230b6Smaya
241210e230b6Smaya#define GEN10_SF_CLIP_VIEWPORT_length         16
241310e230b6Smayastruct GEN10_SF_CLIP_VIEWPORT {
241410e230b6Smaya   float                                ViewportMatrixElementm00;
241510e230b6Smaya   float                                ViewportMatrixElementm11;
241610e230b6Smaya   float                                ViewportMatrixElementm22;
241710e230b6Smaya   float                                ViewportMatrixElementm30;
241810e230b6Smaya   float                                ViewportMatrixElementm31;
241910e230b6Smaya   float                                ViewportMatrixElementm32;
242010e230b6Smaya   float                                XMinClipGuardband;
242110e230b6Smaya   float                                XMaxClipGuardband;
242210e230b6Smaya   float                                YMinClipGuardband;
242310e230b6Smaya   float                                YMaxClipGuardband;
242410e230b6Smaya   float                                XMinViewPort;
242510e230b6Smaya   float                                XMaxViewPort;
242610e230b6Smaya   float                                YMinViewPort;
242710e230b6Smaya   float                                YMaxViewPort;
242810e230b6Smaya};
242910e230b6Smaya
243010e230b6Smayastatic inline void
243110e230b6SmayaGEN10_SF_CLIP_VIEWPORT_pack(__attribute__((unused)) __gen_user_data *data,
243210e230b6Smaya                            __attribute__((unused)) void * restrict dst,
243310e230b6Smaya                            __attribute__((unused)) const struct GEN10_SF_CLIP_VIEWPORT * restrict values)
243410e230b6Smaya{
243510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
243610e230b6Smaya
243710e230b6Smaya   dw[0] =
243810e230b6Smaya      __gen_float(values->ViewportMatrixElementm00);
243910e230b6Smaya
244010e230b6Smaya   dw[1] =
244110e230b6Smaya      __gen_float(values->ViewportMatrixElementm11);
244210e230b6Smaya
244310e230b6Smaya   dw[2] =
244410e230b6Smaya      __gen_float(values->ViewportMatrixElementm22);
244510e230b6Smaya
244610e230b6Smaya   dw[3] =
244710e230b6Smaya      __gen_float(values->ViewportMatrixElementm30);
244810e230b6Smaya
244910e230b6Smaya   dw[4] =
245010e230b6Smaya      __gen_float(values->ViewportMatrixElementm31);
245110e230b6Smaya
245210e230b6Smaya   dw[5] =
245310e230b6Smaya      __gen_float(values->ViewportMatrixElementm32);
245410e230b6Smaya
245510e230b6Smaya   dw[6] = 0;
245610e230b6Smaya
245710e230b6Smaya   dw[7] = 0;
245810e230b6Smaya
245910e230b6Smaya   dw[8] =
246010e230b6Smaya      __gen_float(values->XMinClipGuardband);
246110e230b6Smaya
246210e230b6Smaya   dw[9] =
246310e230b6Smaya      __gen_float(values->XMaxClipGuardband);
246410e230b6Smaya
246510e230b6Smaya   dw[10] =
246610e230b6Smaya      __gen_float(values->YMinClipGuardband);
246710e230b6Smaya
246810e230b6Smaya   dw[11] =
246910e230b6Smaya      __gen_float(values->YMaxClipGuardband);
247010e230b6Smaya
247110e230b6Smaya   dw[12] =
247210e230b6Smaya      __gen_float(values->XMinViewPort);
247310e230b6Smaya
247410e230b6Smaya   dw[13] =
247510e230b6Smaya      __gen_float(values->XMaxViewPort);
247610e230b6Smaya
247710e230b6Smaya   dw[14] =
247810e230b6Smaya      __gen_float(values->YMinViewPort);
247910e230b6Smaya
248010e230b6Smaya   dw[15] =
248110e230b6Smaya      __gen_float(values->YMaxViewPort);
248210e230b6Smaya}
248310e230b6Smaya
248410e230b6Smaya#define GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_length      1
248510e230b6Smayastruct GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL {
248610e230b6Smaya   uint32_t                             SourceAttribute;
248710e230b6Smaya   uint32_t                             SwizzleSelect;
248810e230b6Smaya#define INPUTATTR                                0
248910e230b6Smaya#define INPUTATTR_FACING                         1
249010e230b6Smaya#define INPUTATTR_W                              2
249110e230b6Smaya#define INPUTATTR_FACING_W                       3
249210e230b6Smaya   uint32_t                             ConstantSource;
249310e230b6Smaya#define CONST_0000                               0
249410e230b6Smaya#define CONST_0001_FLOAT                         1
249510e230b6Smaya#define CONST_1111_FLOAT                         2
249610e230b6Smaya#define PRIM_ID                                  3
249710e230b6Smaya   uint32_t                             SwizzleControlMode;
249810e230b6Smaya   bool                                 ComponentOverrideX;
249910e230b6Smaya   bool                                 ComponentOverrideY;
250010e230b6Smaya   bool                                 ComponentOverrideZ;
250110e230b6Smaya   bool                                 ComponentOverrideW;
250210e230b6Smaya};
250310e230b6Smaya
250410e230b6Smayastatic inline void
250510e230b6SmayaGEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(__attribute__((unused)) __gen_user_data *data,
250610e230b6Smaya                                      __attribute__((unused)) void * restrict dst,
250710e230b6Smaya                                      __attribute__((unused)) const struct GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL * restrict values)
250810e230b6Smaya{
250910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
251010e230b6Smaya
251110e230b6Smaya   dw[0] =
251210e230b6Smaya      __gen_uint(values->SourceAttribute, 0, 4) |
251310e230b6Smaya      __gen_uint(values->SwizzleSelect, 6, 7) |
251410e230b6Smaya      __gen_uint(values->ConstantSource, 9, 10) |
251510e230b6Smaya      __gen_uint(values->SwizzleControlMode, 11, 11) |
251610e230b6Smaya      __gen_uint(values->ComponentOverrideX, 12, 12) |
251710e230b6Smaya      __gen_uint(values->ComponentOverrideY, 13, 13) |
251810e230b6Smaya      __gen_uint(values->ComponentOverrideZ, 14, 14) |
251910e230b6Smaya      __gen_uint(values->ComponentOverrideW, 15, 15);
252010e230b6Smaya}
252110e230b6Smaya
252210e230b6Smaya#define GEN10_SO_DECL_length                   1
252310e230b6Smayastruct GEN10_SO_DECL {
252410e230b6Smaya   uint32_t                             ComponentMask;
252510e230b6Smaya   uint32_t                             RegisterIndex;
252610e230b6Smaya   uint32_t                             HoleFlag;
252710e230b6Smaya   uint32_t                             OutputBufferSlot;
252810e230b6Smaya};
252910e230b6Smaya
253010e230b6Smayastatic inline void
253110e230b6SmayaGEN10_SO_DECL_pack(__attribute__((unused)) __gen_user_data *data,
253210e230b6Smaya                   __attribute__((unused)) void * restrict dst,
253310e230b6Smaya                   __attribute__((unused)) const struct GEN10_SO_DECL * restrict values)
253410e230b6Smaya{
253510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
253610e230b6Smaya
253710e230b6Smaya   dw[0] =
253810e230b6Smaya      __gen_uint(values->ComponentMask, 0, 3) |
253910e230b6Smaya      __gen_uint(values->RegisterIndex, 4, 9) |
254010e230b6Smaya      __gen_uint(values->HoleFlag, 11, 11) |
254110e230b6Smaya      __gen_uint(values->OutputBufferSlot, 12, 13);
254210e230b6Smaya}
254310e230b6Smaya
254410e230b6Smaya#define GEN10_SO_DECL_ENTRY_length             2
254510e230b6Smayastruct GEN10_SO_DECL_ENTRY {
254610e230b6Smaya   struct GEN10_SO_DECL                 Stream0Decl;
254710e230b6Smaya   struct GEN10_SO_DECL                 Stream1Decl;
254810e230b6Smaya   struct GEN10_SO_DECL                 Stream2Decl;
254910e230b6Smaya   struct GEN10_SO_DECL                 Stream3Decl;
255010e230b6Smaya};
255110e230b6Smaya
255210e230b6Smayastatic inline void
255310e230b6SmayaGEN10_SO_DECL_ENTRY_pack(__attribute__((unused)) __gen_user_data *data,
255410e230b6Smaya                         __attribute__((unused)) void * restrict dst,
255510e230b6Smaya                         __attribute__((unused)) const struct GEN10_SO_DECL_ENTRY * restrict values)
255610e230b6Smaya{
255710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
255810e230b6Smaya
255910e230b6Smaya   uint32_t v0_0;
256010e230b6Smaya   GEN10_SO_DECL_pack(data, &v0_0, &values->Stream0Decl);
256110e230b6Smaya
256210e230b6Smaya   uint32_t v0_1;
256310e230b6Smaya   GEN10_SO_DECL_pack(data, &v0_1, &values->Stream1Decl);
256410e230b6Smaya
256510e230b6Smaya   dw[0] =
256610e230b6Smaya      __gen_uint(v0_0, 0, 15) |
256710e230b6Smaya      __gen_uint(v0_1, 16, 31);
256810e230b6Smaya
256910e230b6Smaya   uint32_t v1_0;
257010e230b6Smaya   GEN10_SO_DECL_pack(data, &v1_0, &values->Stream2Decl);
257110e230b6Smaya
257210e230b6Smaya   uint32_t v1_1;
257310e230b6Smaya   GEN10_SO_DECL_pack(data, &v1_1, &values->Stream3Decl);
257410e230b6Smaya
257510e230b6Smaya   dw[1] =
257610e230b6Smaya      __gen_uint(v1_0, 0, 15) |
257710e230b6Smaya      __gen_uint(v1_1, 16, 31);
257810e230b6Smaya}
257910e230b6Smaya
258010e230b6Smaya#define GEN10_VDENC_SURFACE_CONTROL_BITS_length      1
258110e230b6Smayastruct GEN10_VDENC_SURFACE_CONTROL_BITS {
258210e230b6Smaya   uint32_t                             MOCS;
258310e230b6Smaya   uint32_t                             ArbitrationPriorityControl;
258410e230b6Smaya#define Highestpriority                          0
258510e230b6Smaya#define Secondhighestpriority                    1
258610e230b6Smaya#define Thirdhighestpriority                     2
258710e230b6Smaya#define Lowestpriority                           3
258810e230b6Smaya   bool                                 MemoryCompressionEnable;
258910e230b6Smaya   uint32_t                             MemoryCompressionMode;
259010e230b6Smaya   uint32_t                             CacheSelect;
259110e230b6Smaya   uint32_t                             TiledResourceMode;
259210e230b6Smaya#define TRMODE_NONE                              0
259310e230b6Smaya#define TRMODE_TILEYF                            1
259410e230b6Smaya#define TRMODE_TILEYS                            2
259510e230b6Smaya};
259610e230b6Smaya
259710e230b6Smayastatic inline void
259810e230b6SmayaGEN10_VDENC_SURFACE_CONTROL_BITS_pack(__attribute__((unused)) __gen_user_data *data,
259910e230b6Smaya                                      __attribute__((unused)) void * restrict dst,
260010e230b6Smaya                                      __attribute__((unused)) const struct GEN10_VDENC_SURFACE_CONTROL_BITS * restrict values)
260110e230b6Smaya{
260210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
260310e230b6Smaya
260410e230b6Smaya   dw[0] =
260510e230b6Smaya      __gen_uint(values->MOCS, 1, 6) |
260610e230b6Smaya      __gen_uint(values->ArbitrationPriorityControl, 7, 8) |
260710e230b6Smaya      __gen_uint(values->MemoryCompressionEnable, 9, 9) |
260810e230b6Smaya      __gen_uint(values->MemoryCompressionMode, 10, 10) |
260910e230b6Smaya      __gen_uint(values->CacheSelect, 12, 12) |
261010e230b6Smaya      __gen_uint(values->TiledResourceMode, 13, 14);
261110e230b6Smaya}
261210e230b6Smaya
261310e230b6Smaya#define GEN10_VDENC_PICTURE_length             3
261410e230b6Smayastruct GEN10_VDENC_PICTURE {
261510e230b6Smaya   __gen_address_type                   Address;
261610e230b6Smaya   struct GEN10_VDENC_SURFACE_CONTROL_BITS PictureFields;
261710e230b6Smaya};
261810e230b6Smaya
261910e230b6Smayastatic inline void
262010e230b6SmayaGEN10_VDENC_PICTURE_pack(__attribute__((unused)) __gen_user_data *data,
262110e230b6Smaya                         __attribute__((unused)) void * restrict dst,
262210e230b6Smaya                         __attribute__((unused)) const struct GEN10_VDENC_PICTURE * restrict values)
262310e230b6Smaya{
262410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
262510e230b6Smaya
262610e230b6Smaya   const uint64_t v0_address =
262710e230b6Smaya      __gen_combine_address(data, &dw[0], values->Address, 0);
262810e230b6Smaya   dw[0] = v0_address;
262910e230b6Smaya   dw[1] = v0_address >> 32;
263010e230b6Smaya
263110e230b6Smaya   GEN10_VDENC_SURFACE_CONTROL_BITS_pack(data, &dw[2], &values->PictureFields);
263210e230b6Smaya}
263310e230b6Smaya
263410e230b6Smaya#define GEN10_VDENC_SURFACE_STATE_FIELDS_length      4
263510e230b6Smayastruct GEN10_VDENC_SURFACE_STATE_FIELDS {
263610e230b6Smaya   float                                CrVCbUPixelOffsetVDirection;
263710e230b6Smaya   bool                                 SurfaceFormatByteSwizzle;
263810e230b6Smaya   uint32_t                             ColorSpaceSelection;
263910e230b6Smaya   uint32_t                             Width;
264010e230b6Smaya   uint32_t                             Height;
264110e230b6Smaya   uint32_t                             TileWalk;
264210e230b6Smaya#define TW_XMAJOR                                0
264310e230b6Smaya#define TW_YMAJOR                                1
264410e230b6Smaya   uint32_t                             TiledSurface;
264510e230b6Smaya   bool                                 HalfPitchforChroma;
264610e230b6Smaya   uint32_t                             SurfacePitch;
264710e230b6Smaya   uint32_t                             ChromaDownsampleFilterControl;
264810e230b6Smaya   uint32_t                             Format;
264910e230b6Smaya   uint32_t                             SurfaceFormat;
265010e230b6Smaya#define VDENC_YUV422                             0
265110e230b6Smaya#define VDENC_RGBA4444                           1
265210e230b6Smaya#define VDENC_YUV444                             2
265310e230b6Smaya#define VDENC_Y8_UNORM                           3
265410e230b6Smaya#define VDENC_PLANAR_420_8                       4
265510e230b6Smaya#define VDENC_YCRCB_SwapY422                     5
265610e230b6Smaya#define VDENC_YCRCB_SwapUV422                    6
265710e230b6Smaya#define VDENC_YCRCB_SwapUVY422                   7
265810e230b6Smaya#define VDENC_P010                               8
265910e230b6Smaya#define VDENC_RGBA10bitpacked                    9
266010e230b6Smaya#define VDENC_Y410                               10
266110e230b6Smaya#define VDENC_NV21                               11
266210e230b6Smaya#define VDENC_P010Variant                        12
266310e230b6Smaya   uint32_t                             YOffsetforUCb;
266410e230b6Smaya   uint32_t                             XOffsetforUCb;
266510e230b6Smaya   uint32_t                             YOffsetforVCr;
266610e230b6Smaya   uint32_t                             XOffsetforVCr;
266710e230b6Smaya};
266810e230b6Smaya
266910e230b6Smayastatic inline void
267010e230b6SmayaGEN10_VDENC_SURFACE_STATE_FIELDS_pack(__attribute__((unused)) __gen_user_data *data,
267110e230b6Smaya                                      __attribute__((unused)) void * restrict dst,
267210e230b6Smaya                                      __attribute__((unused)) const struct GEN10_VDENC_SURFACE_STATE_FIELDS * restrict values)
267310e230b6Smaya{
267410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
267510e230b6Smaya
267610e230b6Smaya   dw[0] =
267710e230b6Smaya      __gen_ufixed(values->CrVCbUPixelOffsetVDirection, 0, 1, 2) |
267810e230b6Smaya      __gen_uint(values->SurfaceFormatByteSwizzle, 2, 2) |
267910e230b6Smaya      __gen_uint(values->ColorSpaceSelection, 3, 3) |
268010e230b6Smaya      __gen_uint(values->Width, 4, 17) |
268110e230b6Smaya      __gen_uint(values->Height, 18, 31);
268210e230b6Smaya
268310e230b6Smaya   dw[1] =
268410e230b6Smaya      __gen_uint(values->TileWalk, 0, 0) |
268510e230b6Smaya      __gen_uint(values->TiledSurface, 1, 1) |
268610e230b6Smaya      __gen_uint(values->HalfPitchforChroma, 2, 2) |
268710e230b6Smaya      __gen_uint(values->SurfacePitch, 3, 19) |
268810e230b6Smaya      __gen_uint(values->ChromaDownsampleFilterControl, 20, 22) |
268910e230b6Smaya      __gen_uint(values->Format, 27, 31) |
269010e230b6Smaya      __gen_uint(values->SurfaceFormat, 28, 31);
269110e230b6Smaya
269210e230b6Smaya   dw[2] =
269310e230b6Smaya      __gen_uint(values->YOffsetforUCb, 0, 14) |
269410e230b6Smaya      __gen_uint(values->XOffsetforUCb, 16, 30);
269510e230b6Smaya
269610e230b6Smaya   dw[3] =
269710e230b6Smaya      __gen_uint(values->YOffsetforVCr, 0, 15) |
269810e230b6Smaya      __gen_uint(values->XOffsetforVCr, 16, 28);
269910e230b6Smaya}
270010e230b6Smaya
270110e230b6Smaya#define GEN10_VERTEX_BUFFER_STATE_length       4
270210e230b6Smayastruct GEN10_VERTEX_BUFFER_STATE {
270310e230b6Smaya   uint32_t                             BufferPitch;
270410e230b6Smaya   bool                                 NullVertexBuffer;
270510e230b6Smaya   bool                                 AddressModifyEnable;
270610e230b6Smaya   uint32_t                             MOCS;
270710e230b6Smaya   uint32_t                             VertexBufferIndex;
270810e230b6Smaya   __gen_address_type                   BufferStartingAddress;
270910e230b6Smaya   uint32_t                             BufferSize;
271010e230b6Smaya};
271110e230b6Smaya
271210e230b6Smayastatic inline void
271310e230b6SmayaGEN10_VERTEX_BUFFER_STATE_pack(__attribute__((unused)) __gen_user_data *data,
271410e230b6Smaya                               __attribute__((unused)) void * restrict dst,
271510e230b6Smaya                               __attribute__((unused)) const struct GEN10_VERTEX_BUFFER_STATE * restrict values)
271610e230b6Smaya{
271710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
271810e230b6Smaya
271910e230b6Smaya   dw[0] =
272010e230b6Smaya      __gen_uint(values->BufferPitch, 0, 11) |
272110e230b6Smaya      __gen_uint(values->NullVertexBuffer, 13, 13) |
272210e230b6Smaya      __gen_uint(values->AddressModifyEnable, 14, 14) |
272310e230b6Smaya      __gen_uint(values->MOCS, 16, 22) |
272410e230b6Smaya      __gen_uint(values->VertexBufferIndex, 26, 31);
272510e230b6Smaya
272610e230b6Smaya   const uint64_t v1_address =
272710e230b6Smaya      __gen_combine_address(data, &dw[1], values->BufferStartingAddress, 0);
272810e230b6Smaya   dw[1] = v1_address;
272910e230b6Smaya   dw[2] = v1_address >> 32;
273010e230b6Smaya
273110e230b6Smaya   dw[3] =
273210e230b6Smaya      __gen_uint(values->BufferSize, 0, 31);
273310e230b6Smaya}
273410e230b6Smaya
273510e230b6Smaya#define GEN10_VERTEX_ELEMENT_STATE_length      2
273610e230b6Smayastruct GEN10_VERTEX_ELEMENT_STATE {
273710e230b6Smaya   uint32_t                             SourceElementOffset;
273810e230b6Smaya   bool                                 EdgeFlagEnable;
273910e230b6Smaya   uint32_t                             SourceElementFormat;
274010e230b6Smaya   bool                                 Valid;
274110e230b6Smaya   uint32_t                             VertexBufferIndex;
274210e230b6Smaya   enum GEN10_3D_Vertex_Component_Control Component3Control;
274310e230b6Smaya   enum GEN10_3D_Vertex_Component_Control Component2Control;
274410e230b6Smaya   enum GEN10_3D_Vertex_Component_Control Component1Control;
274510e230b6Smaya   enum GEN10_3D_Vertex_Component_Control Component0Control;
274610e230b6Smaya};
274710e230b6Smaya
274810e230b6Smayastatic inline void
274910e230b6SmayaGEN10_VERTEX_ELEMENT_STATE_pack(__attribute__((unused)) __gen_user_data *data,
275010e230b6Smaya                                __attribute__((unused)) void * restrict dst,
275110e230b6Smaya                                __attribute__((unused)) const struct GEN10_VERTEX_ELEMENT_STATE * restrict values)
275210e230b6Smaya{
275310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
275410e230b6Smaya
275510e230b6Smaya   dw[0] =
275610e230b6Smaya      __gen_uint(values->SourceElementOffset, 0, 11) |
275710e230b6Smaya      __gen_uint(values->EdgeFlagEnable, 15, 15) |
275810e230b6Smaya      __gen_uint(values->SourceElementFormat, 16, 24) |
275910e230b6Smaya      __gen_uint(values->Valid, 25, 25) |
276010e230b6Smaya      __gen_uint(values->VertexBufferIndex, 26, 31);
276110e230b6Smaya
276210e230b6Smaya   dw[1] =
276310e230b6Smaya      __gen_uint(values->Component3Control, 16, 18) |
276410e230b6Smaya      __gen_uint(values->Component2Control, 20, 22) |
276510e230b6Smaya      __gen_uint(values->Component1Control, 24, 26) |
276610e230b6Smaya      __gen_uint(values->Component0Control, 28, 30);
276710e230b6Smaya}
276810e230b6Smaya
276910e230b6Smaya#define GEN10_3DPRIMITIVE_length               7
277010e230b6Smaya#define GEN10_3DPRIMITIVE_length_bias          2
277110e230b6Smaya#define GEN10_3DPRIMITIVE_header                \
277210e230b6Smaya   .DWordLength                         =      5,  \
277310e230b6Smaya   ._3DCommandSubOpcode                 =      0,  \
277410e230b6Smaya   ._3DCommandOpcode                    =      3,  \
277510e230b6Smaya   .CommandSubType                      =      3,  \
277610e230b6Smaya   .CommandType                         =      3
277710e230b6Smaya
277810e230b6Smayastruct GEN10_3DPRIMITIVE {
277910e230b6Smaya   uint32_t                             DWordLength;
278010e230b6Smaya   bool                                 PredicateEnable;
278110e230b6Smaya   bool                                 UAVCoherencyRequired;
278210e230b6Smaya   bool                                 IndirectParameterEnable;
278310e230b6Smaya   uint32_t                             ExtendedParametersPresent;
278410e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
278510e230b6Smaya   uint32_t                             _3DCommandOpcode;
278610e230b6Smaya   uint32_t                             CommandSubType;
278710e230b6Smaya   uint32_t                             CommandType;
278810e230b6Smaya   enum GEN10_3D_Prim_Topo_Type         PrimitiveTopologyType;
278910e230b6Smaya   uint32_t                             VertexAccessType;
279010e230b6Smaya#define SEQUENTIAL                               0
279110e230b6Smaya#define RANDOM                                   1
279210e230b6Smaya   bool                                 EndOffsetEnable;
279310e230b6Smaya   uint32_t                             VertexCountPerInstance;
279410e230b6Smaya   uint32_t                             StartVertexLocation;
279510e230b6Smaya   uint32_t                             InstanceCount;
279610e230b6Smaya   uint32_t                             StartInstanceLocation;
279710e230b6Smaya   int32_t                              BaseVertexLocation;
279810e230b6Smaya   uint32_t                             ExtendedParameter0;
279910e230b6Smaya   uint32_t                             ExtendedParameter1;
280010e230b6Smaya   uint32_t                             ExtendedParameter2;
280110e230b6Smaya};
280210e230b6Smaya
280310e230b6Smayastatic inline void
280410e230b6SmayaGEN10_3DPRIMITIVE_pack(__attribute__((unused)) __gen_user_data *data,
280510e230b6Smaya                       __attribute__((unused)) void * restrict dst,
280610e230b6Smaya                       __attribute__((unused)) const struct GEN10_3DPRIMITIVE * restrict values)
280710e230b6Smaya{
280810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
280910e230b6Smaya
281010e230b6Smaya   dw[0] =
281110e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
281210e230b6Smaya      __gen_uint(values->PredicateEnable, 8, 8) |
281310e230b6Smaya      __gen_uint(values->UAVCoherencyRequired, 9, 9) |
281410e230b6Smaya      __gen_uint(values->IndirectParameterEnable, 10, 10) |
281510e230b6Smaya      __gen_uint(values->ExtendedParametersPresent, 11, 11) |
281610e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
281710e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
281810e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
281910e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
282010e230b6Smaya
282110e230b6Smaya   dw[1] =
282210e230b6Smaya      __gen_uint(values->PrimitiveTopologyType, 0, 5) |
282310e230b6Smaya      __gen_uint(values->VertexAccessType, 8, 8) |
282410e230b6Smaya      __gen_uint(values->EndOffsetEnable, 9, 9);
282510e230b6Smaya
282610e230b6Smaya   dw[2] =
282710e230b6Smaya      __gen_uint(values->VertexCountPerInstance, 0, 31);
282810e230b6Smaya
282910e230b6Smaya   dw[3] =
283010e230b6Smaya      __gen_uint(values->StartVertexLocation, 0, 31);
283110e230b6Smaya
283210e230b6Smaya   dw[4] =
283310e230b6Smaya      __gen_uint(values->InstanceCount, 0, 31);
283410e230b6Smaya
283510e230b6Smaya   dw[5] =
283610e230b6Smaya      __gen_uint(values->StartInstanceLocation, 0, 31);
283710e230b6Smaya
283810e230b6Smaya   dw[6] =
283910e230b6Smaya      __gen_sint(values->BaseVertexLocation, 0, 31);
284010e230b6Smaya}
284110e230b6Smaya
284210e230b6Smaya#define GEN10_3DSTATE_AA_LINE_PARAMETERS_length      3
284310e230b6Smaya#define GEN10_3DSTATE_AA_LINE_PARAMETERS_length_bias      2
284410e230b6Smaya#define GEN10_3DSTATE_AA_LINE_PARAMETERS_header \
284510e230b6Smaya   .DWordLength                         =      1,  \
284610e230b6Smaya   ._3DCommandSubOpcode                 =     10,  \
284710e230b6Smaya   ._3DCommandOpcode                    =      1,  \
284810e230b6Smaya   .CommandSubType                      =      3,  \
284910e230b6Smaya   .CommandType                         =      3
285010e230b6Smaya
285110e230b6Smayastruct GEN10_3DSTATE_AA_LINE_PARAMETERS {
285210e230b6Smaya   uint32_t                             DWordLength;
285310e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
285410e230b6Smaya   uint32_t                             _3DCommandOpcode;
285510e230b6Smaya   uint32_t                             CommandSubType;
285610e230b6Smaya   uint32_t                             CommandType;
285710e230b6Smaya   float                                AACoverageSlope;
285810e230b6Smaya   float                                AAPointCoverageSlope;
285910e230b6Smaya   float                                AACoverageBias;
286010e230b6Smaya   float                                AAPointCoverageBias;
286110e230b6Smaya   float                                AACoverageEndCapSlope;
286210e230b6Smaya   float                                AAPointCoverageEndCapSlope;
286310e230b6Smaya   float                                AACoverageEndCapBias;
286410e230b6Smaya   float                                AAPointCoverageEndCapBias;
286510e230b6Smaya};
286610e230b6Smaya
286710e230b6Smayastatic inline void
286810e230b6SmayaGEN10_3DSTATE_AA_LINE_PARAMETERS_pack(__attribute__((unused)) __gen_user_data *data,
286910e230b6Smaya                                      __attribute__((unused)) void * restrict dst,
287010e230b6Smaya                                      __attribute__((unused)) const struct GEN10_3DSTATE_AA_LINE_PARAMETERS * restrict values)
287110e230b6Smaya{
287210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
287310e230b6Smaya
287410e230b6Smaya   dw[0] =
287510e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
287610e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
287710e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
287810e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
287910e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
288010e230b6Smaya
288110e230b6Smaya   dw[1] =
288210e230b6Smaya      __gen_ufixed(values->AACoverageSlope, 0, 7, 8) |
288310e230b6Smaya      __gen_ufixed(values->AAPointCoverageSlope, 8, 15, 8) |
288410e230b6Smaya      __gen_ufixed(values->AACoverageBias, 16, 23, 8) |
288510e230b6Smaya      __gen_ufixed(values->AAPointCoverageBias, 24, 31, 8);
288610e230b6Smaya
288710e230b6Smaya   dw[2] =
288810e230b6Smaya      __gen_ufixed(values->AACoverageEndCapSlope, 0, 7, 8) |
288910e230b6Smaya      __gen_ufixed(values->AAPointCoverageEndCapSlope, 8, 15, 8) |
289010e230b6Smaya      __gen_ufixed(values->AACoverageEndCapBias, 16, 23, 8) |
289110e230b6Smaya      __gen_ufixed(values->AAPointCoverageEndCapBias, 24, 31, 8);
289210e230b6Smaya}
289310e230b6Smaya
289410e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_length_bias      2
289510e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_EDIT_DS_header\
289610e230b6Smaya   .DWordLength                         =      0,  \
289710e230b6Smaya   ._3DCommandSubOpcode                 =     70,  \
289810e230b6Smaya   ._3DCommandOpcode                    =      0,  \
289910e230b6Smaya   .CommandSubType                      =      3,  \
290010e230b6Smaya   .CommandType                         =      3
290110e230b6Smaya
290210e230b6Smayastruct GEN10_3DSTATE_BINDING_TABLE_EDIT_DS {
290310e230b6Smaya   uint32_t                             DWordLength;
290410e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
290510e230b6Smaya   uint32_t                             _3DCommandOpcode;
290610e230b6Smaya   uint32_t                             CommandSubType;
290710e230b6Smaya   uint32_t                             CommandType;
290810e230b6Smaya   uint32_t                             BindingTableEditTarget;
290910e230b6Smaya#define AllCores                                 3
291010e230b6Smaya#define Core1                                    2
291110e230b6Smaya#define Core0                                    1
291210e230b6Smaya   uint32_t                             BindingTableBlockClear;
291310e230b6Smaya   /* variable length fields follow */
291410e230b6Smaya};
291510e230b6Smaya
291610e230b6Smayastatic inline void
291710e230b6SmayaGEN10_3DSTATE_BINDING_TABLE_EDIT_DS_pack(__attribute__((unused)) __gen_user_data *data,
291810e230b6Smaya                                         __attribute__((unused)) void * restrict dst,
291910e230b6Smaya                                         __attribute__((unused)) const struct GEN10_3DSTATE_BINDING_TABLE_EDIT_DS * restrict values)
292010e230b6Smaya{
292110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
292210e230b6Smaya
292310e230b6Smaya   dw[0] =
292410e230b6Smaya      __gen_uint(values->DWordLength, 0, 8) |
292510e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
292610e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
292710e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
292810e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
292910e230b6Smaya
293010e230b6Smaya   dw[1] =
293110e230b6Smaya      __gen_uint(values->BindingTableEditTarget, 0, 1) |
293210e230b6Smaya      __gen_uint(values->BindingTableBlockClear, 16, 31);
293310e230b6Smaya}
293410e230b6Smaya
293510e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_length_bias      2
293610e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_EDIT_GS_header\
293710e230b6Smaya   .DWordLength                         =      0,  \
293810e230b6Smaya   ._3DCommandSubOpcode                 =     68,  \
293910e230b6Smaya   ._3DCommandOpcode                    =      0,  \
294010e230b6Smaya   .CommandSubType                      =      3,  \
294110e230b6Smaya   .CommandType                         =      3
294210e230b6Smaya
294310e230b6Smayastruct GEN10_3DSTATE_BINDING_TABLE_EDIT_GS {
294410e230b6Smaya   uint32_t                             DWordLength;
294510e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
294610e230b6Smaya   uint32_t                             _3DCommandOpcode;
294710e230b6Smaya   uint32_t                             CommandSubType;
294810e230b6Smaya   uint32_t                             CommandType;
294910e230b6Smaya   uint32_t                             BindingTableEditTarget;
295010e230b6Smaya#define AllCores                                 3
295110e230b6Smaya#define Core1                                    2
295210e230b6Smaya#define Core0                                    1
295310e230b6Smaya   uint32_t                             BindingTableBlockClear;
295410e230b6Smaya   /* variable length fields follow */
295510e230b6Smaya};
295610e230b6Smaya
295710e230b6Smayastatic inline void
295810e230b6SmayaGEN10_3DSTATE_BINDING_TABLE_EDIT_GS_pack(__attribute__((unused)) __gen_user_data *data,
295910e230b6Smaya                                         __attribute__((unused)) void * restrict dst,
296010e230b6Smaya                                         __attribute__((unused)) const struct GEN10_3DSTATE_BINDING_TABLE_EDIT_GS * restrict values)
296110e230b6Smaya{
296210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
296310e230b6Smaya
296410e230b6Smaya   dw[0] =
296510e230b6Smaya      __gen_uint(values->DWordLength, 0, 8) |
296610e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
296710e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
296810e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
296910e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
297010e230b6Smaya
297110e230b6Smaya   dw[1] =
297210e230b6Smaya      __gen_uint(values->BindingTableEditTarget, 0, 1) |
297310e230b6Smaya      __gen_uint(values->BindingTableBlockClear, 16, 31);
297410e230b6Smaya}
297510e230b6Smaya
297610e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_length_bias      2
297710e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_EDIT_HS_header\
297810e230b6Smaya   .DWordLength                         =      0,  \
297910e230b6Smaya   ._3DCommandSubOpcode                 =     69,  \
298010e230b6Smaya   ._3DCommandOpcode                    =      0,  \
298110e230b6Smaya   .CommandSubType                      =      3,  \
298210e230b6Smaya   .CommandType                         =      3
298310e230b6Smaya
298410e230b6Smayastruct GEN10_3DSTATE_BINDING_TABLE_EDIT_HS {
298510e230b6Smaya   uint32_t                             DWordLength;
298610e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
298710e230b6Smaya   uint32_t                             _3DCommandOpcode;
298810e230b6Smaya   uint32_t                             CommandSubType;
298910e230b6Smaya   uint32_t                             CommandType;
299010e230b6Smaya   uint32_t                             BindingTableEditTarget;
299110e230b6Smaya#define AllCores                                 3
299210e230b6Smaya#define Core1                                    2
299310e230b6Smaya#define Core0                                    1
299410e230b6Smaya   uint32_t                             BindingTableBlockClear;
299510e230b6Smaya   /* variable length fields follow */
299610e230b6Smaya};
299710e230b6Smaya
299810e230b6Smayastatic inline void
299910e230b6SmayaGEN10_3DSTATE_BINDING_TABLE_EDIT_HS_pack(__attribute__((unused)) __gen_user_data *data,
300010e230b6Smaya                                         __attribute__((unused)) void * restrict dst,
300110e230b6Smaya                                         __attribute__((unused)) const struct GEN10_3DSTATE_BINDING_TABLE_EDIT_HS * restrict values)
300210e230b6Smaya{
300310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
300410e230b6Smaya
300510e230b6Smaya   dw[0] =
300610e230b6Smaya      __gen_uint(values->DWordLength, 0, 8) |
300710e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
300810e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
300910e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
301010e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
301110e230b6Smaya
301210e230b6Smaya   dw[1] =
301310e230b6Smaya      __gen_uint(values->BindingTableEditTarget, 0, 1) |
301410e230b6Smaya      __gen_uint(values->BindingTableBlockClear, 16, 31);
301510e230b6Smaya}
301610e230b6Smaya
301710e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_length_bias      2
301810e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_EDIT_PS_header\
301910e230b6Smaya   .DWordLength                         =      0,  \
302010e230b6Smaya   ._3DCommandSubOpcode                 =     71,  \
302110e230b6Smaya   ._3DCommandOpcode                    =      0,  \
302210e230b6Smaya   .CommandSubType                      =      3,  \
302310e230b6Smaya   .CommandType                         =      3
302410e230b6Smaya
302510e230b6Smayastruct GEN10_3DSTATE_BINDING_TABLE_EDIT_PS {
302610e230b6Smaya   uint32_t                             DWordLength;
302710e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
302810e230b6Smaya   uint32_t                             _3DCommandOpcode;
302910e230b6Smaya   uint32_t                             CommandSubType;
303010e230b6Smaya   uint32_t                             CommandType;
303110e230b6Smaya   uint32_t                             BindingTableEditTarget;
303210e230b6Smaya#define AllCores                                 3
303310e230b6Smaya#define Core1                                    2
303410e230b6Smaya#define Core0                                    1
303510e230b6Smaya   uint32_t                             BindingTableBlockClear;
303610e230b6Smaya   /* variable length fields follow */
303710e230b6Smaya};
303810e230b6Smaya
303910e230b6Smayastatic inline void
304010e230b6SmayaGEN10_3DSTATE_BINDING_TABLE_EDIT_PS_pack(__attribute__((unused)) __gen_user_data *data,
304110e230b6Smaya                                         __attribute__((unused)) void * restrict dst,
304210e230b6Smaya                                         __attribute__((unused)) const struct GEN10_3DSTATE_BINDING_TABLE_EDIT_PS * restrict values)
304310e230b6Smaya{
304410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
304510e230b6Smaya
304610e230b6Smaya   dw[0] =
304710e230b6Smaya      __gen_uint(values->DWordLength, 0, 8) |
304810e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
304910e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
305010e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
305110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
305210e230b6Smaya
305310e230b6Smaya   dw[1] =
305410e230b6Smaya      __gen_uint(values->BindingTableEditTarget, 0, 1) |
305510e230b6Smaya      __gen_uint(values->BindingTableBlockClear, 16, 31);
305610e230b6Smaya}
305710e230b6Smaya
305810e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_length_bias      2
305910e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_EDIT_VS_header\
306010e230b6Smaya   .DWordLength                         =      0,  \
306110e230b6Smaya   ._3DCommandSubOpcode                 =     67,  \
306210e230b6Smaya   ._3DCommandOpcode                    =      0,  \
306310e230b6Smaya   .CommandSubType                      =      3,  \
306410e230b6Smaya   .CommandType                         =      3
306510e230b6Smaya
306610e230b6Smayastruct GEN10_3DSTATE_BINDING_TABLE_EDIT_VS {
306710e230b6Smaya   uint32_t                             DWordLength;
306810e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
306910e230b6Smaya   uint32_t                             _3DCommandOpcode;
307010e230b6Smaya   uint32_t                             CommandSubType;
307110e230b6Smaya   uint32_t                             CommandType;
307210e230b6Smaya   uint32_t                             BindingTableEditTarget;
307310e230b6Smaya#define AllCores                                 3
307410e230b6Smaya#define Core1                                    2
307510e230b6Smaya#define Core0                                    1
307610e230b6Smaya   uint32_t                             BindingTableBlockClear;
307710e230b6Smaya   /* variable length fields follow */
307810e230b6Smaya};
307910e230b6Smaya
308010e230b6Smayastatic inline void
308110e230b6SmayaGEN10_3DSTATE_BINDING_TABLE_EDIT_VS_pack(__attribute__((unused)) __gen_user_data *data,
308210e230b6Smaya                                         __attribute__((unused)) void * restrict dst,
308310e230b6Smaya                                         __attribute__((unused)) const struct GEN10_3DSTATE_BINDING_TABLE_EDIT_VS * restrict values)
308410e230b6Smaya{
308510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
308610e230b6Smaya
308710e230b6Smaya   dw[0] =
308810e230b6Smaya      __gen_uint(values->DWordLength, 0, 8) |
308910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
309010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
309110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
309210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
309310e230b6Smaya
309410e230b6Smaya   dw[1] =
309510e230b6Smaya      __gen_uint(values->BindingTableEditTarget, 0, 1) |
309610e230b6Smaya      __gen_uint(values->BindingTableBlockClear, 16, 31);
309710e230b6Smaya}
309810e230b6Smaya
309910e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_length      2
310010e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_length_bias      2
310110e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_header\
310210e230b6Smaya   .DWordLength                         =      0,  \
310310e230b6Smaya   ._3DCommandSubOpcode                 =     40,  \
310410e230b6Smaya   ._3DCommandOpcode                    =      0,  \
310510e230b6Smaya   .CommandSubType                      =      3,  \
310610e230b6Smaya   .CommandType                         =      3
310710e230b6Smaya
310810e230b6Smayastruct GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS {
310910e230b6Smaya   uint32_t                             DWordLength;
311010e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
311110e230b6Smaya   uint32_t                             _3DCommandOpcode;
311210e230b6Smaya   uint32_t                             CommandSubType;
311310e230b6Smaya   uint32_t                             CommandType;
311410e230b6Smaya   uint64_t                             PointertoDSBindingTable;
311510e230b6Smaya};
311610e230b6Smaya
311710e230b6Smayastatic inline void
311810e230b6SmayaGEN10_3DSTATE_BINDING_TABLE_POINTERS_DS_pack(__attribute__((unused)) __gen_user_data *data,
311910e230b6Smaya                                             __attribute__((unused)) void * restrict dst,
312010e230b6Smaya                                             __attribute__((unused)) const struct GEN10_3DSTATE_BINDING_TABLE_POINTERS_DS * restrict values)
312110e230b6Smaya{
312210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
312310e230b6Smaya
312410e230b6Smaya   dw[0] =
312510e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
312610e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
312710e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
312810e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
312910e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
313010e230b6Smaya
313110e230b6Smaya   dw[1] =
313210e230b6Smaya      __gen_offset(values->PointertoDSBindingTable, 5, 15);
313310e230b6Smaya}
313410e230b6Smaya
313510e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_length      2
313610e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_length_bias      2
313710e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_header\
313810e230b6Smaya   .DWordLength                         =      0,  \
313910e230b6Smaya   ._3DCommandSubOpcode                 =     41,  \
314010e230b6Smaya   ._3DCommandOpcode                    =      0,  \
314110e230b6Smaya   .CommandSubType                      =      3,  \
314210e230b6Smaya   .CommandType                         =      3
314310e230b6Smaya
314410e230b6Smayastruct GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS {
314510e230b6Smaya   uint32_t                             DWordLength;
314610e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
314710e230b6Smaya   uint32_t                             _3DCommandOpcode;
314810e230b6Smaya   uint32_t                             CommandSubType;
314910e230b6Smaya   uint32_t                             CommandType;
315010e230b6Smaya   uint64_t                             PointertoGSBindingTable;
315110e230b6Smaya};
315210e230b6Smaya
315310e230b6Smayastatic inline void
315410e230b6SmayaGEN10_3DSTATE_BINDING_TABLE_POINTERS_GS_pack(__attribute__((unused)) __gen_user_data *data,
315510e230b6Smaya                                             __attribute__((unused)) void * restrict dst,
315610e230b6Smaya                                             __attribute__((unused)) const struct GEN10_3DSTATE_BINDING_TABLE_POINTERS_GS * restrict values)
315710e230b6Smaya{
315810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
315910e230b6Smaya
316010e230b6Smaya   dw[0] =
316110e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
316210e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
316310e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
316410e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
316510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
316610e230b6Smaya
316710e230b6Smaya   dw[1] =
316810e230b6Smaya      __gen_offset(values->PointertoGSBindingTable, 5, 15);
316910e230b6Smaya}
317010e230b6Smaya
317110e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_length      2
317210e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_length_bias      2
317310e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_header\
317410e230b6Smaya   .DWordLength                         =      0,  \
317510e230b6Smaya   ._3DCommandSubOpcode                 =     39,  \
317610e230b6Smaya   ._3DCommandOpcode                    =      0,  \
317710e230b6Smaya   .CommandSubType                      =      3,  \
317810e230b6Smaya   .CommandType                         =      3
317910e230b6Smaya
318010e230b6Smayastruct GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS {
318110e230b6Smaya   uint32_t                             DWordLength;
318210e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
318310e230b6Smaya   uint32_t                             _3DCommandOpcode;
318410e230b6Smaya   uint32_t                             CommandSubType;
318510e230b6Smaya   uint32_t                             CommandType;
318610e230b6Smaya   uint64_t                             PointertoHSBindingTable;
318710e230b6Smaya};
318810e230b6Smaya
318910e230b6Smayastatic inline void
319010e230b6SmayaGEN10_3DSTATE_BINDING_TABLE_POINTERS_HS_pack(__attribute__((unused)) __gen_user_data *data,
319110e230b6Smaya                                             __attribute__((unused)) void * restrict dst,
319210e230b6Smaya                                             __attribute__((unused)) const struct GEN10_3DSTATE_BINDING_TABLE_POINTERS_HS * restrict values)
319310e230b6Smaya{
319410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
319510e230b6Smaya
319610e230b6Smaya   dw[0] =
319710e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
319810e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
319910e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
320010e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
320110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
320210e230b6Smaya
320310e230b6Smaya   dw[1] =
320410e230b6Smaya      __gen_offset(values->PointertoHSBindingTable, 5, 15);
320510e230b6Smaya}
320610e230b6Smaya
320710e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_length      2
320810e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_length_bias      2
320910e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_header\
321010e230b6Smaya   .DWordLength                         =      0,  \
321110e230b6Smaya   ._3DCommandSubOpcode                 =     42,  \
321210e230b6Smaya   ._3DCommandOpcode                    =      0,  \
321310e230b6Smaya   .CommandSubType                      =      3,  \
321410e230b6Smaya   .CommandType                         =      3
321510e230b6Smaya
321610e230b6Smayastruct GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS {
321710e230b6Smaya   uint32_t                             DWordLength;
321810e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
321910e230b6Smaya   uint32_t                             _3DCommandOpcode;
322010e230b6Smaya   uint32_t                             CommandSubType;
322110e230b6Smaya   uint32_t                             CommandType;
322210e230b6Smaya   uint64_t                             PointertoPSBindingTable;
322310e230b6Smaya};
322410e230b6Smaya
322510e230b6Smayastatic inline void
322610e230b6SmayaGEN10_3DSTATE_BINDING_TABLE_POINTERS_PS_pack(__attribute__((unused)) __gen_user_data *data,
322710e230b6Smaya                                             __attribute__((unused)) void * restrict dst,
322810e230b6Smaya                                             __attribute__((unused)) const struct GEN10_3DSTATE_BINDING_TABLE_POINTERS_PS * restrict values)
322910e230b6Smaya{
323010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
323110e230b6Smaya
323210e230b6Smaya   dw[0] =
323310e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
323410e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
323510e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
323610e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
323710e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
323810e230b6Smaya
323910e230b6Smaya   dw[1] =
324010e230b6Smaya      __gen_offset(values->PointertoPSBindingTable, 5, 15);
324110e230b6Smaya}
324210e230b6Smaya
324310e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_length      2
324410e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_length_bias      2
324510e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_header\
324610e230b6Smaya   .DWordLength                         =      0,  \
324710e230b6Smaya   ._3DCommandSubOpcode                 =     38,  \
324810e230b6Smaya   ._3DCommandOpcode                    =      0,  \
324910e230b6Smaya   .CommandSubType                      =      3,  \
325010e230b6Smaya   .CommandType                         =      3
325110e230b6Smaya
325210e230b6Smayastruct GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS {
325310e230b6Smaya   uint32_t                             DWordLength;
325410e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
325510e230b6Smaya   uint32_t                             _3DCommandOpcode;
325610e230b6Smaya   uint32_t                             CommandSubType;
325710e230b6Smaya   uint32_t                             CommandType;
325810e230b6Smaya   uint64_t                             PointertoVSBindingTable;
325910e230b6Smaya};
326010e230b6Smaya
326110e230b6Smayastatic inline void
326210e230b6SmayaGEN10_3DSTATE_BINDING_TABLE_POINTERS_VS_pack(__attribute__((unused)) __gen_user_data *data,
326310e230b6Smaya                                             __attribute__((unused)) void * restrict dst,
326410e230b6Smaya                                             __attribute__((unused)) const struct GEN10_3DSTATE_BINDING_TABLE_POINTERS_VS * restrict values)
326510e230b6Smaya{
326610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
326710e230b6Smaya
326810e230b6Smaya   dw[0] =
326910e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
327010e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
327110e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
327210e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
327310e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
327410e230b6Smaya
327510e230b6Smaya   dw[1] =
327610e230b6Smaya      __gen_offset(values->PointertoVSBindingTable, 5, 15);
327710e230b6Smaya}
327810e230b6Smaya
327910e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_length      4
328010e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_length_bias      2
328110e230b6Smaya#define GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_header\
328210e230b6Smaya   .DWordLength                         =      2,  \
328310e230b6Smaya   ._3DCommandSubOpcode                 =     25,  \
328410e230b6Smaya   ._3DCommandOpcode                    =      1,  \
328510e230b6Smaya   .CommandSubType                      =      3,  \
328610e230b6Smaya   .CommandType                         =      3
328710e230b6Smaya
328810e230b6Smayastruct GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC {
328910e230b6Smaya   uint32_t                             DWordLength;
329010e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
329110e230b6Smaya   uint32_t                             _3DCommandOpcode;
329210e230b6Smaya   uint32_t                             CommandSubType;
329310e230b6Smaya   uint32_t                             CommandType;
329410e230b6Smaya   uint32_t                             MOCS;
329510e230b6Smaya   uint32_t                             BindingTablePoolEnable;
329610e230b6Smaya   __gen_address_type                   BindingTablePoolBaseAddress;
329710e230b6Smaya   uint32_t                             BindingTablePoolBufferSize;
329810e230b6Smaya#define NoValidData                              0
329910e230b6Smaya};
330010e230b6Smaya
330110e230b6Smayastatic inline void
330210e230b6SmayaGEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC_pack(__attribute__((unused)) __gen_user_data *data,
330310e230b6Smaya                                            __attribute__((unused)) void * restrict dst,
330410e230b6Smaya                                            __attribute__((unused)) const struct GEN10_3DSTATE_BINDING_TABLE_POOL_ALLOC * restrict values)
330510e230b6Smaya{
330610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
330710e230b6Smaya
330810e230b6Smaya   dw[0] =
330910e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
331010e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
331110e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
331210e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
331310e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
331410e230b6Smaya
331510e230b6Smaya   const uint64_t v1 =
331610e230b6Smaya      __gen_uint(values->MOCS, 0, 6) |
331710e230b6Smaya      __gen_uint(values->BindingTablePoolEnable, 11, 11);
331810e230b6Smaya   const uint64_t v1_address =
331910e230b6Smaya      __gen_combine_address(data, &dw[1], values->BindingTablePoolBaseAddress, v1);
332010e230b6Smaya   dw[1] = v1_address;
332110e230b6Smaya   dw[2] = (v1_address >> 32) | (v1 >> 32);
332210e230b6Smaya
332310e230b6Smaya   dw[3] =
332410e230b6Smaya      __gen_uint(values->BindingTablePoolBufferSize, 12, 31);
332510e230b6Smaya}
332610e230b6Smaya
332710e230b6Smaya#define GEN10_3DSTATE_BLEND_STATE_POINTERS_length      2
332810e230b6Smaya#define GEN10_3DSTATE_BLEND_STATE_POINTERS_length_bias      2
332910e230b6Smaya#define GEN10_3DSTATE_BLEND_STATE_POINTERS_header\
333010e230b6Smaya   .DWordLength                         =      0,  \
333110e230b6Smaya   ._3DCommandSubOpcode                 =     36,  \
333210e230b6Smaya   ._3DCommandOpcode                    =      0,  \
333310e230b6Smaya   .CommandSubType                      =      3,  \
333410e230b6Smaya   .CommandType                         =      3
333510e230b6Smaya
333610e230b6Smayastruct GEN10_3DSTATE_BLEND_STATE_POINTERS {
333710e230b6Smaya   uint32_t                             DWordLength;
333810e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
333910e230b6Smaya   uint32_t                             _3DCommandOpcode;
334010e230b6Smaya   uint32_t                             CommandSubType;
334110e230b6Smaya   uint32_t                             CommandType;
334210e230b6Smaya   bool                                 BlendStatePointerValid;
334310e230b6Smaya   uint64_t                             BlendStatePointer;
334410e230b6Smaya};
334510e230b6Smaya
334610e230b6Smayastatic inline void
334710e230b6SmayaGEN10_3DSTATE_BLEND_STATE_POINTERS_pack(__attribute__((unused)) __gen_user_data *data,
334810e230b6Smaya                                        __attribute__((unused)) void * restrict dst,
334910e230b6Smaya                                        __attribute__((unused)) const struct GEN10_3DSTATE_BLEND_STATE_POINTERS * restrict values)
335010e230b6Smaya{
335110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
335210e230b6Smaya
335310e230b6Smaya   dw[0] =
335410e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
335510e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
335610e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
335710e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
335810e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
335910e230b6Smaya
336010e230b6Smaya   dw[1] =
336110e230b6Smaya      __gen_uint(values->BlendStatePointerValid, 0, 0) |
336210e230b6Smaya      __gen_offset(values->BlendStatePointer, 6, 31);
336310e230b6Smaya}
336410e230b6Smaya
336510e230b6Smaya#define GEN10_3DSTATE_CC_STATE_POINTERS_length      2
336610e230b6Smaya#define GEN10_3DSTATE_CC_STATE_POINTERS_length_bias      2
336710e230b6Smaya#define GEN10_3DSTATE_CC_STATE_POINTERS_header  \
336810e230b6Smaya   .DWordLength                         =      0,  \
336910e230b6Smaya   ._3DCommandSubOpcode                 =     14,  \
337010e230b6Smaya   ._3DCommandOpcode                    =      0,  \
337110e230b6Smaya   .CommandSubType                      =      3,  \
337210e230b6Smaya   .CommandType                         =      3
337310e230b6Smaya
337410e230b6Smayastruct GEN10_3DSTATE_CC_STATE_POINTERS {
337510e230b6Smaya   uint32_t                             DWordLength;
337610e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
337710e230b6Smaya   uint32_t                             _3DCommandOpcode;
337810e230b6Smaya   uint32_t                             CommandSubType;
337910e230b6Smaya   uint32_t                             CommandType;
338010e230b6Smaya   bool                                 ColorCalcStatePointerValid;
338110e230b6Smaya   uint64_t                             ColorCalcStatePointer;
338210e230b6Smaya};
338310e230b6Smaya
338410e230b6Smayastatic inline void
338510e230b6SmayaGEN10_3DSTATE_CC_STATE_POINTERS_pack(__attribute__((unused)) __gen_user_data *data,
338610e230b6Smaya                                     __attribute__((unused)) void * restrict dst,
338710e230b6Smaya                                     __attribute__((unused)) const struct GEN10_3DSTATE_CC_STATE_POINTERS * restrict values)
338810e230b6Smaya{
338910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
339010e230b6Smaya
339110e230b6Smaya   dw[0] =
339210e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
339310e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
339410e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
339510e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
339610e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
339710e230b6Smaya
339810e230b6Smaya   dw[1] =
339910e230b6Smaya      __gen_uint(values->ColorCalcStatePointerValid, 0, 0) |
340010e230b6Smaya      __gen_offset(values->ColorCalcStatePointer, 6, 31);
340110e230b6Smaya}
340210e230b6Smaya
340310e230b6Smaya#define GEN10_3DSTATE_CHROMA_KEY_length        4
340410e230b6Smaya#define GEN10_3DSTATE_CHROMA_KEY_length_bias      2
340510e230b6Smaya#define GEN10_3DSTATE_CHROMA_KEY_header         \
340610e230b6Smaya   .DWordLength                         =      2,  \
340710e230b6Smaya   ._3DCommandSubOpcode                 =      4,  \
340810e230b6Smaya   ._3DCommandOpcode                    =      1,  \
340910e230b6Smaya   .CommandSubType                      =      3,  \
341010e230b6Smaya   .CommandType                         =      3
341110e230b6Smaya
341210e230b6Smayastruct GEN10_3DSTATE_CHROMA_KEY {
341310e230b6Smaya   uint32_t                             DWordLength;
341410e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
341510e230b6Smaya   uint32_t                             _3DCommandOpcode;
341610e230b6Smaya   uint32_t                             CommandSubType;
341710e230b6Smaya   uint32_t                             CommandType;
341810e230b6Smaya   uint32_t                             ChromaKeyTableIndex;
341910e230b6Smaya   uint32_t                             ChromaKeyLowValue;
342010e230b6Smaya   uint32_t                             ChromaKeyHighValue;
342110e230b6Smaya};
342210e230b6Smaya
342310e230b6Smayastatic inline void
342410e230b6SmayaGEN10_3DSTATE_CHROMA_KEY_pack(__attribute__((unused)) __gen_user_data *data,
342510e230b6Smaya                              __attribute__((unused)) void * restrict dst,
342610e230b6Smaya                              __attribute__((unused)) const struct GEN10_3DSTATE_CHROMA_KEY * restrict values)
342710e230b6Smaya{
342810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
342910e230b6Smaya
343010e230b6Smaya   dw[0] =
343110e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
343210e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
343310e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
343410e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
343510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
343610e230b6Smaya
343710e230b6Smaya   dw[1] =
343810e230b6Smaya      __gen_uint(values->ChromaKeyTableIndex, 30, 31);
343910e230b6Smaya
344010e230b6Smaya   dw[2] =
344110e230b6Smaya      __gen_uint(values->ChromaKeyLowValue, 0, 31);
344210e230b6Smaya
344310e230b6Smaya   dw[3] =
344410e230b6Smaya      __gen_uint(values->ChromaKeyHighValue, 0, 31);
344510e230b6Smaya}
344610e230b6Smaya
344710e230b6Smaya#define GEN10_3DSTATE_CLEAR_PARAMS_length      3
344810e230b6Smaya#define GEN10_3DSTATE_CLEAR_PARAMS_length_bias      2
344910e230b6Smaya#define GEN10_3DSTATE_CLEAR_PARAMS_header       \
345010e230b6Smaya   .DWordLength                         =      1,  \
345110e230b6Smaya   ._3DCommandSubOpcode                 =      4,  \
345210e230b6Smaya   ._3DCommandOpcode                    =      0,  \
345310e230b6Smaya   .CommandSubType                      =      3,  \
345410e230b6Smaya   .CommandType                         =      3
345510e230b6Smaya
345610e230b6Smayastruct GEN10_3DSTATE_CLEAR_PARAMS {
345710e230b6Smaya   uint32_t                             DWordLength;
345810e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
345910e230b6Smaya   uint32_t                             _3DCommandOpcode;
346010e230b6Smaya   uint32_t                             CommandSubType;
346110e230b6Smaya   uint32_t                             CommandType;
346210e230b6Smaya   float                                DepthClearValue;
346310e230b6Smaya   bool                                 DepthClearValueValid;
346410e230b6Smaya};
346510e230b6Smaya
346610e230b6Smayastatic inline void
346710e230b6SmayaGEN10_3DSTATE_CLEAR_PARAMS_pack(__attribute__((unused)) __gen_user_data *data,
346810e230b6Smaya                                __attribute__((unused)) void * restrict dst,
346910e230b6Smaya                                __attribute__((unused)) const struct GEN10_3DSTATE_CLEAR_PARAMS * restrict values)
347010e230b6Smaya{
347110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
347210e230b6Smaya
347310e230b6Smaya   dw[0] =
347410e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
347510e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
347610e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
347710e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
347810e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
347910e230b6Smaya
348010e230b6Smaya   dw[1] =
348110e230b6Smaya      __gen_float(values->DepthClearValue);
348210e230b6Smaya
348310e230b6Smaya   dw[2] =
348410e230b6Smaya      __gen_uint(values->DepthClearValueValid, 0, 0);
348510e230b6Smaya}
348610e230b6Smaya
348710e230b6Smaya#define GEN10_3DSTATE_CLIP_length              4
348810e230b6Smaya#define GEN10_3DSTATE_CLIP_length_bias         2
348910e230b6Smaya#define GEN10_3DSTATE_CLIP_header               \
349010e230b6Smaya   .DWordLength                         =      2,  \
349110e230b6Smaya   ._3DCommandSubOpcode                 =     18,  \
349210e230b6Smaya   ._3DCommandOpcode                    =      0,  \
349310e230b6Smaya   .CommandSubType                      =      3,  \
349410e230b6Smaya   .CommandType                         =      3
349510e230b6Smaya
349610e230b6Smayastruct GEN10_3DSTATE_CLIP {
349710e230b6Smaya   uint32_t                             DWordLength;
349810e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
349910e230b6Smaya   uint32_t                             _3DCommandOpcode;
350010e230b6Smaya   uint32_t                             CommandSubType;
350110e230b6Smaya   uint32_t                             CommandType;
350210e230b6Smaya   uint32_t                             UserClipDistanceCullTestEnableBitmask;
350310e230b6Smaya   bool                                 StatisticsEnable;
350410e230b6Smaya   bool                                 ForceClipMode;
350510e230b6Smaya   bool                                 ForceUserClipDistanceClipTestEnableBitmask;
350610e230b6Smaya   bool                                 EarlyCullEnable;
350710e230b6Smaya   uint32_t                             VertexSubPixelPrecisionSelect;
350810e230b6Smaya#define _8Bit                                    0
350910e230b6Smaya#define _4Bit                                    1
351010e230b6Smaya   bool                                 ForceUserClipDistanceCullTestEnableBitmask;
351110e230b6Smaya   uint32_t                             TriangleFanProvokingVertexSelect;
351210e230b6Smaya   uint32_t                             LineStripListProvokingVertexSelect;
351310e230b6Smaya   uint32_t                             TriangleStripListProvokingVertexSelect;
351410e230b6Smaya   bool                                 NonPerspectiveBarycentricEnable;
351510e230b6Smaya   bool                                 PerspectiveDivideDisable;
351610e230b6Smaya   uint32_t                             ClipMode;
351710e230b6Smaya#define CLIPMODE_NORMAL                          0
351810e230b6Smaya#define CLIPMODE_REJECT_ALL                      3
351910e230b6Smaya#define CLIPMODE_ACCEPT_ALL                      4
352010e230b6Smaya   uint32_t                             UserClipDistanceClipTestEnableBitmask;
352110e230b6Smaya   bool                                 GuardbandClipTestEnable;
352210e230b6Smaya   bool                                 ViewportXYClipTestEnable;
352310e230b6Smaya   uint32_t                             APIMode;
352410e230b6Smaya#define APIMODE_OGL                              0
352510e230b6Smaya#define APIMODE_D3D                              1
352610e230b6Smaya   bool                                 ClipEnable;
352710e230b6Smaya   uint32_t                             MaximumVPIndex;
352810e230b6Smaya   bool                                 ForceZeroRTAIndexEnable;
352910e230b6Smaya   float                                MaximumPointWidth;
353010e230b6Smaya   float                                MinimumPointWidth;
353110e230b6Smaya};
353210e230b6Smaya
353310e230b6Smayastatic inline void
353410e230b6SmayaGEN10_3DSTATE_CLIP_pack(__attribute__((unused)) __gen_user_data *data,
353510e230b6Smaya                        __attribute__((unused)) void * restrict dst,
353610e230b6Smaya                        __attribute__((unused)) const struct GEN10_3DSTATE_CLIP * restrict values)
353710e230b6Smaya{
353810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
353910e230b6Smaya
354010e230b6Smaya   dw[0] =
354110e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
354210e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
354310e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
354410e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
354510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
354610e230b6Smaya
354710e230b6Smaya   dw[1] =
354810e230b6Smaya      __gen_uint(values->UserClipDistanceCullTestEnableBitmask, 0, 7) |
354910e230b6Smaya      __gen_uint(values->StatisticsEnable, 10, 10) |
355010e230b6Smaya      __gen_uint(values->ForceClipMode, 16, 16) |
355110e230b6Smaya      __gen_uint(values->ForceUserClipDistanceClipTestEnableBitmask, 17, 17) |
355210e230b6Smaya      __gen_uint(values->EarlyCullEnable, 18, 18) |
355310e230b6Smaya      __gen_uint(values->VertexSubPixelPrecisionSelect, 19, 19) |
355410e230b6Smaya      __gen_uint(values->ForceUserClipDistanceCullTestEnableBitmask, 20, 20);
355510e230b6Smaya
355610e230b6Smaya   dw[2] =
355710e230b6Smaya      __gen_uint(values->TriangleFanProvokingVertexSelect, 0, 1) |
355810e230b6Smaya      __gen_uint(values->LineStripListProvokingVertexSelect, 2, 3) |
355910e230b6Smaya      __gen_uint(values->TriangleStripListProvokingVertexSelect, 4, 5) |
356010e230b6Smaya      __gen_uint(values->NonPerspectiveBarycentricEnable, 8, 8) |
356110e230b6Smaya      __gen_uint(values->PerspectiveDivideDisable, 9, 9) |
356210e230b6Smaya      __gen_uint(values->ClipMode, 13, 15) |
356310e230b6Smaya      __gen_uint(values->UserClipDistanceClipTestEnableBitmask, 16, 23) |
356410e230b6Smaya      __gen_uint(values->GuardbandClipTestEnable, 26, 26) |
356510e230b6Smaya      __gen_uint(values->ViewportXYClipTestEnable, 28, 28) |
356610e230b6Smaya      __gen_uint(values->APIMode, 30, 30) |
356710e230b6Smaya      __gen_uint(values->ClipEnable, 31, 31);
356810e230b6Smaya
356910e230b6Smaya   dw[3] =
357010e230b6Smaya      __gen_uint(values->MaximumVPIndex, 0, 3) |
357110e230b6Smaya      __gen_uint(values->ForceZeroRTAIndexEnable, 5, 5) |
357210e230b6Smaya      __gen_ufixed(values->MaximumPointWidth, 6, 16, 3) |
357310e230b6Smaya      __gen_ufixed(values->MinimumPointWidth, 17, 27, 3);
357410e230b6Smaya}
357510e230b6Smaya
357610e230b6Smaya#define GEN10_3DSTATE_CONSTANT_DS_length      11
357710e230b6Smaya#define GEN10_3DSTATE_CONSTANT_DS_length_bias      2
357810e230b6Smaya#define GEN10_3DSTATE_CONSTANT_DS_header        \
357910e230b6Smaya   .DWordLength                         =      9,  \
358010e230b6Smaya   ._3DCommandSubOpcode                 =     26,  \
358110e230b6Smaya   ._3DCommandOpcode                    =      0,  \
358210e230b6Smaya   .CommandSubType                      =      3,  \
358310e230b6Smaya   .CommandType                         =      3
358410e230b6Smaya
358510e230b6Smayastruct GEN10_3DSTATE_CONSTANT_DS {
358610e230b6Smaya   uint32_t                             DWordLength;
358710e230b6Smaya   uint32_t                             MOCS;
358810e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
358910e230b6Smaya   uint32_t                             _3DCommandOpcode;
359010e230b6Smaya   uint32_t                             CommandSubType;
359110e230b6Smaya   uint32_t                             CommandType;
359210e230b6Smaya   struct GEN10_3DSTATE_CONSTANT_BODY   ConstantBody;
359310e230b6Smaya};
359410e230b6Smaya
359510e230b6Smayastatic inline void
359610e230b6SmayaGEN10_3DSTATE_CONSTANT_DS_pack(__attribute__((unused)) __gen_user_data *data,
359710e230b6Smaya                               __attribute__((unused)) void * restrict dst,
359810e230b6Smaya                               __attribute__((unused)) const struct GEN10_3DSTATE_CONSTANT_DS * restrict values)
359910e230b6Smaya{
360010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
360110e230b6Smaya
360210e230b6Smaya   dw[0] =
360310e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
360410e230b6Smaya      __gen_uint(values->MOCS, 8, 14) |
360510e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
360610e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
360710e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
360810e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
360910e230b6Smaya
361010e230b6Smaya   GEN10_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
361110e230b6Smaya}
361210e230b6Smaya
361310e230b6Smaya#define GEN10_3DSTATE_CONSTANT_GS_length      11
361410e230b6Smaya#define GEN10_3DSTATE_CONSTANT_GS_length_bias      2
361510e230b6Smaya#define GEN10_3DSTATE_CONSTANT_GS_header        \
361610e230b6Smaya   .DWordLength                         =      9,  \
361710e230b6Smaya   ._3DCommandSubOpcode                 =     22,  \
361810e230b6Smaya   ._3DCommandOpcode                    =      0,  \
361910e230b6Smaya   .CommandSubType                      =      3,  \
362010e230b6Smaya   .CommandType                         =      3
362110e230b6Smaya
362210e230b6Smayastruct GEN10_3DSTATE_CONSTANT_GS {
362310e230b6Smaya   uint32_t                             DWordLength;
362410e230b6Smaya   uint32_t                             MOCS;
362510e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
362610e230b6Smaya   uint32_t                             _3DCommandOpcode;
362710e230b6Smaya   uint32_t                             CommandSubType;
362810e230b6Smaya   uint32_t                             CommandType;
362910e230b6Smaya   struct GEN10_3DSTATE_CONSTANT_BODY   ConstantBody;
363010e230b6Smaya};
363110e230b6Smaya
363210e230b6Smayastatic inline void
363310e230b6SmayaGEN10_3DSTATE_CONSTANT_GS_pack(__attribute__((unused)) __gen_user_data *data,
363410e230b6Smaya                               __attribute__((unused)) void * restrict dst,
363510e230b6Smaya                               __attribute__((unused)) const struct GEN10_3DSTATE_CONSTANT_GS * restrict values)
363610e230b6Smaya{
363710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
363810e230b6Smaya
363910e230b6Smaya   dw[0] =
364010e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
364110e230b6Smaya      __gen_uint(values->MOCS, 8, 14) |
364210e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
364310e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
364410e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
364510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
364610e230b6Smaya
364710e230b6Smaya   GEN10_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
364810e230b6Smaya}
364910e230b6Smaya
365010e230b6Smaya#define GEN10_3DSTATE_CONSTANT_HS_length      11
365110e230b6Smaya#define GEN10_3DSTATE_CONSTANT_HS_length_bias      2
365210e230b6Smaya#define GEN10_3DSTATE_CONSTANT_HS_header        \
365310e230b6Smaya   .DWordLength                         =      9,  \
365410e230b6Smaya   ._3DCommandSubOpcode                 =     25,  \
365510e230b6Smaya   ._3DCommandOpcode                    =      0,  \
365610e230b6Smaya   .CommandSubType                      =      3,  \
365710e230b6Smaya   .CommandType                         =      3
365810e230b6Smaya
365910e230b6Smayastruct GEN10_3DSTATE_CONSTANT_HS {
366010e230b6Smaya   uint32_t                             DWordLength;
366110e230b6Smaya   uint32_t                             MOCS;
366210e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
366310e230b6Smaya   uint32_t                             _3DCommandOpcode;
366410e230b6Smaya   uint32_t                             CommandSubType;
366510e230b6Smaya   uint32_t                             CommandType;
366610e230b6Smaya   struct GEN10_3DSTATE_CONSTANT_BODY   ConstantBody;
366710e230b6Smaya};
366810e230b6Smaya
366910e230b6Smayastatic inline void
367010e230b6SmayaGEN10_3DSTATE_CONSTANT_HS_pack(__attribute__((unused)) __gen_user_data *data,
367110e230b6Smaya                               __attribute__((unused)) void * restrict dst,
367210e230b6Smaya                               __attribute__((unused)) const struct GEN10_3DSTATE_CONSTANT_HS * restrict values)
367310e230b6Smaya{
367410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
367510e230b6Smaya
367610e230b6Smaya   dw[0] =
367710e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
367810e230b6Smaya      __gen_uint(values->MOCS, 8, 14) |
367910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
368010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
368110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
368210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
368310e230b6Smaya
368410e230b6Smaya   GEN10_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
368510e230b6Smaya}
368610e230b6Smaya
368710e230b6Smaya#define GEN10_3DSTATE_CONSTANT_PS_length      11
368810e230b6Smaya#define GEN10_3DSTATE_CONSTANT_PS_length_bias      2
368910e230b6Smaya#define GEN10_3DSTATE_CONSTANT_PS_header        \
369010e230b6Smaya   .DWordLength                         =      9,  \
369110e230b6Smaya   ._3DCommandSubOpcode                 =     23,  \
369210e230b6Smaya   ._3DCommandOpcode                    =      0,  \
369310e230b6Smaya   .CommandSubType                      =      3,  \
369410e230b6Smaya   .CommandType                         =      3
369510e230b6Smaya
369610e230b6Smayastruct GEN10_3DSTATE_CONSTANT_PS {
369710e230b6Smaya   uint32_t                             DWordLength;
369810e230b6Smaya   uint32_t                             MOCS;
369910e230b6Smaya   uint32_t                             DisableGatheratSetShaderHint;
370010e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
370110e230b6Smaya   uint32_t                             _3DCommandOpcode;
370210e230b6Smaya   uint32_t                             CommandSubType;
370310e230b6Smaya   uint32_t                             CommandType;
370410e230b6Smaya   struct GEN10_3DSTATE_CONSTANT_BODY   ConstantBody;
370510e230b6Smaya};
370610e230b6Smaya
370710e230b6Smayastatic inline void
370810e230b6SmayaGEN10_3DSTATE_CONSTANT_PS_pack(__attribute__((unused)) __gen_user_data *data,
370910e230b6Smaya                               __attribute__((unused)) void * restrict dst,
371010e230b6Smaya                               __attribute__((unused)) const struct GEN10_3DSTATE_CONSTANT_PS * restrict values)
371110e230b6Smaya{
371210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
371310e230b6Smaya
371410e230b6Smaya   dw[0] =
371510e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
371610e230b6Smaya      __gen_uint(values->MOCS, 8, 14) |
371710e230b6Smaya      __gen_uint(values->DisableGatheratSetShaderHint, 15, 15) |
371810e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
371910e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
372010e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
372110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
372210e230b6Smaya
372310e230b6Smaya   GEN10_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
372410e230b6Smaya}
372510e230b6Smaya
372610e230b6Smaya#define GEN10_3DSTATE_CONSTANT_VS_length      11
372710e230b6Smaya#define GEN10_3DSTATE_CONSTANT_VS_length_bias      2
372810e230b6Smaya#define GEN10_3DSTATE_CONSTANT_VS_header        \
372910e230b6Smaya   .DWordLength                         =      9,  \
373010e230b6Smaya   ._3DCommandSubOpcode                 =     21,  \
373110e230b6Smaya   ._3DCommandOpcode                    =      0,  \
373210e230b6Smaya   .CommandSubType                      =      3,  \
373310e230b6Smaya   .CommandType                         =      3
373410e230b6Smaya
373510e230b6Smayastruct GEN10_3DSTATE_CONSTANT_VS {
373610e230b6Smaya   uint32_t                             DWordLength;
373710e230b6Smaya   uint32_t                             MOCS;
373810e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
373910e230b6Smaya   uint32_t                             _3DCommandOpcode;
374010e230b6Smaya   uint32_t                             CommandSubType;
374110e230b6Smaya   uint32_t                             CommandType;
374210e230b6Smaya   struct GEN10_3DSTATE_CONSTANT_BODY   ConstantBody;
374310e230b6Smaya};
374410e230b6Smaya
374510e230b6Smayastatic inline void
374610e230b6SmayaGEN10_3DSTATE_CONSTANT_VS_pack(__attribute__((unused)) __gen_user_data *data,
374710e230b6Smaya                               __attribute__((unused)) void * restrict dst,
374810e230b6Smaya                               __attribute__((unused)) const struct GEN10_3DSTATE_CONSTANT_VS * restrict values)
374910e230b6Smaya{
375010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
375110e230b6Smaya
375210e230b6Smaya   dw[0] =
375310e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
375410e230b6Smaya      __gen_uint(values->MOCS, 8, 14) |
375510e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
375610e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
375710e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
375810e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
375910e230b6Smaya
376010e230b6Smaya   GEN10_3DSTATE_CONSTANT_BODY_pack(data, &dw[1], &values->ConstantBody);
376110e230b6Smaya}
376210e230b6Smaya
376310e230b6Smaya#define GEN10_3DSTATE_DEPTH_BUFFER_length      8
376410e230b6Smaya#define GEN10_3DSTATE_DEPTH_BUFFER_length_bias      2
376510e230b6Smaya#define GEN10_3DSTATE_DEPTH_BUFFER_header       \
376610e230b6Smaya   .DWordLength                         =      6,  \
376710e230b6Smaya   ._3DCommandSubOpcode                 =      5,  \
376810e230b6Smaya   ._3DCommandOpcode                    =      0,  \
376910e230b6Smaya   .CommandSubType                      =      3,  \
377010e230b6Smaya   .CommandType                         =      3
377110e230b6Smaya
377210e230b6Smayastruct GEN10_3DSTATE_DEPTH_BUFFER {
377310e230b6Smaya   uint32_t                             DWordLength;
377410e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
377510e230b6Smaya   uint32_t                             _3DCommandOpcode;
377610e230b6Smaya   uint32_t                             CommandSubType;
377710e230b6Smaya   uint32_t                             CommandType;
377810e230b6Smaya   uint32_t                             SurfacePitch;
377910e230b6Smaya   uint32_t                             SurfaceFormat;
378010e230b6Smaya#define D32_FLOAT                                1
378110e230b6Smaya#define D24_UNORM_X8_UINT                        3
378210e230b6Smaya#define D16_UNORM                                5
378310e230b6Smaya   bool                                 HierarchicalDepthBufferEnable;
378410e230b6Smaya   bool                                 StencilWriteEnable;
378510e230b6Smaya   bool                                 DepthWriteEnable;
378610e230b6Smaya   uint32_t                             SurfaceType;
378710e230b6Smaya#define SURFTYPE_2D                              1
378810e230b6Smaya#define SURFTYPE_CUBE                            3
378910e230b6Smaya#define SURFTYPE_NULL                            7
379010e230b6Smaya   __gen_address_type                   SurfaceBaseAddress;
379110e230b6Smaya   uint32_t                             LOD;
379210e230b6Smaya   uint32_t                             Width;
379310e230b6Smaya   uint32_t                             Height;
379410e230b6Smaya   uint32_t                             MOCS;
379510e230b6Smaya   uint32_t                             MinimumArrayElement;
379610e230b6Smaya   uint32_t                             Depth;
379710e230b6Smaya   uint32_t                             MipTailStartLOD;
379810e230b6Smaya   uint32_t                             TiledResourceMode;
379910e230b6Smaya#define NONE                                     0
380010e230b6Smaya#define TILEYF                                   1
380110e230b6Smaya#define TILEYS                                   2
380210e230b6Smaya   uint32_t                             SurfaceQPitch;
380310e230b6Smaya   uint32_t                             RenderTargetViewExtent;
380410e230b6Smaya};
380510e230b6Smaya
380610e230b6Smayastatic inline void
380710e230b6SmayaGEN10_3DSTATE_DEPTH_BUFFER_pack(__attribute__((unused)) __gen_user_data *data,
380810e230b6Smaya                                __attribute__((unused)) void * restrict dst,
380910e230b6Smaya                                __attribute__((unused)) const struct GEN10_3DSTATE_DEPTH_BUFFER * restrict values)
381010e230b6Smaya{
381110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
381210e230b6Smaya
381310e230b6Smaya   dw[0] =
381410e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
381510e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
381610e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
381710e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
381810e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
381910e230b6Smaya
382010e230b6Smaya   dw[1] =
382110e230b6Smaya      __gen_uint(values->SurfacePitch, 0, 17) |
382210e230b6Smaya      __gen_uint(values->SurfaceFormat, 18, 20) |
382310e230b6Smaya      __gen_uint(values->HierarchicalDepthBufferEnable, 22, 22) |
382410e230b6Smaya      __gen_uint(values->StencilWriteEnable, 27, 27) |
382510e230b6Smaya      __gen_uint(values->DepthWriteEnable, 28, 28) |
382610e230b6Smaya      __gen_uint(values->SurfaceType, 29, 31);
382710e230b6Smaya
382810e230b6Smaya   const uint64_t v2_address =
382910e230b6Smaya      __gen_combine_address(data, &dw[2], values->SurfaceBaseAddress, 0);
383010e230b6Smaya   dw[2] = v2_address;
383110e230b6Smaya   dw[3] = v2_address >> 32;
383210e230b6Smaya
383310e230b6Smaya   dw[4] =
383410e230b6Smaya      __gen_uint(values->LOD, 0, 3) |
383510e230b6Smaya      __gen_uint(values->Width, 4, 17) |
383610e230b6Smaya      __gen_uint(values->Height, 18, 31);
383710e230b6Smaya
383810e230b6Smaya   dw[5] =
383910e230b6Smaya      __gen_uint(values->MOCS, 0, 6) |
384010e230b6Smaya      __gen_uint(values->MinimumArrayElement, 10, 20) |
384110e230b6Smaya      __gen_uint(values->Depth, 21, 31);
384210e230b6Smaya
384310e230b6Smaya   dw[6] =
384410e230b6Smaya      __gen_uint(values->MipTailStartLOD, 26, 29) |
384510e230b6Smaya      __gen_uint(values->TiledResourceMode, 30, 31);
384610e230b6Smaya
384710e230b6Smaya   dw[7] =
384810e230b6Smaya      __gen_uint(values->SurfaceQPitch, 0, 14) |
384910e230b6Smaya      __gen_uint(values->RenderTargetViewExtent, 21, 31);
385010e230b6Smaya}
385110e230b6Smaya
385210e230b6Smaya#define GEN10_3DSTATE_DRAWING_RECTANGLE_length      4
385310e230b6Smaya#define GEN10_3DSTATE_DRAWING_RECTANGLE_length_bias      2
385410e230b6Smaya#define GEN10_3DSTATE_DRAWING_RECTANGLE_header  \
385510e230b6Smaya   .DWordLength                         =      2,  \
385610e230b6Smaya   ._3DCommandSubOpcode                 =      0,  \
385710e230b6Smaya   ._3DCommandOpcode                    =      1,  \
385810e230b6Smaya   .CommandSubType                      =      3,  \
385910e230b6Smaya   .CommandType                         =      3
386010e230b6Smaya
386110e230b6Smayastruct GEN10_3DSTATE_DRAWING_RECTANGLE {
386210e230b6Smaya   uint32_t                             DWordLength;
386310e230b6Smaya   uint32_t                             CoreModeSelect;
386410e230b6Smaya#define Legacy                                   0
386510e230b6Smaya#define Core0Enabled                             1
386610e230b6Smaya#define Core1Enabled                             2
386710e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
386810e230b6Smaya   uint32_t                             _3DCommandOpcode;
386910e230b6Smaya   uint32_t                             CommandSubType;
387010e230b6Smaya   uint32_t                             CommandType;
387110e230b6Smaya   uint32_t                             ClippedDrawingRectangleXMin;
387210e230b6Smaya   uint32_t                             ClippedDrawingRectangleYMin;
387310e230b6Smaya   uint32_t                             ClippedDrawingRectangleXMax;
387410e230b6Smaya   uint32_t                             ClippedDrawingRectangleYMax;
387510e230b6Smaya   int32_t                              DrawingRectangleOriginX;
387610e230b6Smaya   int32_t                              DrawingRectangleOriginY;
387710e230b6Smaya};
387810e230b6Smaya
387910e230b6Smayastatic inline void
388010e230b6SmayaGEN10_3DSTATE_DRAWING_RECTANGLE_pack(__attribute__((unused)) __gen_user_data *data,
388110e230b6Smaya                                     __attribute__((unused)) void * restrict dst,
388210e230b6Smaya                                     __attribute__((unused)) const struct GEN10_3DSTATE_DRAWING_RECTANGLE * restrict values)
388310e230b6Smaya{
388410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
388510e230b6Smaya
388610e230b6Smaya   dw[0] =
388710e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
388810e230b6Smaya      __gen_uint(values->CoreModeSelect, 14, 15) |
388910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
389010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
389110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
389210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
389310e230b6Smaya
389410e230b6Smaya   dw[1] =
389510e230b6Smaya      __gen_uint(values->ClippedDrawingRectangleXMin, 0, 15) |
389610e230b6Smaya      __gen_uint(values->ClippedDrawingRectangleYMin, 16, 31);
389710e230b6Smaya
389810e230b6Smaya   dw[2] =
389910e230b6Smaya      __gen_uint(values->ClippedDrawingRectangleXMax, 0, 15) |
390010e230b6Smaya      __gen_uint(values->ClippedDrawingRectangleYMax, 16, 31);
390110e230b6Smaya
390210e230b6Smaya   dw[3] =
390310e230b6Smaya      __gen_sint(values->DrawingRectangleOriginX, 0, 15) |
390410e230b6Smaya      __gen_sint(values->DrawingRectangleOriginY, 16, 31);
390510e230b6Smaya}
390610e230b6Smaya
390710e230b6Smaya#define GEN10_3DSTATE_DS_length               11
390810e230b6Smaya#define GEN10_3DSTATE_DS_length_bias           2
390910e230b6Smaya#define GEN10_3DSTATE_DS_header                 \
391010e230b6Smaya   .DWordLength                         =      9,  \
391110e230b6Smaya   ._3DCommandSubOpcode                 =     29,  \
391210e230b6Smaya   ._3DCommandOpcode                    =      0,  \
391310e230b6Smaya   .CommandSubType                      =      3,  \
391410e230b6Smaya   .CommandType                         =      3
391510e230b6Smaya
391610e230b6Smayastruct GEN10_3DSTATE_DS {
391710e230b6Smaya   uint32_t                             DWordLength;
391810e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
391910e230b6Smaya   uint32_t                             _3DCommandOpcode;
392010e230b6Smaya   uint32_t                             CommandSubType;
392110e230b6Smaya   uint32_t                             CommandType;
392210e230b6Smaya   uint64_t                             KernelStartPointer;
392310e230b6Smaya   bool                                 SoftwareExceptionEnable;
392410e230b6Smaya   bool                                 IllegalOpcodeExceptionEnable;
392510e230b6Smaya   bool                                 AccessesUAV;
392610e230b6Smaya   uint32_t                             FloatingPointMode;
392710e230b6Smaya#define IEEE754                                  0
392810e230b6Smaya#define Alternate                                1
392910e230b6Smaya   uint32_t                             ThreadDispatchPriority;
393010e230b6Smaya#define High                                     1
393110e230b6Smaya   uint32_t                             BindingTableEntryCount;
393210e230b6Smaya   uint32_t                             SamplerCount;
393310e230b6Smaya#define NoSamplers                               0
393410e230b6Smaya#define _14Samplers                              1
393510e230b6Smaya#define _58Samplers                              2
393610e230b6Smaya#define _912Samplers                             3
393710e230b6Smaya#define _1316Samplers                            4
393810e230b6Smaya   bool                                 VectorMaskEnable;
393910e230b6Smaya   uint32_t                             PerThreadScratchSpace;
394010e230b6Smaya   __gen_address_type                   ScratchSpaceBasePointer;
394110e230b6Smaya   uint32_t                             PatchURBEntryReadOffset;
394210e230b6Smaya   uint32_t                             PatchURBEntryReadLength;
394310e230b6Smaya   uint32_t                             DispatchGRFStartRegisterForURBData;
394410e230b6Smaya   bool                                 Enable;
394510e230b6Smaya   bool                                 CacheDisable;
394610e230b6Smaya   bool                                 ComputeWCoordinateEnable;
394710e230b6Smaya   uint32_t                             DispatchMode;
394810e230b6Smaya#define DISPATCH_MODE_SIMD4X2                    0
394910e230b6Smaya#define DISPATCH_MODE_SIMD8_SINGLE_PATCH         1
395010e230b6Smaya#define DISPATCH_MODE_SIMD8_SINGLE_OR_DUAL_PATCH 2
395110e230b6Smaya   bool                                 StatisticsEnable;
395210e230b6Smaya   uint32_t                             MaximumNumberofThreads;
395310e230b6Smaya   uint32_t                             UserClipDistanceCullTestEnableBitmask;
395410e230b6Smaya   uint32_t                             UserClipDistanceClipTestEnableBitmask;
395510e230b6Smaya   uint32_t                             VertexURBEntryOutputLength;
395610e230b6Smaya   uint32_t                             VertexURBEntryOutputReadOffset;
395710e230b6Smaya   uint64_t                             DUAL_PATCHKernelStartPointer;
395810e230b6Smaya};
395910e230b6Smaya
396010e230b6Smayastatic inline void
396110e230b6SmayaGEN10_3DSTATE_DS_pack(__attribute__((unused)) __gen_user_data *data,
396210e230b6Smaya                      __attribute__((unused)) void * restrict dst,
396310e230b6Smaya                      __attribute__((unused)) const struct GEN10_3DSTATE_DS * restrict values)
396410e230b6Smaya{
396510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
396610e230b6Smaya
396710e230b6Smaya   dw[0] =
396810e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
396910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
397010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
397110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
397210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
397310e230b6Smaya
397410e230b6Smaya   const uint64_t v1 =
397510e230b6Smaya      __gen_offset(values->KernelStartPointer, 6, 63);
397610e230b6Smaya   dw[1] = v1;
397710e230b6Smaya   dw[2] = v1 >> 32;
397810e230b6Smaya
397910e230b6Smaya   dw[3] =
398010e230b6Smaya      __gen_uint(values->SoftwareExceptionEnable, 7, 7) |
398110e230b6Smaya      __gen_uint(values->IllegalOpcodeExceptionEnable, 13, 13) |
398210e230b6Smaya      __gen_uint(values->AccessesUAV, 14, 14) |
398310e230b6Smaya      __gen_uint(values->FloatingPointMode, 16, 16) |
398410e230b6Smaya      __gen_uint(values->ThreadDispatchPriority, 17, 17) |
398510e230b6Smaya      __gen_uint(values->BindingTableEntryCount, 18, 25) |
398610e230b6Smaya      __gen_uint(values->SamplerCount, 27, 29) |
398710e230b6Smaya      __gen_uint(values->VectorMaskEnable, 30, 30);
398810e230b6Smaya
398910e230b6Smaya   const uint64_t v4 =
399010e230b6Smaya      __gen_uint(values->PerThreadScratchSpace, 0, 3);
399110e230b6Smaya   const uint64_t v4_address =
399210e230b6Smaya      __gen_combine_address(data, &dw[4], values->ScratchSpaceBasePointer, v4);
399310e230b6Smaya   dw[4] = v4_address;
399410e230b6Smaya   dw[5] = (v4_address >> 32) | (v4 >> 32);
399510e230b6Smaya
399610e230b6Smaya   dw[6] =
399710e230b6Smaya      __gen_uint(values->PatchURBEntryReadOffset, 4, 9) |
399810e230b6Smaya      __gen_uint(values->PatchURBEntryReadLength, 11, 17) |
399910e230b6Smaya      __gen_uint(values->DispatchGRFStartRegisterForURBData, 20, 24);
400010e230b6Smaya
400110e230b6Smaya   dw[7] =
400210e230b6Smaya      __gen_uint(values->Enable, 0, 0) |
400310e230b6Smaya      __gen_uint(values->CacheDisable, 1, 1) |
400410e230b6Smaya      __gen_uint(values->ComputeWCoordinateEnable, 2, 2) |
400510e230b6Smaya      __gen_uint(values->DispatchMode, 3, 4) |
400610e230b6Smaya      __gen_uint(values->StatisticsEnable, 10, 10) |
400710e230b6Smaya      __gen_uint(values->MaximumNumberofThreads, 21, 30);
400810e230b6Smaya
400910e230b6Smaya   dw[8] =
401010e230b6Smaya      __gen_uint(values->UserClipDistanceCullTestEnableBitmask, 0, 7) |
401110e230b6Smaya      __gen_uint(values->UserClipDistanceClipTestEnableBitmask, 8, 15) |
401210e230b6Smaya      __gen_uint(values->VertexURBEntryOutputLength, 16, 20) |
401310e230b6Smaya      __gen_uint(values->VertexURBEntryOutputReadOffset, 21, 26);
401410e230b6Smaya
401510e230b6Smaya   const uint64_t v9 =
401610e230b6Smaya      __gen_offset(values->DUAL_PATCHKernelStartPointer, 6, 63);
401710e230b6Smaya   dw[9] = v9;
401810e230b6Smaya   dw[10] = v9 >> 32;
401910e230b6Smaya}
402010e230b6Smaya
402110e230b6Smaya#define GEN10_3DSTATE_GATHER_CONSTANT_DS_length_bias      2
402210e230b6Smaya#define GEN10_3DSTATE_GATHER_CONSTANT_DS_header \
402310e230b6Smaya   .DWordLength                         =      1,  \
402410e230b6Smaya   ._3DCommandSubOpcode                 =     55,  \
402510e230b6Smaya   ._3DCommandOpcode                    =      0,  \
402610e230b6Smaya   .CommandSubType                      =      3,  \
402710e230b6Smaya   .CommandType                         =      3
402810e230b6Smaya
402910e230b6Smayastruct GEN10_3DSTATE_GATHER_CONSTANT_DS {
403010e230b6Smaya   uint32_t                             DWordLength;
403110e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
403210e230b6Smaya   uint32_t                             _3DCommandOpcode;
403310e230b6Smaya   uint32_t                             CommandSubType;
403410e230b6Smaya   uint32_t                             CommandType;
403510e230b6Smaya   uint32_t                             UpdateGatherTableOnly;
403610e230b6Smaya#define CommitGather                             0
403710e230b6Smaya#define NonCommitGather                          1
403810e230b6Smaya   uint32_t                             ConstantBufferBindingTableBlock;
403910e230b6Smaya   uint32_t                             ConstantBufferValid;
404010e230b6Smaya   uint32_t                             OnDieTable;
404110e230b6Smaya#define Load                                     0
404210e230b6Smaya#define Read                                     1
404310e230b6Smaya   bool                                 ConstantBufferDx9GenerateStall;
404410e230b6Smaya   uint64_t                             GatherBufferOffset;
404510e230b6Smaya   /* variable length fields follow */
404610e230b6Smaya};
404710e230b6Smaya
404810e230b6Smayastatic inline void
404910e230b6SmayaGEN10_3DSTATE_GATHER_CONSTANT_DS_pack(__attribute__((unused)) __gen_user_data *data,
405010e230b6Smaya                                      __attribute__((unused)) void * restrict dst,
405110e230b6Smaya                                      __attribute__((unused)) const struct GEN10_3DSTATE_GATHER_CONSTANT_DS * restrict values)
405210e230b6Smaya{
405310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
405410e230b6Smaya
405510e230b6Smaya   dw[0] =
405610e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
405710e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
405810e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
405910e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
406010e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
406110e230b6Smaya
406210e230b6Smaya   dw[1] =
406310e230b6Smaya      __gen_uint(values->UpdateGatherTableOnly, 1, 1) |
406410e230b6Smaya      __gen_uint(values->ConstantBufferBindingTableBlock, 12, 15) |
406510e230b6Smaya      __gen_uint(values->ConstantBufferValid, 16, 31);
406610e230b6Smaya
406710e230b6Smaya   dw[2] =
406810e230b6Smaya      __gen_uint(values->OnDieTable, 3, 3) |
406910e230b6Smaya      __gen_uint(values->ConstantBufferDx9GenerateStall, 5, 5) |
407010e230b6Smaya      __gen_offset(values->GatherBufferOffset, 6, 22);
407110e230b6Smaya}
407210e230b6Smaya
407310e230b6Smaya#define GEN10_3DSTATE_GATHER_CONSTANT_GS_length_bias      2
407410e230b6Smaya#define GEN10_3DSTATE_GATHER_CONSTANT_GS_header \
407510e230b6Smaya   .DWordLength                         =      1,  \
407610e230b6Smaya   ._3DCommandSubOpcode                 =     53,  \
407710e230b6Smaya   ._3DCommandOpcode                    =      0,  \
407810e230b6Smaya   .CommandSubType                      =      3,  \
407910e230b6Smaya   .CommandType                         =      3
408010e230b6Smaya
408110e230b6Smayastruct GEN10_3DSTATE_GATHER_CONSTANT_GS {
408210e230b6Smaya   uint32_t                             DWordLength;
408310e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
408410e230b6Smaya   uint32_t                             _3DCommandOpcode;
408510e230b6Smaya   uint32_t                             CommandSubType;
408610e230b6Smaya   uint32_t                             CommandType;
408710e230b6Smaya   uint32_t                             UpdateGatherTableOnly;
408810e230b6Smaya#define CommitGather                             0
408910e230b6Smaya#define NonCommitGather                          1
409010e230b6Smaya   uint32_t                             ConstantBufferBindingTableBlock;
409110e230b6Smaya   uint32_t                             ConstantBufferValid;
409210e230b6Smaya   uint32_t                             OnDieTable;
409310e230b6Smaya#define Load                                     0
409410e230b6Smaya#define Read                                     1
409510e230b6Smaya   bool                                 ConstantBufferDx9GenerateStall;
409610e230b6Smaya   uint64_t                             GatherBufferOffset;
409710e230b6Smaya   /* variable length fields follow */
409810e230b6Smaya};
409910e230b6Smaya
410010e230b6Smayastatic inline void
410110e230b6SmayaGEN10_3DSTATE_GATHER_CONSTANT_GS_pack(__attribute__((unused)) __gen_user_data *data,
410210e230b6Smaya                                      __attribute__((unused)) void * restrict dst,
410310e230b6Smaya                                      __attribute__((unused)) const struct GEN10_3DSTATE_GATHER_CONSTANT_GS * restrict values)
410410e230b6Smaya{
410510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
410610e230b6Smaya
410710e230b6Smaya   dw[0] =
410810e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
410910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
411010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
411110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
411210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
411310e230b6Smaya
411410e230b6Smaya   dw[1] =
411510e230b6Smaya      __gen_uint(values->UpdateGatherTableOnly, 1, 1) |
411610e230b6Smaya      __gen_uint(values->ConstantBufferBindingTableBlock, 12, 15) |
411710e230b6Smaya      __gen_uint(values->ConstantBufferValid, 16, 31);
411810e230b6Smaya
411910e230b6Smaya   dw[2] =
412010e230b6Smaya      __gen_uint(values->OnDieTable, 3, 3) |
412110e230b6Smaya      __gen_uint(values->ConstantBufferDx9GenerateStall, 5, 5) |
412210e230b6Smaya      __gen_offset(values->GatherBufferOffset, 6, 22);
412310e230b6Smaya}
412410e230b6Smaya
412510e230b6Smaya#define GEN10_3DSTATE_GATHER_CONSTANT_HS_length_bias      2
412610e230b6Smaya#define GEN10_3DSTATE_GATHER_CONSTANT_HS_header \
412710e230b6Smaya   .DWordLength                         =      1,  \
412810e230b6Smaya   ._3DCommandSubOpcode                 =     54,  \
412910e230b6Smaya   ._3DCommandOpcode                    =      0,  \
413010e230b6Smaya   .CommandSubType                      =      3,  \
413110e230b6Smaya   .CommandType                         =      3
413210e230b6Smaya
413310e230b6Smayastruct GEN10_3DSTATE_GATHER_CONSTANT_HS {
413410e230b6Smaya   uint32_t                             DWordLength;
413510e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
413610e230b6Smaya   uint32_t                             _3DCommandOpcode;
413710e230b6Smaya   uint32_t                             CommandSubType;
413810e230b6Smaya   uint32_t                             CommandType;
413910e230b6Smaya   uint32_t                             UpdateGatherTableOnly;
414010e230b6Smaya#define CommitGather                             0
414110e230b6Smaya#define NonCommitGather                          1
414210e230b6Smaya   uint32_t                             ConstantBufferBindingTableBlock;
414310e230b6Smaya   uint32_t                             ConstantBufferValid;
414410e230b6Smaya   uint32_t                             OnDieTable;
414510e230b6Smaya#define Load                                     0
414610e230b6Smaya#define Read                                     1
414710e230b6Smaya   bool                                 ConstantBufferDx9GenerateStall;
414810e230b6Smaya   uint64_t                             GatherBufferOffset;
414910e230b6Smaya   /* variable length fields follow */
415010e230b6Smaya};
415110e230b6Smaya
415210e230b6Smayastatic inline void
415310e230b6SmayaGEN10_3DSTATE_GATHER_CONSTANT_HS_pack(__attribute__((unused)) __gen_user_data *data,
415410e230b6Smaya                                      __attribute__((unused)) void * restrict dst,
415510e230b6Smaya                                      __attribute__((unused)) const struct GEN10_3DSTATE_GATHER_CONSTANT_HS * restrict values)
415610e230b6Smaya{
415710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
415810e230b6Smaya
415910e230b6Smaya   dw[0] =
416010e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
416110e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
416210e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
416310e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
416410e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
416510e230b6Smaya
416610e230b6Smaya   dw[1] =
416710e230b6Smaya      __gen_uint(values->UpdateGatherTableOnly, 1, 1) |
416810e230b6Smaya      __gen_uint(values->ConstantBufferBindingTableBlock, 12, 15) |
416910e230b6Smaya      __gen_uint(values->ConstantBufferValid, 16, 31);
417010e230b6Smaya
417110e230b6Smaya   dw[2] =
417210e230b6Smaya      __gen_uint(values->OnDieTable, 3, 3) |
417310e230b6Smaya      __gen_uint(values->ConstantBufferDx9GenerateStall, 5, 5) |
417410e230b6Smaya      __gen_offset(values->GatherBufferOffset, 6, 22);
417510e230b6Smaya}
417610e230b6Smaya
417710e230b6Smaya#define GEN10_3DSTATE_GATHER_CONSTANT_PS_length_bias      2
417810e230b6Smaya#define GEN10_3DSTATE_GATHER_CONSTANT_PS_header \
417910e230b6Smaya   .DWordLength                         =      1,  \
418010e230b6Smaya   ._3DCommandSubOpcode                 =     56,  \
418110e230b6Smaya   ._3DCommandOpcode                    =      0,  \
418210e230b6Smaya   .CommandSubType                      =      3,  \
418310e230b6Smaya   .CommandType                         =      3
418410e230b6Smaya
418510e230b6Smayastruct GEN10_3DSTATE_GATHER_CONSTANT_PS {
418610e230b6Smaya   uint32_t                             DWordLength;
418710e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
418810e230b6Smaya   uint32_t                             _3DCommandOpcode;
418910e230b6Smaya   uint32_t                             CommandSubType;
419010e230b6Smaya   uint32_t                             CommandType;
419110e230b6Smaya   bool                                 DX9OnDieRegisterReadEnable;
419210e230b6Smaya   uint32_t                             UpdateGatherTableOnly;
419310e230b6Smaya#define CommitGather                             0
419410e230b6Smaya#define NonCommitGather                          1
419510e230b6Smaya   uint32_t                             ConstantBufferBindingTableBlock;
419610e230b6Smaya   uint32_t                             ConstantBufferValid;
419710e230b6Smaya   uint32_t                             OnDieTable;
419810e230b6Smaya#define Load                                     0
419910e230b6Smaya#define Read                                     1
420010e230b6Smaya   bool                                 ConstantBufferDx9Enable;
420110e230b6Smaya   bool                                 ConstantBufferDx9GenerateStall;
420210e230b6Smaya   uint64_t                             GatherBufferOffset;
420310e230b6Smaya   /* variable length fields follow */
420410e230b6Smaya};
420510e230b6Smaya
420610e230b6Smayastatic inline void
420710e230b6SmayaGEN10_3DSTATE_GATHER_CONSTANT_PS_pack(__attribute__((unused)) __gen_user_data *data,
420810e230b6Smaya                                      __attribute__((unused)) void * restrict dst,
420910e230b6Smaya                                      __attribute__((unused)) const struct GEN10_3DSTATE_GATHER_CONSTANT_PS * restrict values)
421010e230b6Smaya{
421110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
421210e230b6Smaya
421310e230b6Smaya   dw[0] =
421410e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
421510e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
421610e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
421710e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
421810e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
421910e230b6Smaya
422010e230b6Smaya   dw[1] =
422110e230b6Smaya      __gen_uint(values->DX9OnDieRegisterReadEnable, 0, 0) |
422210e230b6Smaya      __gen_uint(values->UpdateGatherTableOnly, 1, 1) |
422310e230b6Smaya      __gen_uint(values->ConstantBufferBindingTableBlock, 12, 15) |
422410e230b6Smaya      __gen_uint(values->ConstantBufferValid, 16, 31);
422510e230b6Smaya
422610e230b6Smaya   dw[2] =
422710e230b6Smaya      __gen_uint(values->OnDieTable, 3, 3) |
422810e230b6Smaya      __gen_uint(values->ConstantBufferDx9Enable, 4, 4) |
422910e230b6Smaya      __gen_uint(values->ConstantBufferDx9GenerateStall, 5, 5) |
423010e230b6Smaya      __gen_offset(values->GatherBufferOffset, 6, 22);
423110e230b6Smaya}
423210e230b6Smaya
423310e230b6Smaya#define GEN10_3DSTATE_GATHER_CONSTANT_VS_length_bias      2
423410e230b6Smaya#define GEN10_3DSTATE_GATHER_CONSTANT_VS_header \
423510e230b6Smaya   .DWordLength                         =      0,  \
423610e230b6Smaya   ._3DCommandSubOpcode                 =     52,  \
423710e230b6Smaya   ._3DCommandOpcode                    =      0,  \
423810e230b6Smaya   .CommandSubType                      =      3,  \
423910e230b6Smaya   .CommandType                         =      3
424010e230b6Smaya
424110e230b6Smayastruct GEN10_3DSTATE_GATHER_CONSTANT_VS {
424210e230b6Smaya   uint32_t                             DWordLength;
424310e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
424410e230b6Smaya   uint32_t                             _3DCommandOpcode;
424510e230b6Smaya   uint32_t                             CommandSubType;
424610e230b6Smaya   uint32_t                             CommandType;
424710e230b6Smaya   bool                                 DX9OnDieRegisterReadEnable;
424810e230b6Smaya   uint32_t                             UpdateGatherTableOnly;
424910e230b6Smaya#define CommitGather                             0
425010e230b6Smaya#define NonCommitGather                          1
425110e230b6Smaya   uint32_t                             ConstantBufferBindingTableBlock;
425210e230b6Smaya   uint32_t                             ConstantBufferValid;
425310e230b6Smaya   uint32_t                             OnDieTable;
425410e230b6Smaya#define Load                                     0
425510e230b6Smaya#define Read                                     1
425610e230b6Smaya   bool                                 ConstantBufferDx9Enable;
425710e230b6Smaya   bool                                 ConstantBufferDx9GenerateStall;
425810e230b6Smaya   uint64_t                             GatherBufferOffset;
425910e230b6Smaya   /* variable length fields follow */
426010e230b6Smaya};
426110e230b6Smaya
426210e230b6Smayastatic inline void
426310e230b6SmayaGEN10_3DSTATE_GATHER_CONSTANT_VS_pack(__attribute__((unused)) __gen_user_data *data,
426410e230b6Smaya                                      __attribute__((unused)) void * restrict dst,
426510e230b6Smaya                                      __attribute__((unused)) const struct GEN10_3DSTATE_GATHER_CONSTANT_VS * restrict values)
426610e230b6Smaya{
426710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
426810e230b6Smaya
426910e230b6Smaya   dw[0] =
427010e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
427110e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
427210e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
427310e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
427410e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
427510e230b6Smaya
427610e230b6Smaya   dw[1] =
427710e230b6Smaya      __gen_uint(values->DX9OnDieRegisterReadEnable, 0, 0) |
427810e230b6Smaya      __gen_uint(values->UpdateGatherTableOnly, 1, 1) |
427910e230b6Smaya      __gen_uint(values->ConstantBufferBindingTableBlock, 12, 15) |
428010e230b6Smaya      __gen_uint(values->ConstantBufferValid, 16, 31);
428110e230b6Smaya
428210e230b6Smaya   dw[2] =
428310e230b6Smaya      __gen_uint(values->OnDieTable, 3, 3) |
428410e230b6Smaya      __gen_uint(values->ConstantBufferDx9Enable, 4, 4) |
428510e230b6Smaya      __gen_uint(values->ConstantBufferDx9GenerateStall, 5, 5) |
428610e230b6Smaya      __gen_offset(values->GatherBufferOffset, 6, 22);
428710e230b6Smaya}
428810e230b6Smaya
428910e230b6Smaya#define GEN10_3DSTATE_GATHER_POOL_ALLOC_length      4
429010e230b6Smaya#define GEN10_3DSTATE_GATHER_POOL_ALLOC_length_bias      2
429110e230b6Smaya#define GEN10_3DSTATE_GATHER_POOL_ALLOC_header  \
429210e230b6Smaya   .DWordLength                         =      2,  \
429310e230b6Smaya   ._3DCommandSubOpcode                 =     26,  \
429410e230b6Smaya   ._3DCommandOpcode                    =      1,  \
429510e230b6Smaya   .CommandSubType                      =      3,  \
429610e230b6Smaya   .CommandType                         =      3
429710e230b6Smaya
429810e230b6Smayastruct GEN10_3DSTATE_GATHER_POOL_ALLOC {
429910e230b6Smaya   uint32_t                             DWordLength;
430010e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
430110e230b6Smaya   uint32_t                             _3DCommandOpcode;
430210e230b6Smaya   uint32_t                             CommandSubType;
430310e230b6Smaya   uint32_t                             CommandType;
430410e230b6Smaya   uint32_t                             MOCS;
430510e230b6Smaya   bool                                 GatherPoolEnable;
430610e230b6Smaya   __gen_address_type                   GatherPoolBaseAddress;
430710e230b6Smaya   uint32_t                             GatherPoolBufferSize;
430810e230b6Smaya};
430910e230b6Smaya
431010e230b6Smayastatic inline void
431110e230b6SmayaGEN10_3DSTATE_GATHER_POOL_ALLOC_pack(__attribute__((unused)) __gen_user_data *data,
431210e230b6Smaya                                     __attribute__((unused)) void * restrict dst,
431310e230b6Smaya                                     __attribute__((unused)) const struct GEN10_3DSTATE_GATHER_POOL_ALLOC * restrict values)
431410e230b6Smaya{
431510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
431610e230b6Smaya
431710e230b6Smaya   dw[0] =
431810e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
431910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
432010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
432110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
432210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
432310e230b6Smaya
432410e230b6Smaya   const uint64_t v1 =
432510e230b6Smaya      __gen_uint(values->MOCS, 0, 6) |
432610e230b6Smaya      __gen_uint(values->GatherPoolEnable, 11, 11);
432710e230b6Smaya   const uint64_t v1_address =
432810e230b6Smaya      __gen_combine_address(data, &dw[1], values->GatherPoolBaseAddress, v1);
432910e230b6Smaya   dw[1] = v1_address;
433010e230b6Smaya   dw[2] = (v1_address >> 32) | (v1 >> 32);
433110e230b6Smaya
433210e230b6Smaya   dw[3] =
433310e230b6Smaya      __gen_uint(values->GatherPoolBufferSize, 12, 31);
433410e230b6Smaya}
433510e230b6Smaya
433610e230b6Smaya#define GEN10_3DSTATE_GS_length               10
433710e230b6Smaya#define GEN10_3DSTATE_GS_length_bias           2
433810e230b6Smaya#define GEN10_3DSTATE_GS_header                 \
433910e230b6Smaya   .DWordLength                         =      8,  \
434010e230b6Smaya   ._3DCommandSubOpcode                 =     17,  \
434110e230b6Smaya   ._3DCommandOpcode                    =      0,  \
434210e230b6Smaya   .CommandSubType                      =      3,  \
434310e230b6Smaya   .CommandType                         =      3
434410e230b6Smaya
434510e230b6Smayastruct GEN10_3DSTATE_GS {
434610e230b6Smaya   uint32_t                             DWordLength;
434710e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
434810e230b6Smaya   uint32_t                             _3DCommandOpcode;
434910e230b6Smaya   uint32_t                             CommandSubType;
435010e230b6Smaya   uint32_t                             CommandType;
435110e230b6Smaya   uint64_t                             KernelStartPointer;
435210e230b6Smaya   uint32_t                             ExpectedVertexCount;
435310e230b6Smaya   bool                                 SoftwareExceptionEnable;
435410e230b6Smaya   bool                                 MaskStackExceptionEnable;
435510e230b6Smaya   bool                                 AccessesUAV;
435610e230b6Smaya   bool                                 IllegalOpcodeExceptionEnable;
435710e230b6Smaya   uint32_t                             FloatingPointMode;
435810e230b6Smaya#define IEEE754                                  0
435910e230b6Smaya#define Alternate                                1
436010e230b6Smaya   uint32_t                             ThreadDispatchPriority;
436110e230b6Smaya#define High                                     1
436210e230b6Smaya   uint32_t                             BindingTableEntryCount;
436310e230b6Smaya   uint32_t                             SamplerCount;
436410e230b6Smaya#define NoSamplers                               0
436510e230b6Smaya#define _14Samplers                              1
436610e230b6Smaya#define _58Samplers                              2
436710e230b6Smaya#define _912Samplers                             3
436810e230b6Smaya#define _1316Samplers                            4
436910e230b6Smaya   bool                                 VectorMaskEnable;
437010e230b6Smaya   bool                                 SingleProgramFlow;
437110e230b6Smaya   uint32_t                             PerThreadScratchSpace;
437210e230b6Smaya   __gen_address_type                   ScratchSpaceBasePointer;
437310e230b6Smaya   uint32_t                             DispatchGRFStartRegisterForURBData;
437410e230b6Smaya   uint32_t                             VertexURBEntryReadOffset;
437510e230b6Smaya   bool                                 IncludeVertexHandles;
437610e230b6Smaya   uint32_t                             VertexURBEntryReadLength;
437710e230b6Smaya   enum GEN10_3D_Prim_Topo_Type         OutputTopology;
437810e230b6Smaya   uint32_t                             OutputVertexSize;
437910e230b6Smaya   uint32_t                             DispatchGRFStartRegisterForURBData54;
438010e230b6Smaya   bool                                 Enable;
438110e230b6Smaya   bool                                 DiscardAdjacency;
438210e230b6Smaya   uint32_t                             ReorderMode;
438310e230b6Smaya#define LEADING                                  0
438410e230b6Smaya#define TRAILING                                 1
438510e230b6Smaya   uint32_t                             Hint;
438610e230b6Smaya   bool                                 IncludePrimitiveID;
438710e230b6Smaya   uint32_t                             InvocationsIncrementValue;
438810e230b6Smaya   bool                                 StatisticsEnable;
438910e230b6Smaya   uint32_t                             DispatchMode;
439010e230b6Smaya#define DISPATCH_MODE_DualInstance               1
439110e230b6Smaya#define DISPATCH_MODE_DualObject                 2
439210e230b6Smaya#define DISPATCH_MODE_SIMD8                      3
439310e230b6Smaya   uint32_t                             DefaultStreamId;
439410e230b6Smaya   uint32_t                             InstanceControl;
439510e230b6Smaya   uint32_t                             ControlDataHeaderSize;
439610e230b6Smaya   uint32_t                             MaximumNumberofThreads;
439710e230b6Smaya   uint32_t                             StaticOutputVertexCount;
439810e230b6Smaya   bool                                 StaticOutput;
439910e230b6Smaya   uint32_t                             ControlDataFormat;
440010e230b6Smaya#define CUT                                      0
440110e230b6Smaya#define SID                                      1
440210e230b6Smaya   uint32_t                             UserClipDistanceCullTestEnableBitmask;
440310e230b6Smaya   uint32_t                             UserClipDistanceClipTestEnableBitmask;
440410e230b6Smaya   uint32_t                             VertexURBEntryOutputLength;
440510e230b6Smaya   uint32_t                             VertexURBEntryOutputReadOffset;
440610e230b6Smaya};
440710e230b6Smaya
440810e230b6Smayastatic inline void
440910e230b6SmayaGEN10_3DSTATE_GS_pack(__attribute__((unused)) __gen_user_data *data,
441010e230b6Smaya                      __attribute__((unused)) void * restrict dst,
441110e230b6Smaya                      __attribute__((unused)) const struct GEN10_3DSTATE_GS * restrict values)
441210e230b6Smaya{
441310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
441410e230b6Smaya
441510e230b6Smaya   dw[0] =
441610e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
441710e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
441810e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
441910e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
442010e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
442110e230b6Smaya
442210e230b6Smaya   const uint64_t v1 =
442310e230b6Smaya      __gen_offset(values->KernelStartPointer, 6, 63);
442410e230b6Smaya   dw[1] = v1;
442510e230b6Smaya   dw[2] = v1 >> 32;
442610e230b6Smaya
442710e230b6Smaya   dw[3] =
442810e230b6Smaya      __gen_uint(values->ExpectedVertexCount, 0, 5) |
442910e230b6Smaya      __gen_uint(values->SoftwareExceptionEnable, 7, 7) |
443010e230b6Smaya      __gen_uint(values->MaskStackExceptionEnable, 11, 11) |
443110e230b6Smaya      __gen_uint(values->AccessesUAV, 12, 12) |
443210e230b6Smaya      __gen_uint(values->IllegalOpcodeExceptionEnable, 13, 13) |
443310e230b6Smaya      __gen_uint(values->FloatingPointMode, 16, 16) |
443410e230b6Smaya      __gen_uint(values->ThreadDispatchPriority, 17, 17) |
443510e230b6Smaya      __gen_uint(values->BindingTableEntryCount, 18, 25) |
443610e230b6Smaya      __gen_uint(values->SamplerCount, 27, 29) |
443710e230b6Smaya      __gen_uint(values->VectorMaskEnable, 30, 30) |
443810e230b6Smaya      __gen_uint(values->SingleProgramFlow, 31, 31);
443910e230b6Smaya
444010e230b6Smaya   const uint64_t v4 =
444110e230b6Smaya      __gen_uint(values->PerThreadScratchSpace, 0, 3);
444210e230b6Smaya   const uint64_t v4_address =
444310e230b6Smaya      __gen_combine_address(data, &dw[4], values->ScratchSpaceBasePointer, v4);
444410e230b6Smaya   dw[4] = v4_address;
444510e230b6Smaya   dw[5] = (v4_address >> 32) | (v4 >> 32);
444610e230b6Smaya
444710e230b6Smaya   dw[6] =
444810e230b6Smaya      __gen_uint(values->DispatchGRFStartRegisterForURBData, 0, 3) |
444910e230b6Smaya      __gen_uint(values->VertexURBEntryReadOffset, 4, 9) |
445010e230b6Smaya      __gen_uint(values->IncludeVertexHandles, 10, 10) |
445110e230b6Smaya      __gen_uint(values->VertexURBEntryReadLength, 11, 16) |
445210e230b6Smaya      __gen_uint(values->OutputTopology, 17, 22) |
445310e230b6Smaya      __gen_uint(values->OutputVertexSize, 23, 28) |
445410e230b6Smaya      __gen_uint(values->DispatchGRFStartRegisterForURBData54, 29, 30);
445510e230b6Smaya
445610e230b6Smaya   dw[7] =
445710e230b6Smaya      __gen_uint(values->Enable, 0, 0) |
445810e230b6Smaya      __gen_uint(values->DiscardAdjacency, 1, 1) |
445910e230b6Smaya      __gen_uint(values->ReorderMode, 2, 2) |
446010e230b6Smaya      __gen_uint(values->Hint, 3, 3) |
446110e230b6Smaya      __gen_uint(values->IncludePrimitiveID, 4, 4) |
446210e230b6Smaya      __gen_uint(values->InvocationsIncrementValue, 5, 9) |
446310e230b6Smaya      __gen_uint(values->StatisticsEnable, 10, 10) |
446410e230b6Smaya      __gen_uint(values->DispatchMode, 11, 12) |
446510e230b6Smaya      __gen_uint(values->DefaultStreamId, 13, 14) |
446610e230b6Smaya      __gen_uint(values->InstanceControl, 15, 19) |
446710e230b6Smaya      __gen_uint(values->ControlDataHeaderSize, 20, 23);
446810e230b6Smaya
446910e230b6Smaya   dw[8] =
447010e230b6Smaya      __gen_uint(values->MaximumNumberofThreads, 0, 8) |
447110e230b6Smaya      __gen_uint(values->StaticOutputVertexCount, 16, 26) |
447210e230b6Smaya      __gen_uint(values->StaticOutput, 30, 30) |
447310e230b6Smaya      __gen_uint(values->ControlDataFormat, 31, 31);
447410e230b6Smaya
447510e230b6Smaya   dw[9] =
447610e230b6Smaya      __gen_uint(values->UserClipDistanceCullTestEnableBitmask, 0, 7) |
447710e230b6Smaya      __gen_uint(values->UserClipDistanceClipTestEnableBitmask, 8, 15) |
447810e230b6Smaya      __gen_uint(values->VertexURBEntryOutputLength, 16, 20) |
447910e230b6Smaya      __gen_uint(values->VertexURBEntryOutputReadOffset, 21, 26);
448010e230b6Smaya}
448110e230b6Smaya
448210e230b6Smaya#define GEN10_3DSTATE_HIER_DEPTH_BUFFER_length      5
448310e230b6Smaya#define GEN10_3DSTATE_HIER_DEPTH_BUFFER_length_bias      2
448410e230b6Smaya#define GEN10_3DSTATE_HIER_DEPTH_BUFFER_header  \
448510e230b6Smaya   .DWordLength                         =      3,  \
448610e230b6Smaya   ._3DCommandSubOpcode                 =      7,  \
448710e230b6Smaya   ._3DCommandOpcode                    =      0,  \
448810e230b6Smaya   .CommandSubType                      =      3,  \
448910e230b6Smaya   .CommandType                         =      3
449010e230b6Smaya
449110e230b6Smayastruct GEN10_3DSTATE_HIER_DEPTH_BUFFER {
449210e230b6Smaya   uint32_t                             DWordLength;
449310e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
449410e230b6Smaya   uint32_t                             _3DCommandOpcode;
449510e230b6Smaya   uint32_t                             CommandSubType;
449610e230b6Smaya   uint32_t                             CommandType;
449710e230b6Smaya   uint32_t                             SurfacePitch;
449810e230b6Smaya   uint32_t                             MOCS;
449910e230b6Smaya   __gen_address_type                   SurfaceBaseAddress;
450010e230b6Smaya   uint32_t                             SurfaceQPitch;
450110e230b6Smaya};
450210e230b6Smaya
450310e230b6Smayastatic inline void
450410e230b6SmayaGEN10_3DSTATE_HIER_DEPTH_BUFFER_pack(__attribute__((unused)) __gen_user_data *data,
450510e230b6Smaya                                     __attribute__((unused)) void * restrict dst,
450610e230b6Smaya                                     __attribute__((unused)) const struct GEN10_3DSTATE_HIER_DEPTH_BUFFER * restrict values)
450710e230b6Smaya{
450810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
450910e230b6Smaya
451010e230b6Smaya   dw[0] =
451110e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
451210e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
451310e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
451410e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
451510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
451610e230b6Smaya
451710e230b6Smaya   dw[1] =
451810e230b6Smaya      __gen_uint(values->SurfacePitch, 0, 16) |
451910e230b6Smaya      __gen_uint(values->MOCS, 25, 31);
452010e230b6Smaya
452110e230b6Smaya   const uint64_t v2_address =
452210e230b6Smaya      __gen_combine_address(data, &dw[2], values->SurfaceBaseAddress, 0);
452310e230b6Smaya   dw[2] = v2_address;
452410e230b6Smaya   dw[3] = v2_address >> 32;
452510e230b6Smaya
452610e230b6Smaya   dw[4] =
452710e230b6Smaya      __gen_uint(values->SurfaceQPitch, 0, 14);
452810e230b6Smaya}
452910e230b6Smaya
453010e230b6Smaya#define GEN10_3DSTATE_HS_length                9
453110e230b6Smaya#define GEN10_3DSTATE_HS_length_bias           2
453210e230b6Smaya#define GEN10_3DSTATE_HS_header                 \
453310e230b6Smaya   .DWordLength                         =      7,  \
453410e230b6Smaya   ._3DCommandSubOpcode                 =     27,  \
453510e230b6Smaya   ._3DCommandOpcode                    =      0,  \
453610e230b6Smaya   .CommandSubType                      =      3,  \
453710e230b6Smaya   .CommandType                         =      3
453810e230b6Smaya
453910e230b6Smayastruct GEN10_3DSTATE_HS {
454010e230b6Smaya   uint32_t                             DWordLength;
454110e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
454210e230b6Smaya   uint32_t                             _3DCommandOpcode;
454310e230b6Smaya   uint32_t                             CommandSubType;
454410e230b6Smaya   uint32_t                             CommandType;
454510e230b6Smaya   bool                                 SoftwareExceptionEnable;
454610e230b6Smaya   bool                                 IllegalOpcodeExceptionEnable;
454710e230b6Smaya   uint32_t                             FloatingPointMode;
454810e230b6Smaya#define IEEE754                                  0
454910e230b6Smaya#define alternate                                1
455010e230b6Smaya   uint32_t                             ThreadDispatchPriority;
455110e230b6Smaya#define High                                     1
455210e230b6Smaya   uint32_t                             BindingTableEntryCount;
455310e230b6Smaya   uint32_t                             SamplerCount;
455410e230b6Smaya#define NoSamplers                               0
455510e230b6Smaya#define _14Samplers                              1
455610e230b6Smaya#define _58Samplers                              2
455710e230b6Smaya#define _912Samplers                             3
455810e230b6Smaya#define _1316Samplers                            4
455910e230b6Smaya   uint32_t                             InstanceCount;
456010e230b6Smaya   uint32_t                             MaximumNumberofThreads;
456110e230b6Smaya   bool                                 StatisticsEnable;
456210e230b6Smaya   bool                                 Enable;
456310e230b6Smaya   uint64_t                             KernelStartPointer;
456410e230b6Smaya   uint32_t                             PerThreadScratchSpace;
456510e230b6Smaya   __gen_address_type                   ScratchSpaceBasePointer;
456610e230b6Smaya   bool                                 IncludePrimitiveID;
456710e230b6Smaya   uint32_t                             VertexURBEntryReadOffset;
456810e230b6Smaya   uint32_t                             VertexURBEntryReadLength;
456910e230b6Smaya   uint32_t                             DispatchMode;
457010e230b6Smaya#define DISPATCH_MODE_SINGLE_PATCH               0
457110e230b6Smaya#define DISPATCH_MODE_DUAL_PATCH                 1
457210e230b6Smaya#define DISPATCH_MODE__8_PATCH                   2
457310e230b6Smaya   uint32_t                             DispatchGRFStartRegisterForURBData;
457410e230b6Smaya   bool                                 IncludeVertexHandles;
457510e230b6Smaya   bool                                 AccessesUAV;
457610e230b6Smaya   bool                                 VectorMaskEnable;
457710e230b6Smaya   bool                                 SingleProgramFlow;
457810e230b6Smaya   uint32_t                             DispatchGRFStartRegisterForURBData5;
457910e230b6Smaya};
458010e230b6Smaya
458110e230b6Smayastatic inline void
458210e230b6SmayaGEN10_3DSTATE_HS_pack(__attribute__((unused)) __gen_user_data *data,
458310e230b6Smaya                      __attribute__((unused)) void * restrict dst,
458410e230b6Smaya                      __attribute__((unused)) const struct GEN10_3DSTATE_HS * restrict values)
458510e230b6Smaya{
458610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
458710e230b6Smaya
458810e230b6Smaya   dw[0] =
458910e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
459010e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
459110e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
459210e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
459310e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
459410e230b6Smaya
459510e230b6Smaya   dw[1] =
459610e230b6Smaya      __gen_uint(values->SoftwareExceptionEnable, 12, 12) |
459710e230b6Smaya      __gen_uint(values->IllegalOpcodeExceptionEnable, 13, 13) |
459810e230b6Smaya      __gen_uint(values->FloatingPointMode, 16, 16) |
459910e230b6Smaya      __gen_uint(values->ThreadDispatchPriority, 17, 17) |
460010e230b6Smaya      __gen_uint(values->BindingTableEntryCount, 18, 25) |
460110e230b6Smaya      __gen_uint(values->SamplerCount, 27, 29);
460210e230b6Smaya
460310e230b6Smaya   dw[2] =
460410e230b6Smaya      __gen_uint(values->InstanceCount, 0, 3) |
460510e230b6Smaya      __gen_uint(values->MaximumNumberofThreads, 8, 16) |
460610e230b6Smaya      __gen_uint(values->StatisticsEnable, 29, 29) |
460710e230b6Smaya      __gen_uint(values->Enable, 31, 31);
460810e230b6Smaya
460910e230b6Smaya   const uint64_t v3 =
461010e230b6Smaya      __gen_offset(values->KernelStartPointer, 6, 63);
461110e230b6Smaya   dw[3] = v3;
461210e230b6Smaya   dw[4] = v3 >> 32;
461310e230b6Smaya
461410e230b6Smaya   const uint64_t v5 =
461510e230b6Smaya      __gen_uint(values->PerThreadScratchSpace, 0, 3);
461610e230b6Smaya   const uint64_t v5_address =
461710e230b6Smaya      __gen_combine_address(data, &dw[5], values->ScratchSpaceBasePointer, v5);
461810e230b6Smaya   dw[5] = v5_address;
461910e230b6Smaya   dw[6] = (v5_address >> 32) | (v5 >> 32);
462010e230b6Smaya
462110e230b6Smaya   dw[7] =
462210e230b6Smaya      __gen_uint(values->IncludePrimitiveID, 0, 0) |
462310e230b6Smaya      __gen_uint(values->VertexURBEntryReadOffset, 4, 9) |
462410e230b6Smaya      __gen_uint(values->VertexURBEntryReadLength, 11, 16) |
462510e230b6Smaya      __gen_uint(values->DispatchMode, 17, 18) |
462610e230b6Smaya      __gen_uint(values->DispatchGRFStartRegisterForURBData, 19, 23) |
462710e230b6Smaya      __gen_uint(values->IncludeVertexHandles, 24, 24) |
462810e230b6Smaya      __gen_uint(values->AccessesUAV, 25, 25) |
462910e230b6Smaya      __gen_uint(values->VectorMaskEnable, 26, 26) |
463010e230b6Smaya      __gen_uint(values->SingleProgramFlow, 27, 27) |
463110e230b6Smaya      __gen_uint(values->DispatchGRFStartRegisterForURBData5, 28, 28);
463210e230b6Smaya
463310e230b6Smaya   dw[8] = 0;
463410e230b6Smaya}
463510e230b6Smaya
463610e230b6Smaya#define GEN10_3DSTATE_INDEX_BUFFER_length      5
463710e230b6Smaya#define GEN10_3DSTATE_INDEX_BUFFER_length_bias      2
463810e230b6Smaya#define GEN10_3DSTATE_INDEX_BUFFER_header       \
463910e230b6Smaya   .DWordLength                         =      3,  \
464010e230b6Smaya   ._3DCommandSubOpcode                 =     10,  \
464110e230b6Smaya   ._3DCommandOpcode                    =      0,  \
464210e230b6Smaya   .CommandSubType                      =      3,  \
464310e230b6Smaya   .CommandType                         =      3
464410e230b6Smaya
464510e230b6Smayastruct GEN10_3DSTATE_INDEX_BUFFER {
464610e230b6Smaya   uint32_t                             DWordLength;
464710e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
464810e230b6Smaya   uint32_t                             _3DCommandOpcode;
464910e230b6Smaya   uint32_t                             CommandSubType;
465010e230b6Smaya   uint32_t                             CommandType;
465110e230b6Smaya   uint32_t                             MOCS;
465210e230b6Smaya   uint32_t                             IndexFormat;
465310e230b6Smaya#define INDEX_BYTE                               0
465410e230b6Smaya#define INDEX_WORD                               1
465510e230b6Smaya#define INDEX_DWORD                              2
465610e230b6Smaya   __gen_address_type                   BufferStartingAddress;
465710e230b6Smaya   uint32_t                             BufferSize;
465810e230b6Smaya};
465910e230b6Smaya
466010e230b6Smayastatic inline void
466110e230b6SmayaGEN10_3DSTATE_INDEX_BUFFER_pack(__attribute__((unused)) __gen_user_data *data,
466210e230b6Smaya                                __attribute__((unused)) void * restrict dst,
466310e230b6Smaya                                __attribute__((unused)) const struct GEN10_3DSTATE_INDEX_BUFFER * restrict values)
466410e230b6Smaya{
466510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
466610e230b6Smaya
466710e230b6Smaya   dw[0] =
466810e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
466910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
467010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
467110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
467210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
467310e230b6Smaya
467410e230b6Smaya   dw[1] =
467510e230b6Smaya      __gen_uint(values->MOCS, 0, 6) |
467610e230b6Smaya      __gen_uint(values->IndexFormat, 8, 9);
467710e230b6Smaya
467810e230b6Smaya   const uint64_t v2_address =
467910e230b6Smaya      __gen_combine_address(data, &dw[2], values->BufferStartingAddress, 0);
468010e230b6Smaya   dw[2] = v2_address;
468110e230b6Smaya   dw[3] = v2_address >> 32;
468210e230b6Smaya
468310e230b6Smaya   dw[4] =
468410e230b6Smaya      __gen_uint(values->BufferSize, 0, 31);
468510e230b6Smaya}
468610e230b6Smaya
468710e230b6Smaya#define GEN10_3DSTATE_LINE_STIPPLE_length      3
468810e230b6Smaya#define GEN10_3DSTATE_LINE_STIPPLE_length_bias      2
468910e230b6Smaya#define GEN10_3DSTATE_LINE_STIPPLE_header       \
469010e230b6Smaya   .DWordLength                         =      1,  \
469110e230b6Smaya   ._3DCommandSubOpcode                 =      8,  \
469210e230b6Smaya   ._3DCommandOpcode                    =      1,  \
469310e230b6Smaya   .CommandSubType                      =      3,  \
469410e230b6Smaya   .CommandType                         =      3
469510e230b6Smaya
469610e230b6Smayastruct GEN10_3DSTATE_LINE_STIPPLE {
469710e230b6Smaya   uint32_t                             DWordLength;
469810e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
469910e230b6Smaya   uint32_t                             _3DCommandOpcode;
470010e230b6Smaya   uint32_t                             CommandSubType;
470110e230b6Smaya   uint32_t                             CommandType;
470210e230b6Smaya   uint32_t                             LineStipplePattern;
470310e230b6Smaya   uint32_t                             CurrentStippleIndex;
470410e230b6Smaya   uint32_t                             CurrentRepeatCounter;
470510e230b6Smaya   bool                                 ModifyEnableCurrentRepeatCounterCurrentStippleIndex;
470610e230b6Smaya   uint32_t                             LineStippleRepeatCount;
470710e230b6Smaya   float                                LineStippleInverseRepeatCount;
470810e230b6Smaya};
470910e230b6Smaya
471010e230b6Smayastatic inline void
471110e230b6SmayaGEN10_3DSTATE_LINE_STIPPLE_pack(__attribute__((unused)) __gen_user_data *data,
471210e230b6Smaya                                __attribute__((unused)) void * restrict dst,
471310e230b6Smaya                                __attribute__((unused)) const struct GEN10_3DSTATE_LINE_STIPPLE * restrict values)
471410e230b6Smaya{
471510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
471610e230b6Smaya
471710e230b6Smaya   dw[0] =
471810e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
471910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
472010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
472110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
472210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
472310e230b6Smaya
472410e230b6Smaya   dw[1] =
472510e230b6Smaya      __gen_uint(values->LineStipplePattern, 0, 15) |
472610e230b6Smaya      __gen_uint(values->CurrentStippleIndex, 16, 19) |
472710e230b6Smaya      __gen_uint(values->CurrentRepeatCounter, 21, 29) |
472810e230b6Smaya      __gen_uint(values->ModifyEnableCurrentRepeatCounterCurrentStippleIndex, 31, 31);
472910e230b6Smaya
473010e230b6Smaya   dw[2] =
473110e230b6Smaya      __gen_uint(values->LineStippleRepeatCount, 0, 8) |
473210e230b6Smaya      __gen_ufixed(values->LineStippleInverseRepeatCount, 15, 31, 16);
473310e230b6Smaya}
473410e230b6Smaya
473510e230b6Smaya#define GEN10_3DSTATE_MONOFILTER_SIZE_length      2
473610e230b6Smaya#define GEN10_3DSTATE_MONOFILTER_SIZE_length_bias      2
473710e230b6Smaya#define GEN10_3DSTATE_MONOFILTER_SIZE_header    \
473810e230b6Smaya   .DWordLength                         =      0,  \
473910e230b6Smaya   ._3DCommandSubOpcode                 =     17,  \
474010e230b6Smaya   ._3DCommandOpcode                    =      1,  \
474110e230b6Smaya   .CommandSubType                      =      3,  \
474210e230b6Smaya   .CommandType                         =      3
474310e230b6Smaya
474410e230b6Smayastruct GEN10_3DSTATE_MONOFILTER_SIZE {
474510e230b6Smaya   uint32_t                             DWordLength;
474610e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
474710e230b6Smaya   uint32_t                             _3DCommandOpcode;
474810e230b6Smaya   uint32_t                             CommandSubType;
474910e230b6Smaya   uint32_t                             CommandType;
475010e230b6Smaya   uint32_t                             MonochromeFilterHeight;
475110e230b6Smaya   uint32_t                             MonochromeFilterWidth;
475210e230b6Smaya};
475310e230b6Smaya
475410e230b6Smayastatic inline void
475510e230b6SmayaGEN10_3DSTATE_MONOFILTER_SIZE_pack(__attribute__((unused)) __gen_user_data *data,
475610e230b6Smaya                                   __attribute__((unused)) void * restrict dst,
475710e230b6Smaya                                   __attribute__((unused)) const struct GEN10_3DSTATE_MONOFILTER_SIZE * restrict values)
475810e230b6Smaya{
475910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
476010e230b6Smaya
476110e230b6Smaya   dw[0] =
476210e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
476310e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
476410e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
476510e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
476610e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
476710e230b6Smaya
476810e230b6Smaya   dw[1] =
476910e230b6Smaya      __gen_uint(values->MonochromeFilterHeight, 0, 2) |
477010e230b6Smaya      __gen_uint(values->MonochromeFilterWidth, 3, 5);
477110e230b6Smaya}
477210e230b6Smaya
477310e230b6Smaya#define GEN10_3DSTATE_MULTISAMPLE_length       2
477410e230b6Smaya#define GEN10_3DSTATE_MULTISAMPLE_length_bias      2
477510e230b6Smaya#define GEN10_3DSTATE_MULTISAMPLE_header        \
477610e230b6Smaya   .DWordLength                         =      0,  \
477710e230b6Smaya   ._3DCommandSubOpcode                 =     13,  \
477810e230b6Smaya   ._3DCommandOpcode                    =      0,  \
477910e230b6Smaya   .CommandSubType                      =      3,  \
478010e230b6Smaya   .CommandType                         =      3
478110e230b6Smaya
478210e230b6Smayastruct GEN10_3DSTATE_MULTISAMPLE {
478310e230b6Smaya   uint32_t                             DWordLength;
478410e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
478510e230b6Smaya   uint32_t                             _3DCommandOpcode;
478610e230b6Smaya   uint32_t                             CommandSubType;
478710e230b6Smaya   uint32_t                             CommandType;
478810e230b6Smaya   uint32_t                             NumberofMultisamples;
478910e230b6Smaya   uint32_t                             PixelLocation;
479010e230b6Smaya#define CENTER                                   0
479110e230b6Smaya#define UL_CORNER                                1
479210e230b6Smaya   bool                                 PixelPositionOffsetEnable;
479310e230b6Smaya};
479410e230b6Smaya
479510e230b6Smayastatic inline void
479610e230b6SmayaGEN10_3DSTATE_MULTISAMPLE_pack(__attribute__((unused)) __gen_user_data *data,
479710e230b6Smaya                               __attribute__((unused)) void * restrict dst,
479810e230b6Smaya                               __attribute__((unused)) const struct GEN10_3DSTATE_MULTISAMPLE * restrict values)
479910e230b6Smaya{
480010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
480110e230b6Smaya
480210e230b6Smaya   dw[0] =
480310e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
480410e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
480510e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
480610e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
480710e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
480810e230b6Smaya
480910e230b6Smaya   dw[1] =
481010e230b6Smaya      __gen_uint(values->NumberofMultisamples, 1, 3) |
481110e230b6Smaya      __gen_uint(values->PixelLocation, 4, 4) |
481210e230b6Smaya      __gen_uint(values->PixelPositionOffsetEnable, 5, 5);
481310e230b6Smaya}
481410e230b6Smaya
481510e230b6Smaya#define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_length      2
481610e230b6Smaya#define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_length_bias      2
481710e230b6Smaya#define GEN10_3DSTATE_POLY_STIPPLE_OFFSET_header\
481810e230b6Smaya   .DWordLength                         =      0,  \
481910e230b6Smaya   ._3DCommandSubOpcode                 =      6,  \
482010e230b6Smaya   ._3DCommandOpcode                    =      1,  \
482110e230b6Smaya   .CommandSubType                      =      3,  \
482210e230b6Smaya   .CommandType                         =      3
482310e230b6Smaya
482410e230b6Smayastruct GEN10_3DSTATE_POLY_STIPPLE_OFFSET {
482510e230b6Smaya   uint32_t                             DWordLength;
482610e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
482710e230b6Smaya   uint32_t                             _3DCommandOpcode;
482810e230b6Smaya   uint32_t                             CommandSubType;
482910e230b6Smaya   uint32_t                             CommandType;
483010e230b6Smaya   uint32_t                             PolygonStippleYOffset;
483110e230b6Smaya   uint32_t                             PolygonStippleXOffset;
483210e230b6Smaya};
483310e230b6Smaya
483410e230b6Smayastatic inline void
483510e230b6SmayaGEN10_3DSTATE_POLY_STIPPLE_OFFSET_pack(__attribute__((unused)) __gen_user_data *data,
483610e230b6Smaya                                       __attribute__((unused)) void * restrict dst,
483710e230b6Smaya                                       __attribute__((unused)) const struct GEN10_3DSTATE_POLY_STIPPLE_OFFSET * restrict values)
483810e230b6Smaya{
483910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
484010e230b6Smaya
484110e230b6Smaya   dw[0] =
484210e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
484310e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
484410e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
484510e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
484610e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
484710e230b6Smaya
484810e230b6Smaya   dw[1] =
484910e230b6Smaya      __gen_uint(values->PolygonStippleYOffset, 0, 4) |
485010e230b6Smaya      __gen_uint(values->PolygonStippleXOffset, 8, 12);
485110e230b6Smaya}
485210e230b6Smaya
485310e230b6Smaya#define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_length     33
485410e230b6Smaya#define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_length_bias      2
485510e230b6Smaya#define GEN10_3DSTATE_POLY_STIPPLE_PATTERN_header\
485610e230b6Smaya   .DWordLength                         =     31,  \
485710e230b6Smaya   ._3DCommandSubOpcode                 =      7,  \
485810e230b6Smaya   ._3DCommandOpcode                    =      1,  \
485910e230b6Smaya   .CommandSubType                      =      3,  \
486010e230b6Smaya   .CommandType                         =      3
486110e230b6Smaya
486210e230b6Smayastruct GEN10_3DSTATE_POLY_STIPPLE_PATTERN {
486310e230b6Smaya   uint32_t                             DWordLength;
486410e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
486510e230b6Smaya   uint32_t                             _3DCommandOpcode;
486610e230b6Smaya   uint32_t                             CommandSubType;
486710e230b6Smaya   uint32_t                             CommandType;
486810e230b6Smaya   uint32_t                             PatternRow[32];
486910e230b6Smaya};
487010e230b6Smaya
487110e230b6Smayastatic inline void
487210e230b6SmayaGEN10_3DSTATE_POLY_STIPPLE_PATTERN_pack(__attribute__((unused)) __gen_user_data *data,
487310e230b6Smaya                                        __attribute__((unused)) void * restrict dst,
487410e230b6Smaya                                        __attribute__((unused)) const struct GEN10_3DSTATE_POLY_STIPPLE_PATTERN * restrict values)
487510e230b6Smaya{
487610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
487710e230b6Smaya
487810e230b6Smaya   dw[0] =
487910e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
488010e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
488110e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
488210e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
488310e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
488410e230b6Smaya
488510e230b6Smaya   dw[1] =
488610e230b6Smaya      __gen_uint(values->PatternRow[0], 0, 31);
488710e230b6Smaya
488810e230b6Smaya   dw[2] =
488910e230b6Smaya      __gen_uint(values->PatternRow[1], 0, 31);
489010e230b6Smaya
489110e230b6Smaya   dw[3] =
489210e230b6Smaya      __gen_uint(values->PatternRow[2], 0, 31);
489310e230b6Smaya
489410e230b6Smaya   dw[4] =
489510e230b6Smaya      __gen_uint(values->PatternRow[3], 0, 31);
489610e230b6Smaya
489710e230b6Smaya   dw[5] =
489810e230b6Smaya      __gen_uint(values->PatternRow[4], 0, 31);
489910e230b6Smaya
490010e230b6Smaya   dw[6] =
490110e230b6Smaya      __gen_uint(values->PatternRow[5], 0, 31);
490210e230b6Smaya
490310e230b6Smaya   dw[7] =
490410e230b6Smaya      __gen_uint(values->PatternRow[6], 0, 31);
490510e230b6Smaya
490610e230b6Smaya   dw[8] =
490710e230b6Smaya      __gen_uint(values->PatternRow[7], 0, 31);
490810e230b6Smaya
490910e230b6Smaya   dw[9] =
491010e230b6Smaya      __gen_uint(values->PatternRow[8], 0, 31);
491110e230b6Smaya
491210e230b6Smaya   dw[10] =
491310e230b6Smaya      __gen_uint(values->PatternRow[9], 0, 31);
491410e230b6Smaya
491510e230b6Smaya   dw[11] =
491610e230b6Smaya      __gen_uint(values->PatternRow[10], 0, 31);
491710e230b6Smaya
491810e230b6Smaya   dw[12] =
491910e230b6Smaya      __gen_uint(values->PatternRow[11], 0, 31);
492010e230b6Smaya
492110e230b6Smaya   dw[13] =
492210e230b6Smaya      __gen_uint(values->PatternRow[12], 0, 31);
492310e230b6Smaya
492410e230b6Smaya   dw[14] =
492510e230b6Smaya      __gen_uint(values->PatternRow[13], 0, 31);
492610e230b6Smaya
492710e230b6Smaya   dw[15] =
492810e230b6Smaya      __gen_uint(values->PatternRow[14], 0, 31);
492910e230b6Smaya
493010e230b6Smaya   dw[16] =
493110e230b6Smaya      __gen_uint(values->PatternRow[15], 0, 31);
493210e230b6Smaya
493310e230b6Smaya   dw[17] =
493410e230b6Smaya      __gen_uint(values->PatternRow[16], 0, 31);
493510e230b6Smaya
493610e230b6Smaya   dw[18] =
493710e230b6Smaya      __gen_uint(values->PatternRow[17], 0, 31);
493810e230b6Smaya
493910e230b6Smaya   dw[19] =
494010e230b6Smaya      __gen_uint(values->PatternRow[18], 0, 31);
494110e230b6Smaya
494210e230b6Smaya   dw[20] =
494310e230b6Smaya      __gen_uint(values->PatternRow[19], 0, 31);
494410e230b6Smaya
494510e230b6Smaya   dw[21] =
494610e230b6Smaya      __gen_uint(values->PatternRow[20], 0, 31);
494710e230b6Smaya
494810e230b6Smaya   dw[22] =
494910e230b6Smaya      __gen_uint(values->PatternRow[21], 0, 31);
495010e230b6Smaya
495110e230b6Smaya   dw[23] =
495210e230b6Smaya      __gen_uint(values->PatternRow[22], 0, 31);
495310e230b6Smaya
495410e230b6Smaya   dw[24] =
495510e230b6Smaya      __gen_uint(values->PatternRow[23], 0, 31);
495610e230b6Smaya
495710e230b6Smaya   dw[25] =
495810e230b6Smaya      __gen_uint(values->PatternRow[24], 0, 31);
495910e230b6Smaya
496010e230b6Smaya   dw[26] =
496110e230b6Smaya      __gen_uint(values->PatternRow[25], 0, 31);
496210e230b6Smaya
496310e230b6Smaya   dw[27] =
496410e230b6Smaya      __gen_uint(values->PatternRow[26], 0, 31);
496510e230b6Smaya
496610e230b6Smaya   dw[28] =
496710e230b6Smaya      __gen_uint(values->PatternRow[27], 0, 31);
496810e230b6Smaya
496910e230b6Smaya   dw[29] =
497010e230b6Smaya      __gen_uint(values->PatternRow[28], 0, 31);
497110e230b6Smaya
497210e230b6Smaya   dw[30] =
497310e230b6Smaya      __gen_uint(values->PatternRow[29], 0, 31);
497410e230b6Smaya
497510e230b6Smaya   dw[31] =
497610e230b6Smaya      __gen_uint(values->PatternRow[30], 0, 31);
497710e230b6Smaya
497810e230b6Smaya   dw[32] =
497910e230b6Smaya      __gen_uint(values->PatternRow[31], 0, 31);
498010e230b6Smaya}
498110e230b6Smaya
498210e230b6Smaya#define GEN10_3DSTATE_PS_length               12
498310e230b6Smaya#define GEN10_3DSTATE_PS_length_bias           2
498410e230b6Smaya#define GEN10_3DSTATE_PS_header                 \
498510e230b6Smaya   .DWordLength                         =     10,  \
498610e230b6Smaya   ._3DCommandSubOpcode                 =     32,  \
498710e230b6Smaya   ._3DCommandOpcode                    =      0,  \
498810e230b6Smaya   .CommandSubType                      =      3,  \
498910e230b6Smaya   .CommandType                         =      3
499010e230b6Smaya
499110e230b6Smayastruct GEN10_3DSTATE_PS {
499210e230b6Smaya   uint32_t                             DWordLength;
499310e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
499410e230b6Smaya   uint32_t                             _3DCommandOpcode;
499510e230b6Smaya   uint32_t                             CommandSubType;
499610e230b6Smaya   uint32_t                             CommandType;
499710e230b6Smaya   uint64_t                             KernelStartPointer0;
499810e230b6Smaya   bool                                 SoftwareExceptionEnable;
499910e230b6Smaya   bool                                 MaskStackExceptionEnable;
500010e230b6Smaya   bool                                 IllegalOpcodeExceptionEnable;
500110e230b6Smaya   uint32_t                             RoundingMode;
500210e230b6Smaya#define RTNE                                     0
500310e230b6Smaya#define RU                                       1
500410e230b6Smaya#define RD                                       2
500510e230b6Smaya#define RTZ                                      3
500610e230b6Smaya   uint32_t                             FloatingPointMode;
500710e230b6Smaya#define IEEE754                                  0
500810e230b6Smaya#define Alternate                                1
500910e230b6Smaya   uint32_t                             ThreadDispatchPriority;
501010e230b6Smaya#define High                                     1
501110e230b6Smaya   uint32_t                             BindingTableEntryCount;
501210e230b6Smaya   uint32_t                             SinglePrecisionDenormalMode;
501310e230b6Smaya#define FlushedtoZero                            0
501410e230b6Smaya#define Retained                                 1
501510e230b6Smaya   uint32_t                             SamplerCount;
501610e230b6Smaya#define NoSamplers                               0
501710e230b6Smaya#define _14Samplers                              1
501810e230b6Smaya#define _58Samplers                              2
501910e230b6Smaya#define _912Samplers                             3
502010e230b6Smaya#define _1316Samplers                            4
502110e230b6Smaya   bool                                 VectorMaskEnable;
502210e230b6Smaya   bool                                 SingleProgramFlow;
502310e230b6Smaya   uint32_t                             PerThreadScratchSpace;
502410e230b6Smaya   __gen_address_type                   ScratchSpaceBasePointer;
502510e230b6Smaya   bool                                 _8PixelDispatchEnable;
502610e230b6Smaya   bool                                 _16PixelDispatchEnable;
502710e230b6Smaya   bool                                 _32PixelDispatchEnable;
502810e230b6Smaya   uint32_t                             PositionXYOffsetSelect;
502910e230b6Smaya#define POSOFFSET_NONE                           0
503010e230b6Smaya#define POSOFFSET_CENTROID                       2
503110e230b6Smaya#define POSOFFSET_SAMPLE                         3
503210e230b6Smaya   uint32_t                             RenderTargetResolveType;
503310e230b6Smaya#define RESOLVE_DISABLED                         0
503410e230b6Smaya#define RESOLVE_PARTIAL                          1
503510e230b6Smaya#define FAST_CLEAR_0                             2
503610e230b6Smaya#define RESOLVE_FULL                             3
503710e230b6Smaya   bool                                 RenderTargetFastClearEnable;
503810e230b6Smaya   bool                                 PushConstantEnable;
503910e230b6Smaya   uint32_t                             MaximumNumberofThreadsPerPSD;
504010e230b6Smaya   uint32_t                             DispatchGRFStartRegisterForConstantSetupData2;
504110e230b6Smaya   uint32_t                             DispatchGRFStartRegisterForConstantSetupData1;
504210e230b6Smaya   uint32_t                             DispatchGRFStartRegisterForConstantSetupData0;
504310e230b6Smaya   uint64_t                             KernelStartPointer1;
504410e230b6Smaya   uint64_t                             KernelStartPointer2;
504510e230b6Smaya};
504610e230b6Smaya
504710e230b6Smayastatic inline void
504810e230b6SmayaGEN10_3DSTATE_PS_pack(__attribute__((unused)) __gen_user_data *data,
504910e230b6Smaya                      __attribute__((unused)) void * restrict dst,
505010e230b6Smaya                      __attribute__((unused)) const struct GEN10_3DSTATE_PS * restrict values)
505110e230b6Smaya{
505210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
505310e230b6Smaya
505410e230b6Smaya   dw[0] =
505510e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
505610e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
505710e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
505810e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
505910e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
506010e230b6Smaya
506110e230b6Smaya   const uint64_t v1 =
506210e230b6Smaya      __gen_offset(values->KernelStartPointer0, 6, 63);
506310e230b6Smaya   dw[1] = v1;
506410e230b6Smaya   dw[2] = v1 >> 32;
506510e230b6Smaya
506610e230b6Smaya   dw[3] =
506710e230b6Smaya      __gen_uint(values->SoftwareExceptionEnable, 7, 7) |
506810e230b6Smaya      __gen_uint(values->MaskStackExceptionEnable, 11, 11) |
506910e230b6Smaya      __gen_uint(values->IllegalOpcodeExceptionEnable, 13, 13) |
507010e230b6Smaya      __gen_uint(values->RoundingMode, 14, 15) |
507110e230b6Smaya      __gen_uint(values->FloatingPointMode, 16, 16) |
507210e230b6Smaya      __gen_uint(values->ThreadDispatchPriority, 17, 17) |
507310e230b6Smaya      __gen_uint(values->BindingTableEntryCount, 18, 25) |
507410e230b6Smaya      __gen_uint(values->SinglePrecisionDenormalMode, 26, 26) |
507510e230b6Smaya      __gen_uint(values->SamplerCount, 27, 29) |
507610e230b6Smaya      __gen_uint(values->VectorMaskEnable, 30, 30) |
507710e230b6Smaya      __gen_uint(values->SingleProgramFlow, 31, 31);
507810e230b6Smaya
507910e230b6Smaya   const uint64_t v4 =
508010e230b6Smaya      __gen_uint(values->PerThreadScratchSpace, 0, 3);
508110e230b6Smaya   const uint64_t v4_address =
508210e230b6Smaya      __gen_combine_address(data, &dw[4], values->ScratchSpaceBasePointer, v4);
508310e230b6Smaya   dw[4] = v4_address;
508410e230b6Smaya   dw[5] = (v4_address >> 32) | (v4 >> 32);
508510e230b6Smaya
508610e230b6Smaya   dw[6] =
508710e230b6Smaya      __gen_uint(values->_8PixelDispatchEnable, 0, 0) |
508810e230b6Smaya      __gen_uint(values->_16PixelDispatchEnable, 1, 1) |
508910e230b6Smaya      __gen_uint(values->_32PixelDispatchEnable, 2, 2) |
509010e230b6Smaya      __gen_uint(values->PositionXYOffsetSelect, 3, 4) |
509110e230b6Smaya      __gen_uint(values->RenderTargetResolveType, 6, 7) |
509210e230b6Smaya      __gen_uint(values->RenderTargetFastClearEnable, 8, 8) |
509310e230b6Smaya      __gen_uint(values->PushConstantEnable, 11, 11) |
509410e230b6Smaya      __gen_uint(values->MaximumNumberofThreadsPerPSD, 23, 31);
509510e230b6Smaya
509610e230b6Smaya   dw[7] =
509710e230b6Smaya      __gen_uint(values->DispatchGRFStartRegisterForConstantSetupData2, 0, 6) |
509810e230b6Smaya      __gen_uint(values->DispatchGRFStartRegisterForConstantSetupData1, 8, 14) |
509910e230b6Smaya      __gen_uint(values->DispatchGRFStartRegisterForConstantSetupData0, 16, 22);
510010e230b6Smaya
510110e230b6Smaya   const uint64_t v8 =
510210e230b6Smaya      __gen_offset(values->KernelStartPointer1, 6, 63);
510310e230b6Smaya   dw[8] = v8;
510410e230b6Smaya   dw[9] = v8 >> 32;
510510e230b6Smaya
510610e230b6Smaya   const uint64_t v10 =
510710e230b6Smaya      __gen_offset(values->KernelStartPointer2, 6, 63);
510810e230b6Smaya   dw[10] = v10;
510910e230b6Smaya   dw[11] = v10 >> 32;
511010e230b6Smaya}
511110e230b6Smaya
511210e230b6Smaya#define GEN10_3DSTATE_PS_BLEND_length          2
511310e230b6Smaya#define GEN10_3DSTATE_PS_BLEND_length_bias      2
511410e230b6Smaya#define GEN10_3DSTATE_PS_BLEND_header           \
511510e230b6Smaya   .DWordLength                         =      0,  \
511610e230b6Smaya   ._3DCommandSubOpcode                 =     77,  \
511710e230b6Smaya   ._3DCommandOpcode                    =      0,  \
511810e230b6Smaya   .CommandSubType                      =      3,  \
511910e230b6Smaya   .CommandType                         =      3
512010e230b6Smaya
512110e230b6Smayastruct GEN10_3DSTATE_PS_BLEND {
512210e230b6Smaya   uint32_t                             DWordLength;
512310e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
512410e230b6Smaya   uint32_t                             _3DCommandOpcode;
512510e230b6Smaya   uint32_t                             CommandSubType;
512610e230b6Smaya   uint32_t                             CommandType;
512710e230b6Smaya   bool                                 IndependentAlphaBlendEnable;
512810e230b6Smaya   bool                                 AlphaTestEnable;
512910e230b6Smaya   enum GEN10_3D_Color_Buffer_Blend_Factor DestinationBlendFactor;
513010e230b6Smaya   enum GEN10_3D_Color_Buffer_Blend_Factor SourceBlendFactor;
513110e230b6Smaya   enum GEN10_3D_Color_Buffer_Blend_Factor DestinationAlphaBlendFactor;
513210e230b6Smaya   enum GEN10_3D_Color_Buffer_Blend_Factor SourceAlphaBlendFactor;
513310e230b6Smaya   bool                                 ColorBufferBlendEnable;
513410e230b6Smaya   bool                                 HasWriteableRT;
513510e230b6Smaya   bool                                 AlphaToCoverageEnable;
513610e230b6Smaya};
513710e230b6Smaya
513810e230b6Smayastatic inline void
513910e230b6SmayaGEN10_3DSTATE_PS_BLEND_pack(__attribute__((unused)) __gen_user_data *data,
514010e230b6Smaya                            __attribute__((unused)) void * restrict dst,
514110e230b6Smaya                            __attribute__((unused)) const struct GEN10_3DSTATE_PS_BLEND * restrict values)
514210e230b6Smaya{
514310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
514410e230b6Smaya
514510e230b6Smaya   dw[0] =
514610e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
514710e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
514810e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
514910e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
515010e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
515110e230b6Smaya
515210e230b6Smaya   dw[1] =
515310e230b6Smaya      __gen_uint(values->IndependentAlphaBlendEnable, 7, 7) |
515410e230b6Smaya      __gen_uint(values->AlphaTestEnable, 8, 8) |
515510e230b6Smaya      __gen_uint(values->DestinationBlendFactor, 9, 13) |
515610e230b6Smaya      __gen_uint(values->SourceBlendFactor, 14, 18) |
515710e230b6Smaya      __gen_uint(values->DestinationAlphaBlendFactor, 19, 23) |
515810e230b6Smaya      __gen_uint(values->SourceAlphaBlendFactor, 24, 28) |
515910e230b6Smaya      __gen_uint(values->ColorBufferBlendEnable, 29, 29) |
516010e230b6Smaya      __gen_uint(values->HasWriteableRT, 30, 30) |
516110e230b6Smaya      __gen_uint(values->AlphaToCoverageEnable, 31, 31);
516210e230b6Smaya}
516310e230b6Smaya
516410e230b6Smaya#define GEN10_3DSTATE_PS_EXTRA_length          2
516510e230b6Smaya#define GEN10_3DSTATE_PS_EXTRA_length_bias      2
516610e230b6Smaya#define GEN10_3DSTATE_PS_EXTRA_header           \
516710e230b6Smaya   .DWordLength                         =      0,  \
516810e230b6Smaya   ._3DCommandSubOpcode                 =     79,  \
516910e230b6Smaya   ._3DCommandOpcode                    =      0,  \
517010e230b6Smaya   .CommandSubType                      =      3,  \
517110e230b6Smaya   .CommandType                         =      3
517210e230b6Smaya
517310e230b6Smayastruct GEN10_3DSTATE_PS_EXTRA {
517410e230b6Smaya   uint32_t                             DWordLength;
517510e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
517610e230b6Smaya   uint32_t                             _3DCommandOpcode;
517710e230b6Smaya   uint32_t                             CommandSubType;
517810e230b6Smaya   uint32_t                             CommandType;
517910e230b6Smaya   uint32_t                             InputCoverageMaskState;
518010e230b6Smaya#define ICMS_NONE                                0
518110e230b6Smaya#define ICMS_NORMAL                              1
518210e230b6Smaya#define ICMS_INNER_CONSERVATIVE                  2
518310e230b6Smaya#define ICMS_DEPTH_COVERAGE                      3
518410e230b6Smaya   bool                                 PixelShaderHasUAV;
518510e230b6Smaya   bool                                 PixelShaderPullsBary;
518610e230b6Smaya   bool                                 PixelShaderComputesStencil;
518710e230b6Smaya   bool                                 PixelShaderIsPerSample;
518810e230b6Smaya   bool                                 PixelShaderDisablesAlphaToCoverage;
518910e230b6Smaya   bool                                 AttributeEnable;
519010e230b6Smaya   bool                                 SimplePSHint;
519110e230b6Smaya   bool                                 PixelShaderRequiresSubpixelSampleOffsets;
519210e230b6Smaya   bool                                 PixelShaderRequiresNonPerspectiveBaryPlaneCoefficients;
519310e230b6Smaya   bool                                 PixelShaderRequiresPerspectiveBaryPlaneCoefficients;
519410e230b6Smaya   bool                                 PixelShaderRequiresSourceDepthandorWPlaneCoefficients;
519510e230b6Smaya   bool                                 PixelShaderUsesSourceW;
519610e230b6Smaya   bool                                 PixelShaderUsesSourceDepth;
519710e230b6Smaya   bool                                 ForceComputedDepth;
519810e230b6Smaya   uint32_t                             PixelShaderComputedDepthMode;
519910e230b6Smaya#define PSCDEPTH_OFF                             0
520010e230b6Smaya#define PSCDEPTH_ON                              1
520110e230b6Smaya#define PSCDEPTH_ON_GE                           2
520210e230b6Smaya#define PSCDEPTH_ON_LE                           3
520310e230b6Smaya   bool                                 PixelShaderKillsPixel;
520410e230b6Smaya   bool                                 oMaskPresenttoRenderTarget;
520510e230b6Smaya   bool                                 PixelShaderDoesnotwritetoRT;
520610e230b6Smaya   bool                                 PixelShaderValid;
520710e230b6Smaya};
520810e230b6Smaya
520910e230b6Smayastatic inline void
521010e230b6SmayaGEN10_3DSTATE_PS_EXTRA_pack(__attribute__((unused)) __gen_user_data *data,
521110e230b6Smaya                            __attribute__((unused)) void * restrict dst,
521210e230b6Smaya                            __attribute__((unused)) const struct GEN10_3DSTATE_PS_EXTRA * restrict values)
521310e230b6Smaya{
521410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
521510e230b6Smaya
521610e230b6Smaya   dw[0] =
521710e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
521810e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
521910e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
522010e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
522110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
522210e230b6Smaya
522310e230b6Smaya   dw[1] =
522410e230b6Smaya      __gen_uint(values->InputCoverageMaskState, 0, 1) |
522510e230b6Smaya      __gen_uint(values->PixelShaderHasUAV, 2, 2) |
522610e230b6Smaya      __gen_uint(values->PixelShaderPullsBary, 3, 3) |
522710e230b6Smaya      __gen_uint(values->PixelShaderComputesStencil, 5, 5) |
522810e230b6Smaya      __gen_uint(values->PixelShaderIsPerSample, 6, 6) |
522910e230b6Smaya      __gen_uint(values->PixelShaderDisablesAlphaToCoverage, 7, 7) |
523010e230b6Smaya      __gen_uint(values->AttributeEnable, 8, 8) |
523110e230b6Smaya      __gen_uint(values->SimplePSHint, 9, 9) |
523210e230b6Smaya      __gen_uint(values->PixelShaderRequiresSubpixelSampleOffsets, 18, 18) |
523310e230b6Smaya      __gen_uint(values->PixelShaderRequiresNonPerspectiveBaryPlaneCoefficients, 19, 19) |
523410e230b6Smaya      __gen_uint(values->PixelShaderRequiresPerspectiveBaryPlaneCoefficients, 20, 20) |
523510e230b6Smaya      __gen_uint(values->PixelShaderRequiresSourceDepthandorWPlaneCoefficients, 21, 21) |
523610e230b6Smaya      __gen_uint(values->PixelShaderUsesSourceW, 23, 23) |
523710e230b6Smaya      __gen_uint(values->PixelShaderUsesSourceDepth, 24, 24) |
523810e230b6Smaya      __gen_uint(values->ForceComputedDepth, 25, 25) |
523910e230b6Smaya      __gen_uint(values->PixelShaderComputedDepthMode, 26, 27) |
524010e230b6Smaya      __gen_uint(values->PixelShaderKillsPixel, 28, 28) |
524110e230b6Smaya      __gen_uint(values->oMaskPresenttoRenderTarget, 29, 29) |
524210e230b6Smaya      __gen_uint(values->PixelShaderDoesnotwritetoRT, 30, 30) |
524310e230b6Smaya      __gen_uint(values->PixelShaderValid, 31, 31);
524410e230b6Smaya}
524510e230b6Smaya
524610e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_length      2
524710e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_length_bias      2
524810e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_header\
524910e230b6Smaya   .DWordLength                         =      0,  \
525010e230b6Smaya   ._3DCommandSubOpcode                 =     20,  \
525110e230b6Smaya   ._3DCommandOpcode                    =      1,  \
525210e230b6Smaya   .CommandSubType                      =      3,  \
525310e230b6Smaya   .CommandType                         =      3
525410e230b6Smaya
525510e230b6Smayastruct GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS {
525610e230b6Smaya   uint32_t                             DWordLength;
525710e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
525810e230b6Smaya   uint32_t                             _3DCommandOpcode;
525910e230b6Smaya   uint32_t                             CommandSubType;
526010e230b6Smaya   uint32_t                             CommandType;
526110e230b6Smaya   uint32_t                             ConstantBufferSize;
526210e230b6Smaya   uint32_t                             ConstantBufferOffset;
526310e230b6Smaya};
526410e230b6Smaya
526510e230b6Smayastatic inline void
526610e230b6SmayaGEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS_pack(__attribute__((unused)) __gen_user_data *data,
526710e230b6Smaya                                          __attribute__((unused)) void * restrict dst,
526810e230b6Smaya                                          __attribute__((unused)) const struct GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_DS * restrict values)
526910e230b6Smaya{
527010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
527110e230b6Smaya
527210e230b6Smaya   dw[0] =
527310e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
527410e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
527510e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
527610e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
527710e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
527810e230b6Smaya
527910e230b6Smaya   dw[1] =
528010e230b6Smaya      __gen_uint(values->ConstantBufferSize, 0, 5) |
528110e230b6Smaya      __gen_uint(values->ConstantBufferOffset, 16, 20);
528210e230b6Smaya}
528310e230b6Smaya
528410e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_length      2
528510e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_length_bias      2
528610e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_header\
528710e230b6Smaya   .DWordLength                         =      0,  \
528810e230b6Smaya   ._3DCommandSubOpcode                 =     21,  \
528910e230b6Smaya   ._3DCommandOpcode                    =      1,  \
529010e230b6Smaya   .CommandSubType                      =      3,  \
529110e230b6Smaya   .CommandType                         =      3
529210e230b6Smaya
529310e230b6Smayastruct GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS {
529410e230b6Smaya   uint32_t                             DWordLength;
529510e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
529610e230b6Smaya   uint32_t                             _3DCommandOpcode;
529710e230b6Smaya   uint32_t                             CommandSubType;
529810e230b6Smaya   uint32_t                             CommandType;
529910e230b6Smaya   uint32_t                             ConstantBufferSize;
530010e230b6Smaya   uint32_t                             ConstantBufferOffset;
530110e230b6Smaya};
530210e230b6Smaya
530310e230b6Smayastatic inline void
530410e230b6SmayaGEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS_pack(__attribute__((unused)) __gen_user_data *data,
530510e230b6Smaya                                          __attribute__((unused)) void * restrict dst,
530610e230b6Smaya                                          __attribute__((unused)) const struct GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_GS * restrict values)
530710e230b6Smaya{
530810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
530910e230b6Smaya
531010e230b6Smaya   dw[0] =
531110e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
531210e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
531310e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
531410e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
531510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
531610e230b6Smaya
531710e230b6Smaya   dw[1] =
531810e230b6Smaya      __gen_uint(values->ConstantBufferSize, 0, 5) |
531910e230b6Smaya      __gen_uint(values->ConstantBufferOffset, 16, 20);
532010e230b6Smaya}
532110e230b6Smaya
532210e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_length      2
532310e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_length_bias      2
532410e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_header\
532510e230b6Smaya   .DWordLength                         =      0,  \
532610e230b6Smaya   ._3DCommandSubOpcode                 =     19,  \
532710e230b6Smaya   ._3DCommandOpcode                    =      1,  \
532810e230b6Smaya   .CommandSubType                      =      3,  \
532910e230b6Smaya   .CommandType                         =      3
533010e230b6Smaya
533110e230b6Smayastruct GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS {
533210e230b6Smaya   uint32_t                             DWordLength;
533310e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
533410e230b6Smaya   uint32_t                             _3DCommandOpcode;
533510e230b6Smaya   uint32_t                             CommandSubType;
533610e230b6Smaya   uint32_t                             CommandType;
533710e230b6Smaya   uint32_t                             ConstantBufferSize;
533810e230b6Smaya   uint32_t                             ConstantBufferOffset;
533910e230b6Smaya};
534010e230b6Smaya
534110e230b6Smayastatic inline void
534210e230b6SmayaGEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS_pack(__attribute__((unused)) __gen_user_data *data,
534310e230b6Smaya                                          __attribute__((unused)) void * restrict dst,
534410e230b6Smaya                                          __attribute__((unused)) const struct GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_HS * restrict values)
534510e230b6Smaya{
534610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
534710e230b6Smaya
534810e230b6Smaya   dw[0] =
534910e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
535010e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
535110e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
535210e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
535310e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
535410e230b6Smaya
535510e230b6Smaya   dw[1] =
535610e230b6Smaya      __gen_uint(values->ConstantBufferSize, 0, 5) |
535710e230b6Smaya      __gen_uint(values->ConstantBufferOffset, 16, 20);
535810e230b6Smaya}
535910e230b6Smaya
536010e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_length      2
536110e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_length_bias      2
536210e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_header\
536310e230b6Smaya   .DWordLength                         =      0,  \
536410e230b6Smaya   ._3DCommandSubOpcode                 =     22,  \
536510e230b6Smaya   ._3DCommandOpcode                    =      1,  \
536610e230b6Smaya   .CommandSubType                      =      3,  \
536710e230b6Smaya   .CommandType                         =      3
536810e230b6Smaya
536910e230b6Smayastruct GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS {
537010e230b6Smaya   uint32_t                             DWordLength;
537110e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
537210e230b6Smaya   uint32_t                             _3DCommandOpcode;
537310e230b6Smaya   uint32_t                             CommandSubType;
537410e230b6Smaya   uint32_t                             CommandType;
537510e230b6Smaya   uint32_t                             ConstantBufferSize;
537610e230b6Smaya   uint32_t                             ConstantBufferOffset;
537710e230b6Smaya};
537810e230b6Smaya
537910e230b6Smayastatic inline void
538010e230b6SmayaGEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS_pack(__attribute__((unused)) __gen_user_data *data,
538110e230b6Smaya                                          __attribute__((unused)) void * restrict dst,
538210e230b6Smaya                                          __attribute__((unused)) const struct GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_PS * restrict values)
538310e230b6Smaya{
538410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
538510e230b6Smaya
538610e230b6Smaya   dw[0] =
538710e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
538810e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
538910e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
539010e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
539110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
539210e230b6Smaya
539310e230b6Smaya   dw[1] =
539410e230b6Smaya      __gen_uint(values->ConstantBufferSize, 0, 5) |
539510e230b6Smaya      __gen_uint(values->ConstantBufferOffset, 16, 20);
539610e230b6Smaya}
539710e230b6Smaya
539810e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_length      2
539910e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_length_bias      2
540010e230b6Smaya#define GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_header\
540110e230b6Smaya   .DWordLength                         =      0,  \
540210e230b6Smaya   ._3DCommandSubOpcode                 =     18,  \
540310e230b6Smaya   ._3DCommandOpcode                    =      1,  \
540410e230b6Smaya   .CommandSubType                      =      3,  \
540510e230b6Smaya   .CommandType                         =      3
540610e230b6Smaya
540710e230b6Smayastruct GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS {
540810e230b6Smaya   uint32_t                             DWordLength;
540910e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
541010e230b6Smaya   uint32_t                             _3DCommandOpcode;
541110e230b6Smaya   uint32_t                             CommandSubType;
541210e230b6Smaya   uint32_t                             CommandType;
541310e230b6Smaya   uint32_t                             ConstantBufferSize;
541410e230b6Smaya   uint32_t                             ConstantBufferOffset;
541510e230b6Smaya};
541610e230b6Smaya
541710e230b6Smayastatic inline void
541810e230b6SmayaGEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS_pack(__attribute__((unused)) __gen_user_data *data,
541910e230b6Smaya                                          __attribute__((unused)) void * restrict dst,
542010e230b6Smaya                                          __attribute__((unused)) const struct GEN10_3DSTATE_PUSH_CONSTANT_ALLOC_VS * restrict values)
542110e230b6Smaya{
542210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
542310e230b6Smaya
542410e230b6Smaya   dw[0] =
542510e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
542610e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
542710e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
542810e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
542910e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
543010e230b6Smaya
543110e230b6Smaya   dw[1] =
543210e230b6Smaya      __gen_uint(values->ConstantBufferSize, 0, 5) |
543310e230b6Smaya      __gen_uint(values->ConstantBufferOffset, 16, 20);
543410e230b6Smaya}
543510e230b6Smaya
543610e230b6Smaya#define GEN10_3DSTATE_RASTER_length            5
543710e230b6Smaya#define GEN10_3DSTATE_RASTER_length_bias       2
543810e230b6Smaya#define GEN10_3DSTATE_RASTER_header             \
543910e230b6Smaya   .DWordLength                         =      3,  \
544010e230b6Smaya   ._3DCommandSubOpcode                 =     80,  \
544110e230b6Smaya   ._3DCommandOpcode                    =      0,  \
544210e230b6Smaya   .CommandSubType                      =      3,  \
544310e230b6Smaya   .CommandType                         =      3
544410e230b6Smaya
544510e230b6Smayastruct GEN10_3DSTATE_RASTER {
544610e230b6Smaya   uint32_t                             DWordLength;
544710e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
544810e230b6Smaya   uint32_t                             _3DCommandOpcode;
544910e230b6Smaya   uint32_t                             CommandSubType;
545010e230b6Smaya   uint32_t                             CommandType;
545110e230b6Smaya   bool                                 ViewportZNearClipTestEnable;
545210e230b6Smaya   bool                                 ScissorRectangleEnable;
545310e230b6Smaya   bool                                 AntialiasingEnable;
545410e230b6Smaya   uint32_t                             BackFaceFillMode;
545510e230b6Smaya#define FILL_MODE_SOLID                          0
545610e230b6Smaya#define FILL_MODE_WIREFRAME                      1
545710e230b6Smaya#define FILL_MODE_POINT                          2
545810e230b6Smaya   uint32_t                             FrontFaceFillMode;
545910e230b6Smaya#define FILL_MODE_SOLID                          0
546010e230b6Smaya#define FILL_MODE_WIREFRAME                      1
546110e230b6Smaya#define FILL_MODE_POINT                          2
546210e230b6Smaya   bool                                 GlobalDepthOffsetEnablePoint;
546310e230b6Smaya   bool                                 GlobalDepthOffsetEnableWireframe;
546410e230b6Smaya   bool                                 GlobalDepthOffsetEnableSolid;
546510e230b6Smaya   uint32_t                             DXMultisampleRasterizationMode;
546610e230b6Smaya#define MSRASTMODE_OFF_PIXEL                     0
546710e230b6Smaya#define MSRASTMODE_OFF_PATTERN                   1
546810e230b6Smaya#define MSRASTMODE_ON_PIXEL                      2
546910e230b6Smaya#define MSRASTMODE_ON_PATTERN                    3
547010e230b6Smaya   bool                                 DXMultisampleRasterizationEnable;
547110e230b6Smaya   bool                                 SmoothPointEnable;
547210e230b6Smaya   uint32_t                             ForceMultisampling;
547310e230b6Smaya   uint32_t                             CullMode;
547410e230b6Smaya#define CULLMODE_BOTH                            0
547510e230b6Smaya#define CULLMODE_NONE                            1
547610e230b6Smaya#define CULLMODE_FRONT                           2
547710e230b6Smaya#define CULLMODE_BACK                            3
547810e230b6Smaya   uint32_t                             ForcedSampleCount;
547910e230b6Smaya#define FSC_NUMRASTSAMPLES_0                     0
548010e230b6Smaya#define FSC_NUMRASTSAMPLES_1                     1
548110e230b6Smaya#define FSC_NUMRASTSAMPLES_2                     2
548210e230b6Smaya#define FSC_NUMRASTSAMPLES_4                     3
548310e230b6Smaya#define FSC_NUMRASTSAMPLES_8                     4
548410e230b6Smaya#define FSC_NUMRASTSAMPLES_16                    5
548510e230b6Smaya   uint32_t                             FrontWinding;
548610e230b6Smaya#define Clockwise                                0
548710e230b6Smaya#define CounterClockwise                         1
548810e230b6Smaya   uint32_t                             APIMode;
548910e230b6Smaya#define DX9OGL                                   0
549010e230b6Smaya#define DX100                                    1
549110e230b6Smaya#define DX101                                    2
549210e230b6Smaya   bool                                 ConservativeRasterizationEnable;
549310e230b6Smaya   bool                                 ViewportZFarClipTestEnable;
549410e230b6Smaya   float                                GlobalDepthOffsetConstant;
549510e230b6Smaya   float                                GlobalDepthOffsetScale;
549610e230b6Smaya   float                                GlobalDepthOffsetClamp;
549710e230b6Smaya};
549810e230b6Smaya
549910e230b6Smayastatic inline void
550010e230b6SmayaGEN10_3DSTATE_RASTER_pack(__attribute__((unused)) __gen_user_data *data,
550110e230b6Smaya                          __attribute__((unused)) void * restrict dst,
550210e230b6Smaya                          __attribute__((unused)) const struct GEN10_3DSTATE_RASTER * restrict values)
550310e230b6Smaya{
550410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
550510e230b6Smaya
550610e230b6Smaya   dw[0] =
550710e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
550810e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
550910e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
551010e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
551110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
551210e230b6Smaya
551310e230b6Smaya   dw[1] =
551410e230b6Smaya      __gen_uint(values->ViewportZNearClipTestEnable, 0, 0) |
551510e230b6Smaya      __gen_uint(values->ScissorRectangleEnable, 1, 1) |
551610e230b6Smaya      __gen_uint(values->AntialiasingEnable, 2, 2) |
551710e230b6Smaya      __gen_uint(values->BackFaceFillMode, 3, 4) |
551810e230b6Smaya      __gen_uint(values->FrontFaceFillMode, 5, 6) |
551910e230b6Smaya      __gen_uint(values->GlobalDepthOffsetEnablePoint, 7, 7) |
552010e230b6Smaya      __gen_uint(values->GlobalDepthOffsetEnableWireframe, 8, 8) |
552110e230b6Smaya      __gen_uint(values->GlobalDepthOffsetEnableSolid, 9, 9) |
552210e230b6Smaya      __gen_uint(values->DXMultisampleRasterizationMode, 10, 11) |
552310e230b6Smaya      __gen_uint(values->DXMultisampleRasterizationEnable, 12, 12) |
552410e230b6Smaya      __gen_uint(values->SmoothPointEnable, 13, 13) |
552510e230b6Smaya      __gen_uint(values->ForceMultisampling, 14, 14) |
552610e230b6Smaya      __gen_uint(values->CullMode, 16, 17) |
552710e230b6Smaya      __gen_uint(values->ForcedSampleCount, 18, 20) |
552810e230b6Smaya      __gen_uint(values->FrontWinding, 21, 21) |
552910e230b6Smaya      __gen_uint(values->APIMode, 22, 23) |
553010e230b6Smaya      __gen_uint(values->ConservativeRasterizationEnable, 24, 24) |
553110e230b6Smaya      __gen_uint(values->ViewportZFarClipTestEnable, 26, 26);
553210e230b6Smaya
553310e230b6Smaya   dw[2] =
553410e230b6Smaya      __gen_float(values->GlobalDepthOffsetConstant);
553510e230b6Smaya
553610e230b6Smaya   dw[3] =
553710e230b6Smaya      __gen_float(values->GlobalDepthOffsetScale);
553810e230b6Smaya
553910e230b6Smaya   dw[4] =
554010e230b6Smaya      __gen_float(values->GlobalDepthOffsetClamp);
554110e230b6Smaya}
554210e230b6Smaya
554310e230b6Smaya#define GEN10_3DSTATE_RS_CONSTANT_POINTER_length      4
554410e230b6Smaya#define GEN10_3DSTATE_RS_CONSTANT_POINTER_length_bias      2
554510e230b6Smaya#define GEN10_3DSTATE_RS_CONSTANT_POINTER_header\
554610e230b6Smaya   .DWordLength                         =      2,  \
554710e230b6Smaya   ._3DCommandSubOpcode                 =     84,  \
554810e230b6Smaya   ._3DCommandOpcode                    =      0,  \
554910e230b6Smaya   .CommandSubType                      =      3,  \
555010e230b6Smaya   .CommandType                         =      3
555110e230b6Smaya
555210e230b6Smayastruct GEN10_3DSTATE_RS_CONSTANT_POINTER {
555310e230b6Smaya   uint32_t                             DWordLength;
555410e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
555510e230b6Smaya   uint32_t                             _3DCommandOpcode;
555610e230b6Smaya   uint32_t                             CommandSubType;
555710e230b6Smaya   uint32_t                             CommandType;
555810e230b6Smaya   uint32_t                             OperationLoadorStore;
555910e230b6Smaya#define RS_Store                                 0
556010e230b6Smaya#define RS_Load                                  1
556110e230b6Smaya   uint32_t                             ShaderSelect;
556210e230b6Smaya#define VS                                       0
556310e230b6Smaya#define PS                                       4
556410e230b6Smaya   __gen_address_type                   GlobalConstantBufferAddress;
556510e230b6Smaya   __gen_address_type                   GlobalConstantBufferAddressHigh;
556610e230b6Smaya};
556710e230b6Smaya
556810e230b6Smayastatic inline void
556910e230b6SmayaGEN10_3DSTATE_RS_CONSTANT_POINTER_pack(__attribute__((unused)) __gen_user_data *data,
557010e230b6Smaya                                       __attribute__((unused)) void * restrict dst,
557110e230b6Smaya                                       __attribute__((unused)) const struct GEN10_3DSTATE_RS_CONSTANT_POINTER * restrict values)
557210e230b6Smaya{
557310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
557410e230b6Smaya
557510e230b6Smaya   dw[0] =
557610e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
557710e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
557810e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
557910e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
558010e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
558110e230b6Smaya
558210e230b6Smaya   dw[1] =
558310e230b6Smaya      __gen_uint(values->OperationLoadorStore, 12, 12) |
558410e230b6Smaya      __gen_uint(values->ShaderSelect, 28, 30);
558510e230b6Smaya
558610e230b6Smaya   dw[2] = __gen_combine_address(data, &dw[2], values->GlobalConstantBufferAddress, 0);
558710e230b6Smaya
558810e230b6Smaya   dw[3] = __gen_combine_address(data, &dw[3], values->GlobalConstantBufferAddressHigh, 0);
558910e230b6Smaya}
559010e230b6Smaya
559110e230b6Smaya#define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_length_bias      2
559210e230b6Smaya#define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_header\
559310e230b6Smaya   ._3DCommandSubOpcode                 =      2,  \
559410e230b6Smaya   ._3DCommandOpcode                    =      1,  \
559510e230b6Smaya   .CommandSubType                      =      3,  \
559610e230b6Smaya   .CommandType                         =      3
559710e230b6Smaya
559810e230b6Smayastruct GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0 {
559910e230b6Smaya   uint32_t                             DWordLength;
560010e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
560110e230b6Smaya   uint32_t                             _3DCommandOpcode;
560210e230b6Smaya   uint32_t                             CommandSubType;
560310e230b6Smaya   uint32_t                             CommandType;
560410e230b6Smaya   /* variable length fields follow */
560510e230b6Smaya};
560610e230b6Smaya
560710e230b6Smayastatic inline void
560810e230b6SmayaGEN10_3DSTATE_SAMPLER_PALETTE_LOAD0_pack(__attribute__((unused)) __gen_user_data *data,
560910e230b6Smaya                                         __attribute__((unused)) void * restrict dst,
561010e230b6Smaya                                         __attribute__((unused)) const struct GEN10_3DSTATE_SAMPLER_PALETTE_LOAD0 * restrict values)
561110e230b6Smaya{
561210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
561310e230b6Smaya
561410e230b6Smaya   dw[0] =
561510e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
561610e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
561710e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
561810e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
561910e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
562010e230b6Smaya}
562110e230b6Smaya
562210e230b6Smaya#define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_length_bias      2
562310e230b6Smaya#define GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_header\
562410e230b6Smaya   .DWordLength                         =      0,  \
562510e230b6Smaya   ._3DCommandSubOpcode                 =     12,  \
562610e230b6Smaya   ._3DCommandOpcode                    =      1,  \
562710e230b6Smaya   .CommandSubType                      =      3,  \
562810e230b6Smaya   .CommandType                         =      3
562910e230b6Smaya
563010e230b6Smayastruct GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1 {
563110e230b6Smaya   uint32_t                             DWordLength;
563210e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
563310e230b6Smaya   uint32_t                             _3DCommandOpcode;
563410e230b6Smaya   uint32_t                             CommandSubType;
563510e230b6Smaya   uint32_t                             CommandType;
563610e230b6Smaya   /* variable length fields follow */
563710e230b6Smaya};
563810e230b6Smaya
563910e230b6Smayastatic inline void
564010e230b6SmayaGEN10_3DSTATE_SAMPLER_PALETTE_LOAD1_pack(__attribute__((unused)) __gen_user_data *data,
564110e230b6Smaya                                         __attribute__((unused)) void * restrict dst,
564210e230b6Smaya                                         __attribute__((unused)) const struct GEN10_3DSTATE_SAMPLER_PALETTE_LOAD1 * restrict values)
564310e230b6Smaya{
564410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
564510e230b6Smaya
564610e230b6Smaya   dw[0] =
564710e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
564810e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
564910e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
565010e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
565110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
565210e230b6Smaya}
565310e230b6Smaya
565410e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_length      2
565510e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_length_bias      2
565610e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_header\
565710e230b6Smaya   .DWordLength                         =      0,  \
565810e230b6Smaya   ._3DCommandSubOpcode                 =     45,  \
565910e230b6Smaya   ._3DCommandOpcode                    =      0,  \
566010e230b6Smaya   .CommandSubType                      =      3,  \
566110e230b6Smaya   .CommandType                         =      3
566210e230b6Smaya
566310e230b6Smayastruct GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS {
566410e230b6Smaya   uint32_t                             DWordLength;
566510e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
566610e230b6Smaya   uint32_t                             _3DCommandOpcode;
566710e230b6Smaya   uint32_t                             CommandSubType;
566810e230b6Smaya   uint32_t                             CommandType;
566910e230b6Smaya   uint64_t                             PointertoDSSamplerState;
567010e230b6Smaya};
567110e230b6Smaya
567210e230b6Smayastatic inline void
567310e230b6SmayaGEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS_pack(__attribute__((unused)) __gen_user_data *data,
567410e230b6Smaya                                             __attribute__((unused)) void * restrict dst,
567510e230b6Smaya                                             __attribute__((unused)) const struct GEN10_3DSTATE_SAMPLER_STATE_POINTERS_DS * restrict values)
567610e230b6Smaya{
567710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
567810e230b6Smaya
567910e230b6Smaya   dw[0] =
568010e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
568110e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
568210e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
568310e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
568410e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
568510e230b6Smaya
568610e230b6Smaya   dw[1] =
568710e230b6Smaya      __gen_offset(values->PointertoDSSamplerState, 5, 31);
568810e230b6Smaya}
568910e230b6Smaya
569010e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_length      2
569110e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_length_bias      2
569210e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_header\
569310e230b6Smaya   .DWordLength                         =      0,  \
569410e230b6Smaya   ._3DCommandSubOpcode                 =     46,  \
569510e230b6Smaya   ._3DCommandOpcode                    =      0,  \
569610e230b6Smaya   .CommandSubType                      =      3,  \
569710e230b6Smaya   .CommandType                         =      3
569810e230b6Smaya
569910e230b6Smayastruct GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS {
570010e230b6Smaya   uint32_t                             DWordLength;
570110e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
570210e230b6Smaya   uint32_t                             _3DCommandOpcode;
570310e230b6Smaya   uint32_t                             CommandSubType;
570410e230b6Smaya   uint32_t                             CommandType;
570510e230b6Smaya   uint64_t                             PointertoGSSamplerState;
570610e230b6Smaya};
570710e230b6Smaya
570810e230b6Smayastatic inline void
570910e230b6SmayaGEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS_pack(__attribute__((unused)) __gen_user_data *data,
571010e230b6Smaya                                             __attribute__((unused)) void * restrict dst,
571110e230b6Smaya                                             __attribute__((unused)) const struct GEN10_3DSTATE_SAMPLER_STATE_POINTERS_GS * restrict values)
571210e230b6Smaya{
571310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
571410e230b6Smaya
571510e230b6Smaya   dw[0] =
571610e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
571710e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
571810e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
571910e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
572010e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
572110e230b6Smaya
572210e230b6Smaya   dw[1] =
572310e230b6Smaya      __gen_offset(values->PointertoGSSamplerState, 5, 31);
572410e230b6Smaya}
572510e230b6Smaya
572610e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_length      2
572710e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_length_bias      2
572810e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_header\
572910e230b6Smaya   .DWordLength                         =      0,  \
573010e230b6Smaya   ._3DCommandSubOpcode                 =     44,  \
573110e230b6Smaya   ._3DCommandOpcode                    =      0,  \
573210e230b6Smaya   .CommandSubType                      =      3,  \
573310e230b6Smaya   .CommandType                         =      3
573410e230b6Smaya
573510e230b6Smayastruct GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS {
573610e230b6Smaya   uint32_t                             DWordLength;
573710e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
573810e230b6Smaya   uint32_t                             _3DCommandOpcode;
573910e230b6Smaya   uint32_t                             CommandSubType;
574010e230b6Smaya   uint32_t                             CommandType;
574110e230b6Smaya   uint64_t                             PointertoHSSamplerState;
574210e230b6Smaya};
574310e230b6Smaya
574410e230b6Smayastatic inline void
574510e230b6SmayaGEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS_pack(__attribute__((unused)) __gen_user_data *data,
574610e230b6Smaya                                             __attribute__((unused)) void * restrict dst,
574710e230b6Smaya                                             __attribute__((unused)) const struct GEN10_3DSTATE_SAMPLER_STATE_POINTERS_HS * restrict values)
574810e230b6Smaya{
574910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
575010e230b6Smaya
575110e230b6Smaya   dw[0] =
575210e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
575310e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
575410e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
575510e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
575610e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
575710e230b6Smaya
575810e230b6Smaya   dw[1] =
575910e230b6Smaya      __gen_offset(values->PointertoHSSamplerState, 5, 31);
576010e230b6Smaya}
576110e230b6Smaya
576210e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_length      2
576310e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_length_bias      2
576410e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_header\
576510e230b6Smaya   .DWordLength                         =      0,  \
576610e230b6Smaya   ._3DCommandSubOpcode                 =     47,  \
576710e230b6Smaya   ._3DCommandOpcode                    =      0,  \
576810e230b6Smaya   .CommandSubType                      =      3,  \
576910e230b6Smaya   .CommandType                         =      3
577010e230b6Smaya
577110e230b6Smayastruct GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS {
577210e230b6Smaya   uint32_t                             DWordLength;
577310e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
577410e230b6Smaya   uint32_t                             _3DCommandOpcode;
577510e230b6Smaya   uint32_t                             CommandSubType;
577610e230b6Smaya   uint32_t                             CommandType;
577710e230b6Smaya   uint64_t                             PointertoPSSamplerState;
577810e230b6Smaya};
577910e230b6Smaya
578010e230b6Smayastatic inline void
578110e230b6SmayaGEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS_pack(__attribute__((unused)) __gen_user_data *data,
578210e230b6Smaya                                             __attribute__((unused)) void * restrict dst,
578310e230b6Smaya                                             __attribute__((unused)) const struct GEN10_3DSTATE_SAMPLER_STATE_POINTERS_PS * restrict values)
578410e230b6Smaya{
578510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
578610e230b6Smaya
578710e230b6Smaya   dw[0] =
578810e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
578910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
579010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
579110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
579210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
579310e230b6Smaya
579410e230b6Smaya   dw[1] =
579510e230b6Smaya      __gen_offset(values->PointertoPSSamplerState, 5, 31);
579610e230b6Smaya}
579710e230b6Smaya
579810e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_length      2
579910e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_length_bias      2
580010e230b6Smaya#define GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_header\
580110e230b6Smaya   .DWordLength                         =      0,  \
580210e230b6Smaya   ._3DCommandSubOpcode                 =     43,  \
580310e230b6Smaya   ._3DCommandOpcode                    =      0,  \
580410e230b6Smaya   .CommandSubType                      =      3,  \
580510e230b6Smaya   .CommandType                         =      3
580610e230b6Smaya
580710e230b6Smayastruct GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS {
580810e230b6Smaya   uint32_t                             DWordLength;
580910e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
581010e230b6Smaya   uint32_t                             _3DCommandOpcode;
581110e230b6Smaya   uint32_t                             CommandSubType;
581210e230b6Smaya   uint32_t                             CommandType;
581310e230b6Smaya   uint64_t                             PointertoVSSamplerState;
581410e230b6Smaya};
581510e230b6Smaya
581610e230b6Smayastatic inline void
581710e230b6SmayaGEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS_pack(__attribute__((unused)) __gen_user_data *data,
581810e230b6Smaya                                             __attribute__((unused)) void * restrict dst,
581910e230b6Smaya                                             __attribute__((unused)) const struct GEN10_3DSTATE_SAMPLER_STATE_POINTERS_VS * restrict values)
582010e230b6Smaya{
582110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
582210e230b6Smaya
582310e230b6Smaya   dw[0] =
582410e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
582510e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
582610e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
582710e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
582810e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
582910e230b6Smaya
583010e230b6Smaya   dw[1] =
583110e230b6Smaya      __gen_offset(values->PointertoVSSamplerState, 5, 31);
583210e230b6Smaya}
583310e230b6Smaya
583410e230b6Smaya#define GEN10_3DSTATE_SAMPLE_MASK_length       2
583510e230b6Smaya#define GEN10_3DSTATE_SAMPLE_MASK_length_bias      2
583610e230b6Smaya#define GEN10_3DSTATE_SAMPLE_MASK_header        \
583710e230b6Smaya   .DWordLength                         =      0,  \
583810e230b6Smaya   ._3DCommandSubOpcode                 =     24,  \
583910e230b6Smaya   ._3DCommandOpcode                    =      0,  \
584010e230b6Smaya   .CommandSubType                      =      3,  \
584110e230b6Smaya   .CommandType                         =      3
584210e230b6Smaya
584310e230b6Smayastruct GEN10_3DSTATE_SAMPLE_MASK {
584410e230b6Smaya   uint32_t                             DWordLength;
584510e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
584610e230b6Smaya   uint32_t                             _3DCommandOpcode;
584710e230b6Smaya   uint32_t                             CommandSubType;
584810e230b6Smaya   uint32_t                             CommandType;
584910e230b6Smaya   uint32_t                             SampleMask;
585010e230b6Smaya};
585110e230b6Smaya
585210e230b6Smayastatic inline void
585310e230b6SmayaGEN10_3DSTATE_SAMPLE_MASK_pack(__attribute__((unused)) __gen_user_data *data,
585410e230b6Smaya                               __attribute__((unused)) void * restrict dst,
585510e230b6Smaya                               __attribute__((unused)) const struct GEN10_3DSTATE_SAMPLE_MASK * restrict values)
585610e230b6Smaya{
585710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
585810e230b6Smaya
585910e230b6Smaya   dw[0] =
586010e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
586110e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
586210e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
586310e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
586410e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
586510e230b6Smaya
586610e230b6Smaya   dw[1] =
586710e230b6Smaya      __gen_uint(values->SampleMask, 0, 15);
586810e230b6Smaya}
586910e230b6Smaya
587010e230b6Smaya#define GEN10_3DSTATE_SAMPLE_PATTERN_length      9
587110e230b6Smaya#define GEN10_3DSTATE_SAMPLE_PATTERN_length_bias      2
587210e230b6Smaya#define GEN10_3DSTATE_SAMPLE_PATTERN_header     \
587310e230b6Smaya   .DWordLength                         =      7,  \
587410e230b6Smaya   ._3DCommandSubOpcode                 =     28,  \
587510e230b6Smaya   ._3DCommandOpcode                    =      1,  \
587610e230b6Smaya   .CommandSubType                      =      3,  \
587710e230b6Smaya   .CommandType                         =      3
587810e230b6Smaya
587910e230b6Smayastruct GEN10_3DSTATE_SAMPLE_PATTERN {
588010e230b6Smaya   uint32_t                             DWordLength;
588110e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
588210e230b6Smaya   uint32_t                             _3DCommandOpcode;
588310e230b6Smaya   uint32_t                             CommandSubType;
588410e230b6Smaya   uint32_t                             CommandType;
588510e230b6Smaya   float                                _16xSample0YOffset;
588610e230b6Smaya   float                                _16xSample0XOffset;
588710e230b6Smaya   float                                _16xSample1YOffset;
588810e230b6Smaya   float                                _16xSample1XOffset;
588910e230b6Smaya   float                                _16xSample2YOffset;
589010e230b6Smaya   float                                _16xSample2XOffset;
589110e230b6Smaya   float                                _16xSample3YOffset;
589210e230b6Smaya   float                                _16xSample3XOffset;
589310e230b6Smaya   float                                _16xSample4YOffset;
589410e230b6Smaya   float                                _16xSample4XOffset;
589510e230b6Smaya   float                                _16xSample5YOffset;
589610e230b6Smaya   float                                _16xSample5XOffset;
589710e230b6Smaya   float                                _16xSample6YOffset;
589810e230b6Smaya   float                                _16xSample6XOffset;
589910e230b6Smaya   float                                _16xSample7YOffset;
590010e230b6Smaya   float                                _16xSample7XOffset;
590110e230b6Smaya   float                                _16xSample8YOffset;
590210e230b6Smaya   float                                _16xSample8XOffset;
590310e230b6Smaya   float                                _16xSample9YOffset;
590410e230b6Smaya   float                                _16xSample9XOffset;
590510e230b6Smaya   float                                _16xSample10YOffset;
590610e230b6Smaya   float                                _16xSample10XOffset;
590710e230b6Smaya   float                                _16xSample11YOffset;
590810e230b6Smaya   float                                _16xSample11XOffset;
590910e230b6Smaya   float                                _16xSample12YOffset;
591010e230b6Smaya   float                                _16xSample12XOffset;
591110e230b6Smaya   float                                _16xSample13YOffset;
591210e230b6Smaya   float                                _16xSample13XOffset;
591310e230b6Smaya   float                                _16xSample14YOffset;
591410e230b6Smaya   float                                _16xSample14XOffset;
591510e230b6Smaya   float                                _16xSample15YOffset;
591610e230b6Smaya   float                                _16xSample15XOffset;
591710e230b6Smaya   float                                _8xSample4YOffset;
591810e230b6Smaya   float                                _8xSample4XOffset;
591910e230b6Smaya   float                                _8xSample5YOffset;
592010e230b6Smaya   float                                _8xSample5XOffset;
592110e230b6Smaya   float                                _8xSample6YOffset;
592210e230b6Smaya   float                                _8xSample6XOffset;
592310e230b6Smaya   float                                _8xSample7YOffset;
592410e230b6Smaya   float                                _8xSample7XOffset;
592510e230b6Smaya   float                                _8xSample0YOffset;
592610e230b6Smaya   float                                _8xSample0XOffset;
592710e230b6Smaya   float                                _8xSample1YOffset;
592810e230b6Smaya   float                                _8xSample1XOffset;
592910e230b6Smaya   float                                _8xSample2YOffset;
593010e230b6Smaya   float                                _8xSample2XOffset;
593110e230b6Smaya   float                                _8xSample3YOffset;
593210e230b6Smaya   float                                _8xSample3XOffset;
593310e230b6Smaya   float                                _4xSample0YOffset;
593410e230b6Smaya   float                                _4xSample0XOffset;
593510e230b6Smaya   float                                _4xSample1YOffset;
593610e230b6Smaya   float                                _4xSample1XOffset;
593710e230b6Smaya   float                                _4xSample2YOffset;
593810e230b6Smaya   float                                _4xSample2XOffset;
593910e230b6Smaya   float                                _4xSample3YOffset;
594010e230b6Smaya   float                                _4xSample3XOffset;
594110e230b6Smaya   float                                _2xSample0YOffset;
594210e230b6Smaya   float                                _2xSample0XOffset;
594310e230b6Smaya   float                                _2xSample1YOffset;
594410e230b6Smaya   float                                _2xSample1XOffset;
594510e230b6Smaya   float                                _1xSample0YOffset;
594610e230b6Smaya   float                                _1xSample0XOffset;
594710e230b6Smaya};
594810e230b6Smaya
594910e230b6Smayastatic inline void
595010e230b6SmayaGEN10_3DSTATE_SAMPLE_PATTERN_pack(__attribute__((unused)) __gen_user_data *data,
595110e230b6Smaya                                  __attribute__((unused)) void * restrict dst,
595210e230b6Smaya                                  __attribute__((unused)) const struct GEN10_3DSTATE_SAMPLE_PATTERN * restrict values)
595310e230b6Smaya{
595410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
595510e230b6Smaya
595610e230b6Smaya   dw[0] =
595710e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
595810e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
595910e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
596010e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
596110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
596210e230b6Smaya
596310e230b6Smaya   dw[1] =
596410e230b6Smaya      __gen_ufixed(values->_16xSample0YOffset, 0, 3, 4) |
596510e230b6Smaya      __gen_ufixed(values->_16xSample0XOffset, 4, 7, 4) |
596610e230b6Smaya      __gen_ufixed(values->_16xSample1YOffset, 8, 11, 4) |
596710e230b6Smaya      __gen_ufixed(values->_16xSample1XOffset, 12, 15, 4) |
596810e230b6Smaya      __gen_ufixed(values->_16xSample2YOffset, 16, 19, 4) |
596910e230b6Smaya      __gen_ufixed(values->_16xSample2XOffset, 20, 23, 4) |
597010e230b6Smaya      __gen_ufixed(values->_16xSample3YOffset, 24, 27, 4) |
597110e230b6Smaya      __gen_ufixed(values->_16xSample3XOffset, 28, 31, 4);
597210e230b6Smaya
597310e230b6Smaya   dw[2] =
597410e230b6Smaya      __gen_ufixed(values->_16xSample4YOffset, 0, 3, 4) |
597510e230b6Smaya      __gen_ufixed(values->_16xSample4XOffset, 4, 7, 4) |
597610e230b6Smaya      __gen_ufixed(values->_16xSample5YOffset, 8, 11, 4) |
597710e230b6Smaya      __gen_ufixed(values->_16xSample5XOffset, 12, 15, 4) |
597810e230b6Smaya      __gen_ufixed(values->_16xSample6YOffset, 16, 19, 4) |
597910e230b6Smaya      __gen_ufixed(values->_16xSample6XOffset, 20, 23, 4) |
598010e230b6Smaya      __gen_ufixed(values->_16xSample7YOffset, 24, 27, 4) |
598110e230b6Smaya      __gen_ufixed(values->_16xSample7XOffset, 28, 31, 4);
598210e230b6Smaya
598310e230b6Smaya   dw[3] =
598410e230b6Smaya      __gen_ufixed(values->_16xSample8YOffset, 0, 3, 4) |
598510e230b6Smaya      __gen_ufixed(values->_16xSample8XOffset, 4, 7, 4) |
598610e230b6Smaya      __gen_ufixed(values->_16xSample9YOffset, 8, 11, 4) |
598710e230b6Smaya      __gen_ufixed(values->_16xSample9XOffset, 12, 15, 4) |
598810e230b6Smaya      __gen_ufixed(values->_16xSample10YOffset, 16, 19, 4) |
598910e230b6Smaya      __gen_ufixed(values->_16xSample10XOffset, 20, 23, 4) |
599010e230b6Smaya      __gen_ufixed(values->_16xSample11YOffset, 24, 27, 4) |
599110e230b6Smaya      __gen_ufixed(values->_16xSample11XOffset, 28, 31, 4);
599210e230b6Smaya
599310e230b6Smaya   dw[4] =
599410e230b6Smaya      __gen_ufixed(values->_16xSample12YOffset, 0, 3, 4) |
599510e230b6Smaya      __gen_ufixed(values->_16xSample12XOffset, 4, 7, 4) |
599610e230b6Smaya      __gen_ufixed(values->_16xSample13YOffset, 8, 11, 4) |
599710e230b6Smaya      __gen_ufixed(values->_16xSample13XOffset, 12, 15, 4) |
599810e230b6Smaya      __gen_ufixed(values->_16xSample14YOffset, 16, 19, 4) |
599910e230b6Smaya      __gen_ufixed(values->_16xSample14XOffset, 20, 23, 4) |
600010e230b6Smaya      __gen_ufixed(values->_16xSample15YOffset, 24, 27, 4) |
600110e230b6Smaya      __gen_ufixed(values->_16xSample15XOffset, 28, 31, 4);
600210e230b6Smaya
600310e230b6Smaya   dw[5] =
600410e230b6Smaya      __gen_ufixed(values->_8xSample4YOffset, 0, 3, 4) |
600510e230b6Smaya      __gen_ufixed(values->_8xSample4XOffset, 4, 7, 4) |
600610e230b6Smaya      __gen_ufixed(values->_8xSample5YOffset, 8, 11, 4) |
600710e230b6Smaya      __gen_ufixed(values->_8xSample5XOffset, 12, 15, 4) |
600810e230b6Smaya      __gen_ufixed(values->_8xSample6YOffset, 16, 19, 4) |
600910e230b6Smaya      __gen_ufixed(values->_8xSample6XOffset, 20, 23, 4) |
601010e230b6Smaya      __gen_ufixed(values->_8xSample7YOffset, 24, 27, 4) |
601110e230b6Smaya      __gen_ufixed(values->_8xSample7XOffset, 28, 31, 4);
601210e230b6Smaya
601310e230b6Smaya   dw[6] =
601410e230b6Smaya      __gen_ufixed(values->_8xSample0YOffset, 0, 3, 4) |
601510e230b6Smaya      __gen_ufixed(values->_8xSample0XOffset, 4, 7, 4) |
601610e230b6Smaya      __gen_ufixed(values->_8xSample1YOffset, 8, 11, 4) |
601710e230b6Smaya      __gen_ufixed(values->_8xSample1XOffset, 12, 15, 4) |
601810e230b6Smaya      __gen_ufixed(values->_8xSample2YOffset, 16, 19, 4) |
601910e230b6Smaya      __gen_ufixed(values->_8xSample2XOffset, 20, 23, 4) |
602010e230b6Smaya      __gen_ufixed(values->_8xSample3YOffset, 24, 27, 4) |
602110e230b6Smaya      __gen_ufixed(values->_8xSample3XOffset, 28, 31, 4);
602210e230b6Smaya
602310e230b6Smaya   dw[7] =
602410e230b6Smaya      __gen_ufixed(values->_4xSample0YOffset, 0, 3, 4) |
602510e230b6Smaya      __gen_ufixed(values->_4xSample0XOffset, 4, 7, 4) |
602610e230b6Smaya      __gen_ufixed(values->_4xSample1YOffset, 8, 11, 4) |
602710e230b6Smaya      __gen_ufixed(values->_4xSample1XOffset, 12, 15, 4) |
602810e230b6Smaya      __gen_ufixed(values->_4xSample2YOffset, 16, 19, 4) |
602910e230b6Smaya      __gen_ufixed(values->_4xSample2XOffset, 20, 23, 4) |
603010e230b6Smaya      __gen_ufixed(values->_4xSample3YOffset, 24, 27, 4) |
603110e230b6Smaya      __gen_ufixed(values->_4xSample3XOffset, 28, 31, 4);
603210e230b6Smaya
603310e230b6Smaya   dw[8] =
603410e230b6Smaya      __gen_ufixed(values->_2xSample0YOffset, 0, 3, 4) |
603510e230b6Smaya      __gen_ufixed(values->_2xSample0XOffset, 4, 7, 4) |
603610e230b6Smaya      __gen_ufixed(values->_2xSample1YOffset, 8, 11, 4) |
603710e230b6Smaya      __gen_ufixed(values->_2xSample1XOffset, 12, 15, 4) |
603810e230b6Smaya      __gen_ufixed(values->_1xSample0YOffset, 16, 19, 4) |
603910e230b6Smaya      __gen_ufixed(values->_1xSample0XOffset, 20, 23, 4);
604010e230b6Smaya}
604110e230b6Smaya
604210e230b6Smaya#define GEN10_3DSTATE_SBE_length               6
604310e230b6Smaya#define GEN10_3DSTATE_SBE_length_bias          2
604410e230b6Smaya#define GEN10_3DSTATE_SBE_header                \
604510e230b6Smaya   .DWordLength                         =      4,  \
604610e230b6Smaya   ._3DCommandSubOpcode                 =     31,  \
604710e230b6Smaya   ._3DCommandOpcode                    =      0,  \
604810e230b6Smaya   .CommandSubType                      =      3,  \
604910e230b6Smaya   .CommandType                         =      3
605010e230b6Smaya
605110e230b6Smayastruct GEN10_3DSTATE_SBE {
605210e230b6Smaya   uint32_t                             DWordLength;
605310e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
605410e230b6Smaya   uint32_t                             _3DCommandOpcode;
605510e230b6Smaya   uint32_t                             CommandSubType;
605610e230b6Smaya   uint32_t                             CommandType;
605710e230b6Smaya   uint32_t                             PrimitiveIDOverrideAttributeSelect;
605810e230b6Smaya   uint32_t                             VertexURBEntryReadOffset;
605910e230b6Smaya   uint32_t                             VertexURBEntryReadLength;
606010e230b6Smaya   bool                                 PrimitiveIDOverrideComponentX;
606110e230b6Smaya   bool                                 PrimitiveIDOverrideComponentY;
606210e230b6Smaya   bool                                 PrimitiveIDOverrideComponentZ;
606310e230b6Smaya   bool                                 PrimitiveIDOverrideComponentW;
606410e230b6Smaya   uint32_t                             PointSpriteTextureCoordinateOrigin;
606510e230b6Smaya#define UPPERLEFT                                0
606610e230b6Smaya#define LOWERLEFT                                1
606710e230b6Smaya   bool                                 AttributeSwizzleEnable;
606810e230b6Smaya   uint32_t                             NumberofSFOutputAttributes;
606910e230b6Smaya   bool                                 ForceVertexURBEntryReadOffset;
607010e230b6Smaya   bool                                 ForceVertexURBEntryReadLength;
607110e230b6Smaya   uint32_t                             PointSpriteTextureCoordinateEnable;
607210e230b6Smaya   uint32_t                             ConstantInterpolationEnable;
607310e230b6Smaya   uint32_t                             AttributeActiveComponentFormat[32];
607410e230b6Smaya#define ACTIVE_COMPONENT_DISABLED                0
607510e230b6Smaya#define ACTIVE_COMPONENT_XY                      1
607610e230b6Smaya#define ACTIVE_COMPONENT_XYZ                     2
607710e230b6Smaya#define ACTIVE_COMPONENT_XYZW                    3
607810e230b6Smaya};
607910e230b6Smaya
608010e230b6Smayastatic inline void
608110e230b6SmayaGEN10_3DSTATE_SBE_pack(__attribute__((unused)) __gen_user_data *data,
608210e230b6Smaya                       __attribute__((unused)) void * restrict dst,
608310e230b6Smaya                       __attribute__((unused)) const struct GEN10_3DSTATE_SBE * restrict values)
608410e230b6Smaya{
608510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
608610e230b6Smaya
608710e230b6Smaya   dw[0] =
608810e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
608910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
609010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
609110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
609210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
609310e230b6Smaya
609410e230b6Smaya   dw[1] =
609510e230b6Smaya      __gen_uint(values->PrimitiveIDOverrideAttributeSelect, 0, 4) |
609610e230b6Smaya      __gen_uint(values->VertexURBEntryReadOffset, 5, 10) |
609710e230b6Smaya      __gen_uint(values->VertexURBEntryReadLength, 11, 15) |
609810e230b6Smaya      __gen_uint(values->PrimitiveIDOverrideComponentX, 16, 16) |
609910e230b6Smaya      __gen_uint(values->PrimitiveIDOverrideComponentY, 17, 17) |
610010e230b6Smaya      __gen_uint(values->PrimitiveIDOverrideComponentZ, 18, 18) |
610110e230b6Smaya      __gen_uint(values->PrimitiveIDOverrideComponentW, 19, 19) |
610210e230b6Smaya      __gen_uint(values->PointSpriteTextureCoordinateOrigin, 20, 20) |
610310e230b6Smaya      __gen_uint(values->AttributeSwizzleEnable, 21, 21) |
610410e230b6Smaya      __gen_uint(values->NumberofSFOutputAttributes, 22, 27) |
610510e230b6Smaya      __gen_uint(values->ForceVertexURBEntryReadOffset, 28, 28) |
610610e230b6Smaya      __gen_uint(values->ForceVertexURBEntryReadLength, 29, 29);
610710e230b6Smaya
610810e230b6Smaya   dw[2] =
610910e230b6Smaya      __gen_uint(values->PointSpriteTextureCoordinateEnable, 0, 31);
611010e230b6Smaya
611110e230b6Smaya   dw[3] =
611210e230b6Smaya      __gen_uint(values->ConstantInterpolationEnable, 0, 31);
611310e230b6Smaya
611410e230b6Smaya   dw[4] =
611510e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[0], 0, 1) |
611610e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[1], 2, 3) |
611710e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[2], 4, 5) |
611810e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[3], 6, 7) |
611910e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[4], 8, 9) |
612010e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[5], 10, 11) |
612110e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[6], 12, 13) |
612210e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[7], 14, 15) |
612310e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[8], 16, 17) |
612410e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[9], 18, 19) |
612510e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[10], 20, 21) |
612610e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[11], 22, 23) |
612710e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[12], 24, 25) |
612810e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[13], 26, 27) |
612910e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[14], 28, 29) |
613010e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[15], 30, 31);
613110e230b6Smaya
613210e230b6Smaya   dw[5] =
613310e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[16], 0, 1) |
613410e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[17], 2, 3) |
613510e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[18], 4, 5) |
613610e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[19], 6, 7) |
613710e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[20], 8, 9) |
613810e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[21], 10, 11) |
613910e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[22], 12, 13) |
614010e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[23], 14, 15) |
614110e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[24], 16, 17) |
614210e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[25], 18, 19) |
614310e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[26], 20, 21) |
614410e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[27], 22, 23) |
614510e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[28], 24, 25) |
614610e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[29], 26, 27) |
614710e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[30], 28, 29) |
614810e230b6Smaya      __gen_uint(values->AttributeActiveComponentFormat[31], 30, 31);
614910e230b6Smaya}
615010e230b6Smaya
615110e230b6Smaya#define GEN10_3DSTATE_SBE_SWIZ_length         11
615210e230b6Smaya#define GEN10_3DSTATE_SBE_SWIZ_length_bias      2
615310e230b6Smaya#define GEN10_3DSTATE_SBE_SWIZ_header           \
615410e230b6Smaya   .DWordLength                         =      9,  \
615510e230b6Smaya   ._3DCommandSubOpcode                 =     81,  \
615610e230b6Smaya   ._3DCommandOpcode                    =      0,  \
615710e230b6Smaya   .CommandSubType                      =      3,  \
615810e230b6Smaya   .CommandType                         =      3
615910e230b6Smaya
616010e230b6Smayastruct GEN10_3DSTATE_SBE_SWIZ {
616110e230b6Smaya   uint32_t                             DWordLength;
616210e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
616310e230b6Smaya   uint32_t                             _3DCommandOpcode;
616410e230b6Smaya   uint32_t                             CommandSubType;
616510e230b6Smaya   uint32_t                             CommandType;
616610e230b6Smaya   struct GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL Attribute[16];
616710e230b6Smaya   uint32_t                             AttributeWrapShortestEnables[16];
616810e230b6Smaya};
616910e230b6Smaya
617010e230b6Smayastatic inline void
617110e230b6SmayaGEN10_3DSTATE_SBE_SWIZ_pack(__attribute__((unused)) __gen_user_data *data,
617210e230b6Smaya                            __attribute__((unused)) void * restrict dst,
617310e230b6Smaya                            __attribute__((unused)) const struct GEN10_3DSTATE_SBE_SWIZ * restrict values)
617410e230b6Smaya{
617510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
617610e230b6Smaya
617710e230b6Smaya   dw[0] =
617810e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
617910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
618010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
618110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
618210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
618310e230b6Smaya
618410e230b6Smaya   uint32_t v1_0;
618510e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v1_0, &values->Attribute[0]);
618610e230b6Smaya
618710e230b6Smaya   uint32_t v1_1;
618810e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v1_1, &values->Attribute[1]);
618910e230b6Smaya
619010e230b6Smaya   dw[1] =
619110e230b6Smaya      __gen_uint(v1_0, 0, 15) |
619210e230b6Smaya      __gen_uint(v1_1, 16, 31);
619310e230b6Smaya
619410e230b6Smaya   uint32_t v2_0;
619510e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v2_0, &values->Attribute[2]);
619610e230b6Smaya
619710e230b6Smaya   uint32_t v2_1;
619810e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v2_1, &values->Attribute[3]);
619910e230b6Smaya
620010e230b6Smaya   dw[2] =
620110e230b6Smaya      __gen_uint(v2_0, 0, 15) |
620210e230b6Smaya      __gen_uint(v2_1, 16, 31);
620310e230b6Smaya
620410e230b6Smaya   uint32_t v3_0;
620510e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v3_0, &values->Attribute[4]);
620610e230b6Smaya
620710e230b6Smaya   uint32_t v3_1;
620810e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v3_1, &values->Attribute[5]);
620910e230b6Smaya
621010e230b6Smaya   dw[3] =
621110e230b6Smaya      __gen_uint(v3_0, 0, 15) |
621210e230b6Smaya      __gen_uint(v3_1, 16, 31);
621310e230b6Smaya
621410e230b6Smaya   uint32_t v4_0;
621510e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v4_0, &values->Attribute[6]);
621610e230b6Smaya
621710e230b6Smaya   uint32_t v4_1;
621810e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v4_1, &values->Attribute[7]);
621910e230b6Smaya
622010e230b6Smaya   dw[4] =
622110e230b6Smaya      __gen_uint(v4_0, 0, 15) |
622210e230b6Smaya      __gen_uint(v4_1, 16, 31);
622310e230b6Smaya
622410e230b6Smaya   uint32_t v5_0;
622510e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v5_0, &values->Attribute[8]);
622610e230b6Smaya
622710e230b6Smaya   uint32_t v5_1;
622810e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v5_1, &values->Attribute[9]);
622910e230b6Smaya
623010e230b6Smaya   dw[5] =
623110e230b6Smaya      __gen_uint(v5_0, 0, 15) |
623210e230b6Smaya      __gen_uint(v5_1, 16, 31);
623310e230b6Smaya
623410e230b6Smaya   uint32_t v6_0;
623510e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v6_0, &values->Attribute[10]);
623610e230b6Smaya
623710e230b6Smaya   uint32_t v6_1;
623810e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v6_1, &values->Attribute[11]);
623910e230b6Smaya
624010e230b6Smaya   dw[6] =
624110e230b6Smaya      __gen_uint(v6_0, 0, 15) |
624210e230b6Smaya      __gen_uint(v6_1, 16, 31);
624310e230b6Smaya
624410e230b6Smaya   uint32_t v7_0;
624510e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v7_0, &values->Attribute[12]);
624610e230b6Smaya
624710e230b6Smaya   uint32_t v7_1;
624810e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v7_1, &values->Attribute[13]);
624910e230b6Smaya
625010e230b6Smaya   dw[7] =
625110e230b6Smaya      __gen_uint(v7_0, 0, 15) |
625210e230b6Smaya      __gen_uint(v7_1, 16, 31);
625310e230b6Smaya
625410e230b6Smaya   uint32_t v8_0;
625510e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v8_0, &values->Attribute[14]);
625610e230b6Smaya
625710e230b6Smaya   uint32_t v8_1;
625810e230b6Smaya   GEN10_SF_OUTPUT_ATTRIBUTE_DETAIL_pack(data, &v8_1, &values->Attribute[15]);
625910e230b6Smaya
626010e230b6Smaya   dw[8] =
626110e230b6Smaya      __gen_uint(v8_0, 0, 15) |
626210e230b6Smaya      __gen_uint(v8_1, 16, 31);
626310e230b6Smaya
626410e230b6Smaya   dw[9] =
626510e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[0], 0, 3) |
626610e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[1], 4, 7) |
626710e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[2], 8, 11) |
626810e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[3], 12, 15) |
626910e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[4], 16, 19) |
627010e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[5], 20, 23) |
627110e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[6], 24, 27) |
627210e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[7], 28, 31);
627310e230b6Smaya
627410e230b6Smaya   dw[10] =
627510e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[8], 0, 3) |
627610e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[9], 4, 7) |
627710e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[10], 8, 11) |
627810e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[11], 12, 15) |
627910e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[12], 16, 19) |
628010e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[13], 20, 23) |
628110e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[14], 24, 27) |
628210e230b6Smaya      __gen_uint(values->AttributeWrapShortestEnables[15], 28, 31);
628310e230b6Smaya}
628410e230b6Smaya
628510e230b6Smaya#define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_length      2
628610e230b6Smaya#define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_length_bias      2
628710e230b6Smaya#define GEN10_3DSTATE_SCISSOR_STATE_POINTERS_header\
628810e230b6Smaya   .DWordLength                         =      0,  \
628910e230b6Smaya   ._3DCommandSubOpcode                 =     15,  \
629010e230b6Smaya   ._3DCommandOpcode                    =      0,  \
629110e230b6Smaya   .CommandSubType                      =      3,  \
629210e230b6Smaya   .CommandType                         =      3
629310e230b6Smaya
629410e230b6Smayastruct GEN10_3DSTATE_SCISSOR_STATE_POINTERS {
629510e230b6Smaya   uint32_t                             DWordLength;
629610e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
629710e230b6Smaya   uint32_t                             _3DCommandOpcode;
629810e230b6Smaya   uint32_t                             CommandSubType;
629910e230b6Smaya   uint32_t                             CommandType;
630010e230b6Smaya   uint64_t                             ScissorRectPointer;
630110e230b6Smaya};
630210e230b6Smaya
630310e230b6Smayastatic inline void
630410e230b6SmayaGEN10_3DSTATE_SCISSOR_STATE_POINTERS_pack(__attribute__((unused)) __gen_user_data *data,
630510e230b6Smaya                                          __attribute__((unused)) void * restrict dst,
630610e230b6Smaya                                          __attribute__((unused)) const struct GEN10_3DSTATE_SCISSOR_STATE_POINTERS * restrict values)
630710e230b6Smaya{
630810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
630910e230b6Smaya
631010e230b6Smaya   dw[0] =
631110e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
631210e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
631310e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
631410e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
631510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
631610e230b6Smaya
631710e230b6Smaya   dw[1] =
631810e230b6Smaya      __gen_offset(values->ScissorRectPointer, 5, 31);
631910e230b6Smaya}
632010e230b6Smaya
632110e230b6Smaya#define GEN10_3DSTATE_SF_length                4
632210e230b6Smaya#define GEN10_3DSTATE_SF_length_bias           2
632310e230b6Smaya#define GEN10_3DSTATE_SF_header                 \
632410e230b6Smaya   .DWordLength                         =      2,  \
632510e230b6Smaya   ._3DCommandSubOpcode                 =     19,  \
632610e230b6Smaya   ._3DCommandOpcode                    =      0,  \
632710e230b6Smaya   .CommandSubType                      =      3,  \
632810e230b6Smaya   .CommandType                         =      3
632910e230b6Smaya
633010e230b6Smayastruct GEN10_3DSTATE_SF {
633110e230b6Smaya   uint32_t                             DWordLength;
633210e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
633310e230b6Smaya   uint32_t                             _3DCommandOpcode;
633410e230b6Smaya   uint32_t                             CommandSubType;
633510e230b6Smaya   uint32_t                             CommandType;
633610e230b6Smaya   bool                                 ViewportTransformEnable;
633710e230b6Smaya   bool                                 StatisticsEnable;
633810e230b6Smaya   bool                                 LegacyGlobalDepthBiasEnable;
633910e230b6Smaya   float                                LineWidth;
634010e230b6Smaya   uint32_t                             LineEndCapAntialiasingRegionWidth;
634110e230b6Smaya#define _05pixels                                0
634210e230b6Smaya#define _10pixels                                1
634310e230b6Smaya#define _20pixels                                2
634410e230b6Smaya#define _40pixels                                3
634510e230b6Smaya   float                                PointWidth;
634610e230b6Smaya   uint32_t                             PointWidthSource;
634710e230b6Smaya#define Vertex                                   0
634810e230b6Smaya#define State                                    1
634910e230b6Smaya   uint32_t                             VertexSubPixelPrecisionSelect;
635010e230b6Smaya#define _8Bit                                    0
635110e230b6Smaya#define _4Bit                                    1
635210e230b6Smaya   bool                                 SmoothPointEnable;
635310e230b6Smaya   uint32_t                             AALineDistanceMode;
635410e230b6Smaya#define AALINEDISTANCE_TRUE                      1
635510e230b6Smaya   uint32_t                             TriangleFanProvokingVertexSelect;
635610e230b6Smaya   uint32_t                             LineStripListProvokingVertexSelect;
635710e230b6Smaya   uint32_t                             TriangleStripListProvokingVertexSelect;
635810e230b6Smaya   bool                                 LastPixelEnable;
635910e230b6Smaya};
636010e230b6Smaya
636110e230b6Smayastatic inline void
636210e230b6SmayaGEN10_3DSTATE_SF_pack(__attribute__((unused)) __gen_user_data *data,
636310e230b6Smaya                      __attribute__((unused)) void * restrict dst,
636410e230b6Smaya                      __attribute__((unused)) const struct GEN10_3DSTATE_SF * restrict values)
636510e230b6Smaya{
636610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
636710e230b6Smaya
636810e230b6Smaya   dw[0] =
636910e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
637010e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
637110e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
637210e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
637310e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
637410e230b6Smaya
637510e230b6Smaya   dw[1] =
637610e230b6Smaya      __gen_uint(values->ViewportTransformEnable, 1, 1) |
637710e230b6Smaya      __gen_uint(values->StatisticsEnable, 10, 10) |
637810e230b6Smaya      __gen_uint(values->LegacyGlobalDepthBiasEnable, 11, 11) |
637910e230b6Smaya      __gen_ufixed(values->LineWidth, 12, 29, 7);
638010e230b6Smaya
638110e230b6Smaya   dw[2] =
638210e230b6Smaya      __gen_uint(values->LineEndCapAntialiasingRegionWidth, 16, 17);
638310e230b6Smaya
638410e230b6Smaya   dw[3] =
638510e230b6Smaya      __gen_ufixed(values->PointWidth, 0, 10, 3) |
638610e230b6Smaya      __gen_uint(values->PointWidthSource, 11, 11) |
638710e230b6Smaya      __gen_uint(values->VertexSubPixelPrecisionSelect, 12, 12) |
638810e230b6Smaya      __gen_uint(values->SmoothPointEnable, 13, 13) |
638910e230b6Smaya      __gen_uint(values->AALineDistanceMode, 14, 14) |
639010e230b6Smaya      __gen_uint(values->TriangleFanProvokingVertexSelect, 25, 26) |
639110e230b6Smaya      __gen_uint(values->LineStripListProvokingVertexSelect, 27, 28) |
639210e230b6Smaya      __gen_uint(values->TriangleStripListProvokingVertexSelect, 29, 30) |
639310e230b6Smaya      __gen_uint(values->LastPixelEnable, 31, 31);
639410e230b6Smaya}
639510e230b6Smaya
639610e230b6Smaya#define GEN10_3DSTATE_SO_BUFFER_length         8
639710e230b6Smaya#define GEN10_3DSTATE_SO_BUFFER_length_bias      2
639810e230b6Smaya#define GEN10_3DSTATE_SO_BUFFER_header          \
639910e230b6Smaya   .DWordLength                         =      6,  \
640010e230b6Smaya   ._3DCommandSubOpcode                 =     24,  \
640110e230b6Smaya   ._3DCommandOpcode                    =      1,  \
640210e230b6Smaya   .CommandSubType                      =      3,  \
640310e230b6Smaya   .CommandType                         =      3
640410e230b6Smaya
640510e230b6Smayastruct GEN10_3DSTATE_SO_BUFFER {
640610e230b6Smaya   uint32_t                             DWordLength;
640710e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
640810e230b6Smaya   uint32_t                             _3DCommandOpcode;
640910e230b6Smaya   uint32_t                             CommandSubType;
641010e230b6Smaya   uint32_t                             CommandType;
641110e230b6Smaya   bool                                 StreamOutputBufferOffsetAddressEnable;
641210e230b6Smaya   bool                                 StreamOffsetWriteEnable;
641310e230b6Smaya   uint32_t                             MOCS;
641410e230b6Smaya   uint32_t                             SOBufferIndex;
641510e230b6Smaya   bool                                 SOBufferEnable;
641610e230b6Smaya   __gen_address_type                   SurfaceBaseAddress;
641710e230b6Smaya   uint32_t                             SurfaceSize;
641810e230b6Smaya   __gen_address_type                   StreamOutputBufferOffsetAddress;
641910e230b6Smaya   uint32_t                             StreamOffset;
642010e230b6Smaya};
642110e230b6Smaya
642210e230b6Smayastatic inline void
642310e230b6SmayaGEN10_3DSTATE_SO_BUFFER_pack(__attribute__((unused)) __gen_user_data *data,
642410e230b6Smaya                             __attribute__((unused)) void * restrict dst,
642510e230b6Smaya                             __attribute__((unused)) const struct GEN10_3DSTATE_SO_BUFFER * restrict values)
642610e230b6Smaya{
642710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
642810e230b6Smaya
642910e230b6Smaya   dw[0] =
643010e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
643110e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
643210e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
643310e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
643410e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
643510e230b6Smaya
643610e230b6Smaya   dw[1] =
643710e230b6Smaya      __gen_uint(values->StreamOutputBufferOffsetAddressEnable, 20, 20) |
643810e230b6Smaya      __gen_uint(values->StreamOffsetWriteEnable, 21, 21) |
643910e230b6Smaya      __gen_uint(values->MOCS, 22, 28) |
644010e230b6Smaya      __gen_uint(values->SOBufferIndex, 29, 30) |
644110e230b6Smaya      __gen_uint(values->SOBufferEnable, 31, 31);
644210e230b6Smaya
644310e230b6Smaya   const uint64_t v2_address =
644410e230b6Smaya      __gen_combine_address(data, &dw[2], values->SurfaceBaseAddress, 0);
644510e230b6Smaya   dw[2] = v2_address;
644610e230b6Smaya   dw[3] = v2_address >> 32;
644710e230b6Smaya
644810e230b6Smaya   dw[4] =
644910e230b6Smaya      __gen_uint(values->SurfaceSize, 0, 29);
645010e230b6Smaya
645110e230b6Smaya   const uint64_t v5_address =
645210e230b6Smaya      __gen_combine_address(data, &dw[5], values->StreamOutputBufferOffsetAddress, 0);
645310e230b6Smaya   dw[5] = v5_address;
645410e230b6Smaya   dw[6] = v5_address >> 32;
645510e230b6Smaya
645610e230b6Smaya   dw[7] =
645710e230b6Smaya      __gen_uint(values->StreamOffset, 0, 31);
645810e230b6Smaya}
645910e230b6Smaya
646010e230b6Smaya#define GEN10_3DSTATE_SO_DECL_LIST_length_bias      2
646110e230b6Smaya#define GEN10_3DSTATE_SO_DECL_LIST_header       \
646210e230b6Smaya   ._3DCommandSubOpcode                 =     23,  \
646310e230b6Smaya   ._3DCommandOpcode                    =      1,  \
646410e230b6Smaya   .CommandSubType                      =      3,  \
646510e230b6Smaya   .CommandType                         =      3
646610e230b6Smaya
646710e230b6Smayastruct GEN10_3DSTATE_SO_DECL_LIST {
646810e230b6Smaya   uint32_t                             DWordLength;
646910e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
647010e230b6Smaya   uint32_t                             _3DCommandOpcode;
647110e230b6Smaya   uint32_t                             CommandSubType;
647210e230b6Smaya   uint32_t                             CommandType;
647310e230b6Smaya   uint32_t                             StreamtoBufferSelects0;
647410e230b6Smaya   uint32_t                             StreamtoBufferSelects1;
647510e230b6Smaya   uint32_t                             StreamtoBufferSelects2;
647610e230b6Smaya   uint32_t                             StreamtoBufferSelects3;
647710e230b6Smaya   uint32_t                             NumEntries0;
647810e230b6Smaya   uint32_t                             NumEntries1;
647910e230b6Smaya   uint32_t                             NumEntries2;
648010e230b6Smaya   uint32_t                             NumEntries3;
648110e230b6Smaya   /* variable length fields follow */
648210e230b6Smaya};
648310e230b6Smaya
648410e230b6Smayastatic inline void
648510e230b6SmayaGEN10_3DSTATE_SO_DECL_LIST_pack(__attribute__((unused)) __gen_user_data *data,
648610e230b6Smaya                                __attribute__((unused)) void * restrict dst,
648710e230b6Smaya                                __attribute__((unused)) const struct GEN10_3DSTATE_SO_DECL_LIST * restrict values)
648810e230b6Smaya{
648910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
649010e230b6Smaya
649110e230b6Smaya   dw[0] =
649210e230b6Smaya      __gen_uint(values->DWordLength, 0, 8) |
649310e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
649410e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
649510e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
649610e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
649710e230b6Smaya
649810e230b6Smaya   dw[1] =
649910e230b6Smaya      __gen_uint(values->StreamtoBufferSelects0, 0, 3) |
650010e230b6Smaya      __gen_uint(values->StreamtoBufferSelects1, 4, 7) |
650110e230b6Smaya      __gen_uint(values->StreamtoBufferSelects2, 8, 11) |
650210e230b6Smaya      __gen_uint(values->StreamtoBufferSelects3, 12, 15);
650310e230b6Smaya
650410e230b6Smaya   dw[2] =
650510e230b6Smaya      __gen_uint(values->NumEntries0, 0, 7) |
650610e230b6Smaya      __gen_uint(values->NumEntries1, 8, 15) |
650710e230b6Smaya      __gen_uint(values->NumEntries2, 16, 23) |
650810e230b6Smaya      __gen_uint(values->NumEntries3, 24, 31);
650910e230b6Smaya}
651010e230b6Smaya
651110e230b6Smaya#define GEN10_3DSTATE_STENCIL_BUFFER_length      5
651210e230b6Smaya#define GEN10_3DSTATE_STENCIL_BUFFER_length_bias      2
651310e230b6Smaya#define GEN10_3DSTATE_STENCIL_BUFFER_header     \
651410e230b6Smaya   .DWordLength                         =      3,  \
651510e230b6Smaya   ._3DCommandSubOpcode                 =      6,  \
651610e230b6Smaya   ._3DCommandOpcode                    =      0,  \
651710e230b6Smaya   .CommandSubType                      =      3,  \
651810e230b6Smaya   .CommandType                         =      3
651910e230b6Smaya
652010e230b6Smayastruct GEN10_3DSTATE_STENCIL_BUFFER {
652110e230b6Smaya   uint32_t                             DWordLength;
652210e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
652310e230b6Smaya   uint32_t                             _3DCommandOpcode;
652410e230b6Smaya   uint32_t                             CommandSubType;
652510e230b6Smaya   uint32_t                             CommandType;
652610e230b6Smaya   uint32_t                             SurfacePitch;
652710e230b6Smaya   uint32_t                             MOCS;
652810e230b6Smaya   bool                                 StencilBufferEnable;
652910e230b6Smaya   __gen_address_type                   SurfaceBaseAddress;
653010e230b6Smaya   uint32_t                             SurfaceQPitch;
653110e230b6Smaya};
653210e230b6Smaya
653310e230b6Smayastatic inline void
653410e230b6SmayaGEN10_3DSTATE_STENCIL_BUFFER_pack(__attribute__((unused)) __gen_user_data *data,
653510e230b6Smaya                                  __attribute__((unused)) void * restrict dst,
653610e230b6Smaya                                  __attribute__((unused)) const struct GEN10_3DSTATE_STENCIL_BUFFER * restrict values)
653710e230b6Smaya{
653810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
653910e230b6Smaya
654010e230b6Smaya   dw[0] =
654110e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
654210e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
654310e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
654410e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
654510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
654610e230b6Smaya
654710e230b6Smaya   dw[1] =
654810e230b6Smaya      __gen_uint(values->SurfacePitch, 0, 16) |
654910e230b6Smaya      __gen_uint(values->MOCS, 22, 28) |
655010e230b6Smaya      __gen_uint(values->StencilBufferEnable, 31, 31);
655110e230b6Smaya
655210e230b6Smaya   const uint64_t v2_address =
655310e230b6Smaya      __gen_combine_address(data, &dw[2], values->SurfaceBaseAddress, 0);
655410e230b6Smaya   dw[2] = v2_address;
655510e230b6Smaya   dw[3] = v2_address >> 32;
655610e230b6Smaya
655710e230b6Smaya   dw[4] =
655810e230b6Smaya      __gen_uint(values->SurfaceQPitch, 0, 14);
655910e230b6Smaya}
656010e230b6Smaya
656110e230b6Smaya#define GEN10_3DSTATE_STREAMOUT_length         5
656210e230b6Smaya#define GEN10_3DSTATE_STREAMOUT_length_bias      2
656310e230b6Smaya#define GEN10_3DSTATE_STREAMOUT_header          \
656410e230b6Smaya   .DWordLength                         =      3,  \
656510e230b6Smaya   ._3DCommandSubOpcode                 =     30,  \
656610e230b6Smaya   ._3DCommandOpcode                    =      0,  \
656710e230b6Smaya   .CommandSubType                      =      3,  \
656810e230b6Smaya   .CommandType                         =      3
656910e230b6Smaya
657010e230b6Smayastruct GEN10_3DSTATE_STREAMOUT {
657110e230b6Smaya   uint32_t                             DWordLength;
657210e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
657310e230b6Smaya   uint32_t                             _3DCommandOpcode;
657410e230b6Smaya   uint32_t                             CommandSubType;
657510e230b6Smaya   uint32_t                             CommandType;
657610e230b6Smaya   uint32_t                             ForceRendering;
657710e230b6Smaya#define Resreved                                 1
657810e230b6Smaya#define Force_Off                                2
657910e230b6Smaya#define Force_on                                 3
658010e230b6Smaya   bool                                 SOStatisticsEnable;
658110e230b6Smaya   uint32_t                             ReorderMode;
658210e230b6Smaya#define LEADING                                  0
658310e230b6Smaya#define TRAILING                                 1
658410e230b6Smaya   uint32_t                             RenderStreamSelect;
658510e230b6Smaya   bool                                 RenderingDisable;
658610e230b6Smaya   bool                                 SOFunctionEnable;
658710e230b6Smaya   uint32_t                             Stream0VertexReadLength;
658810e230b6Smaya   uint32_t                             Stream0VertexReadOffset;
658910e230b6Smaya   uint32_t                             Stream1VertexReadLength;
659010e230b6Smaya   uint32_t                             Stream1VertexReadOffset;
659110e230b6Smaya   uint32_t                             Stream2VertexReadLength;
659210e230b6Smaya   uint32_t                             Stream2VertexReadOffset;
659310e230b6Smaya   uint32_t                             Stream3VertexReadLength;
659410e230b6Smaya   uint32_t                             Stream3VertexReadOffset;
659510e230b6Smaya   uint32_t                             Buffer0SurfacePitch;
659610e230b6Smaya   uint32_t                             Buffer1SurfacePitch;
659710e230b6Smaya   uint32_t                             Buffer2SurfacePitch;
659810e230b6Smaya   uint32_t                             Buffer3SurfacePitch;
659910e230b6Smaya};
660010e230b6Smaya
660110e230b6Smayastatic inline void
660210e230b6SmayaGEN10_3DSTATE_STREAMOUT_pack(__attribute__((unused)) __gen_user_data *data,
660310e230b6Smaya                             __attribute__((unused)) void * restrict dst,
660410e230b6Smaya                             __attribute__((unused)) const struct GEN10_3DSTATE_STREAMOUT * restrict values)
660510e230b6Smaya{
660610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
660710e230b6Smaya
660810e230b6Smaya   dw[0] =
660910e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
661010e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
661110e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
661210e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
661310e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
661410e230b6Smaya
661510e230b6Smaya   dw[1] =
661610e230b6Smaya      __gen_uint(values->ForceRendering, 23, 24) |
661710e230b6Smaya      __gen_uint(values->SOStatisticsEnable, 25, 25) |
661810e230b6Smaya      __gen_uint(values->ReorderMode, 26, 26) |
661910e230b6Smaya      __gen_uint(values->RenderStreamSelect, 27, 28) |
662010e230b6Smaya      __gen_uint(values->RenderingDisable, 30, 30) |
662110e230b6Smaya      __gen_uint(values->SOFunctionEnable, 31, 31);
662210e230b6Smaya
662310e230b6Smaya   dw[2] =
662410e230b6Smaya      __gen_uint(values->Stream0VertexReadLength, 0, 4) |
662510e230b6Smaya      __gen_uint(values->Stream0VertexReadOffset, 5, 5) |
662610e230b6Smaya      __gen_uint(values->Stream1VertexReadLength, 8, 12) |
662710e230b6Smaya      __gen_uint(values->Stream1VertexReadOffset, 13, 13) |
662810e230b6Smaya      __gen_uint(values->Stream2VertexReadLength, 16, 20) |
662910e230b6Smaya      __gen_uint(values->Stream2VertexReadOffset, 21, 21) |
663010e230b6Smaya      __gen_uint(values->Stream3VertexReadLength, 24, 28) |
663110e230b6Smaya      __gen_uint(values->Stream3VertexReadOffset, 29, 29);
663210e230b6Smaya
663310e230b6Smaya   dw[3] =
663410e230b6Smaya      __gen_uint(values->Buffer0SurfacePitch, 0, 11) |
663510e230b6Smaya      __gen_uint(values->Buffer1SurfacePitch, 16, 27);
663610e230b6Smaya
663710e230b6Smaya   dw[4] =
663810e230b6Smaya      __gen_uint(values->Buffer2SurfacePitch, 0, 11) |
663910e230b6Smaya      __gen_uint(values->Buffer3SurfacePitch, 16, 27);
664010e230b6Smaya}
664110e230b6Smaya
664210e230b6Smaya#define GEN10_3DSTATE_TE_length                4
664310e230b6Smaya#define GEN10_3DSTATE_TE_length_bias           2
664410e230b6Smaya#define GEN10_3DSTATE_TE_header                 \
664510e230b6Smaya   .DWordLength                         =      2,  \
664610e230b6Smaya   ._3DCommandSubOpcode                 =     28,  \
664710e230b6Smaya   ._3DCommandOpcode                    =      0,  \
664810e230b6Smaya   .CommandSubType                      =      3,  \
664910e230b6Smaya   .CommandType                         =      3
665010e230b6Smaya
665110e230b6Smayastruct GEN10_3DSTATE_TE {
665210e230b6Smaya   uint32_t                             DWordLength;
665310e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
665410e230b6Smaya   uint32_t                             _3DCommandOpcode;
665510e230b6Smaya   uint32_t                             CommandSubType;
665610e230b6Smaya   uint32_t                             CommandType;
665710e230b6Smaya   bool                                 TEEnable;
665810e230b6Smaya   uint32_t                             TEMode;
665910e230b6Smaya#define HW_TESS                                  0
666010e230b6Smaya   uint32_t                             TEDomain;
666110e230b6Smaya#define QUAD                                     0
666210e230b6Smaya#define TRI                                      1
666310e230b6Smaya#define ISOLINE                                  2
666410e230b6Smaya   uint32_t                             OutputTopology;
666510e230b6Smaya#define OUTPUT_POINT                             0
666610e230b6Smaya#define OUTPUT_LINE                              1
666710e230b6Smaya#define OUTPUT_TRI_CW                            2
666810e230b6Smaya#define OUTPUT_TRI_CCW                           3
666910e230b6Smaya   uint32_t                             Partitioning;
667010e230b6Smaya#define INTEGER                                  0
667110e230b6Smaya#define ODD_FRACTIONAL                           1
667210e230b6Smaya#define EVEN_FRACTIONAL                          2
667310e230b6Smaya   float                                MaximumTessellationFactorOdd;
667410e230b6Smaya   float                                MaximumTessellationFactorNotOdd;
667510e230b6Smaya};
667610e230b6Smaya
667710e230b6Smayastatic inline void
667810e230b6SmayaGEN10_3DSTATE_TE_pack(__attribute__((unused)) __gen_user_data *data,
667910e230b6Smaya                      __attribute__((unused)) void * restrict dst,
668010e230b6Smaya                      __attribute__((unused)) const struct GEN10_3DSTATE_TE * restrict values)
668110e230b6Smaya{
668210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
668310e230b6Smaya
668410e230b6Smaya   dw[0] =
668510e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
668610e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
668710e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
668810e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
668910e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
669010e230b6Smaya
669110e230b6Smaya   dw[1] =
669210e230b6Smaya      __gen_uint(values->TEEnable, 0, 0) |
669310e230b6Smaya      __gen_uint(values->TEMode, 1, 2) |
669410e230b6Smaya      __gen_uint(values->TEDomain, 4, 5) |
669510e230b6Smaya      __gen_uint(values->OutputTopology, 8, 9) |
669610e230b6Smaya      __gen_uint(values->Partitioning, 12, 13);
669710e230b6Smaya
669810e230b6Smaya   dw[2] =
669910e230b6Smaya      __gen_float(values->MaximumTessellationFactorOdd);
670010e230b6Smaya
670110e230b6Smaya   dw[3] =
670210e230b6Smaya      __gen_float(values->MaximumTessellationFactorNotOdd);
670310e230b6Smaya}
670410e230b6Smaya
670510e230b6Smaya#define GEN10_3DSTATE_URB_CLEAR_length         2
670610e230b6Smaya#define GEN10_3DSTATE_URB_CLEAR_length_bias      2
670710e230b6Smaya#define GEN10_3DSTATE_URB_CLEAR_header          \
670810e230b6Smaya   .DWordLength                         =      0,  \
670910e230b6Smaya   ._3DCommandSubOpcode                 =     29,  \
671010e230b6Smaya   ._3DCommandOpcode                    =      1,  \
671110e230b6Smaya   .CommandSubType                      =      3,  \
671210e230b6Smaya   .CommandType                         =      3
671310e230b6Smaya
671410e230b6Smayastruct GEN10_3DSTATE_URB_CLEAR {
671510e230b6Smaya   uint32_t                             DWordLength;
671610e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
671710e230b6Smaya   uint32_t                             _3DCommandOpcode;
671810e230b6Smaya   uint32_t                             CommandSubType;
671910e230b6Smaya   uint32_t                             CommandType;
672010e230b6Smaya   uint64_t                             URBAddress;
672110e230b6Smaya   uint32_t                             URBClearLength;
672210e230b6Smaya};
672310e230b6Smaya
672410e230b6Smayastatic inline void
672510e230b6SmayaGEN10_3DSTATE_URB_CLEAR_pack(__attribute__((unused)) __gen_user_data *data,
672610e230b6Smaya                             __attribute__((unused)) void * restrict dst,
672710e230b6Smaya                             __attribute__((unused)) const struct GEN10_3DSTATE_URB_CLEAR * restrict values)
672810e230b6Smaya{
672910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
673010e230b6Smaya
673110e230b6Smaya   dw[0] =
673210e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
673310e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
673410e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
673510e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
673610e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
673710e230b6Smaya
673810e230b6Smaya   dw[1] =
673910e230b6Smaya      __gen_offset(values->URBAddress, 0, 14) |
674010e230b6Smaya      __gen_uint(values->URBClearLength, 16, 29);
674110e230b6Smaya}
674210e230b6Smaya
674310e230b6Smaya#define GEN10_3DSTATE_URB_DS_length            2
674410e230b6Smaya#define GEN10_3DSTATE_URB_DS_length_bias       2
674510e230b6Smaya#define GEN10_3DSTATE_URB_DS_header             \
674610e230b6Smaya   .DWordLength                         =      0,  \
674710e230b6Smaya   ._3DCommandSubOpcode                 =     50,  \
674810e230b6Smaya   ._3DCommandOpcode                    =      0,  \
674910e230b6Smaya   .CommandSubType                      =      3,  \
675010e230b6Smaya   .CommandType                         =      3
675110e230b6Smaya
675210e230b6Smayastruct GEN10_3DSTATE_URB_DS {
675310e230b6Smaya   uint32_t                             DWordLength;
675410e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
675510e230b6Smaya   uint32_t                             _3DCommandOpcode;
675610e230b6Smaya   uint32_t                             CommandSubType;
675710e230b6Smaya   uint32_t                             CommandType;
675810e230b6Smaya   uint32_t                             DSNumberofURBEntries;
675910e230b6Smaya   uint32_t                             DSURBEntryAllocationSize;
676010e230b6Smaya   uint32_t                             DSURBStartingAddress;
676110e230b6Smaya};
676210e230b6Smaya
676310e230b6Smayastatic inline void
676410e230b6SmayaGEN10_3DSTATE_URB_DS_pack(__attribute__((unused)) __gen_user_data *data,
676510e230b6Smaya                          __attribute__((unused)) void * restrict dst,
676610e230b6Smaya                          __attribute__((unused)) const struct GEN10_3DSTATE_URB_DS * restrict values)
676710e230b6Smaya{
676810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
676910e230b6Smaya
677010e230b6Smaya   dw[0] =
677110e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
677210e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
677310e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
677410e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
677510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
677610e230b6Smaya
677710e230b6Smaya   dw[1] =
677810e230b6Smaya      __gen_uint(values->DSNumberofURBEntries, 0, 15) |
677910e230b6Smaya      __gen_uint(values->DSURBEntryAllocationSize, 16, 24) |
678010e230b6Smaya      __gen_uint(values->DSURBStartingAddress, 25, 31);
678110e230b6Smaya}
678210e230b6Smaya
678310e230b6Smaya#define GEN10_3DSTATE_URB_GS_length            2
678410e230b6Smaya#define GEN10_3DSTATE_URB_GS_length_bias       2
678510e230b6Smaya#define GEN10_3DSTATE_URB_GS_header             \
678610e230b6Smaya   .DWordLength                         =      0,  \
678710e230b6Smaya   ._3DCommandSubOpcode                 =     51,  \
678810e230b6Smaya   ._3DCommandOpcode                    =      0,  \
678910e230b6Smaya   .CommandSubType                      =      3,  \
679010e230b6Smaya   .CommandType                         =      3
679110e230b6Smaya
679210e230b6Smayastruct GEN10_3DSTATE_URB_GS {
679310e230b6Smaya   uint32_t                             DWordLength;
679410e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
679510e230b6Smaya   uint32_t                             _3DCommandOpcode;
679610e230b6Smaya   uint32_t                             CommandSubType;
679710e230b6Smaya   uint32_t                             CommandType;
679810e230b6Smaya   uint32_t                             GSNumberofURBEntries;
679910e230b6Smaya   uint32_t                             GSURBEntryAllocationSize;
680010e230b6Smaya   uint32_t                             GSURBStartingAddress;
680110e230b6Smaya};
680210e230b6Smaya
680310e230b6Smayastatic inline void
680410e230b6SmayaGEN10_3DSTATE_URB_GS_pack(__attribute__((unused)) __gen_user_data *data,
680510e230b6Smaya                          __attribute__((unused)) void * restrict dst,
680610e230b6Smaya                          __attribute__((unused)) const struct GEN10_3DSTATE_URB_GS * restrict values)
680710e230b6Smaya{
680810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
680910e230b6Smaya
681010e230b6Smaya   dw[0] =
681110e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
681210e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
681310e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
681410e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
681510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
681610e230b6Smaya
681710e230b6Smaya   dw[1] =
681810e230b6Smaya      __gen_uint(values->GSNumberofURBEntries, 0, 15) |
681910e230b6Smaya      __gen_uint(values->GSURBEntryAllocationSize, 16, 24) |
682010e230b6Smaya      __gen_uint(values->GSURBStartingAddress, 25, 31);
682110e230b6Smaya}
682210e230b6Smaya
682310e230b6Smaya#define GEN10_3DSTATE_URB_HS_length            2
682410e230b6Smaya#define GEN10_3DSTATE_URB_HS_length_bias       2
682510e230b6Smaya#define GEN10_3DSTATE_URB_HS_header             \
682610e230b6Smaya   .DWordLength                         =      0,  \
682710e230b6Smaya   ._3DCommandSubOpcode                 =     49,  \
682810e230b6Smaya   ._3DCommandOpcode                    =      0,  \
682910e230b6Smaya   .CommandSubType                      =      3,  \
683010e230b6Smaya   .CommandType                         =      3
683110e230b6Smaya
683210e230b6Smayastruct GEN10_3DSTATE_URB_HS {
683310e230b6Smaya   uint32_t                             DWordLength;
683410e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
683510e230b6Smaya   uint32_t                             _3DCommandOpcode;
683610e230b6Smaya   uint32_t                             CommandSubType;
683710e230b6Smaya   uint32_t                             CommandType;
683810e230b6Smaya   uint32_t                             HSNumberofURBEntries;
683910e230b6Smaya   uint32_t                             HSURBEntryAllocationSize;
684010e230b6Smaya   uint32_t                             HSURBStartingAddress;
684110e230b6Smaya};
684210e230b6Smaya
684310e230b6Smayastatic inline void
684410e230b6SmayaGEN10_3DSTATE_URB_HS_pack(__attribute__((unused)) __gen_user_data *data,
684510e230b6Smaya                          __attribute__((unused)) void * restrict dst,
684610e230b6Smaya                          __attribute__((unused)) const struct GEN10_3DSTATE_URB_HS * restrict values)
684710e230b6Smaya{
684810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
684910e230b6Smaya
685010e230b6Smaya   dw[0] =
685110e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
685210e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
685310e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
685410e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
685510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
685610e230b6Smaya
685710e230b6Smaya   dw[1] =
685810e230b6Smaya      __gen_uint(values->HSNumberofURBEntries, 0, 15) |
685910e230b6Smaya      __gen_uint(values->HSURBEntryAllocationSize, 16, 24) |
686010e230b6Smaya      __gen_uint(values->HSURBStartingAddress, 25, 31);
686110e230b6Smaya}
686210e230b6Smaya
686310e230b6Smaya#define GEN10_3DSTATE_URB_VS_length            2
686410e230b6Smaya#define GEN10_3DSTATE_URB_VS_length_bias       2
686510e230b6Smaya#define GEN10_3DSTATE_URB_VS_header             \
686610e230b6Smaya   .DWordLength                         =      0,  \
686710e230b6Smaya   ._3DCommandSubOpcode                 =     48,  \
686810e230b6Smaya   ._3DCommandOpcode                    =      0,  \
686910e230b6Smaya   .CommandSubType                      =      3,  \
687010e230b6Smaya   .CommandType                         =      3
687110e230b6Smaya
687210e230b6Smayastruct GEN10_3DSTATE_URB_VS {
687310e230b6Smaya   uint32_t                             DWordLength;
687410e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
687510e230b6Smaya   uint32_t                             _3DCommandOpcode;
687610e230b6Smaya   uint32_t                             CommandSubType;
687710e230b6Smaya   uint32_t                             CommandType;
687810e230b6Smaya   uint32_t                             VSNumberofURBEntries;
687910e230b6Smaya   uint32_t                             VSURBEntryAllocationSize;
688010e230b6Smaya   uint32_t                             VSURBStartingAddress;
688110e230b6Smaya};
688210e230b6Smaya
688310e230b6Smayastatic inline void
688410e230b6SmayaGEN10_3DSTATE_URB_VS_pack(__attribute__((unused)) __gen_user_data *data,
688510e230b6Smaya                          __attribute__((unused)) void * restrict dst,
688610e230b6Smaya                          __attribute__((unused)) const struct GEN10_3DSTATE_URB_VS * restrict values)
688710e230b6Smaya{
688810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
688910e230b6Smaya
689010e230b6Smaya   dw[0] =
689110e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
689210e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
689310e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
689410e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
689510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
689610e230b6Smaya
689710e230b6Smaya   dw[1] =
689810e230b6Smaya      __gen_uint(values->VSNumberofURBEntries, 0, 15) |
689910e230b6Smaya      __gen_uint(values->VSURBEntryAllocationSize, 16, 24) |
690010e230b6Smaya      __gen_uint(values->VSURBStartingAddress, 25, 31);
690110e230b6Smaya}
690210e230b6Smaya
690310e230b6Smaya#define GEN10_3DSTATE_VERTEX_BUFFERS_length_bias      2
690410e230b6Smaya#define GEN10_3DSTATE_VERTEX_BUFFERS_header     \
690510e230b6Smaya   .DWordLength                         =      3,  \
690610e230b6Smaya   ._3DCommandSubOpcode                 =      8,  \
690710e230b6Smaya   ._3DCommandOpcode                    =      0,  \
690810e230b6Smaya   .CommandSubType                      =      3,  \
690910e230b6Smaya   .CommandType                         =      3
691010e230b6Smaya
691110e230b6Smayastruct GEN10_3DSTATE_VERTEX_BUFFERS {
691210e230b6Smaya   uint32_t                             DWordLength;
691310e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
691410e230b6Smaya   uint32_t                             _3DCommandOpcode;
691510e230b6Smaya   uint32_t                             CommandSubType;
691610e230b6Smaya   uint32_t                             CommandType;
691710e230b6Smaya   /* variable length fields follow */
691810e230b6Smaya};
691910e230b6Smaya
692010e230b6Smayastatic inline void
692110e230b6SmayaGEN10_3DSTATE_VERTEX_BUFFERS_pack(__attribute__((unused)) __gen_user_data *data,
692210e230b6Smaya                                  __attribute__((unused)) void * restrict dst,
692310e230b6Smaya                                  __attribute__((unused)) const struct GEN10_3DSTATE_VERTEX_BUFFERS * restrict values)
692410e230b6Smaya{
692510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
692610e230b6Smaya
692710e230b6Smaya   dw[0] =
692810e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
692910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
693010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
693110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
693210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
693310e230b6Smaya}
693410e230b6Smaya
693510e230b6Smaya#define GEN10_3DSTATE_VERTEX_ELEMENTS_length_bias      2
693610e230b6Smaya#define GEN10_3DSTATE_VERTEX_ELEMENTS_header    \
693710e230b6Smaya   .DWordLength                         =      1,  \
693810e230b6Smaya   ._3DCommandSubOpcode                 =      9,  \
693910e230b6Smaya   ._3DCommandOpcode                    =      0,  \
694010e230b6Smaya   .CommandSubType                      =      3,  \
694110e230b6Smaya   .CommandType                         =      3
694210e230b6Smaya
694310e230b6Smayastruct GEN10_3DSTATE_VERTEX_ELEMENTS {
694410e230b6Smaya   uint32_t                             DWordLength;
694510e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
694610e230b6Smaya   uint32_t                             _3DCommandOpcode;
694710e230b6Smaya   uint32_t                             CommandSubType;
694810e230b6Smaya   uint32_t                             CommandType;
694910e230b6Smaya   /* variable length fields follow */
695010e230b6Smaya};
695110e230b6Smaya
695210e230b6Smayastatic inline void
695310e230b6SmayaGEN10_3DSTATE_VERTEX_ELEMENTS_pack(__attribute__((unused)) __gen_user_data *data,
695410e230b6Smaya                                   __attribute__((unused)) void * restrict dst,
695510e230b6Smaya                                   __attribute__((unused)) const struct GEN10_3DSTATE_VERTEX_ELEMENTS * restrict values)
695610e230b6Smaya{
695710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
695810e230b6Smaya
695910e230b6Smaya   dw[0] =
696010e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
696110e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
696210e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
696310e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
696410e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
696510e230b6Smaya}
696610e230b6Smaya
696710e230b6Smaya#define GEN10_3DSTATE_VF_length                2
696810e230b6Smaya#define GEN10_3DSTATE_VF_length_bias           2
696910e230b6Smaya#define GEN10_3DSTATE_VF_header                 \
697010e230b6Smaya   .DWordLength                         =      0,  \
697110e230b6Smaya   ._3DCommandSubOpcode                 =     12,  \
697210e230b6Smaya   ._3DCommandOpcode                    =      0,  \
697310e230b6Smaya   .CommandSubType                      =      3,  \
697410e230b6Smaya   .CommandType                         =      3
697510e230b6Smaya
697610e230b6Smayastruct GEN10_3DSTATE_VF {
697710e230b6Smaya   uint32_t                             DWordLength;
697810e230b6Smaya   bool                                 IndexedDrawCutIndexEnable;
697910e230b6Smaya   bool                                 ComponentPackingEnable;
698010e230b6Smaya   bool                                 SequentialDrawCutIndexEnable;
698110e230b6Smaya   bool                                 VertexIDOffsetEnable;
698210e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
698310e230b6Smaya   uint32_t                             _3DCommandOpcode;
698410e230b6Smaya   uint32_t                             CommandSubType;
698510e230b6Smaya   uint32_t                             CommandType;
698610e230b6Smaya   uint32_t                             CutIndex;
698710e230b6Smaya};
698810e230b6Smaya
698910e230b6Smayastatic inline void
699010e230b6SmayaGEN10_3DSTATE_VF_pack(__attribute__((unused)) __gen_user_data *data,
699110e230b6Smaya                      __attribute__((unused)) void * restrict dst,
699210e230b6Smaya                      __attribute__((unused)) const struct GEN10_3DSTATE_VF * restrict values)
699310e230b6Smaya{
699410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
699510e230b6Smaya
699610e230b6Smaya   dw[0] =
699710e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
699810e230b6Smaya      __gen_uint(values->IndexedDrawCutIndexEnable, 8, 8) |
699910e230b6Smaya      __gen_uint(values->ComponentPackingEnable, 9, 9) |
700010e230b6Smaya      __gen_uint(values->SequentialDrawCutIndexEnable, 10, 10) |
700110e230b6Smaya      __gen_uint(values->VertexIDOffsetEnable, 11, 11) |
700210e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
700310e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
700410e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
700510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
700610e230b6Smaya
700710e230b6Smaya   dw[1] =
700810e230b6Smaya      __gen_uint(values->CutIndex, 0, 31);
700910e230b6Smaya}
701010e230b6Smaya
701110e230b6Smaya#define GEN10_3DSTATE_VF_COMPONENT_PACKING_length      5
701210e230b6Smaya#define GEN10_3DSTATE_VF_COMPONENT_PACKING_length_bias      2
701310e230b6Smaya#define GEN10_3DSTATE_VF_COMPONENT_PACKING_header\
701410e230b6Smaya   .DWordLength                         =      3,  \
701510e230b6Smaya   ._3DCommandSubOpcode                 =     85,  \
701610e230b6Smaya   ._3DCommandOpcode                    =      0,  \
701710e230b6Smaya   .CommandSubType                      =      3,  \
701810e230b6Smaya   .CommandType                         =      3
701910e230b6Smaya
702010e230b6Smayastruct GEN10_3DSTATE_VF_COMPONENT_PACKING {
702110e230b6Smaya   uint32_t                             DWordLength;
702210e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
702310e230b6Smaya   uint32_t                             _3DCommandOpcode;
702410e230b6Smaya   uint32_t                             CommandSubType;
702510e230b6Smaya   uint32_t                             CommandType;
702610e230b6Smaya   uint32_t                             VertexElement00Enables;
702710e230b6Smaya   uint32_t                             VertexElement01Enables;
702810e230b6Smaya   uint32_t                             VertexElement02Enables;
702910e230b6Smaya   uint32_t                             VertexElement03Enables;
703010e230b6Smaya   uint32_t                             VertexElement04Enables;
703110e230b6Smaya   uint32_t                             VertexElement05Enables;
703210e230b6Smaya   uint32_t                             VertexElement06Enables;
703310e230b6Smaya   uint32_t                             VertexElement07Enables;
703410e230b6Smaya   uint32_t                             VertexElement08Enables;
703510e230b6Smaya   uint32_t                             VertexElement09Enables;
703610e230b6Smaya   uint32_t                             VertexElement10Enables;
703710e230b6Smaya   uint32_t                             VertexElement11Enables;
703810e230b6Smaya   uint32_t                             VertexElement12Enables;
703910e230b6Smaya   uint32_t                             VertexElement13Enables;
704010e230b6Smaya   uint32_t                             VertexElement14Enables;
704110e230b6Smaya   uint32_t                             VertexElement15Enables;
704210e230b6Smaya   uint32_t                             VertexElement16Enables;
704310e230b6Smaya   uint32_t                             VertexElement17Enables;
704410e230b6Smaya   uint32_t                             VertexElement18Enables;
704510e230b6Smaya   uint32_t                             VertexElement19Enables;
704610e230b6Smaya   uint32_t                             VertexElement20Enables;
704710e230b6Smaya   uint32_t                             VertexElement21Enables;
704810e230b6Smaya   uint32_t                             VertexElement22Enables;
704910e230b6Smaya   uint32_t                             VertexElement23Enables;
705010e230b6Smaya   uint32_t                             VertexElement24Enables;
705110e230b6Smaya   uint32_t                             VertexElement25Enables;
705210e230b6Smaya   uint32_t                             VertexElement26Enables;
705310e230b6Smaya   uint32_t                             VertexElement27Enables;
705410e230b6Smaya   uint32_t                             VertexElement28Enables;
705510e230b6Smaya   uint32_t                             VertexElement29Enables;
705610e230b6Smaya   uint32_t                             VertexElement30Enables;
705710e230b6Smaya   uint32_t                             VertexElement31Enables;
705810e230b6Smaya};
705910e230b6Smaya
706010e230b6Smayastatic inline void
706110e230b6SmayaGEN10_3DSTATE_VF_COMPONENT_PACKING_pack(__attribute__((unused)) __gen_user_data *data,
706210e230b6Smaya                                        __attribute__((unused)) void * restrict dst,
706310e230b6Smaya                                        __attribute__((unused)) const struct GEN10_3DSTATE_VF_COMPONENT_PACKING * restrict values)
706410e230b6Smaya{
706510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
706610e230b6Smaya
706710e230b6Smaya   dw[0] =
706810e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
706910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
707010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
707110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
707210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
707310e230b6Smaya
707410e230b6Smaya   dw[1] =
707510e230b6Smaya      __gen_uint(values->VertexElement00Enables, 0, 3) |
707610e230b6Smaya      __gen_uint(values->VertexElement01Enables, 4, 7) |
707710e230b6Smaya      __gen_uint(values->VertexElement02Enables, 8, 11) |
707810e230b6Smaya      __gen_uint(values->VertexElement03Enables, 12, 15) |
707910e230b6Smaya      __gen_uint(values->VertexElement04Enables, 16, 19) |
708010e230b6Smaya      __gen_uint(values->VertexElement05Enables, 20, 23) |
708110e230b6Smaya      __gen_uint(values->VertexElement06Enables, 24, 27) |
708210e230b6Smaya      __gen_uint(values->VertexElement07Enables, 28, 31);
708310e230b6Smaya
708410e230b6Smaya   dw[2] =
708510e230b6Smaya      __gen_uint(values->VertexElement08Enables, 0, 3) |
708610e230b6Smaya      __gen_uint(values->VertexElement09Enables, 4, 7) |
708710e230b6Smaya      __gen_uint(values->VertexElement10Enables, 8, 11) |
708810e230b6Smaya      __gen_uint(values->VertexElement11Enables, 12, 15) |
708910e230b6Smaya      __gen_uint(values->VertexElement12Enables, 16, 19) |
709010e230b6Smaya      __gen_uint(values->VertexElement13Enables, 20, 23) |
709110e230b6Smaya      __gen_uint(values->VertexElement14Enables, 24, 27) |
709210e230b6Smaya      __gen_uint(values->VertexElement15Enables, 28, 31);
709310e230b6Smaya
709410e230b6Smaya   dw[3] =
709510e230b6Smaya      __gen_uint(values->VertexElement16Enables, 0, 3) |
709610e230b6Smaya      __gen_uint(values->VertexElement17Enables, 4, 7) |
709710e230b6Smaya      __gen_uint(values->VertexElement18Enables, 8, 11) |
709810e230b6Smaya      __gen_uint(values->VertexElement19Enables, 12, 15) |
709910e230b6Smaya      __gen_uint(values->VertexElement20Enables, 16, 19) |
710010e230b6Smaya      __gen_uint(values->VertexElement21Enables, 20, 23) |
710110e230b6Smaya      __gen_uint(values->VertexElement22Enables, 24, 27) |
710210e230b6Smaya      __gen_uint(values->VertexElement23Enables, 28, 31);
710310e230b6Smaya
710410e230b6Smaya   dw[4] =
710510e230b6Smaya      __gen_uint(values->VertexElement24Enables, 0, 3) |
710610e230b6Smaya      __gen_uint(values->VertexElement25Enables, 4, 7) |
710710e230b6Smaya      __gen_uint(values->VertexElement26Enables, 8, 11) |
710810e230b6Smaya      __gen_uint(values->VertexElement27Enables, 12, 15) |
710910e230b6Smaya      __gen_uint(values->VertexElement28Enables, 16, 19) |
711010e230b6Smaya      __gen_uint(values->VertexElement29Enables, 20, 23) |
711110e230b6Smaya      __gen_uint(values->VertexElement30Enables, 24, 27) |
711210e230b6Smaya      __gen_uint(values->VertexElement31Enables, 28, 31);
711310e230b6Smaya}
711410e230b6Smaya
711510e230b6Smaya#define GEN10_3DSTATE_VF_INSTANCING_length      3
711610e230b6Smaya#define GEN10_3DSTATE_VF_INSTANCING_length_bias      2
711710e230b6Smaya#define GEN10_3DSTATE_VF_INSTANCING_header      \
711810e230b6Smaya   .DWordLength                         =      1,  \
711910e230b6Smaya   ._3DCommandSubOpcode                 =     73,  \
712010e230b6Smaya   ._3DCommandOpcode                    =      0,  \
712110e230b6Smaya   .CommandSubType                      =      3,  \
712210e230b6Smaya   .CommandType                         =      3
712310e230b6Smaya
712410e230b6Smayastruct GEN10_3DSTATE_VF_INSTANCING {
712510e230b6Smaya   uint32_t                             DWordLength;
712610e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
712710e230b6Smaya   uint32_t                             _3DCommandOpcode;
712810e230b6Smaya   uint32_t                             CommandSubType;
712910e230b6Smaya   uint32_t                             CommandType;
713010e230b6Smaya   uint32_t                             VertexElementIndex;
713110e230b6Smaya   bool                                 InstancingEnable;
713210e230b6Smaya   uint32_t                             InstanceDataStepRate;
713310e230b6Smaya};
713410e230b6Smaya
713510e230b6Smayastatic inline void
713610e230b6SmayaGEN10_3DSTATE_VF_INSTANCING_pack(__attribute__((unused)) __gen_user_data *data,
713710e230b6Smaya                                 __attribute__((unused)) void * restrict dst,
713810e230b6Smaya                                 __attribute__((unused)) const struct GEN10_3DSTATE_VF_INSTANCING * restrict values)
713910e230b6Smaya{
714010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
714110e230b6Smaya
714210e230b6Smaya   dw[0] =
714310e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
714410e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
714510e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
714610e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
714710e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
714810e230b6Smaya
714910e230b6Smaya   dw[1] =
715010e230b6Smaya      __gen_uint(values->VertexElementIndex, 0, 5) |
715110e230b6Smaya      __gen_uint(values->InstancingEnable, 8, 8);
715210e230b6Smaya
715310e230b6Smaya   dw[2] =
715410e230b6Smaya      __gen_uint(values->InstanceDataStepRate, 0, 31);
715510e230b6Smaya}
715610e230b6Smaya
715710e230b6Smaya#define GEN10_3DSTATE_VF_SGVS_length           2
715810e230b6Smaya#define GEN10_3DSTATE_VF_SGVS_length_bias      2
715910e230b6Smaya#define GEN10_3DSTATE_VF_SGVS_header            \
716010e230b6Smaya   .DWordLength                         =      0,  \
716110e230b6Smaya   ._3DCommandSubOpcode                 =     74,  \
716210e230b6Smaya   ._3DCommandOpcode                    =      0,  \
716310e230b6Smaya   .CommandSubType                      =      3,  \
716410e230b6Smaya   .CommandType                         =      3
716510e230b6Smaya
716610e230b6Smayastruct GEN10_3DSTATE_VF_SGVS {
716710e230b6Smaya   uint32_t                             DWordLength;
716810e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
716910e230b6Smaya   uint32_t                             _3DCommandOpcode;
717010e230b6Smaya   uint32_t                             CommandSubType;
717110e230b6Smaya   uint32_t                             CommandType;
717210e230b6Smaya   uint32_t                             VertexIDElementOffset;
717310e230b6Smaya   uint32_t                             VertexIDComponentNumber;
717410e230b6Smaya#define COMP_0                                   0
717510e230b6Smaya#define COMP_1                                   1
717610e230b6Smaya#define COMP_2                                   2
717710e230b6Smaya#define COMP_3                                   3
717810e230b6Smaya   bool                                 VertexIDEnable;
717910e230b6Smaya   uint32_t                             InstanceIDElementOffset;
718010e230b6Smaya   uint32_t                             InstanceIDComponentNumber;
718110e230b6Smaya#define COMP_0                                   0
718210e230b6Smaya#define COMP_1                                   1
718310e230b6Smaya#define COMP_2                                   2
718410e230b6Smaya#define COMP_3                                   3
718510e230b6Smaya   bool                                 InstanceIDEnable;
718610e230b6Smaya};
718710e230b6Smaya
718810e230b6Smayastatic inline void
718910e230b6SmayaGEN10_3DSTATE_VF_SGVS_pack(__attribute__((unused)) __gen_user_data *data,
719010e230b6Smaya                           __attribute__((unused)) void * restrict dst,
719110e230b6Smaya                           __attribute__((unused)) const struct GEN10_3DSTATE_VF_SGVS * restrict values)
719210e230b6Smaya{
719310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
719410e230b6Smaya
719510e230b6Smaya   dw[0] =
719610e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
719710e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
719810e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
719910e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
720010e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
720110e230b6Smaya
720210e230b6Smaya   dw[1] =
720310e230b6Smaya      __gen_uint(values->VertexIDElementOffset, 0, 5) |
720410e230b6Smaya      __gen_uint(values->VertexIDComponentNumber, 13, 14) |
720510e230b6Smaya      __gen_uint(values->VertexIDEnable, 15, 15) |
720610e230b6Smaya      __gen_uint(values->InstanceIDElementOffset, 16, 21) |
720710e230b6Smaya      __gen_uint(values->InstanceIDComponentNumber, 29, 30) |
720810e230b6Smaya      __gen_uint(values->InstanceIDEnable, 31, 31);
720910e230b6Smaya}
721010e230b6Smaya
721110e230b6Smaya#define GEN10_3DSTATE_VF_SGVS_2_length         3
721210e230b6Smaya#define GEN10_3DSTATE_VF_SGVS_2_length_bias      2
721310e230b6Smaya#define GEN10_3DSTATE_VF_SGVS_2_header          \
721410e230b6Smaya   .DWordLength                         =      1,  \
721510e230b6Smaya   ._3DCommandSubOpcode                 =     86,  \
721610e230b6Smaya   ._3DCommandOpcode                    =      0,  \
721710e230b6Smaya   .CommandSubType                      =      3,  \
721810e230b6Smaya   .CommandType                         =      3
721910e230b6Smaya
722010e230b6Smayastruct GEN10_3DSTATE_VF_SGVS_2 {
722110e230b6Smaya   uint32_t                             DWordLength;
722210e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
722310e230b6Smaya   uint32_t                             _3DCommandOpcode;
722410e230b6Smaya   uint32_t                             CommandSubType;
722510e230b6Smaya   uint32_t                             CommandType;
722610e230b6Smaya   uint32_t                             XP0ElementOffset;
722710e230b6Smaya   uint32_t                             XP0SourceSelect;
722810e230b6Smaya#define VERTEX_LOCATION                          1
722910e230b6Smaya#define XP0_PARAMETER                            0
723010e230b6Smaya   uint32_t                             XP0ComponentNumber;
723110e230b6Smaya#define COMP_0                                   0
723210e230b6Smaya#define COMP_1                                   1
723310e230b6Smaya#define COMP_2                                   2
723410e230b6Smaya#define COMP_3                                   3
723510e230b6Smaya   uint32_t                             XP0Enable;
723610e230b6Smaya   uint32_t                             XP1ElementOffset;
723710e230b6Smaya   uint32_t                             XP1SourceSelect;
723810e230b6Smaya#define StartingInstanceLocation                 1
723910e230b6Smaya#define XP1_PARAMETER                            0
724010e230b6Smaya   uint32_t                             XP1ComponentNumber;
724110e230b6Smaya#define COMP_0                                   0
724210e230b6Smaya#define COMP_1                                   1
724310e230b6Smaya#define COMP_2                                   2
724410e230b6Smaya#define COMP_3                                   3
724510e230b6Smaya   uint32_t                             XP1Enable;
724610e230b6Smaya   uint32_t                             XP2ElementOffset;
724710e230b6Smaya   uint32_t                             XP2ComponentNumber;
724810e230b6Smaya#define COMP_0                                   0
724910e230b6Smaya#define COMP_1                                   1
725010e230b6Smaya#define COMP_2                                   2
725110e230b6Smaya#define COMP_3                                   3
725210e230b6Smaya   uint32_t                             XP2Enable;
725310e230b6Smaya};
725410e230b6Smaya
725510e230b6Smayastatic inline void
725610e230b6SmayaGEN10_3DSTATE_VF_SGVS_2_pack(__attribute__((unused)) __gen_user_data *data,
725710e230b6Smaya                             __attribute__((unused)) void * restrict dst,
725810e230b6Smaya                             __attribute__((unused)) const struct GEN10_3DSTATE_VF_SGVS_2 * restrict values)
725910e230b6Smaya{
726010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
726110e230b6Smaya
726210e230b6Smaya   dw[0] =
726310e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
726410e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
726510e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
726610e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
726710e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
726810e230b6Smaya
726910e230b6Smaya   dw[1] =
727010e230b6Smaya      __gen_uint(values->XP0ElementOffset, 0, 5) |
727110e230b6Smaya      __gen_uint(values->XP0SourceSelect, 12, 12) |
727210e230b6Smaya      __gen_uint(values->XP0ComponentNumber, 13, 14) |
727310e230b6Smaya      __gen_uint(values->XP0Enable, 15, 15) |
727410e230b6Smaya      __gen_uint(values->XP1ElementOffset, 16, 21) |
727510e230b6Smaya      __gen_uint(values->XP1SourceSelect, 28, 28) |
727610e230b6Smaya      __gen_uint(values->XP1ComponentNumber, 29, 30) |
727710e230b6Smaya      __gen_uint(values->XP1Enable, 31, 31);
727810e230b6Smaya
727910e230b6Smaya   dw[2] =
728010e230b6Smaya      __gen_uint(values->XP2ElementOffset, 0, 5) |
728110e230b6Smaya      __gen_uint(values->XP2ComponentNumber, 13, 14) |
728210e230b6Smaya      __gen_uint(values->XP2Enable, 15, 15);
728310e230b6Smaya}
728410e230b6Smaya
728510e230b6Smaya#define GEN10_3DSTATE_VF_STATISTICS_length      1
728610e230b6Smaya#define GEN10_3DSTATE_VF_STATISTICS_length_bias      1
728710e230b6Smaya#define GEN10_3DSTATE_VF_STATISTICS_header      \
728810e230b6Smaya   ._3DCommandSubOpcode                 =     11,  \
728910e230b6Smaya   ._3DCommandOpcode                    =      0,  \
729010e230b6Smaya   .CommandSubType                      =      1,  \
729110e230b6Smaya   .CommandType                         =      3
729210e230b6Smaya
729310e230b6Smayastruct GEN10_3DSTATE_VF_STATISTICS {
729410e230b6Smaya   bool                                 StatisticsEnable;
729510e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
729610e230b6Smaya   uint32_t                             _3DCommandOpcode;
729710e230b6Smaya   uint32_t                             CommandSubType;
729810e230b6Smaya   uint32_t                             CommandType;
729910e230b6Smaya};
730010e230b6Smaya
730110e230b6Smayastatic inline void
730210e230b6SmayaGEN10_3DSTATE_VF_STATISTICS_pack(__attribute__((unused)) __gen_user_data *data,
730310e230b6Smaya                                 __attribute__((unused)) void * restrict dst,
730410e230b6Smaya                                 __attribute__((unused)) const struct GEN10_3DSTATE_VF_STATISTICS * restrict values)
730510e230b6Smaya{
730610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
730710e230b6Smaya
730810e230b6Smaya   dw[0] =
730910e230b6Smaya      __gen_uint(values->StatisticsEnable, 0, 0) |
731010e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
731110e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
731210e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
731310e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
731410e230b6Smaya}
731510e230b6Smaya
731610e230b6Smaya#define GEN10_3DSTATE_VF_TOPOLOGY_length       2
731710e230b6Smaya#define GEN10_3DSTATE_VF_TOPOLOGY_length_bias      2
731810e230b6Smaya#define GEN10_3DSTATE_VF_TOPOLOGY_header        \
731910e230b6Smaya   .DWordLength                         =      0,  \
732010e230b6Smaya   ._3DCommandSubOpcode                 =     75,  \
732110e230b6Smaya   ._3DCommandOpcode                    =      0,  \
732210e230b6Smaya   .CommandSubType                      =      3,  \
732310e230b6Smaya   .CommandType                         =      3
732410e230b6Smaya
732510e230b6Smayastruct GEN10_3DSTATE_VF_TOPOLOGY {
732610e230b6Smaya   uint32_t                             DWordLength;
732710e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
732810e230b6Smaya   uint32_t                             _3DCommandOpcode;
732910e230b6Smaya   uint32_t                             CommandSubType;
733010e230b6Smaya   uint32_t                             CommandType;
733110e230b6Smaya   enum GEN10_3D_Prim_Topo_Type         PrimitiveTopologyType;
733210e230b6Smaya};
733310e230b6Smaya
733410e230b6Smayastatic inline void
733510e230b6SmayaGEN10_3DSTATE_VF_TOPOLOGY_pack(__attribute__((unused)) __gen_user_data *data,
733610e230b6Smaya                               __attribute__((unused)) void * restrict dst,
733710e230b6Smaya                               __attribute__((unused)) const struct GEN10_3DSTATE_VF_TOPOLOGY * restrict values)
733810e230b6Smaya{
733910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
734010e230b6Smaya
734110e230b6Smaya   dw[0] =
734210e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
734310e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
734410e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
734510e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
734610e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
734710e230b6Smaya
734810e230b6Smaya   dw[1] =
734910e230b6Smaya      __gen_uint(values->PrimitiveTopologyType, 0, 5);
735010e230b6Smaya}
735110e230b6Smaya
735210e230b6Smaya#define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_length      2
735310e230b6Smaya#define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_length_bias      2
735410e230b6Smaya#define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_header\
735510e230b6Smaya   .DWordLength                         =      0,  \
735610e230b6Smaya   ._3DCommandSubOpcode                 =     35,  \
735710e230b6Smaya   ._3DCommandOpcode                    =      0,  \
735810e230b6Smaya   .CommandSubType                      =      3,  \
735910e230b6Smaya   .CommandType                         =      3
736010e230b6Smaya
736110e230b6Smayastruct GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC {
736210e230b6Smaya   uint32_t                             DWordLength;
736310e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
736410e230b6Smaya   uint32_t                             _3DCommandOpcode;
736510e230b6Smaya   uint32_t                             CommandSubType;
736610e230b6Smaya   uint32_t                             CommandType;
736710e230b6Smaya   uint64_t                             CCViewportPointer;
736810e230b6Smaya};
736910e230b6Smaya
737010e230b6Smayastatic inline void
737110e230b6SmayaGEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC_pack(__attribute__((unused)) __gen_user_data *data,
737210e230b6Smaya                                              __attribute__((unused)) void * restrict dst,
737310e230b6Smaya                                              __attribute__((unused)) const struct GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_CC * restrict values)
737410e230b6Smaya{
737510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
737610e230b6Smaya
737710e230b6Smaya   dw[0] =
737810e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
737910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
738010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
738110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
738210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
738310e230b6Smaya
738410e230b6Smaya   dw[1] =
738510e230b6Smaya      __gen_offset(values->CCViewportPointer, 5, 31);
738610e230b6Smaya}
738710e230b6Smaya
738810e230b6Smaya#define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_length      2
738910e230b6Smaya#define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_length_bias      2
739010e230b6Smaya#define GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_header\
739110e230b6Smaya   .DWordLength                         =      0,  \
739210e230b6Smaya   ._3DCommandSubOpcode                 =     33,  \
739310e230b6Smaya   ._3DCommandOpcode                    =      0,  \
739410e230b6Smaya   .CommandSubType                      =      3,  \
739510e230b6Smaya   .CommandType                         =      3
739610e230b6Smaya
739710e230b6Smayastruct GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP {
739810e230b6Smaya   uint32_t                             DWordLength;
739910e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
740010e230b6Smaya   uint32_t                             _3DCommandOpcode;
740110e230b6Smaya   uint32_t                             CommandSubType;
740210e230b6Smaya   uint32_t                             CommandType;
740310e230b6Smaya   uint64_t                             SFClipViewportPointer;
740410e230b6Smaya};
740510e230b6Smaya
740610e230b6Smayastatic inline void
740710e230b6SmayaGEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP_pack(__attribute__((unused)) __gen_user_data *data,
740810e230b6Smaya                                                   __attribute__((unused)) void * restrict dst,
740910e230b6Smaya                                                   __attribute__((unused)) const struct GEN10_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP * restrict values)
741010e230b6Smaya{
741110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
741210e230b6Smaya
741310e230b6Smaya   dw[0] =
741410e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
741510e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
741610e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
741710e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
741810e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
741910e230b6Smaya
742010e230b6Smaya   dw[1] =
742110e230b6Smaya      __gen_offset(values->SFClipViewportPointer, 6, 31);
742210e230b6Smaya}
742310e230b6Smaya
742410e230b6Smaya#define GEN10_3DSTATE_VS_length                9
742510e230b6Smaya#define GEN10_3DSTATE_VS_length_bias           2
742610e230b6Smaya#define GEN10_3DSTATE_VS_header                 \
742710e230b6Smaya   .DWordLength                         =      7,  \
742810e230b6Smaya   ._3DCommandSubOpcode                 =     16,  \
742910e230b6Smaya   ._3DCommandOpcode                    =      0,  \
743010e230b6Smaya   .CommandSubType                      =      3,  \
743110e230b6Smaya   .CommandType                         =      3
743210e230b6Smaya
743310e230b6Smayastruct GEN10_3DSTATE_VS {
743410e230b6Smaya   uint32_t                             DWordLength;
743510e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
743610e230b6Smaya   uint32_t                             _3DCommandOpcode;
743710e230b6Smaya   uint32_t                             CommandSubType;
743810e230b6Smaya   uint32_t                             CommandType;
743910e230b6Smaya   uint64_t                             KernelStartPointer;
744010e230b6Smaya   bool                                 SoftwareExceptionEnable;
744110e230b6Smaya   bool                                 AccessesUAV;
744210e230b6Smaya   bool                                 IllegalOpcodeExceptionEnable;
744310e230b6Smaya   uint32_t                             FloatingPointMode;
744410e230b6Smaya#define IEEE754                                  0
744510e230b6Smaya#define Alternate                                1
744610e230b6Smaya   uint32_t                             ThreadDispatchPriority;
744710e230b6Smaya#define High                                     1
744810e230b6Smaya   uint32_t                             BindingTableEntryCount;
744910e230b6Smaya   uint32_t                             SamplerCount;
745010e230b6Smaya#define NoSamplers                               0
745110e230b6Smaya#define _14Samplers                              1
745210e230b6Smaya#define _58Samplers                              2
745310e230b6Smaya#define _912Samplers                             3
745410e230b6Smaya#define _1316Samplers                            4
745510e230b6Smaya   bool                                 VectorMaskEnable;
745610e230b6Smaya   bool                                 SingleVertexDispatch;
745710e230b6Smaya   uint32_t                             PerThreadScratchSpace;
745810e230b6Smaya   __gen_address_type                   ScratchSpaceBasePointer;
745910e230b6Smaya   uint32_t                             VertexURBEntryReadOffset;
746010e230b6Smaya   uint32_t                             VertexURBEntryReadLength;
746110e230b6Smaya   uint32_t                             DispatchGRFStartRegisterForURBData;
746210e230b6Smaya   bool                                 Enable;
746310e230b6Smaya   bool                                 VertexCacheDisable;
746410e230b6Smaya   bool                                 SIMD8DispatchEnable;
746510e230b6Smaya   bool                                 SIMD8SingleInstanceDispatchEnable;
746610e230b6Smaya   bool                                 StatisticsEnable;
746710e230b6Smaya   uint32_t                             MaximumNumberofThreads;
746810e230b6Smaya   uint32_t                             UserClipDistanceCullTestEnableBitmask;
746910e230b6Smaya   uint32_t                             UserClipDistanceClipTestEnableBitmask;
747010e230b6Smaya   uint32_t                             VertexURBEntryOutputLength;
747110e230b6Smaya   uint32_t                             VertexURBEntryOutputReadOffset;
747210e230b6Smaya};
747310e230b6Smaya
747410e230b6Smayastatic inline void
747510e230b6SmayaGEN10_3DSTATE_VS_pack(__attribute__((unused)) __gen_user_data *data,
747610e230b6Smaya                      __attribute__((unused)) void * restrict dst,
747710e230b6Smaya                      __attribute__((unused)) const struct GEN10_3DSTATE_VS * restrict values)
747810e230b6Smaya{
747910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
748010e230b6Smaya
748110e230b6Smaya   dw[0] =
748210e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
748310e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
748410e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
748510e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
748610e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
748710e230b6Smaya
748810e230b6Smaya   const uint64_t v1 =
748910e230b6Smaya      __gen_offset(values->KernelStartPointer, 6, 63);
749010e230b6Smaya   dw[1] = v1;
749110e230b6Smaya   dw[2] = v1 >> 32;
749210e230b6Smaya
749310e230b6Smaya   dw[3] =
749410e230b6Smaya      __gen_uint(values->SoftwareExceptionEnable, 7, 7) |
749510e230b6Smaya      __gen_uint(values->AccessesUAV, 12, 12) |
749610e230b6Smaya      __gen_uint(values->IllegalOpcodeExceptionEnable, 13, 13) |
749710e230b6Smaya      __gen_uint(values->FloatingPointMode, 16, 16) |
749810e230b6Smaya      __gen_uint(values->ThreadDispatchPriority, 17, 17) |
749910e230b6Smaya      __gen_uint(values->BindingTableEntryCount, 18, 25) |
750010e230b6Smaya      __gen_uint(values->SamplerCount, 27, 29) |
750110e230b6Smaya      __gen_uint(values->VectorMaskEnable, 30, 30) |
750210e230b6Smaya      __gen_uint(values->SingleVertexDispatch, 31, 31);
750310e230b6Smaya
750410e230b6Smaya   const uint64_t v4 =
750510e230b6Smaya      __gen_uint(values->PerThreadScratchSpace, 0, 3);
750610e230b6Smaya   const uint64_t v4_address =
750710e230b6Smaya      __gen_combine_address(data, &dw[4], values->ScratchSpaceBasePointer, v4);
750810e230b6Smaya   dw[4] = v4_address;
750910e230b6Smaya   dw[5] = (v4_address >> 32) | (v4 >> 32);
751010e230b6Smaya
751110e230b6Smaya   dw[6] =
751210e230b6Smaya      __gen_uint(values->VertexURBEntryReadOffset, 4, 9) |
751310e230b6Smaya      __gen_uint(values->VertexURBEntryReadLength, 11, 16) |
751410e230b6Smaya      __gen_uint(values->DispatchGRFStartRegisterForURBData, 20, 24);
751510e230b6Smaya
751610e230b6Smaya   dw[7] =
751710e230b6Smaya      __gen_uint(values->Enable, 0, 0) |
751810e230b6Smaya      __gen_uint(values->VertexCacheDisable, 1, 1) |
751910e230b6Smaya      __gen_uint(values->SIMD8DispatchEnable, 2, 2) |
752010e230b6Smaya      __gen_uint(values->SIMD8SingleInstanceDispatchEnable, 9, 9) |
752110e230b6Smaya      __gen_uint(values->StatisticsEnable, 10, 10) |
752210e230b6Smaya      __gen_uint(values->MaximumNumberofThreads, 22, 31);
752310e230b6Smaya
752410e230b6Smaya   dw[8] =
752510e230b6Smaya      __gen_uint(values->UserClipDistanceCullTestEnableBitmask, 0, 7) |
752610e230b6Smaya      __gen_uint(values->UserClipDistanceClipTestEnableBitmask, 8, 15) |
752710e230b6Smaya      __gen_uint(values->VertexURBEntryOutputLength, 16, 20) |
752810e230b6Smaya      __gen_uint(values->VertexURBEntryOutputReadOffset, 21, 26);
752910e230b6Smaya}
753010e230b6Smaya
753110e230b6Smaya#define GEN10_3DSTATE_WM_length                2
753210e230b6Smaya#define GEN10_3DSTATE_WM_length_bias           2
753310e230b6Smaya#define GEN10_3DSTATE_WM_header                 \
753410e230b6Smaya   .DWordLength                         =      0,  \
753510e230b6Smaya   ._3DCommandSubOpcode                 =     20,  \
753610e230b6Smaya   ._3DCommandOpcode                    =      0,  \
753710e230b6Smaya   .CommandSubType                      =      3,  \
753810e230b6Smaya   .CommandType                         =      3
753910e230b6Smaya
754010e230b6Smayastruct GEN10_3DSTATE_WM {
754110e230b6Smaya   uint32_t                             DWordLength;
754210e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
754310e230b6Smaya   uint32_t                             _3DCommandOpcode;
754410e230b6Smaya   uint32_t                             CommandSubType;
754510e230b6Smaya   uint32_t                             CommandType;
754610e230b6Smaya   uint32_t                             ForceKillPixelEnable;
754710e230b6Smaya#define ForceOff                                 1
754810e230b6Smaya#define ForceON                                  2
754910e230b6Smaya   uint32_t                             PointRasterizationRule;
755010e230b6Smaya#define RASTRULE_UPPER_LEFT                      0
755110e230b6Smaya#define RASTRULE_UPPER_RIGHT                     1
755210e230b6Smaya   bool                                 LineStippleEnable;
755310e230b6Smaya   bool                                 PolygonStippleEnable;
755410e230b6Smaya   uint32_t                             LineAntialiasingRegionWidth;
755510e230b6Smaya#define _05pixels                                0
755610e230b6Smaya#define _10pixels                                1
755710e230b6Smaya#define _20pixels                                2
755810e230b6Smaya#define _40pixels                                3
755910e230b6Smaya   uint32_t                             LineEndCapAntialiasingRegionWidth;
756010e230b6Smaya#define _05pixels                                0
756110e230b6Smaya#define _10pixels                                1
756210e230b6Smaya#define _20pixels                                2
756310e230b6Smaya#define _40pixels                                3
756410e230b6Smaya   uint32_t                             BarycentricInterpolationMode;
756510e230b6Smaya#define BIM_PERSPECTIVE_PIXEL                    1
756610e230b6Smaya#define BIM_PERSPECTIVE_CENTROID                 2
756710e230b6Smaya#define BIM_PERSPECTIVE_SAMPLE                   4
756810e230b6Smaya#define BIM_LINEAR_PIXEL                         8
756910e230b6Smaya#define BIM_LINEAR_CENTROID                      16
757010e230b6Smaya#define BIM_LINEAR_SAMPLE                        32
757110e230b6Smaya   uint32_t                             PositionZWInterpolationMode;
757210e230b6Smaya#define INTERP_PIXEL                             0
757310e230b6Smaya#define INTERP_CENTROID                          2
757410e230b6Smaya#define INTERP_SAMPLE                            3
757510e230b6Smaya   uint32_t                             ForceThreadDispatchEnable;
757610e230b6Smaya#define ForceOff                                 1
757710e230b6Smaya#define ForceON                                  2
757810e230b6Smaya   uint32_t                             EarlyDepthStencilControl;
757910e230b6Smaya#define EDSC_NORMAL                              0
758010e230b6Smaya#define EDSC_PSEXEC                              1
758110e230b6Smaya#define EDSC_PREPS                               2
758210e230b6Smaya   bool                                 LegacyDiamondLineRasterization;
758310e230b6Smaya   bool                                 LegacyHierarchicalDepthBufferResolveEnable;
758410e230b6Smaya   bool                                 LegacyDepthBufferResolveEnable;
758510e230b6Smaya   bool                                 LegacyDepthBufferClearEnable;
758610e230b6Smaya   bool                                 StatisticsEnable;
758710e230b6Smaya};
758810e230b6Smaya
758910e230b6Smayastatic inline void
759010e230b6SmayaGEN10_3DSTATE_WM_pack(__attribute__((unused)) __gen_user_data *data,
759110e230b6Smaya                      __attribute__((unused)) void * restrict dst,
759210e230b6Smaya                      __attribute__((unused)) const struct GEN10_3DSTATE_WM * restrict values)
759310e230b6Smaya{
759410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
759510e230b6Smaya
759610e230b6Smaya   dw[0] =
759710e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
759810e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
759910e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
760010e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
760110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
760210e230b6Smaya
760310e230b6Smaya   dw[1] =
760410e230b6Smaya      __gen_uint(values->ForceKillPixelEnable, 0, 1) |
760510e230b6Smaya      __gen_uint(values->PointRasterizationRule, 2, 2) |
760610e230b6Smaya      __gen_uint(values->LineStippleEnable, 3, 3) |
760710e230b6Smaya      __gen_uint(values->PolygonStippleEnable, 4, 4) |
760810e230b6Smaya      __gen_uint(values->LineAntialiasingRegionWidth, 6, 7) |
760910e230b6Smaya      __gen_uint(values->LineEndCapAntialiasingRegionWidth, 8, 9) |
761010e230b6Smaya      __gen_uint(values->BarycentricInterpolationMode, 11, 16) |
761110e230b6Smaya      __gen_uint(values->PositionZWInterpolationMode, 17, 18) |
761210e230b6Smaya      __gen_uint(values->ForceThreadDispatchEnable, 19, 20) |
761310e230b6Smaya      __gen_uint(values->EarlyDepthStencilControl, 21, 22) |
761410e230b6Smaya      __gen_uint(values->LegacyDiamondLineRasterization, 26, 26) |
761510e230b6Smaya      __gen_uint(values->LegacyHierarchicalDepthBufferResolveEnable, 27, 27) |
761610e230b6Smaya      __gen_uint(values->LegacyDepthBufferResolveEnable, 28, 28) |
761710e230b6Smaya      __gen_uint(values->LegacyDepthBufferClearEnable, 30, 30) |
761810e230b6Smaya      __gen_uint(values->StatisticsEnable, 31, 31);
761910e230b6Smaya}
762010e230b6Smaya
762110e230b6Smaya#define GEN10_3DSTATE_WM_CHROMAKEY_length      2
762210e230b6Smaya#define GEN10_3DSTATE_WM_CHROMAKEY_length_bias      2
762310e230b6Smaya#define GEN10_3DSTATE_WM_CHROMAKEY_header       \
762410e230b6Smaya   .DWordLength                         =      0,  \
762510e230b6Smaya   ._3DCommandSubOpcode                 =     76,  \
762610e230b6Smaya   ._3DCommandOpcode                    =      0,  \
762710e230b6Smaya   .CommandSubType                      =      3,  \
762810e230b6Smaya   .CommandType                         =      3
762910e230b6Smaya
763010e230b6Smayastruct GEN10_3DSTATE_WM_CHROMAKEY {
763110e230b6Smaya   uint32_t                             DWordLength;
763210e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
763310e230b6Smaya   uint32_t                             _3DCommandOpcode;
763410e230b6Smaya   uint32_t                             CommandSubType;
763510e230b6Smaya   uint32_t                             CommandType;
763610e230b6Smaya   bool                                 ChromaKeyKillEnable;
763710e230b6Smaya};
763810e230b6Smaya
763910e230b6Smayastatic inline void
764010e230b6SmayaGEN10_3DSTATE_WM_CHROMAKEY_pack(__attribute__((unused)) __gen_user_data *data,
764110e230b6Smaya                                __attribute__((unused)) void * restrict dst,
764210e230b6Smaya                                __attribute__((unused)) const struct GEN10_3DSTATE_WM_CHROMAKEY * restrict values)
764310e230b6Smaya{
764410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
764510e230b6Smaya
764610e230b6Smaya   dw[0] =
764710e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
764810e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
764910e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
765010e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
765110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
765210e230b6Smaya
765310e230b6Smaya   dw[1] =
765410e230b6Smaya      __gen_uint(values->ChromaKeyKillEnable, 31, 31);
765510e230b6Smaya}
765610e230b6Smaya
765710e230b6Smaya#define GEN10_3DSTATE_WM_DEPTH_STENCIL_length      4
765810e230b6Smaya#define GEN10_3DSTATE_WM_DEPTH_STENCIL_length_bias      2
765910e230b6Smaya#define GEN10_3DSTATE_WM_DEPTH_STENCIL_header   \
766010e230b6Smaya   .DWordLength                         =      2,  \
766110e230b6Smaya   ._3DCommandSubOpcode                 =     78,  \
766210e230b6Smaya   ._3DCommandOpcode                    =      0,  \
766310e230b6Smaya   .CommandSubType                      =      3,  \
766410e230b6Smaya   .CommandType                         =      3
766510e230b6Smaya
766610e230b6Smayastruct GEN10_3DSTATE_WM_DEPTH_STENCIL {
766710e230b6Smaya   uint32_t                             DWordLength;
766810e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
766910e230b6Smaya   uint32_t                             _3DCommandOpcode;
767010e230b6Smaya   uint32_t                             CommandSubType;
767110e230b6Smaya   uint32_t                             CommandType;
767210e230b6Smaya   bool                                 DepthBufferWriteEnable;
767310e230b6Smaya   bool                                 DepthTestEnable;
767410e230b6Smaya   bool                                 StencilBufferWriteEnable;
767510e230b6Smaya   bool                                 StencilTestEnable;
767610e230b6Smaya   bool                                 DoubleSidedStencilEnable;
767710e230b6Smaya   enum GEN10_3D_Compare_Function       DepthTestFunction;
767810e230b6Smaya   enum GEN10_3D_Compare_Function       StencilTestFunction;
767910e230b6Smaya   enum GEN10_3D_Stencil_Operation      BackfaceStencilPassDepthPassOp;
768010e230b6Smaya   enum GEN10_3D_Stencil_Operation      BackfaceStencilPassDepthFailOp;
768110e230b6Smaya   enum GEN10_3D_Stencil_Operation      BackfaceStencilFailOp;
768210e230b6Smaya   enum GEN10_3D_Compare_Function       BackfaceStencilTestFunction;
768310e230b6Smaya   enum GEN10_3D_Stencil_Operation      StencilPassDepthPassOp;
768410e230b6Smaya   enum GEN10_3D_Stencil_Operation      StencilPassDepthFailOp;
768510e230b6Smaya   enum GEN10_3D_Stencil_Operation      StencilFailOp;
768610e230b6Smaya   uint32_t                             BackfaceStencilWriteMask;
768710e230b6Smaya   uint32_t                             BackfaceStencilTestMask;
768810e230b6Smaya   uint32_t                             StencilWriteMask;
768910e230b6Smaya   uint32_t                             StencilTestMask;
769010e230b6Smaya   uint32_t                             BackfaceStencilReferenceValue;
769110e230b6Smaya   uint32_t                             StencilReferenceValue;
769210e230b6Smaya};
769310e230b6Smaya
769410e230b6Smayastatic inline void
769510e230b6SmayaGEN10_3DSTATE_WM_DEPTH_STENCIL_pack(__attribute__((unused)) __gen_user_data *data,
769610e230b6Smaya                                    __attribute__((unused)) void * restrict dst,
769710e230b6Smaya                                    __attribute__((unused)) const struct GEN10_3DSTATE_WM_DEPTH_STENCIL * restrict values)
769810e230b6Smaya{
769910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
770010e230b6Smaya
770110e230b6Smaya   dw[0] =
770210e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
770310e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
770410e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
770510e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
770610e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
770710e230b6Smaya
770810e230b6Smaya   dw[1] =
770910e230b6Smaya      __gen_uint(values->DepthBufferWriteEnable, 0, 0) |
771010e230b6Smaya      __gen_uint(values->DepthTestEnable, 1, 1) |
771110e230b6Smaya      __gen_uint(values->StencilBufferWriteEnable, 2, 2) |
771210e230b6Smaya      __gen_uint(values->StencilTestEnable, 3, 3) |
771310e230b6Smaya      __gen_uint(values->DoubleSidedStencilEnable, 4, 4) |
771410e230b6Smaya      __gen_uint(values->DepthTestFunction, 5, 7) |
771510e230b6Smaya      __gen_uint(values->StencilTestFunction, 8, 10) |
771610e230b6Smaya      __gen_uint(values->BackfaceStencilPassDepthPassOp, 11, 13) |
771710e230b6Smaya      __gen_uint(values->BackfaceStencilPassDepthFailOp, 14, 16) |
771810e230b6Smaya      __gen_uint(values->BackfaceStencilFailOp, 17, 19) |
771910e230b6Smaya      __gen_uint(values->BackfaceStencilTestFunction, 20, 22) |
772010e230b6Smaya      __gen_uint(values->StencilPassDepthPassOp, 23, 25) |
772110e230b6Smaya      __gen_uint(values->StencilPassDepthFailOp, 26, 28) |
772210e230b6Smaya      __gen_uint(values->StencilFailOp, 29, 31);
772310e230b6Smaya
772410e230b6Smaya   dw[2] =
772510e230b6Smaya      __gen_uint(values->BackfaceStencilWriteMask, 0, 7) |
772610e230b6Smaya      __gen_uint(values->BackfaceStencilTestMask, 8, 15) |
772710e230b6Smaya      __gen_uint(values->StencilWriteMask, 16, 23) |
772810e230b6Smaya      __gen_uint(values->StencilTestMask, 24, 31);
772910e230b6Smaya
773010e230b6Smaya   dw[3] =
773110e230b6Smaya      __gen_uint(values->BackfaceStencilReferenceValue, 0, 7) |
773210e230b6Smaya      __gen_uint(values->StencilReferenceValue, 8, 15);
773310e230b6Smaya}
773410e230b6Smaya
773510e230b6Smaya#define GEN10_3DSTATE_WM_HZ_OP_length          5
773610e230b6Smaya#define GEN10_3DSTATE_WM_HZ_OP_length_bias      2
773710e230b6Smaya#define GEN10_3DSTATE_WM_HZ_OP_header           \
773810e230b6Smaya   .DWordLength                         =      3,  \
773910e230b6Smaya   ._3DCommandSubOpcode                 =     82,  \
774010e230b6Smaya   ._3DCommandOpcode                    =      0,  \
774110e230b6Smaya   .CommandSubType                      =      3,  \
774210e230b6Smaya   .CommandType                         =      3
774310e230b6Smaya
774410e230b6Smayastruct GEN10_3DSTATE_WM_HZ_OP {
774510e230b6Smaya   uint32_t                             DWordLength;
774610e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
774710e230b6Smaya   uint32_t                             _3DCommandOpcode;
774810e230b6Smaya   uint32_t                             CommandSubType;
774910e230b6Smaya   uint32_t                             CommandType;
775010e230b6Smaya   uint32_t                             NumberofMultisamples;
775110e230b6Smaya   uint32_t                             StencilClearValue;
775210e230b6Smaya   bool                                 FullSurfaceDepthandStencilClear;
775310e230b6Smaya   bool                                 PixelPositionOffsetEnable;
775410e230b6Smaya   bool                                 HierarchicalDepthBufferResolveEnable;
775510e230b6Smaya   bool                                 DepthBufferResolveEnable;
775610e230b6Smaya   bool                                 ScissorRectangleEnable;
775710e230b6Smaya   bool                                 DepthBufferClearEnable;
775810e230b6Smaya   bool                                 StencilBufferClearEnable;
775910e230b6Smaya   uint32_t                             ClearRectangleXMin;
776010e230b6Smaya   uint32_t                             ClearRectangleYMin;
776110e230b6Smaya   uint32_t                             ClearRectangleXMax;
776210e230b6Smaya   uint32_t                             ClearRectangleYMax;
776310e230b6Smaya   uint32_t                             SampleMask;
776410e230b6Smaya};
776510e230b6Smaya
776610e230b6Smayastatic inline void
776710e230b6SmayaGEN10_3DSTATE_WM_HZ_OP_pack(__attribute__((unused)) __gen_user_data *data,
776810e230b6Smaya                            __attribute__((unused)) void * restrict dst,
776910e230b6Smaya                            __attribute__((unused)) const struct GEN10_3DSTATE_WM_HZ_OP * restrict values)
777010e230b6Smaya{
777110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
777210e230b6Smaya
777310e230b6Smaya   dw[0] =
777410e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
777510e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
777610e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
777710e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
777810e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
777910e230b6Smaya
778010e230b6Smaya   dw[1] =
778110e230b6Smaya      __gen_uint(values->NumberofMultisamples, 13, 15) |
778210e230b6Smaya      __gen_uint(values->StencilClearValue, 16, 23) |
778310e230b6Smaya      __gen_uint(values->FullSurfaceDepthandStencilClear, 25, 25) |
778410e230b6Smaya      __gen_uint(values->PixelPositionOffsetEnable, 26, 26) |
778510e230b6Smaya      __gen_uint(values->HierarchicalDepthBufferResolveEnable, 27, 27) |
778610e230b6Smaya      __gen_uint(values->DepthBufferResolveEnable, 28, 28) |
778710e230b6Smaya      __gen_uint(values->ScissorRectangleEnable, 29, 29) |
778810e230b6Smaya      __gen_uint(values->DepthBufferClearEnable, 30, 30) |
778910e230b6Smaya      __gen_uint(values->StencilBufferClearEnable, 31, 31);
779010e230b6Smaya
779110e230b6Smaya   dw[2] =
779210e230b6Smaya      __gen_uint(values->ClearRectangleXMin, 0, 15) |
779310e230b6Smaya      __gen_uint(values->ClearRectangleYMin, 16, 31);
779410e230b6Smaya
779510e230b6Smaya   dw[3] =
779610e230b6Smaya      __gen_uint(values->ClearRectangleXMax, 0, 15) |
779710e230b6Smaya      __gen_uint(values->ClearRectangleYMax, 16, 31);
779810e230b6Smaya
779910e230b6Smaya   dw[4] =
780010e230b6Smaya      __gen_uint(values->SampleMask, 0, 15);
780110e230b6Smaya}
780210e230b6Smaya
780310e230b6Smaya#define GEN10_GPGPU_WALKER_length             15
780410e230b6Smaya#define GEN10_GPGPU_WALKER_length_bias         2
780510e230b6Smaya#define GEN10_GPGPU_WALKER_header               \
780610e230b6Smaya   .DWordLength                         =     13,  \
780710e230b6Smaya   .SubOpcode                           =      5,  \
780810e230b6Smaya   .MediaCommandOpcode                  =      1,  \
780910e230b6Smaya   .Pipeline                            =      2,  \
781010e230b6Smaya   .CommandType                         =      3
781110e230b6Smaya
781210e230b6Smayastruct GEN10_GPGPU_WALKER {
781310e230b6Smaya   uint32_t                             DWordLength;
781410e230b6Smaya   bool                                 PredicateEnable;
781510e230b6Smaya   bool                                 IndirectParameterEnable;
781610e230b6Smaya   uint32_t                             SubOpcode;
781710e230b6Smaya   uint32_t                             MediaCommandOpcode;
781810e230b6Smaya   uint32_t                             Pipeline;
781910e230b6Smaya   uint32_t                             CommandType;
782010e230b6Smaya   uint32_t                             InterfaceDescriptorOffset;
782110e230b6Smaya   uint32_t                             IndirectDataLength;
782210e230b6Smaya   uint64_t                             IndirectDataStartAddress;
782310e230b6Smaya   uint32_t                             ThreadWidthCounterMaximum;
782410e230b6Smaya   uint32_t                             ThreadHeightCounterMaximum;
782510e230b6Smaya   uint32_t                             ThreadDepthCounterMaximum;
782610e230b6Smaya   uint32_t                             SIMDSize;
782710e230b6Smaya#define SIMD8                                    0
782810e230b6Smaya#define SIMD16                                   1
782910e230b6Smaya#define SIMD32                                   2
783010e230b6Smaya   uint32_t                             ThreadGroupIDStartingX;
783110e230b6Smaya   uint32_t                             ThreadGroupIDXDimension;
783210e230b6Smaya   uint32_t                             ThreadGroupIDStartingY;
783310e230b6Smaya   uint32_t                             ThreadGroupIDYDimension;
783410e230b6Smaya   uint32_t                             ThreadGroupIDStartingResumeZ;
783510e230b6Smaya   uint32_t                             ThreadGroupIDZDimension;
783610e230b6Smaya   uint32_t                             RightExecutionMask;
783710e230b6Smaya   uint32_t                             BottomExecutionMask;
783810e230b6Smaya};
783910e230b6Smaya
784010e230b6Smayastatic inline void
784110e230b6SmayaGEN10_GPGPU_WALKER_pack(__attribute__((unused)) __gen_user_data *data,
784210e230b6Smaya                        __attribute__((unused)) void * restrict dst,
784310e230b6Smaya                        __attribute__((unused)) const struct GEN10_GPGPU_WALKER * restrict values)
784410e230b6Smaya{
784510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
784610e230b6Smaya
784710e230b6Smaya   dw[0] =
784810e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
784910e230b6Smaya      __gen_uint(values->PredicateEnable, 8, 8) |
785010e230b6Smaya      __gen_uint(values->IndirectParameterEnable, 10, 10) |
785110e230b6Smaya      __gen_uint(values->SubOpcode, 16, 23) |
785210e230b6Smaya      __gen_uint(values->MediaCommandOpcode, 24, 26) |
785310e230b6Smaya      __gen_uint(values->Pipeline, 27, 28) |
785410e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
785510e230b6Smaya
785610e230b6Smaya   dw[1] =
785710e230b6Smaya      __gen_uint(values->InterfaceDescriptorOffset, 0, 5);
785810e230b6Smaya
785910e230b6Smaya   dw[2] =
786010e230b6Smaya      __gen_uint(values->IndirectDataLength, 0, 16);
786110e230b6Smaya
786210e230b6Smaya   dw[3] =
786310e230b6Smaya      __gen_offset(values->IndirectDataStartAddress, 6, 31);
786410e230b6Smaya
786510e230b6Smaya   dw[4] =
786610e230b6Smaya      __gen_uint(values->ThreadWidthCounterMaximum, 0, 5) |
786710e230b6Smaya      __gen_uint(values->ThreadHeightCounterMaximum, 8, 13) |
786810e230b6Smaya      __gen_uint(values->ThreadDepthCounterMaximum, 16, 21) |
786910e230b6Smaya      __gen_uint(values->SIMDSize, 30, 31);
787010e230b6Smaya
787110e230b6Smaya   dw[5] =
787210e230b6Smaya      __gen_uint(values->ThreadGroupIDStartingX, 0, 31);
787310e230b6Smaya
787410e230b6Smaya   dw[6] = 0;
787510e230b6Smaya
787610e230b6Smaya   dw[7] =
787710e230b6Smaya      __gen_uint(values->ThreadGroupIDXDimension, 0, 31);
787810e230b6Smaya
787910e230b6Smaya   dw[8] =
788010e230b6Smaya      __gen_uint(values->ThreadGroupIDStartingY, 0, 31);
788110e230b6Smaya
788210e230b6Smaya   dw[9] = 0;
788310e230b6Smaya
788410e230b6Smaya   dw[10] =
788510e230b6Smaya      __gen_uint(values->ThreadGroupIDYDimension, 0, 31);
788610e230b6Smaya
788710e230b6Smaya   dw[11] =
788810e230b6Smaya      __gen_uint(values->ThreadGroupIDStartingResumeZ, 0, 31);
788910e230b6Smaya
789010e230b6Smaya   dw[12] =
789110e230b6Smaya      __gen_uint(values->ThreadGroupIDZDimension, 0, 31);
789210e230b6Smaya
789310e230b6Smaya   dw[13] =
789410e230b6Smaya      __gen_uint(values->RightExecutionMask, 0, 31);
789510e230b6Smaya
789610e230b6Smaya   dw[14] =
789710e230b6Smaya      __gen_uint(values->BottomExecutionMask, 0, 31);
789810e230b6Smaya}
789910e230b6Smaya
790010e230b6Smaya#define GEN10_MEDIA_CURBE_LOAD_length          4
790110e230b6Smaya#define GEN10_MEDIA_CURBE_LOAD_length_bias      2
790210e230b6Smaya#define GEN10_MEDIA_CURBE_LOAD_header           \
790310e230b6Smaya   .DWordLength                         =      2,  \
790410e230b6Smaya   .SubOpcode                           =      1,  \
790510e230b6Smaya   .MediaCommandOpcode                  =      0,  \
790610e230b6Smaya   .Pipeline                            =      2,  \
790710e230b6Smaya   .CommandType                         =      3
790810e230b6Smaya
790910e230b6Smayastruct GEN10_MEDIA_CURBE_LOAD {
791010e230b6Smaya   uint32_t                             DWordLength;
791110e230b6Smaya   uint32_t                             SubOpcode;
791210e230b6Smaya   uint32_t                             MediaCommandOpcode;
791310e230b6Smaya   uint32_t                             Pipeline;
791410e230b6Smaya   uint32_t                             CommandType;
791510e230b6Smaya   uint32_t                             CURBETotalDataLength;
791610e230b6Smaya   uint32_t                             CURBEDataStartAddress;
791710e230b6Smaya};
791810e230b6Smaya
791910e230b6Smayastatic inline void
792010e230b6SmayaGEN10_MEDIA_CURBE_LOAD_pack(__attribute__((unused)) __gen_user_data *data,
792110e230b6Smaya                            __attribute__((unused)) void * restrict dst,
792210e230b6Smaya                            __attribute__((unused)) const struct GEN10_MEDIA_CURBE_LOAD * restrict values)
792310e230b6Smaya{
792410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
792510e230b6Smaya
792610e230b6Smaya   dw[0] =
792710e230b6Smaya      __gen_uint(values->DWordLength, 0, 15) |
792810e230b6Smaya      __gen_uint(values->SubOpcode, 16, 23) |
792910e230b6Smaya      __gen_uint(values->MediaCommandOpcode, 24, 26) |
793010e230b6Smaya      __gen_uint(values->Pipeline, 27, 28) |
793110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
793210e230b6Smaya
793310e230b6Smaya   dw[1] = 0;
793410e230b6Smaya
793510e230b6Smaya   dw[2] =
793610e230b6Smaya      __gen_uint(values->CURBETotalDataLength, 0, 16);
793710e230b6Smaya
793810e230b6Smaya   dw[3] =
793910e230b6Smaya      __gen_uint(values->CURBEDataStartAddress, 0, 31);
794010e230b6Smaya}
794110e230b6Smaya
794210e230b6Smaya#define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_length      4
794310e230b6Smaya#define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_length_bias      2
794410e230b6Smaya#define GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_header\
794510e230b6Smaya   .DWordLength                         =      2,  \
794610e230b6Smaya   .SubOpcode                           =      2,  \
794710e230b6Smaya   .MediaCommandOpcode                  =      0,  \
794810e230b6Smaya   .Pipeline                            =      2,  \
794910e230b6Smaya   .CommandType                         =      3
795010e230b6Smaya
795110e230b6Smayastruct GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD {
795210e230b6Smaya   uint32_t                             DWordLength;
795310e230b6Smaya   uint32_t                             SubOpcode;
795410e230b6Smaya   uint32_t                             MediaCommandOpcode;
795510e230b6Smaya   uint32_t                             Pipeline;
795610e230b6Smaya   uint32_t                             CommandType;
795710e230b6Smaya   uint32_t                             InterfaceDescriptorTotalLength;
795810e230b6Smaya   uint64_t                             InterfaceDescriptorDataStartAddress;
795910e230b6Smaya};
796010e230b6Smaya
796110e230b6Smayastatic inline void
796210e230b6SmayaGEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD_pack(__attribute__((unused)) __gen_user_data *data,
796310e230b6Smaya                                           __attribute__((unused)) void * restrict dst,
796410e230b6Smaya                                           __attribute__((unused)) const struct GEN10_MEDIA_INTERFACE_DESCRIPTOR_LOAD * restrict values)
796510e230b6Smaya{
796610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
796710e230b6Smaya
796810e230b6Smaya   dw[0] =
796910e230b6Smaya      __gen_uint(values->DWordLength, 0, 15) |
797010e230b6Smaya      __gen_uint(values->SubOpcode, 16, 23) |
797110e230b6Smaya      __gen_uint(values->MediaCommandOpcode, 24, 26) |
797210e230b6Smaya      __gen_uint(values->Pipeline, 27, 28) |
797310e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
797410e230b6Smaya
797510e230b6Smaya   dw[1] = 0;
797610e230b6Smaya
797710e230b6Smaya   dw[2] =
797810e230b6Smaya      __gen_uint(values->InterfaceDescriptorTotalLength, 0, 16);
797910e230b6Smaya
798010e230b6Smaya   dw[3] =
798110e230b6Smaya      __gen_offset(values->InterfaceDescriptorDataStartAddress, 0, 31);
798210e230b6Smaya}
798310e230b6Smaya
798410e230b6Smaya#define GEN10_MEDIA_OBJECT_length_bias         2
798510e230b6Smaya#define GEN10_MEDIA_OBJECT_header               \
798610e230b6Smaya   .DWordLength                         =      4,  \
798710e230b6Smaya   .MediaCommandSubOpcode               =      0,  \
798810e230b6Smaya   .MediaCommandOpcode                  =      1,  \
798910e230b6Smaya   .MediaCommandPipeline                =      2,  \
799010e230b6Smaya   .CommandType                         =      3
799110e230b6Smaya
799210e230b6Smayastruct GEN10_MEDIA_OBJECT {
799310e230b6Smaya   uint32_t                             DWordLength;
799410e230b6Smaya   uint32_t                             MediaCommandSubOpcode;
799510e230b6Smaya   uint32_t                             MediaCommandOpcode;
799610e230b6Smaya   uint32_t                             MediaCommandPipeline;
799710e230b6Smaya   uint32_t                             CommandType;
799810e230b6Smaya   uint32_t                             InterfaceDescriptorOffset;
799910e230b6Smaya   uint32_t                             IndirectDataLength;
800010e230b6Smaya   uint32_t                             SubSliceDestinationSelect;
800110e230b6Smaya#define Subslice3                                3
800210e230b6Smaya#define SubSlice2                                2
800310e230b6Smaya#define SubSlice1                                1
800410e230b6Smaya#define SubSlice0                                0
800510e230b6Smaya   uint32_t                             SliceDestinationSelect;
800610e230b6Smaya#define Slice0                                   0
800710e230b6Smaya#define Slice1                                   1
800810e230b6Smaya#define Slice2                                   2
800910e230b6Smaya   uint32_t                             UseScoreboard;
801010e230b6Smaya#define Notusingscoreboard                       0
801110e230b6Smaya#define Usingscoreboard                          1
801210e230b6Smaya   uint32_t                             ForceDestination;
801310e230b6Smaya   uint32_t                             ThreadSynchronization;
801410e230b6Smaya#define Nothreadsynchronization                  0
801510e230b6Smaya#define Threaddispatchissynchronizedbythespawnrootthreadmessage 1
801610e230b6Smaya   uint32_t                             SliceDestinationSelectMSBs;
801710e230b6Smaya   bool                                 ChildrenPresent;
801810e230b6Smaya   __gen_address_type                   IndirectDataStartAddress;
801910e230b6Smaya   uint32_t                             ScoreboardX;
802010e230b6Smaya   uint32_t                             ScoredboardY;
802110e230b6Smaya   uint32_t                             ScoreboardMask;
802210e230b6Smaya   uint32_t                             ScoreboardColor;
802310e230b6Smaya   /* variable length fields follow */
802410e230b6Smaya};
802510e230b6Smaya
802610e230b6Smayastatic inline void
802710e230b6SmayaGEN10_MEDIA_OBJECT_pack(__attribute__((unused)) __gen_user_data *data,
802810e230b6Smaya                        __attribute__((unused)) void * restrict dst,
802910e230b6Smaya                        __attribute__((unused)) const struct GEN10_MEDIA_OBJECT * restrict values)
803010e230b6Smaya{
803110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
803210e230b6Smaya
803310e230b6Smaya   dw[0] =
803410e230b6Smaya      __gen_uint(values->DWordLength, 0, 14) |
803510e230b6Smaya      __gen_uint(values->MediaCommandSubOpcode, 16, 23) |
803610e230b6Smaya      __gen_uint(values->MediaCommandOpcode, 24, 26) |
803710e230b6Smaya      __gen_uint(values->MediaCommandPipeline, 27, 28) |
803810e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
803910e230b6Smaya
804010e230b6Smaya   dw[1] =
804110e230b6Smaya      __gen_uint(values->InterfaceDescriptorOffset, 0, 5);
804210e230b6Smaya
804310e230b6Smaya   dw[2] =
804410e230b6Smaya      __gen_uint(values->IndirectDataLength, 0, 16) |
804510e230b6Smaya      __gen_uint(values->SubSliceDestinationSelect, 17, 18) |
804610e230b6Smaya      __gen_uint(values->SliceDestinationSelect, 19, 20) |
804710e230b6Smaya      __gen_uint(values->UseScoreboard, 21, 21) |
804810e230b6Smaya      __gen_uint(values->ForceDestination, 22, 22) |
804910e230b6Smaya      __gen_uint(values->ThreadSynchronization, 24, 24) |
805010e230b6Smaya      __gen_uint(values->SliceDestinationSelectMSBs, 25, 26) |
805110e230b6Smaya      __gen_uint(values->ChildrenPresent, 31, 31);
805210e230b6Smaya
805310e230b6Smaya   dw[3] = __gen_combine_address(data, &dw[3], values->IndirectDataStartAddress, 0);
805410e230b6Smaya
805510e230b6Smaya   dw[4] =
805610e230b6Smaya      __gen_uint(values->ScoreboardX, 0, 8) |
805710e230b6Smaya      __gen_uint(values->ScoredboardY, 16, 24);
805810e230b6Smaya
805910e230b6Smaya   dw[5] =
806010e230b6Smaya      __gen_uint(values->ScoreboardMask, 0, 7) |
806110e230b6Smaya      __gen_uint(values->ScoreboardColor, 16, 19);
806210e230b6Smaya}
806310e230b6Smaya
806410e230b6Smaya#define GEN10_MEDIA_OBJECT_GRPID_length_bias      2
806510e230b6Smaya#define GEN10_MEDIA_OBJECT_GRPID_header         \
806610e230b6Smaya   .DWordLength                         =      5,  \
806710e230b6Smaya   .MediaCommandSubOpcode               =      6,  \
806810e230b6Smaya   .MediaCommandOpcode                  =      1,  \
806910e230b6Smaya   .MediaCommandPipeline                =      2,  \
807010e230b6Smaya   .CommandType                         =      3
807110e230b6Smaya
807210e230b6Smayastruct GEN10_MEDIA_OBJECT_GRPID {
807310e230b6Smaya   uint32_t                             DWordLength;
807410e230b6Smaya   uint32_t                             MediaCommandSubOpcode;
807510e230b6Smaya   uint32_t                             MediaCommandOpcode;
807610e230b6Smaya   uint32_t                             MediaCommandPipeline;
807710e230b6Smaya   uint32_t                             CommandType;
807810e230b6Smaya   uint32_t                             InterfaceDescriptorOffset;
807910e230b6Smaya   uint32_t                             IndirectDataLength;
808010e230b6Smaya   uint32_t                             UseScoreboard;
808110e230b6Smaya#define Notusingscoreboard                       0
808210e230b6Smaya#define Usingscoreboard                          1
808310e230b6Smaya   uint32_t                             EndofThreadGroup;
808410e230b6Smaya   __gen_address_type                   IndirectDataStartAddress;
808510e230b6Smaya   uint32_t                             ScoreboardX;
808610e230b6Smaya   uint32_t                             ScoreboardY;
808710e230b6Smaya   uint32_t                             ScoreboardMask;
808810e230b6Smaya   uint32_t                             ScoreboardColor;
808910e230b6Smaya   uint32_t                             GroupID;
809010e230b6Smaya   /* variable length fields follow */
809110e230b6Smaya};
809210e230b6Smaya
809310e230b6Smayastatic inline void
809410e230b6SmayaGEN10_MEDIA_OBJECT_GRPID_pack(__attribute__((unused)) __gen_user_data *data,
809510e230b6Smaya                              __attribute__((unused)) void * restrict dst,
809610e230b6Smaya                              __attribute__((unused)) const struct GEN10_MEDIA_OBJECT_GRPID * restrict values)
809710e230b6Smaya{
809810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
809910e230b6Smaya
810010e230b6Smaya   dw[0] =
810110e230b6Smaya      __gen_uint(values->DWordLength, 0, 15) |
810210e230b6Smaya      __gen_uint(values->MediaCommandSubOpcode, 16, 23) |
810310e230b6Smaya      __gen_uint(values->MediaCommandOpcode, 24, 26) |
810410e230b6Smaya      __gen_uint(values->MediaCommandPipeline, 27, 28) |
810510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
810610e230b6Smaya
810710e230b6Smaya   dw[1] =
810810e230b6Smaya      __gen_uint(values->InterfaceDescriptorOffset, 0, 5);
810910e230b6Smaya
811010e230b6Smaya   dw[2] =
811110e230b6Smaya      __gen_uint(values->IndirectDataLength, 0, 16) |
811210e230b6Smaya      __gen_uint(values->UseScoreboard, 21, 21) |
811310e230b6Smaya      __gen_uint(values->EndofThreadGroup, 23, 23);
811410e230b6Smaya
811510e230b6Smaya   dw[3] = __gen_combine_address(data, &dw[3], values->IndirectDataStartAddress, 0);
811610e230b6Smaya
811710e230b6Smaya   dw[4] =
811810e230b6Smaya      __gen_uint(values->ScoreboardX, 0, 8) |
811910e230b6Smaya      __gen_uint(values->ScoreboardY, 16, 24);
812010e230b6Smaya
812110e230b6Smaya   dw[5] =
812210e230b6Smaya      __gen_uint(values->ScoreboardMask, 0, 7) |
812310e230b6Smaya      __gen_uint(values->ScoreboardColor, 16, 19);
812410e230b6Smaya
812510e230b6Smaya   dw[6] =
812610e230b6Smaya      __gen_uint(values->GroupID, 0, 31);
812710e230b6Smaya}
812810e230b6Smaya
812910e230b6Smaya#define GEN10_MEDIA_OBJECT_PRT_length         16
813010e230b6Smaya#define GEN10_MEDIA_OBJECT_PRT_length_bias      2
813110e230b6Smaya#define GEN10_MEDIA_OBJECT_PRT_header           \
813210e230b6Smaya   .DWordLength                         =     14,  \
813310e230b6Smaya   .SubOpcode                           =      2,  \
813410e230b6Smaya   .MediaCommandOpcode                  =      1,  \
813510e230b6Smaya   .Pipeline                            =      2,  \
813610e230b6Smaya   .CommandType                         =      3
813710e230b6Smaya
813810e230b6Smayastruct GEN10_MEDIA_OBJECT_PRT {
813910e230b6Smaya   uint32_t                             DWordLength;
814010e230b6Smaya   uint32_t                             SubOpcode;
814110e230b6Smaya   uint32_t                             MediaCommandOpcode;
814210e230b6Smaya   uint32_t                             Pipeline;
814310e230b6Smaya   uint32_t                             CommandType;
814410e230b6Smaya   uint32_t                             InterfaceDescriptorOffset;
814510e230b6Smaya   uint32_t                             PRT_FenceType;
814610e230b6Smaya#define Rootthreadqueue                          0
814710e230b6Smaya#define VFEstateflush                            1
814810e230b6Smaya   bool                                 PRT_FenceNeeded;
814910e230b6Smaya   bool                                 ChildrenPresent;
815010e230b6Smaya   uint32_t                             InlineData[12];
815110e230b6Smaya};
815210e230b6Smaya
815310e230b6Smayastatic inline void
815410e230b6SmayaGEN10_MEDIA_OBJECT_PRT_pack(__attribute__((unused)) __gen_user_data *data,
815510e230b6Smaya                            __attribute__((unused)) void * restrict dst,
815610e230b6Smaya                            __attribute__((unused)) const struct GEN10_MEDIA_OBJECT_PRT * restrict values)
815710e230b6Smaya{
815810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
815910e230b6Smaya
816010e230b6Smaya   dw[0] =
816110e230b6Smaya      __gen_uint(values->DWordLength, 0, 14) |
816210e230b6Smaya      __gen_uint(values->SubOpcode, 16, 23) |
816310e230b6Smaya      __gen_uint(values->MediaCommandOpcode, 24, 26) |
816410e230b6Smaya      __gen_uint(values->Pipeline, 27, 28) |
816510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
816610e230b6Smaya
816710e230b6Smaya   dw[1] =
816810e230b6Smaya      __gen_uint(values->InterfaceDescriptorOffset, 0, 5);
816910e230b6Smaya
817010e230b6Smaya   dw[2] =
817110e230b6Smaya      __gen_uint(values->PRT_FenceType, 22, 22) |
817210e230b6Smaya      __gen_uint(values->PRT_FenceNeeded, 23, 23) |
817310e230b6Smaya      __gen_uint(values->ChildrenPresent, 31, 31);
817410e230b6Smaya
817510e230b6Smaya   dw[3] = 0;
817610e230b6Smaya
817710e230b6Smaya   dw[4] =
817810e230b6Smaya      __gen_uint(values->InlineData[0], 0, 31);
817910e230b6Smaya
818010e230b6Smaya   dw[5] =
818110e230b6Smaya      __gen_uint(values->InlineData[1], 0, 31);
818210e230b6Smaya
818310e230b6Smaya   dw[6] =
818410e230b6Smaya      __gen_uint(values->InlineData[2], 0, 31);
818510e230b6Smaya
818610e230b6Smaya   dw[7] =
818710e230b6Smaya      __gen_uint(values->InlineData[3], 0, 31);
818810e230b6Smaya
818910e230b6Smaya   dw[8] =
819010e230b6Smaya      __gen_uint(values->InlineData[4], 0, 31);
819110e230b6Smaya
819210e230b6Smaya   dw[9] =
819310e230b6Smaya      __gen_uint(values->InlineData[5], 0, 31);
819410e230b6Smaya
819510e230b6Smaya   dw[10] =
819610e230b6Smaya      __gen_uint(values->InlineData[6], 0, 31);
819710e230b6Smaya
819810e230b6Smaya   dw[11] =
819910e230b6Smaya      __gen_uint(values->InlineData[7], 0, 31);
820010e230b6Smaya
820110e230b6Smaya   dw[12] =
820210e230b6Smaya      __gen_uint(values->InlineData[8], 0, 31);
820310e230b6Smaya
820410e230b6Smaya   dw[13] =
820510e230b6Smaya      __gen_uint(values->InlineData[9], 0, 31);
820610e230b6Smaya
820710e230b6Smaya   dw[14] =
820810e230b6Smaya      __gen_uint(values->InlineData[10], 0, 31);
820910e230b6Smaya
821010e230b6Smaya   dw[15] =
821110e230b6Smaya      __gen_uint(values->InlineData[11], 0, 31);
821210e230b6Smaya}
821310e230b6Smaya
821410e230b6Smaya#define GEN10_MEDIA_OBJECT_WALKER_length_bias      2
821510e230b6Smaya#define GEN10_MEDIA_OBJECT_WALKER_header        \
821610e230b6Smaya   .DWordLength                         =     15,  \
821710e230b6Smaya   .SubOpcode                           =      3,  \
821810e230b6Smaya   .MediaCommandOpcode                  =      1,  \
821910e230b6Smaya   .Pipeline                            =      2,  \
822010e230b6Smaya   .CommandType                         =      3
822110e230b6Smaya
822210e230b6Smayastruct GEN10_MEDIA_OBJECT_WALKER {
822310e230b6Smaya   uint32_t                             DWordLength;
822410e230b6Smaya   uint32_t                             SubOpcode;
822510e230b6Smaya   uint32_t                             MediaCommandOpcode;
822610e230b6Smaya   uint32_t                             Pipeline;
822710e230b6Smaya   uint32_t                             CommandType;
822810e230b6Smaya   uint32_t                             InterfaceDescriptorOffset;
822910e230b6Smaya   uint32_t                             IndirectDataLength;
823010e230b6Smaya   uint32_t                             UseScoreboard;
823110e230b6Smaya#define Notusingscoreboard                       0
823210e230b6Smaya#define Usingscoreboard                          1
823310e230b6Smaya   uint32_t                             MaskedDispatch;
823410e230b6Smaya   uint32_t                             ThreadSynchronization;
823510e230b6Smaya#define Nothreadsynchronization                  0
823610e230b6Smaya#define Threaddispatchissynchronizedbythespawnrootthreadmessage 1
823710e230b6Smaya   uint32_t                             IndirectDataStartAddress;
823810e230b6Smaya   uint32_t                             ScoreboardMask;
823910e230b6Smaya   uint32_t                             GroupIDLoopSelect;
824010e230b6Smaya#define No_Groups                                0
824110e230b6Smaya#define Color_Groups                             1
824210e230b6Smaya#define InnerLocal_Groups                        2
824310e230b6Smaya#define MidLocal_Groups                          3
824410e230b6Smaya#define OuterLocal_Groups                        4
824510e230b6Smaya#define InnerGlobal_Groups                       5
824610e230b6Smaya   int32_t                              MidLoopUnitX;
824710e230b6Smaya   int32_t                              LocalMidLoopUnitY;
824810e230b6Smaya   uint32_t                             MiddleLoopExtraSteps;
824910e230b6Smaya   uint32_t                             ColorCountMinusOne;
825010e230b6Smaya   uint32_t                             LocalLoopExecCount;
825110e230b6Smaya   uint32_t                             GlobalLoopExecCount;
825210e230b6Smaya   uint32_t                             BlockResolutionX;
825310e230b6Smaya   uint32_t                             BlockResolutionY;
825410e230b6Smaya   uint32_t                             LocalStartX;
825510e230b6Smaya   uint32_t                             LocalStartY;
825610e230b6Smaya   int32_t                              LocalOuterLoopStrideX;
825710e230b6Smaya   int32_t                              LocalOuterLoopStrideY;
825810e230b6Smaya   int32_t                              LocalInnerLoopUnitX;
825910e230b6Smaya   int32_t                              LocalInnerLoopUnitY;
826010e230b6Smaya   uint32_t                             GlobalResolutionX;
826110e230b6Smaya   uint32_t                             GlobalResolutionY;
826210e230b6Smaya   int32_t                              GlobalStartX;
826310e230b6Smaya   int32_t                              GlobalStartY;
826410e230b6Smaya   int32_t                              GlobalOuterLoopStrideX;
826510e230b6Smaya   int32_t                              GlobalOuterLoopStrideY;
826610e230b6Smaya   int32_t                              GlobalInnerLoopUnitX;
826710e230b6Smaya   int32_t                              GlobalInnerLoopUnitY;
826810e230b6Smaya   /* variable length fields follow */
826910e230b6Smaya};
827010e230b6Smaya
827110e230b6Smayastatic inline void
827210e230b6SmayaGEN10_MEDIA_OBJECT_WALKER_pack(__attribute__((unused)) __gen_user_data *data,
827310e230b6Smaya                               __attribute__((unused)) void * restrict dst,
827410e230b6Smaya                               __attribute__((unused)) const struct GEN10_MEDIA_OBJECT_WALKER * restrict values)
827510e230b6Smaya{
827610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
827710e230b6Smaya
827810e230b6Smaya   dw[0] =
827910e230b6Smaya      __gen_uint(values->DWordLength, 0, 14) |
828010e230b6Smaya      __gen_uint(values->SubOpcode, 16, 23) |
828110e230b6Smaya      __gen_uint(values->MediaCommandOpcode, 24, 26) |
828210e230b6Smaya      __gen_uint(values->Pipeline, 27, 28) |
828310e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
828410e230b6Smaya
828510e230b6Smaya   dw[1] =
828610e230b6Smaya      __gen_uint(values->InterfaceDescriptorOffset, 0, 5);
828710e230b6Smaya
828810e230b6Smaya   dw[2] =
828910e230b6Smaya      __gen_uint(values->IndirectDataLength, 0, 16) |
829010e230b6Smaya      __gen_uint(values->UseScoreboard, 21, 21) |
829110e230b6Smaya      __gen_uint(values->MaskedDispatch, 22, 23) |
829210e230b6Smaya      __gen_uint(values->ThreadSynchronization, 24, 24);
829310e230b6Smaya
829410e230b6Smaya   dw[3] =
829510e230b6Smaya      __gen_uint(values->IndirectDataStartAddress, 0, 31);
829610e230b6Smaya
829710e230b6Smaya   dw[4] = 0;
829810e230b6Smaya
829910e230b6Smaya   dw[5] =
830010e230b6Smaya      __gen_uint(values->ScoreboardMask, 0, 7) |
830110e230b6Smaya      __gen_uint(values->GroupIDLoopSelect, 8, 31);
830210e230b6Smaya
830310e230b6Smaya   dw[6] =
830410e230b6Smaya      __gen_sint(values->MidLoopUnitX, 8, 9) |
830510e230b6Smaya      __gen_sint(values->LocalMidLoopUnitY, 12, 13) |
830610e230b6Smaya      __gen_uint(values->MiddleLoopExtraSteps, 16, 20) |
830710e230b6Smaya      __gen_uint(values->ColorCountMinusOne, 24, 27);
830810e230b6Smaya
830910e230b6Smaya   dw[7] =
831010e230b6Smaya      __gen_uint(values->LocalLoopExecCount, 0, 11) |
831110e230b6Smaya      __gen_uint(values->GlobalLoopExecCount, 16, 27);
831210e230b6Smaya
831310e230b6Smaya   dw[8] =
831410e230b6Smaya      __gen_uint(values->BlockResolutionX, 0, 10) |
831510e230b6Smaya      __gen_uint(values->BlockResolutionY, 16, 26);
831610e230b6Smaya
831710e230b6Smaya   dw[9] =
831810e230b6Smaya      __gen_uint(values->LocalStartX, 0, 10) |
831910e230b6Smaya      __gen_uint(values->LocalStartY, 16, 26);
832010e230b6Smaya
832110e230b6Smaya   dw[10] = 0;
832210e230b6Smaya
832310e230b6Smaya   dw[11] =
832410e230b6Smaya      __gen_sint(values->LocalOuterLoopStrideX, 0, 11) |
832510e230b6Smaya      __gen_sint(values->LocalOuterLoopStrideY, 16, 27);
832610e230b6Smaya
832710e230b6Smaya   dw[12] =
832810e230b6Smaya      __gen_sint(values->LocalInnerLoopUnitX, 0, 11) |
832910e230b6Smaya      __gen_sint(values->LocalInnerLoopUnitY, 16, 27);
833010e230b6Smaya
833110e230b6Smaya   dw[13] =
833210e230b6Smaya      __gen_uint(values->GlobalResolutionX, 0, 10) |
833310e230b6Smaya      __gen_uint(values->GlobalResolutionY, 16, 26);
833410e230b6Smaya
833510e230b6Smaya   dw[14] =
833610e230b6Smaya      __gen_sint(values->GlobalStartX, 0, 11) |
833710e230b6Smaya      __gen_sint(values->GlobalStartY, 16, 27);
833810e230b6Smaya
833910e230b6Smaya   dw[15] =
834010e230b6Smaya      __gen_sint(values->GlobalOuterLoopStrideX, 0, 11) |
834110e230b6Smaya      __gen_sint(values->GlobalOuterLoopStrideY, 16, 27);
834210e230b6Smaya
834310e230b6Smaya   dw[16] =
834410e230b6Smaya      __gen_sint(values->GlobalInnerLoopUnitX, 0, 11) |
834510e230b6Smaya      __gen_sint(values->GlobalInnerLoopUnitY, 16, 27);
834610e230b6Smaya}
834710e230b6Smaya
834810e230b6Smaya#define GEN10_MEDIA_STATE_FLUSH_length         2
834910e230b6Smaya#define GEN10_MEDIA_STATE_FLUSH_length_bias      2
835010e230b6Smaya#define GEN10_MEDIA_STATE_FLUSH_header          \
835110e230b6Smaya   .DWordLength                         =      0,  \
835210e230b6Smaya   .SubOpcode                           =      4,  \
835310e230b6Smaya   .MediaCommandOpcode                  =      0,  \
835410e230b6Smaya   .Pipeline                            =      2,  \
835510e230b6Smaya   .CommandType                         =      3
835610e230b6Smaya
835710e230b6Smayastruct GEN10_MEDIA_STATE_FLUSH {
835810e230b6Smaya   uint32_t                             DWordLength;
835910e230b6Smaya   uint32_t                             SubOpcode;
836010e230b6Smaya   uint32_t                             MediaCommandOpcode;
836110e230b6Smaya   uint32_t                             Pipeline;
836210e230b6Smaya   uint32_t                             CommandType;
836310e230b6Smaya   uint32_t                             InterfaceDescriptorOffset;
836410e230b6Smaya   uint32_t                             WatermarkRequired;
836510e230b6Smaya   bool                                 FlushtoGO;
836610e230b6Smaya};
836710e230b6Smaya
836810e230b6Smayastatic inline void
836910e230b6SmayaGEN10_MEDIA_STATE_FLUSH_pack(__attribute__((unused)) __gen_user_data *data,
837010e230b6Smaya                             __attribute__((unused)) void * restrict dst,
837110e230b6Smaya                             __attribute__((unused)) const struct GEN10_MEDIA_STATE_FLUSH * restrict values)
837210e230b6Smaya{
837310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
837410e230b6Smaya
837510e230b6Smaya   dw[0] =
837610e230b6Smaya      __gen_uint(values->DWordLength, 0, 15) |
837710e230b6Smaya      __gen_uint(values->SubOpcode, 16, 23) |
837810e230b6Smaya      __gen_uint(values->MediaCommandOpcode, 24, 26) |
837910e230b6Smaya      __gen_uint(values->Pipeline, 27, 28) |
838010e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
838110e230b6Smaya
838210e230b6Smaya   dw[1] =
838310e230b6Smaya      __gen_uint(values->InterfaceDescriptorOffset, 0, 5) |
838410e230b6Smaya      __gen_uint(values->WatermarkRequired, 6, 6) |
838510e230b6Smaya      __gen_uint(values->FlushtoGO, 7, 7);
838610e230b6Smaya}
838710e230b6Smaya
838810e230b6Smaya#define GEN10_MEDIA_VFE_STATE_length           9
838910e230b6Smaya#define GEN10_MEDIA_VFE_STATE_length_bias      2
839010e230b6Smaya#define GEN10_MEDIA_VFE_STATE_header            \
839110e230b6Smaya   .DWordLength                         =      7,  \
839210e230b6Smaya   .SubOpcode                           =      0,  \
839310e230b6Smaya   .MediaCommandOpcode                  =      0,  \
839410e230b6Smaya   .Pipeline                            =      2,  \
839510e230b6Smaya   .CommandType                         =      3
839610e230b6Smaya
839710e230b6Smayastruct GEN10_MEDIA_VFE_STATE {
839810e230b6Smaya   uint32_t                             DWordLength;
839910e230b6Smaya   uint32_t                             SubOpcode;
840010e230b6Smaya   uint32_t                             MediaCommandOpcode;
840110e230b6Smaya   uint32_t                             Pipeline;
840210e230b6Smaya   uint32_t                             CommandType;
840310e230b6Smaya   uint32_t                             PerThreadScratchSpace;
840410e230b6Smaya   uint32_t                             StackSize;
840510e230b6Smaya   __gen_address_type                   ScratchSpaceBasePointer;
840610e230b6Smaya   uint32_t                             SLMBankSelectionPolicy;
840710e230b6Smaya#define Legacy                                   0
840810e230b6Smaya#define SLMLoadBalance                           1
840910e230b6Smaya   uint32_t                             ThreadDispatchSelectionPolicy;
841010e230b6Smaya#define Legacy                                   0
841110e230b6Smaya#define Prefer1SS                                1
841210e230b6Smaya#define Prefer2SS                                2
841310e230b6Smaya#define LoadBalance                              3
841410e230b6Smaya   uint32_t                             ResetGatewayTimer;
841510e230b6Smaya#define Maintainingtheexistingtimestampstate     0
841610e230b6Smaya#define Resettingrelativetimerandlatchingtheglobaltimestamp 1
841710e230b6Smaya   uint32_t                             NumberofURBEntries;
841810e230b6Smaya   uint32_t                             MaximumNumberofThreads;
841910e230b6Smaya   uint32_t                             SliceDisable;
842010e230b6Smaya#define AllSubslicesEnabled                      0
842110e230b6Smaya#define OnlySlice0Enabled                        1
842210e230b6Smaya#define OnlySlice0Subslice0Enabled               3
842310e230b6Smaya   uint32_t                             CURBEAllocationSize;
842410e230b6Smaya   uint32_t                             URBEntryAllocationSize;
842510e230b6Smaya   uint32_t                             ScoreboardMask;
842610e230b6Smaya   uint32_t                             NumberofMediaObjectsperPreEmptionCheckpoint;
842710e230b6Smaya   uint32_t                             ScoreboardType;
842810e230b6Smaya#define StallingScoreboard                       0
842910e230b6Smaya#define NonStallingScoreboard                    1
843010e230b6Smaya   bool                                 ScoreboardEnable;
843110e230b6Smaya   int32_t                              Scoreboard0DeltaX;
843210e230b6Smaya   int32_t                              Scoreboard0DeltaY;
843310e230b6Smaya   int32_t                              Scoreboard1DeltaX;
843410e230b6Smaya   int32_t                              Scoreboard1DeltaY;
843510e230b6Smaya   int32_t                              Scoreboard2DeltaX;
843610e230b6Smaya   int32_t                              Scoreboard2DeltaY;
843710e230b6Smaya   int32_t                              Scoreboard3DeltaX;
843810e230b6Smaya   int32_t                              Scoreboard3DeltaY;
843910e230b6Smaya   int32_t                              Scoreboard4DeltaX;
844010e230b6Smaya   int32_t                              Scoreboard4DeltaY;
844110e230b6Smaya   int32_t                              Scoreboard5DeltaX;
844210e230b6Smaya   int32_t                              Scoreboard5DeltaY;
844310e230b6Smaya   int32_t                              Scoreboard6DeltaX;
844410e230b6Smaya   int32_t                              Scoreboard6DeltaY;
844510e230b6Smaya   int32_t                              Scoreboard7DeltaX;
844610e230b6Smaya   int32_t                              Scoreboard7DeltaY;
844710e230b6Smaya};
844810e230b6Smaya
844910e230b6Smayastatic inline void
845010e230b6SmayaGEN10_MEDIA_VFE_STATE_pack(__attribute__((unused)) __gen_user_data *data,
845110e230b6Smaya                           __attribute__((unused)) void * restrict dst,
845210e230b6Smaya                           __attribute__((unused)) const struct GEN10_MEDIA_VFE_STATE * restrict values)
845310e230b6Smaya{
845410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
845510e230b6Smaya
845610e230b6Smaya   dw[0] =
845710e230b6Smaya      __gen_uint(values->DWordLength, 0, 15) |
845810e230b6Smaya      __gen_uint(values->SubOpcode, 16, 23) |
845910e230b6Smaya      __gen_uint(values->MediaCommandOpcode, 24, 26) |
846010e230b6Smaya      __gen_uint(values->Pipeline, 27, 28) |
846110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
846210e230b6Smaya
846310e230b6Smaya   const uint64_t v1 =
846410e230b6Smaya      __gen_uint(values->PerThreadScratchSpace, 0, 3) |
846510e230b6Smaya      __gen_uint(values->StackSize, 4, 7);
846610e230b6Smaya   const uint64_t v1_address =
846710e230b6Smaya      __gen_combine_address(data, &dw[1], values->ScratchSpaceBasePointer, v1);
846810e230b6Smaya   dw[1] = v1_address;
846910e230b6Smaya   dw[2] = (v1_address >> 32) | (v1 >> 32);
847010e230b6Smaya
847110e230b6Smaya   dw[3] =
847210e230b6Smaya      __gen_uint(values->SLMBankSelectionPolicy, 3, 3) |
847310e230b6Smaya      __gen_uint(values->ThreadDispatchSelectionPolicy, 4, 5) |
847410e230b6Smaya      __gen_uint(values->ResetGatewayTimer, 7, 7) |
847510e230b6Smaya      __gen_uint(values->NumberofURBEntries, 8, 15) |
847610e230b6Smaya      __gen_uint(values->MaximumNumberofThreads, 16, 31);
847710e230b6Smaya
847810e230b6Smaya   dw[4] =
847910e230b6Smaya      __gen_uint(values->SliceDisable, 0, 1);
848010e230b6Smaya
848110e230b6Smaya   dw[5] =
848210e230b6Smaya      __gen_uint(values->CURBEAllocationSize, 0, 15) |
848310e230b6Smaya      __gen_uint(values->URBEntryAllocationSize, 16, 31);
848410e230b6Smaya
848510e230b6Smaya   dw[6] =
848610e230b6Smaya      __gen_uint(values->ScoreboardMask, 0, 7) |
848710e230b6Smaya      __gen_uint(values->NumberofMediaObjectsperPreEmptionCheckpoint, 8, 15) |
848810e230b6Smaya      __gen_uint(values->ScoreboardType, 30, 30) |
848910e230b6Smaya      __gen_uint(values->ScoreboardEnable, 31, 31);
849010e230b6Smaya
849110e230b6Smaya   dw[7] =
849210e230b6Smaya      __gen_sint(values->Scoreboard0DeltaX, 0, 3) |
849310e230b6Smaya      __gen_sint(values->Scoreboard0DeltaY, 4, 7) |
849410e230b6Smaya      __gen_sint(values->Scoreboard1DeltaX, 8, 11) |
849510e230b6Smaya      __gen_sint(values->Scoreboard1DeltaY, 12, 15) |
849610e230b6Smaya      __gen_sint(values->Scoreboard2DeltaX, 16, 19) |
849710e230b6Smaya      __gen_sint(values->Scoreboard2DeltaY, 20, 23) |
849810e230b6Smaya      __gen_sint(values->Scoreboard3DeltaX, 24, 27) |
849910e230b6Smaya      __gen_sint(values->Scoreboard3DeltaY, 28, 31);
850010e230b6Smaya
850110e230b6Smaya   dw[8] =
850210e230b6Smaya      __gen_sint(values->Scoreboard4DeltaX, 0, 3) |
850310e230b6Smaya      __gen_sint(values->Scoreboard4DeltaY, 4, 7) |
850410e230b6Smaya      __gen_sint(values->Scoreboard5DeltaX, 8, 11) |
850510e230b6Smaya      __gen_sint(values->Scoreboard5DeltaY, 12, 15) |
850610e230b6Smaya      __gen_sint(values->Scoreboard6DeltaX, 16, 19) |
850710e230b6Smaya      __gen_sint(values->Scoreboard6DeltaY, 20, 23) |
850810e230b6Smaya      __gen_sint(values->Scoreboard7DeltaX, 24, 27) |
850910e230b6Smaya      __gen_sint(values->Scoreboard7DeltaY, 28, 31);
851010e230b6Smaya}
851110e230b6Smaya
851210e230b6Smaya#define GEN10_MI_ARB_CHECK_length              1
851310e230b6Smaya#define GEN10_MI_ARB_CHECK_length_bias         1
851410e230b6Smaya#define GEN10_MI_ARB_CHECK_header               \
851510e230b6Smaya   .MICommandOpcode                     =      5,  \
851610e230b6Smaya   .CommandType                         =      0
851710e230b6Smaya
851810e230b6Smayastruct GEN10_MI_ARB_CHECK {
851910e230b6Smaya   uint32_t                             MICommandOpcode;
852010e230b6Smaya   uint32_t                             CommandType;
852110e230b6Smaya};
852210e230b6Smaya
852310e230b6Smayastatic inline void
852410e230b6SmayaGEN10_MI_ARB_CHECK_pack(__attribute__((unused)) __gen_user_data *data,
852510e230b6Smaya                        __attribute__((unused)) void * restrict dst,
852610e230b6Smaya                        __attribute__((unused)) const struct GEN10_MI_ARB_CHECK * restrict values)
852710e230b6Smaya{
852810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
852910e230b6Smaya
853010e230b6Smaya   dw[0] =
853110e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
853210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
853310e230b6Smaya}
853410e230b6Smaya
853510e230b6Smaya#define GEN10_MI_ARB_ON_OFF_length             1
853610e230b6Smaya#define GEN10_MI_ARB_ON_OFF_length_bias        1
853710e230b6Smaya#define GEN10_MI_ARB_ON_OFF_header              \
853810e230b6Smaya   .ArbitrationEnable                   =      1,  \
853910e230b6Smaya   .MICommandOpcode                     =      8,  \
854010e230b6Smaya   .CommandType                         =      0
854110e230b6Smaya
854210e230b6Smayastruct GEN10_MI_ARB_ON_OFF {
854310e230b6Smaya   bool                                 ArbitrationEnable;
854410e230b6Smaya   bool                                 AllowLiteRestore;
854510e230b6Smaya   uint32_t                             MICommandOpcode;
854610e230b6Smaya   uint32_t                             CommandType;
854710e230b6Smaya};
854810e230b6Smaya
854910e230b6Smayastatic inline void
855010e230b6SmayaGEN10_MI_ARB_ON_OFF_pack(__attribute__((unused)) __gen_user_data *data,
855110e230b6Smaya                         __attribute__((unused)) void * restrict dst,
855210e230b6Smaya                         __attribute__((unused)) const struct GEN10_MI_ARB_ON_OFF * restrict values)
855310e230b6Smaya{
855410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
855510e230b6Smaya
855610e230b6Smaya   dw[0] =
855710e230b6Smaya      __gen_uint(values->ArbitrationEnable, 0, 0) |
855810e230b6Smaya      __gen_uint(values->AllowLiteRestore, 1, 1) |
855910e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
856010e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
856110e230b6Smaya}
856210e230b6Smaya
856310e230b6Smaya#define GEN10_MI_ATOMIC_length                 3
856410e230b6Smaya#define GEN10_MI_ATOMIC_length_bias            2
856510e230b6Smaya#define GEN10_MI_ATOMIC_header                  \
856610e230b6Smaya   .DWordLength                         =      1,  \
856710e230b6Smaya   .MICommandOpcode                     =     47,  \
856810e230b6Smaya   .CommandType                         =      0
856910e230b6Smaya
857010e230b6Smayastruct GEN10_MI_ATOMIC {
857110e230b6Smaya   uint32_t                             DWordLength;
857210e230b6Smaya   enum GEN10_Atomic_OPCODE             ATOMICOPCODE;
857310e230b6Smaya   bool                                 ReturnDataControl;
857410e230b6Smaya   bool                                 CSSTALL;
857510e230b6Smaya   bool                                 InlineData;
857610e230b6Smaya   uint32_t                             DataSize;
857710e230b6Smaya#define MI_ATOMIC_DWORD                          0
857810e230b6Smaya#define MI_ATOMIC_QWORD                          1
857910e230b6Smaya#define MI_ATOMIC_OCTWORD                        2
858010e230b6Smaya#define MI_ATOMIC_RESERVED                       3
858110e230b6Smaya   bool                                 PostSyncOperation;
858210e230b6Smaya   uint32_t                             MemoryType;
858310e230b6Smaya#define PerProcessGraphicsAddress                0
858410e230b6Smaya#define GlobalGraphicsAddress                    1
858510e230b6Smaya   uint32_t                             MICommandOpcode;
858610e230b6Smaya   uint32_t                             CommandType;
858710e230b6Smaya   __gen_address_type                   MemoryAddress;
858810e230b6Smaya   uint32_t                             Operand1DataDword0;
858910e230b6Smaya   uint32_t                             Operand2DataDword0;
859010e230b6Smaya   uint32_t                             Operand1DataDword1;
859110e230b6Smaya   uint32_t                             Operand2DataDword1;
859210e230b6Smaya   uint32_t                             Operand1DataDword2;
859310e230b6Smaya   uint32_t                             Operand2DataDword2;
859410e230b6Smaya   uint32_t                             Operand1DataDword3;
859510e230b6Smaya   uint32_t                             Operand2DataDword3;
859610e230b6Smaya};
859710e230b6Smaya
859810e230b6Smayastatic inline void
859910e230b6SmayaGEN10_MI_ATOMIC_pack(__attribute__((unused)) __gen_user_data *data,
860010e230b6Smaya                     __attribute__((unused)) void * restrict dst,
860110e230b6Smaya                     __attribute__((unused)) const struct GEN10_MI_ATOMIC * restrict values)
860210e230b6Smaya{
860310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
860410e230b6Smaya
860510e230b6Smaya   dw[0] =
860610e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
860710e230b6Smaya      __gen_uint(values->ATOMICOPCODE, 8, 15) |
860810e230b6Smaya      __gen_uint(values->ReturnDataControl, 16, 16) |
860910e230b6Smaya      __gen_uint(values->CSSTALL, 17, 17) |
861010e230b6Smaya      __gen_uint(values->InlineData, 18, 18) |
861110e230b6Smaya      __gen_uint(values->DataSize, 19, 20) |
861210e230b6Smaya      __gen_uint(values->PostSyncOperation, 21, 21) |
861310e230b6Smaya      __gen_uint(values->MemoryType, 22, 22) |
861410e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
861510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
861610e230b6Smaya
861710e230b6Smaya   const uint64_t v1_address =
861810e230b6Smaya      __gen_combine_address(data, &dw[1], values->MemoryAddress, 0);
861910e230b6Smaya   dw[1] = v1_address;
862010e230b6Smaya   dw[2] = v1_address >> 32;
862110e230b6Smaya}
862210e230b6Smaya
862310e230b6Smaya#define GEN10_MI_BATCH_BUFFER_END_length       1
862410e230b6Smaya#define GEN10_MI_BATCH_BUFFER_END_length_bias      1
862510e230b6Smaya#define GEN10_MI_BATCH_BUFFER_END_header        \
862610e230b6Smaya   .MICommandOpcode                     =     10,  \
862710e230b6Smaya   .CommandType                         =      0
862810e230b6Smaya
862910e230b6Smayastruct GEN10_MI_BATCH_BUFFER_END {
863010e230b6Smaya   bool                                 EndContext;
863110e230b6Smaya   uint32_t                             MICommandOpcode;
863210e230b6Smaya   uint32_t                             CommandType;
863310e230b6Smaya};
863410e230b6Smaya
863510e230b6Smayastatic inline void
863610e230b6SmayaGEN10_MI_BATCH_BUFFER_END_pack(__attribute__((unused)) __gen_user_data *data,
863710e230b6Smaya                               __attribute__((unused)) void * restrict dst,
863810e230b6Smaya                               __attribute__((unused)) const struct GEN10_MI_BATCH_BUFFER_END * restrict values)
863910e230b6Smaya{
864010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
864110e230b6Smaya
864210e230b6Smaya   dw[0] =
864310e230b6Smaya      __gen_uint(values->EndContext, 0, 0) |
864410e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
864510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
864610e230b6Smaya}
864710e230b6Smaya
864810e230b6Smaya#define GEN10_MI_BATCH_BUFFER_START_length      3
864910e230b6Smaya#define GEN10_MI_BATCH_BUFFER_START_length_bias      2
865010e230b6Smaya#define GEN10_MI_BATCH_BUFFER_START_header      \
865110e230b6Smaya   .DWordLength                         =      1,  \
865210e230b6Smaya   .MICommandOpcode                     =     49,  \
865310e230b6Smaya   .CommandType                         =      0
865410e230b6Smaya
865510e230b6Smayastruct GEN10_MI_BATCH_BUFFER_START {
865610e230b6Smaya   uint32_t                             DWordLength;
865710e230b6Smaya   uint32_t                             AddressSpaceIndicator;
865810e230b6Smaya#define ASI_GGTT                                 0
865910e230b6Smaya#define ASI_PPGTT                                1
866010e230b6Smaya   bool                                 ResourceStreamerEnable;
866110e230b6Smaya   bool                                 PredicationEnable;
866210e230b6Smaya   bool                                 AddOffsetEnable;
866310e230b6Smaya   uint32_t                             SecondLevelBatchBuffer;
866410e230b6Smaya#define Firstlevelbatch                          0
866510e230b6Smaya#define Secondlevelbatch                         1
866610e230b6Smaya   uint32_t                             MICommandOpcode;
866710e230b6Smaya   uint32_t                             CommandType;
866810e230b6Smaya   __gen_address_type                   BatchBufferStartAddress;
866910e230b6Smaya};
867010e230b6Smaya
867110e230b6Smayastatic inline void
867210e230b6SmayaGEN10_MI_BATCH_BUFFER_START_pack(__attribute__((unused)) __gen_user_data *data,
867310e230b6Smaya                                 __attribute__((unused)) void * restrict dst,
867410e230b6Smaya                                 __attribute__((unused)) const struct GEN10_MI_BATCH_BUFFER_START * restrict values)
867510e230b6Smaya{
867610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
867710e230b6Smaya
867810e230b6Smaya   dw[0] =
867910e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
868010e230b6Smaya      __gen_uint(values->AddressSpaceIndicator, 8, 8) |
868110e230b6Smaya      __gen_uint(values->ResourceStreamerEnable, 10, 10) |
868210e230b6Smaya      __gen_uint(values->PredicationEnable, 15, 15) |
868310e230b6Smaya      __gen_uint(values->AddOffsetEnable, 16, 16) |
868410e230b6Smaya      __gen_uint(values->SecondLevelBatchBuffer, 22, 22) |
868510e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
868610e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
868710e230b6Smaya
868810e230b6Smaya   const uint64_t v1_address =
868910e230b6Smaya      __gen_combine_address(data, &dw[1], values->BatchBufferStartAddress, 0);
869010e230b6Smaya   dw[1] = v1_address;
869110e230b6Smaya   dw[2] = v1_address >> 32;
869210e230b6Smaya}
869310e230b6Smaya
869410e230b6Smaya#define GEN10_MI_CLFLUSH_length_bias           2
869510e230b6Smaya#define GEN10_MI_CLFLUSH_header                 \
869610e230b6Smaya   .DWordLength                         =      1,  \
869710e230b6Smaya   .MICommandOpcode                     =     39,  \
869810e230b6Smaya   .CommandType                         =      0
869910e230b6Smaya
870010e230b6Smayastruct GEN10_MI_CLFLUSH {
870110e230b6Smaya   uint32_t                             DWordLength;
870210e230b6Smaya   bool                                 UseGlobalGTT;
870310e230b6Smaya   uint32_t                             MICommandOpcode;
870410e230b6Smaya   uint32_t                             CommandType;
870510e230b6Smaya   uint32_t                             StartingCachelineOffset;
870610e230b6Smaya   __gen_address_type                   PageBaseAddress;
870710e230b6Smaya   /* variable length fields follow */
870810e230b6Smaya};
870910e230b6Smaya
871010e230b6Smayastatic inline void
871110e230b6SmayaGEN10_MI_CLFLUSH_pack(__attribute__((unused)) __gen_user_data *data,
871210e230b6Smaya                      __attribute__((unused)) void * restrict dst,
871310e230b6Smaya                      __attribute__((unused)) const struct GEN10_MI_CLFLUSH * restrict values)
871410e230b6Smaya{
871510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
871610e230b6Smaya
871710e230b6Smaya   dw[0] =
871810e230b6Smaya      __gen_uint(values->DWordLength, 0, 9) |
871910e230b6Smaya      __gen_uint(values->UseGlobalGTT, 22, 22) |
872010e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
872110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
872210e230b6Smaya
872310e230b6Smaya   const uint64_t v1 =
872410e230b6Smaya      __gen_uint(values->StartingCachelineOffset, 6, 11);
872510e230b6Smaya   const uint64_t v1_address =
872610e230b6Smaya      __gen_combine_address(data, &dw[1], values->PageBaseAddress, v1);
872710e230b6Smaya   dw[1] = v1_address;
872810e230b6Smaya   dw[2] = (v1_address >> 32) | (v1 >> 32);
872910e230b6Smaya}
873010e230b6Smaya
873110e230b6Smaya#define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_length      4
873210e230b6Smaya#define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_length_bias      2
873310e230b6Smaya#define GEN10_MI_CONDITIONAL_BATCH_BUFFER_END_header\
873410e230b6Smaya   .DWordLength                         =      2,  \
873510e230b6Smaya   .CompareSemaphore                    =      0,  \
873610e230b6Smaya   .MICommandOpcode                     =     54,  \
873710e230b6Smaya   .CommandType                         =      0
873810e230b6Smaya
873910e230b6Smayastruct GEN10_MI_CONDITIONAL_BATCH_BUFFER_END {
874010e230b6Smaya   uint32_t                             DWordLength;
874110e230b6Smaya   uint32_t                             CompareMaskMode;
874210e230b6Smaya#define CompareMaskModeDisabled                  0
874310e230b6Smaya#define CompareMaskModeEnabled                   1
874410e230b6Smaya   uint32_t                             CompareSemaphore;
874510e230b6Smaya   bool                                 UseGlobalGTT;
874610e230b6Smaya   uint32_t                             MICommandOpcode;
874710e230b6Smaya   uint32_t                             CommandType;
874810e230b6Smaya   uint32_t                             CompareDataDword;
874910e230b6Smaya   __gen_address_type                   CompareAddress;
875010e230b6Smaya};
875110e230b6Smaya
875210e230b6Smayastatic inline void
875310e230b6SmayaGEN10_MI_CONDITIONAL_BATCH_BUFFER_END_pack(__attribute__((unused)) __gen_user_data *data,
875410e230b6Smaya                                           __attribute__((unused)) void * restrict dst,
875510e230b6Smaya                                           __attribute__((unused)) const struct GEN10_MI_CONDITIONAL_BATCH_BUFFER_END * restrict values)
875610e230b6Smaya{
875710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
875810e230b6Smaya
875910e230b6Smaya   dw[0] =
876010e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
876110e230b6Smaya      __gen_uint(values->CompareMaskMode, 19, 19) |
876210e230b6Smaya      __gen_uint(values->CompareSemaphore, 21, 21) |
876310e230b6Smaya      __gen_uint(values->UseGlobalGTT, 22, 22) |
876410e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
876510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
876610e230b6Smaya
876710e230b6Smaya   dw[1] =
876810e230b6Smaya      __gen_uint(values->CompareDataDword, 0, 31);
876910e230b6Smaya
877010e230b6Smaya   const uint64_t v2_address =
877110e230b6Smaya      __gen_combine_address(data, &dw[2], values->CompareAddress, 0);
877210e230b6Smaya   dw[2] = v2_address;
877310e230b6Smaya   dw[3] = v2_address >> 32;
877410e230b6Smaya}
877510e230b6Smaya
877610e230b6Smaya#define GEN10_MI_COPY_MEM_MEM_length           5
877710e230b6Smaya#define GEN10_MI_COPY_MEM_MEM_length_bias      2
877810e230b6Smaya#define GEN10_MI_COPY_MEM_MEM_header            \
877910e230b6Smaya   .DWordLength                         =      3,  \
878010e230b6Smaya   .MICommandOpcode                     =     46,  \
878110e230b6Smaya   .CommandType                         =      0
878210e230b6Smaya
878310e230b6Smayastruct GEN10_MI_COPY_MEM_MEM {
878410e230b6Smaya   uint32_t                             DWordLength;
878510e230b6Smaya   bool                                 UseGlobalGTTDestination;
878610e230b6Smaya   bool                                 UseGlobalGTTSource;
878710e230b6Smaya   uint32_t                             MICommandOpcode;
878810e230b6Smaya   uint32_t                             CommandType;
878910e230b6Smaya   __gen_address_type                   DestinationMemoryAddress;
879010e230b6Smaya   __gen_address_type                   SourceMemoryAddress;
879110e230b6Smaya};
879210e230b6Smaya
879310e230b6Smayastatic inline void
879410e230b6SmayaGEN10_MI_COPY_MEM_MEM_pack(__attribute__((unused)) __gen_user_data *data,
879510e230b6Smaya                           __attribute__((unused)) void * restrict dst,
879610e230b6Smaya                           __attribute__((unused)) const struct GEN10_MI_COPY_MEM_MEM * restrict values)
879710e230b6Smaya{
879810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
879910e230b6Smaya
880010e230b6Smaya   dw[0] =
880110e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
880210e230b6Smaya      __gen_uint(values->UseGlobalGTTDestination, 21, 21) |
880310e230b6Smaya      __gen_uint(values->UseGlobalGTTSource, 22, 22) |
880410e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
880510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
880610e230b6Smaya
880710e230b6Smaya   const uint64_t v1_address =
880810e230b6Smaya      __gen_combine_address(data, &dw[1], values->DestinationMemoryAddress, 0);
880910e230b6Smaya   dw[1] = v1_address;
881010e230b6Smaya   dw[2] = v1_address >> 32;
881110e230b6Smaya
881210e230b6Smaya   const uint64_t v3_address =
881310e230b6Smaya      __gen_combine_address(data, &dw[3], values->SourceMemoryAddress, 0);
881410e230b6Smaya   dw[3] = v3_address;
881510e230b6Smaya   dw[4] = v3_address >> 32;
881610e230b6Smaya}
881710e230b6Smaya
881810e230b6Smaya#define GEN10_MI_DISPLAY_FLIP_length           3
881910e230b6Smaya#define GEN10_MI_DISPLAY_FLIP_length_bias      2
882010e230b6Smaya#define GEN10_MI_DISPLAY_FLIP_header            \
882110e230b6Smaya   .DWordLength                         =      1,  \
882210e230b6Smaya   .MICommandOpcode                     =     20,  \
882310e230b6Smaya   .CommandType                         =      0
882410e230b6Smaya
882510e230b6Smayastruct GEN10_MI_DISPLAY_FLIP {
882610e230b6Smaya   uint32_t                             DWordLength;
882710e230b6Smaya   uint32_t                             DisplayPlaneSelect;
882810e230b6Smaya#define DisplayPlane1                            0
882910e230b6Smaya#define DisplayPlane2                            1
883010e230b6Smaya#define DisplayPlane3                            2
883110e230b6Smaya#define DisplayPlane4                            4
883210e230b6Smaya#define DisplayPlane5                            5
883310e230b6Smaya#define DisplayPlane6                            6
883410e230b6Smaya#define DisplayPlane7                            7
883510e230b6Smaya#define DisplayPlane8                            8
883610e230b6Smaya#define DisplayPlane9                            9
883710e230b6Smaya#define DisplayPlane10                           10
883810e230b6Smaya#define DisplayPlane11                           11
883910e230b6Smaya#define DisplayPlane12                           12
884010e230b6Smaya   bool                                 AsyncFlipIndicator;
884110e230b6Smaya   uint32_t                             MICommandOpcode;
884210e230b6Smaya   uint32_t                             CommandType;
884310e230b6Smaya   uint32_t                             TileParameter;
884410e230b6Smaya   uint32_t                             DisplayBufferPitch;
884510e230b6Smaya   bool                                 Stereoscopic3DMode;
884610e230b6Smaya   uint32_t                             FlipType;
884710e230b6Smaya#define SyncFlip                                 0
884810e230b6Smaya#define AsyncFlip                                1
884910e230b6Smaya#define Stereo3DFlip                             2
885010e230b6Smaya   uint32_t                             VRRMasterFlip;
885110e230b6Smaya   __gen_address_type                   DisplayBufferBaseAddress;
885210e230b6Smaya   __gen_address_type                   LeftEyeDisplayBufferBaseAddress;
885310e230b6Smaya};
885410e230b6Smaya
885510e230b6Smayastatic inline void
885610e230b6SmayaGEN10_MI_DISPLAY_FLIP_pack(__attribute__((unused)) __gen_user_data *data,
885710e230b6Smaya                           __attribute__((unused)) void * restrict dst,
885810e230b6Smaya                           __attribute__((unused)) const struct GEN10_MI_DISPLAY_FLIP * restrict values)
885910e230b6Smaya{
886010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
886110e230b6Smaya
886210e230b6Smaya   dw[0] =
886310e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
886410e230b6Smaya      __gen_uint(values->DisplayPlaneSelect, 8, 12) |
886510e230b6Smaya      __gen_uint(values->AsyncFlipIndicator, 22, 22) |
886610e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
886710e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
886810e230b6Smaya
886910e230b6Smaya   dw[1] =
887010e230b6Smaya      __gen_uint(values->TileParameter, 0, 2) |
887110e230b6Smaya      __gen_uint(values->DisplayBufferPitch, 6, 15) |
887210e230b6Smaya      __gen_uint(values->Stereoscopic3DMode, 31, 31);
887310e230b6Smaya
887410e230b6Smaya   const uint32_t v2 =
887510e230b6Smaya      __gen_uint(values->FlipType, 0, 1) |
887610e230b6Smaya      __gen_uint(values->VRRMasterFlip, 11, 11);
887710e230b6Smaya   dw[2] = __gen_combine_address(data, &dw[2], values->DisplayBufferBaseAddress, v2);
887810e230b6Smaya}
887910e230b6Smaya
888010e230b6Smaya#define GEN10_MI_FORCE_WAKEUP_length           2
888110e230b6Smaya#define GEN10_MI_FORCE_WAKEUP_length_bias      2
888210e230b6Smaya#define GEN10_MI_FORCE_WAKEUP_header            \
888310e230b6Smaya   .DWordLength                         =      0,  \
888410e230b6Smaya   .MICommandOpcode                     =     29,  \
888510e230b6Smaya   .CommandType                         =      0
888610e230b6Smaya
888710e230b6Smayastruct GEN10_MI_FORCE_WAKEUP {
888810e230b6Smaya   uint32_t                             DWordLength;
888910e230b6Smaya   uint32_t                             MICommandOpcode;
889010e230b6Smaya   uint32_t                             CommandType;
889110e230b6Smaya   uint32_t                             ForceMediaAwake;
889210e230b6Smaya   uint32_t                             ForceRenderAwake;
889310e230b6Smaya   uint32_t                             MaskBits;
889410e230b6Smaya};
889510e230b6Smaya
889610e230b6Smayastatic inline void
889710e230b6SmayaGEN10_MI_FORCE_WAKEUP_pack(__attribute__((unused)) __gen_user_data *data,
889810e230b6Smaya                           __attribute__((unused)) void * restrict dst,
889910e230b6Smaya                           __attribute__((unused)) const struct GEN10_MI_FORCE_WAKEUP * restrict values)
890010e230b6Smaya{
890110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
890210e230b6Smaya
890310e230b6Smaya   dw[0] =
890410e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
890510e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
890610e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
890710e230b6Smaya
890810e230b6Smaya   dw[1] =
890910e230b6Smaya      __gen_uint(values->ForceMediaAwake, 0, 0) |
891010e230b6Smaya      __gen_uint(values->ForceRenderAwake, 1, 1) |
891110e230b6Smaya      __gen_uint(values->MaskBits, 16, 31);
891210e230b6Smaya}
891310e230b6Smaya
891410e230b6Smaya#define GEN10_MI_LOAD_REGISTER_IMM_length      3
891510e230b6Smaya#define GEN10_MI_LOAD_REGISTER_IMM_length_bias      2
891610e230b6Smaya#define GEN10_MI_LOAD_REGISTER_IMM_header       \
891710e230b6Smaya   .DWordLength                         =      1,  \
891810e230b6Smaya   .MICommandOpcode                     =     34,  \
891910e230b6Smaya   .CommandType                         =      0
892010e230b6Smaya
892110e230b6Smayastruct GEN10_MI_LOAD_REGISTER_IMM {
892210e230b6Smaya   uint32_t                             DWordLength;
892310e230b6Smaya   uint32_t                             ByteWriteDisables;
892410e230b6Smaya   uint32_t                             MICommandOpcode;
892510e230b6Smaya   uint32_t                             CommandType;
892610e230b6Smaya   uint64_t                             RegisterOffset;
892710e230b6Smaya   uint32_t                             DataDWord;
892810e230b6Smaya   /* variable length fields follow */
892910e230b6Smaya};
893010e230b6Smaya
893110e230b6Smayastatic inline void
893210e230b6SmayaGEN10_MI_LOAD_REGISTER_IMM_pack(__attribute__((unused)) __gen_user_data *data,
893310e230b6Smaya                                __attribute__((unused)) void * restrict dst,
893410e230b6Smaya                                __attribute__((unused)) const struct GEN10_MI_LOAD_REGISTER_IMM * restrict values)
893510e230b6Smaya{
893610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
893710e230b6Smaya
893810e230b6Smaya   dw[0] =
893910e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
894010e230b6Smaya      __gen_uint(values->ByteWriteDisables, 8, 11) |
894110e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
894210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
894310e230b6Smaya
894410e230b6Smaya   dw[1] =
894510e230b6Smaya      __gen_offset(values->RegisterOffset, 2, 22);
894610e230b6Smaya
894710e230b6Smaya   dw[2] =
894810e230b6Smaya      __gen_uint(values->DataDWord, 0, 31);
894910e230b6Smaya}
895010e230b6Smaya
895110e230b6Smaya#define GEN10_MI_LOAD_REGISTER_MEM_length      4
895210e230b6Smaya#define GEN10_MI_LOAD_REGISTER_MEM_length_bias      2
895310e230b6Smaya#define GEN10_MI_LOAD_REGISTER_MEM_header       \
895410e230b6Smaya   .DWordLength                         =      2,  \
895510e230b6Smaya   .MICommandOpcode                     =     41,  \
895610e230b6Smaya   .CommandType                         =      0
895710e230b6Smaya
895810e230b6Smayastruct GEN10_MI_LOAD_REGISTER_MEM {
895910e230b6Smaya   uint32_t                             DWordLength;
896010e230b6Smaya   bool                                 AsyncModeEnable;
896110e230b6Smaya   bool                                 UseGlobalGTT;
896210e230b6Smaya   uint32_t                             MICommandOpcode;
896310e230b6Smaya   uint32_t                             CommandType;
896410e230b6Smaya   uint64_t                             RegisterAddress;
896510e230b6Smaya   __gen_address_type                   MemoryAddress;
896610e230b6Smaya};
896710e230b6Smaya
896810e230b6Smayastatic inline void
896910e230b6SmayaGEN10_MI_LOAD_REGISTER_MEM_pack(__attribute__((unused)) __gen_user_data *data,
897010e230b6Smaya                                __attribute__((unused)) void * restrict dst,
897110e230b6Smaya                                __attribute__((unused)) const struct GEN10_MI_LOAD_REGISTER_MEM * restrict values)
897210e230b6Smaya{
897310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
897410e230b6Smaya
897510e230b6Smaya   dw[0] =
897610e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
897710e230b6Smaya      __gen_uint(values->AsyncModeEnable, 21, 21) |
897810e230b6Smaya      __gen_uint(values->UseGlobalGTT, 22, 22) |
897910e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
898010e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
898110e230b6Smaya
898210e230b6Smaya   dw[1] =
898310e230b6Smaya      __gen_offset(values->RegisterAddress, 2, 22);
898410e230b6Smaya
898510e230b6Smaya   const uint64_t v2_address =
898610e230b6Smaya      __gen_combine_address(data, &dw[2], values->MemoryAddress, 0);
898710e230b6Smaya   dw[2] = v2_address;
898810e230b6Smaya   dw[3] = v2_address >> 32;
898910e230b6Smaya}
899010e230b6Smaya
899110e230b6Smaya#define GEN10_MI_LOAD_REGISTER_REG_length      3
899210e230b6Smaya#define GEN10_MI_LOAD_REGISTER_REG_length_bias      2
899310e230b6Smaya#define GEN10_MI_LOAD_REGISTER_REG_header       \
899410e230b6Smaya   .DWordLength                         =      1,  \
899510e230b6Smaya   .MICommandOpcode                     =     42,  \
899610e230b6Smaya   .CommandType                         =      0
899710e230b6Smaya
899810e230b6Smayastruct GEN10_MI_LOAD_REGISTER_REG {
899910e230b6Smaya   uint32_t                             DWordLength;
900010e230b6Smaya   uint32_t                             MICommandOpcode;
900110e230b6Smaya   uint32_t                             CommandType;
900210e230b6Smaya   uint64_t                             SourceRegisterAddress;
900310e230b6Smaya   uint64_t                             DestinationRegisterAddress;
900410e230b6Smaya};
900510e230b6Smaya
900610e230b6Smayastatic inline void
900710e230b6SmayaGEN10_MI_LOAD_REGISTER_REG_pack(__attribute__((unused)) __gen_user_data *data,
900810e230b6Smaya                                __attribute__((unused)) void * restrict dst,
900910e230b6Smaya                                __attribute__((unused)) const struct GEN10_MI_LOAD_REGISTER_REG * restrict values)
901010e230b6Smaya{
901110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
901210e230b6Smaya
901310e230b6Smaya   dw[0] =
901410e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
901510e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
901610e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
901710e230b6Smaya
901810e230b6Smaya   dw[1] =
901910e230b6Smaya      __gen_offset(values->SourceRegisterAddress, 2, 22);
902010e230b6Smaya
902110e230b6Smaya   dw[2] =
902210e230b6Smaya      __gen_offset(values->DestinationRegisterAddress, 2, 22);
902310e230b6Smaya}
902410e230b6Smaya
902510e230b6Smaya#define GEN10_MI_LOAD_SCAN_LINES_EXCL_length      2
902610e230b6Smaya#define GEN10_MI_LOAD_SCAN_LINES_EXCL_length_bias      2
902710e230b6Smaya#define GEN10_MI_LOAD_SCAN_LINES_EXCL_header    \
902810e230b6Smaya   .DWordLength                         =      0,  \
902910e230b6Smaya   .MICommandOpcode                     =     19,  \
903010e230b6Smaya   .CommandType                         =      0
903110e230b6Smaya
903210e230b6Smayastruct GEN10_MI_LOAD_SCAN_LINES_EXCL {
903310e230b6Smaya   uint32_t                             DWordLength;
903410e230b6Smaya   uint32_t                             DisplayPlaneSelect;
903510e230b6Smaya#define DisplayPlaneA                            0
903610e230b6Smaya#define DisplayPlaneB                            1
903710e230b6Smaya#define DisplayPlaneC                            4
903810e230b6Smaya   uint32_t                             MICommandOpcode;
903910e230b6Smaya   uint32_t                             CommandType;
904010e230b6Smaya   uint32_t                             EndScanLineNumber;
904110e230b6Smaya   uint32_t                             StartScanLineNumber;
904210e230b6Smaya};
904310e230b6Smaya
904410e230b6Smayastatic inline void
904510e230b6SmayaGEN10_MI_LOAD_SCAN_LINES_EXCL_pack(__attribute__((unused)) __gen_user_data *data,
904610e230b6Smaya                                   __attribute__((unused)) void * restrict dst,
904710e230b6Smaya                                   __attribute__((unused)) const struct GEN10_MI_LOAD_SCAN_LINES_EXCL * restrict values)
904810e230b6Smaya{
904910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
905010e230b6Smaya
905110e230b6Smaya   dw[0] =
905210e230b6Smaya      __gen_uint(values->DWordLength, 0, 5) |
905310e230b6Smaya      __gen_uint(values->DisplayPlaneSelect, 19, 21) |
905410e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
905510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
905610e230b6Smaya
905710e230b6Smaya   dw[1] =
905810e230b6Smaya      __gen_uint(values->EndScanLineNumber, 0, 12) |
905910e230b6Smaya      __gen_uint(values->StartScanLineNumber, 16, 28);
906010e230b6Smaya}
906110e230b6Smaya
906210e230b6Smaya#define GEN10_MI_LOAD_SCAN_LINES_INCL_length      2
906310e230b6Smaya#define GEN10_MI_LOAD_SCAN_LINES_INCL_length_bias      2
906410e230b6Smaya#define GEN10_MI_LOAD_SCAN_LINES_INCL_header    \
906510e230b6Smaya   .DWordLength                         =      0,  \
906610e230b6Smaya   .MICommandOpcode                     =     18,  \
906710e230b6Smaya   .CommandType                         =      0
906810e230b6Smaya
906910e230b6Smayastruct GEN10_MI_LOAD_SCAN_LINES_INCL {
907010e230b6Smaya   uint32_t                             DWordLength;
907110e230b6Smaya   uint32_t                             ScanLineEventDoneForward;
907210e230b6Smaya   uint32_t                             DisplayPlaneSelect;
907310e230b6Smaya#define DisplayPlane1A                           0
907410e230b6Smaya#define DisplayPlane1B                           1
907510e230b6Smaya#define DisplayPlane1C                           4
907610e230b6Smaya   uint32_t                             MICommandOpcode;
907710e230b6Smaya   uint32_t                             CommandType;
907810e230b6Smaya   uint32_t                             EndScanLineNumber;
907910e230b6Smaya   uint32_t                             StartScanLineNumber;
908010e230b6Smaya};
908110e230b6Smaya
908210e230b6Smayastatic inline void
908310e230b6SmayaGEN10_MI_LOAD_SCAN_LINES_INCL_pack(__attribute__((unused)) __gen_user_data *data,
908410e230b6Smaya                                   __attribute__((unused)) void * restrict dst,
908510e230b6Smaya                                   __attribute__((unused)) const struct GEN10_MI_LOAD_SCAN_LINES_INCL * restrict values)
908610e230b6Smaya{
908710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
908810e230b6Smaya
908910e230b6Smaya   dw[0] =
909010e230b6Smaya      __gen_uint(values->DWordLength, 0, 5) |
909110e230b6Smaya      __gen_uint(values->ScanLineEventDoneForward, 17, 18) |
909210e230b6Smaya      __gen_uint(values->DisplayPlaneSelect, 19, 21) |
909310e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
909410e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
909510e230b6Smaya
909610e230b6Smaya   dw[1] =
909710e230b6Smaya      __gen_uint(values->EndScanLineNumber, 0, 12) |
909810e230b6Smaya      __gen_uint(values->StartScanLineNumber, 16, 28);
909910e230b6Smaya}
910010e230b6Smaya
910110e230b6Smaya#define GEN10_MI_MATH_length_bias              2
910210e230b6Smaya#define GEN10_MI_MATH_header                    \
910310e230b6Smaya   .DWordLength                         =      0,  \
910410e230b6Smaya   .MICommandOpcode                     =     26,  \
910510e230b6Smaya   .CommandType                         =      0
910610e230b6Smaya
910710e230b6Smayastruct GEN10_MI_MATH {
910810e230b6Smaya   uint32_t                             DWordLength;
910910e230b6Smaya   uint32_t                             MICommandOpcode;
911010e230b6Smaya   uint32_t                             CommandType;
911110e230b6Smaya   /* variable length fields follow */
911210e230b6Smaya};
911310e230b6Smaya
911410e230b6Smayastatic inline void
911510e230b6SmayaGEN10_MI_MATH_pack(__attribute__((unused)) __gen_user_data *data,
911610e230b6Smaya                   __attribute__((unused)) void * restrict dst,
911710e230b6Smaya                   __attribute__((unused)) const struct GEN10_MI_MATH * restrict values)
911810e230b6Smaya{
911910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
912010e230b6Smaya
912110e230b6Smaya   dw[0] =
912210e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
912310e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
912410e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
912510e230b6Smaya}
912610e230b6Smaya
912710e230b6Smaya#define GEN10_MI_NOOP_length                   1
912810e230b6Smaya#define GEN10_MI_NOOP_length_bias              1
912910e230b6Smaya#define GEN10_MI_NOOP_header                    \
913010e230b6Smaya   .MICommandOpcode                     =      0,  \
913110e230b6Smaya   .CommandType                         =      0
913210e230b6Smaya
913310e230b6Smayastruct GEN10_MI_NOOP {
913410e230b6Smaya   uint32_t                             IdentificationNumber;
913510e230b6Smaya   bool                                 IdentificationNumberRegisterWriteEnable;
913610e230b6Smaya   uint32_t                             MICommandOpcode;
913710e230b6Smaya   uint32_t                             CommandType;
913810e230b6Smaya};
913910e230b6Smaya
914010e230b6Smayastatic inline void
914110e230b6SmayaGEN10_MI_NOOP_pack(__attribute__((unused)) __gen_user_data *data,
914210e230b6Smaya                   __attribute__((unused)) void * restrict dst,
914310e230b6Smaya                   __attribute__((unused)) const struct GEN10_MI_NOOP * restrict values)
914410e230b6Smaya{
914510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
914610e230b6Smaya
914710e230b6Smaya   dw[0] =
914810e230b6Smaya      __gen_uint(values->IdentificationNumber, 0, 21) |
914910e230b6Smaya      __gen_uint(values->IdentificationNumberRegisterWriteEnable, 22, 22) |
915010e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
915110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
915210e230b6Smaya}
915310e230b6Smaya
915410e230b6Smaya#define GEN10_MI_PREDICATE_length              1
915510e230b6Smaya#define GEN10_MI_PREDICATE_length_bias         1
915610e230b6Smaya#define GEN10_MI_PREDICATE_header               \
915710e230b6Smaya   .MICommandOpcode                     =     12,  \
915810e230b6Smaya   .CommandType                         =      0
915910e230b6Smaya
916010e230b6Smayastruct GEN10_MI_PREDICATE {
916110e230b6Smaya   uint32_t                             CompareOperation;
916210e230b6Smaya#define COMPARE_TRUE                             0
916310e230b6Smaya#define COMPARE_FALSE                            1
916410e230b6Smaya#define COMPARE_SRCS_EQUAL                       2
916510e230b6Smaya#define COMPARE_DELTAS_EQUAL                     3
916610e230b6Smaya   uint32_t                             CombineOperation;
916710e230b6Smaya#define COMBINE_SET                              0
916810e230b6Smaya#define COMBINE_AND                              1
916910e230b6Smaya#define COMBINE_OR                               2
917010e230b6Smaya#define COMBINE_XOR                              3
917110e230b6Smaya   uint32_t                             LoadOperation;
917210e230b6Smaya#define LOAD_KEEP                                0
917310e230b6Smaya#define LOAD_LOAD                                2
917410e230b6Smaya#define LOAD_LOADINV                             3
917510e230b6Smaya   uint32_t                             MICommandOpcode;
917610e230b6Smaya   uint32_t                             CommandType;
917710e230b6Smaya};
917810e230b6Smaya
917910e230b6Smayastatic inline void
918010e230b6SmayaGEN10_MI_PREDICATE_pack(__attribute__((unused)) __gen_user_data *data,
918110e230b6Smaya                        __attribute__((unused)) void * restrict dst,
918210e230b6Smaya                        __attribute__((unused)) const struct GEN10_MI_PREDICATE * restrict values)
918310e230b6Smaya{
918410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
918510e230b6Smaya
918610e230b6Smaya   dw[0] =
918710e230b6Smaya      __gen_uint(values->CompareOperation, 0, 1) |
918810e230b6Smaya      __gen_uint(values->CombineOperation, 3, 4) |
918910e230b6Smaya      __gen_uint(values->LoadOperation, 6, 7) |
919010e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
919110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
919210e230b6Smaya}
919310e230b6Smaya
919410e230b6Smaya#define GEN10_MI_REPORT_HEAD_length            1
919510e230b6Smaya#define GEN10_MI_REPORT_HEAD_length_bias       1
919610e230b6Smaya#define GEN10_MI_REPORT_HEAD_header             \
919710e230b6Smaya   .MICommandOpcode                     =      7,  \
919810e230b6Smaya   .CommandType                         =      0
919910e230b6Smaya
920010e230b6Smayastruct GEN10_MI_REPORT_HEAD {
920110e230b6Smaya   uint32_t                             MICommandOpcode;
920210e230b6Smaya   uint32_t                             CommandType;
920310e230b6Smaya};
920410e230b6Smaya
920510e230b6Smayastatic inline void
920610e230b6SmayaGEN10_MI_REPORT_HEAD_pack(__attribute__((unused)) __gen_user_data *data,
920710e230b6Smaya                          __attribute__((unused)) void * restrict dst,
920810e230b6Smaya                          __attribute__((unused)) const struct GEN10_MI_REPORT_HEAD * restrict values)
920910e230b6Smaya{
921010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
921110e230b6Smaya
921210e230b6Smaya   dw[0] =
921310e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
921410e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
921510e230b6Smaya}
921610e230b6Smaya
921710e230b6Smaya#define GEN10_MI_REPORT_PERF_COUNT_length      4
921810e230b6Smaya#define GEN10_MI_REPORT_PERF_COUNT_length_bias      2
921910e230b6Smaya#define GEN10_MI_REPORT_PERF_COUNT_header       \
922010e230b6Smaya   .DWordLength                         =      2,  \
922110e230b6Smaya   .MICommandOpcode                     =     40,  \
922210e230b6Smaya   .CommandType                         =      0
922310e230b6Smaya
922410e230b6Smayastruct GEN10_MI_REPORT_PERF_COUNT {
922510e230b6Smaya   uint32_t                             DWordLength;
922610e230b6Smaya   uint32_t                             MICommandOpcode;
922710e230b6Smaya   uint32_t                             CommandType;
922810e230b6Smaya   bool                                 UseGlobalGTT;
922910e230b6Smaya   uint32_t                             CoreModeEnable;
923010e230b6Smaya   __gen_address_type                   MemoryAddress;
923110e230b6Smaya   uint32_t                             ReportID;
923210e230b6Smaya};
923310e230b6Smaya
923410e230b6Smayastatic inline void
923510e230b6SmayaGEN10_MI_REPORT_PERF_COUNT_pack(__attribute__((unused)) __gen_user_data *data,
923610e230b6Smaya                                __attribute__((unused)) void * restrict dst,
923710e230b6Smaya                                __attribute__((unused)) const struct GEN10_MI_REPORT_PERF_COUNT * restrict values)
923810e230b6Smaya{
923910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
924010e230b6Smaya
924110e230b6Smaya   dw[0] =
924210e230b6Smaya      __gen_uint(values->DWordLength, 0, 5) |
924310e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
924410e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
924510e230b6Smaya
924610e230b6Smaya   const uint64_t v1 =
924710e230b6Smaya      __gen_uint(values->UseGlobalGTT, 0, 0) |
924810e230b6Smaya      __gen_uint(values->CoreModeEnable, 4, 4);
924910e230b6Smaya   const uint64_t v1_address =
925010e230b6Smaya      __gen_combine_address(data, &dw[1], values->MemoryAddress, v1);
925110e230b6Smaya   dw[1] = v1_address;
925210e230b6Smaya   dw[2] = (v1_address >> 32) | (v1 >> 32);
925310e230b6Smaya
925410e230b6Smaya   dw[3] =
925510e230b6Smaya      __gen_uint(values->ReportID, 0, 31);
925610e230b6Smaya}
925710e230b6Smaya
925810e230b6Smaya#define GEN10_MI_RS_CONTEXT_length             1
925910e230b6Smaya#define GEN10_MI_RS_CONTEXT_length_bias        1
926010e230b6Smaya#define GEN10_MI_RS_CONTEXT_header              \
926110e230b6Smaya   .MICommandOpcode                     =     15,  \
926210e230b6Smaya   .CommandType                         =      0
926310e230b6Smaya
926410e230b6Smayastruct GEN10_MI_RS_CONTEXT {
926510e230b6Smaya   uint32_t                             ResourceStreamerSave;
926610e230b6Smaya#define RS_Restore                               0
926710e230b6Smaya#define RS_Save                                  1
926810e230b6Smaya   uint32_t                             MICommandOpcode;
926910e230b6Smaya   uint32_t                             CommandType;
927010e230b6Smaya};
927110e230b6Smaya
927210e230b6Smayastatic inline void
927310e230b6SmayaGEN10_MI_RS_CONTEXT_pack(__attribute__((unused)) __gen_user_data *data,
927410e230b6Smaya                         __attribute__((unused)) void * restrict dst,
927510e230b6Smaya                         __attribute__((unused)) const struct GEN10_MI_RS_CONTEXT * restrict values)
927610e230b6Smaya{
927710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
927810e230b6Smaya
927910e230b6Smaya   dw[0] =
928010e230b6Smaya      __gen_uint(values->ResourceStreamerSave, 0, 0) |
928110e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
928210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
928310e230b6Smaya}
928410e230b6Smaya
928510e230b6Smaya#define GEN10_MI_RS_CONTROL_length             1
928610e230b6Smaya#define GEN10_MI_RS_CONTROL_length_bias        1
928710e230b6Smaya#define GEN10_MI_RS_CONTROL_header              \
928810e230b6Smaya   .MICommandOpcode                     =      6,  \
928910e230b6Smaya   .CommandType                         =      0
929010e230b6Smaya
929110e230b6Smayastruct GEN10_MI_RS_CONTROL {
929210e230b6Smaya   uint32_t                             ResourceStreamerControl;
929310e230b6Smaya#define RS_Stop                                  0
929410e230b6Smaya#define RS_Start                                 1
929510e230b6Smaya   uint32_t                             MICommandOpcode;
929610e230b6Smaya   uint32_t                             CommandType;
929710e230b6Smaya};
929810e230b6Smaya
929910e230b6Smayastatic inline void
930010e230b6SmayaGEN10_MI_RS_CONTROL_pack(__attribute__((unused)) __gen_user_data *data,
930110e230b6Smaya                         __attribute__((unused)) void * restrict dst,
930210e230b6Smaya                         __attribute__((unused)) const struct GEN10_MI_RS_CONTROL * restrict values)
930310e230b6Smaya{
930410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
930510e230b6Smaya
930610e230b6Smaya   dw[0] =
930710e230b6Smaya      __gen_uint(values->ResourceStreamerControl, 0, 0) |
930810e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
930910e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
931010e230b6Smaya}
931110e230b6Smaya
931210e230b6Smaya#define GEN10_MI_RS_STORE_DATA_IMM_length      4
931310e230b6Smaya#define GEN10_MI_RS_STORE_DATA_IMM_length_bias      2
931410e230b6Smaya#define GEN10_MI_RS_STORE_DATA_IMM_header       \
931510e230b6Smaya   .DWordLength                         =      2,  \
931610e230b6Smaya   .MICommandOpcode                     =     43,  \
931710e230b6Smaya   .CommandType                         =      0
931810e230b6Smaya
931910e230b6Smayastruct GEN10_MI_RS_STORE_DATA_IMM {
932010e230b6Smaya   uint32_t                             DWordLength;
932110e230b6Smaya   uint32_t                             MICommandOpcode;
932210e230b6Smaya   uint32_t                             CommandType;
932310e230b6Smaya   uint32_t                             CoreModeEnable;
932410e230b6Smaya   __gen_address_type                   DestinationAddress;
932510e230b6Smaya   uint32_t                             DataDWord0;
932610e230b6Smaya};
932710e230b6Smaya
932810e230b6Smayastatic inline void
932910e230b6SmayaGEN10_MI_RS_STORE_DATA_IMM_pack(__attribute__((unused)) __gen_user_data *data,
933010e230b6Smaya                                __attribute__((unused)) void * restrict dst,
933110e230b6Smaya                                __attribute__((unused)) const struct GEN10_MI_RS_STORE_DATA_IMM * restrict values)
933210e230b6Smaya{
933310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
933410e230b6Smaya
933510e230b6Smaya   dw[0] =
933610e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
933710e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
933810e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
933910e230b6Smaya
934010e230b6Smaya   const uint64_t v1 =
934110e230b6Smaya      __gen_uint(values->CoreModeEnable, 0, 0);
934210e230b6Smaya   const uint64_t v1_address =
934310e230b6Smaya      __gen_combine_address(data, &dw[1], values->DestinationAddress, v1);
934410e230b6Smaya   dw[1] = v1_address;
934510e230b6Smaya   dw[2] = (v1_address >> 32) | (v1 >> 32);
934610e230b6Smaya
934710e230b6Smaya   dw[3] =
934810e230b6Smaya      __gen_uint(values->DataDWord0, 0, 31);
934910e230b6Smaya}
935010e230b6Smaya
935110e230b6Smaya#define GEN10_MI_SEMAPHORE_SIGNAL_length       2
935210e230b6Smaya#define GEN10_MI_SEMAPHORE_SIGNAL_length_bias      2
935310e230b6Smaya#define GEN10_MI_SEMAPHORE_SIGNAL_header        \
935410e230b6Smaya   .DWordLength                         =      0,  \
935510e230b6Smaya   .MICommandOpcode                     =     27,  \
935610e230b6Smaya   .CommandType                         =      0
935710e230b6Smaya
935810e230b6Smayastruct GEN10_MI_SEMAPHORE_SIGNAL {
935910e230b6Smaya   uint32_t                             DWordLength;
936010e230b6Smaya   uint32_t                             TargetEngineSelect;
936110e230b6Smaya#define RCS                                      0
936210e230b6Smaya#define VCS0                                     1
936310e230b6Smaya#define BCS                                      2
936410e230b6Smaya#define VECS                                     3
936510e230b6Smaya#define VCS1                                     4
936610e230b6Smaya   bool                                 PostSyncOperation;
936710e230b6Smaya   uint32_t                             MICommandOpcode;
936810e230b6Smaya   uint32_t                             CommandType;
936910e230b6Smaya   uint32_t                             TargetContextID;
937010e230b6Smaya};
937110e230b6Smaya
937210e230b6Smayastatic inline void
937310e230b6SmayaGEN10_MI_SEMAPHORE_SIGNAL_pack(__attribute__((unused)) __gen_user_data *data,
937410e230b6Smaya                               __attribute__((unused)) void * restrict dst,
937510e230b6Smaya                               __attribute__((unused)) const struct GEN10_MI_SEMAPHORE_SIGNAL * restrict values)
937610e230b6Smaya{
937710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
937810e230b6Smaya
937910e230b6Smaya   dw[0] =
938010e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
938110e230b6Smaya      __gen_uint(values->TargetEngineSelect, 15, 17) |
938210e230b6Smaya      __gen_uint(values->PostSyncOperation, 21, 21) |
938310e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
938410e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
938510e230b6Smaya
938610e230b6Smaya   dw[1] =
938710e230b6Smaya      __gen_uint(values->TargetContextID, 0, 31);
938810e230b6Smaya}
938910e230b6Smaya
939010e230b6Smaya#define GEN10_MI_SEMAPHORE_WAIT_length         4
939110e230b6Smaya#define GEN10_MI_SEMAPHORE_WAIT_length_bias      2
939210e230b6Smaya#define GEN10_MI_SEMAPHORE_WAIT_header          \
939310e230b6Smaya   .DWordLength                         =      2,  \
939410e230b6Smaya   .MICommandOpcode                     =     28,  \
939510e230b6Smaya   .CommandType                         =      0
939610e230b6Smaya
939710e230b6Smayastruct GEN10_MI_SEMAPHORE_WAIT {
939810e230b6Smaya   uint32_t                             DWordLength;
939910e230b6Smaya   uint32_t                             CompareOperation;
940010e230b6Smaya#define COMPARE_SAD_GREATER_THAN_SDD             0
940110e230b6Smaya#define COMPARE_SAD_GREATER_THAN_OR_EQUAL_SDD    1
940210e230b6Smaya#define COMPARE_SAD_LESS_THAN_SDD                2
940310e230b6Smaya#define COMPARE_SAD_LESS_THAN_OR_EQUAL_SDD       3
940410e230b6Smaya#define COMPARE_SAD_EQUAL_SDD                    4
940510e230b6Smaya#define COMPARE_SAD_NOT_EQUAL_SDD                5
940610e230b6Smaya   uint32_t                             WaitMode;
940710e230b6Smaya#define PollingMode                              1
940810e230b6Smaya#define SignalMode                               0
940910e230b6Smaya   bool                                 RegisterPollMode;
941010e230b6Smaya   uint32_t                             MemoryType;
941110e230b6Smaya#define PerProcessGraphicsAddress                0
941210e230b6Smaya#define GlobalGraphicsAddress                    1
941310e230b6Smaya   uint32_t                             MICommandOpcode;
941410e230b6Smaya   uint32_t                             CommandType;
941510e230b6Smaya   uint32_t                             SemaphoreDataDword;
941610e230b6Smaya   __gen_address_type                   SemaphoreAddress;
941710e230b6Smaya};
941810e230b6Smaya
941910e230b6Smayastatic inline void
942010e230b6SmayaGEN10_MI_SEMAPHORE_WAIT_pack(__attribute__((unused)) __gen_user_data *data,
942110e230b6Smaya                             __attribute__((unused)) void * restrict dst,
942210e230b6Smaya                             __attribute__((unused)) const struct GEN10_MI_SEMAPHORE_WAIT * restrict values)
942310e230b6Smaya{
942410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
942510e230b6Smaya
942610e230b6Smaya   dw[0] =
942710e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
942810e230b6Smaya      __gen_uint(values->CompareOperation, 12, 14) |
942910e230b6Smaya      __gen_uint(values->WaitMode, 15, 15) |
943010e230b6Smaya      __gen_uint(values->RegisterPollMode, 16, 16) |
943110e230b6Smaya      __gen_uint(values->MemoryType, 22, 22) |
943210e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
943310e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
943410e230b6Smaya
943510e230b6Smaya   dw[1] =
943610e230b6Smaya      __gen_uint(values->SemaphoreDataDword, 0, 31);
943710e230b6Smaya
943810e230b6Smaya   const uint64_t v2_address =
943910e230b6Smaya      __gen_combine_address(data, &dw[2], values->SemaphoreAddress, 0);
944010e230b6Smaya   dw[2] = v2_address;
944110e230b6Smaya   dw[3] = v2_address >> 32;
944210e230b6Smaya}
944310e230b6Smaya
944410e230b6Smaya#define GEN10_MI_SET_CONTEXT_length            2
944510e230b6Smaya#define GEN10_MI_SET_CONTEXT_length_bias       2
944610e230b6Smaya#define GEN10_MI_SET_CONTEXT_header             \
944710e230b6Smaya   .DWordLength                         =      0,  \
944810e230b6Smaya   .MICommandOpcode                     =     24,  \
944910e230b6Smaya   .CommandType                         =      0
945010e230b6Smaya
945110e230b6Smayastruct GEN10_MI_SET_CONTEXT {
945210e230b6Smaya   uint32_t                             DWordLength;
945310e230b6Smaya   uint32_t                             MICommandOpcode;
945410e230b6Smaya   uint32_t                             CommandType;
945510e230b6Smaya   uint32_t                             RestoreInhibit;
945610e230b6Smaya   uint32_t                             ForceRestore;
945710e230b6Smaya   bool                                 ResourceStreamerStateRestoreEnable;
945810e230b6Smaya   bool                                 ResourceStreamerStateSaveEnable;
945910e230b6Smaya   bool                                 CoreModeEnable;
946010e230b6Smaya   uint32_t                             ReservedMustbe1;
946110e230b6Smaya   __gen_address_type                   LogicalContextAddress;
946210e230b6Smaya};
946310e230b6Smaya
946410e230b6Smayastatic inline void
946510e230b6SmayaGEN10_MI_SET_CONTEXT_pack(__attribute__((unused)) __gen_user_data *data,
946610e230b6Smaya                          __attribute__((unused)) void * restrict dst,
946710e230b6Smaya                          __attribute__((unused)) const struct GEN10_MI_SET_CONTEXT * restrict values)
946810e230b6Smaya{
946910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
947010e230b6Smaya
947110e230b6Smaya   dw[0] =
947210e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
947310e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
947410e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
947510e230b6Smaya
947610e230b6Smaya   const uint32_t v1 =
947710e230b6Smaya      __gen_uint(values->RestoreInhibit, 0, 0) |
947810e230b6Smaya      __gen_uint(values->ForceRestore, 1, 1) |
947910e230b6Smaya      __gen_uint(values->ResourceStreamerStateRestoreEnable, 2, 2) |
948010e230b6Smaya      __gen_uint(values->ResourceStreamerStateSaveEnable, 3, 3) |
948110e230b6Smaya      __gen_uint(values->CoreModeEnable, 4, 4) |
948210e230b6Smaya      __gen_uint(values->ReservedMustbe1, 8, 8);
948310e230b6Smaya   dw[1] = __gen_combine_address(data, &dw[1], values->LogicalContextAddress, v1);
948410e230b6Smaya}
948510e230b6Smaya
948610e230b6Smaya#define GEN10_MI_SET_PREDICATE_length          1
948710e230b6Smaya#define GEN10_MI_SET_PREDICATE_length_bias      1
948810e230b6Smaya#define GEN10_MI_SET_PREDICATE_header           \
948910e230b6Smaya   .MICommandOpcode                     =      1,  \
949010e230b6Smaya   .CommandType                         =      0
949110e230b6Smaya
949210e230b6Smayastruct GEN10_MI_SET_PREDICATE {
949310e230b6Smaya   uint32_t                             PREDICATEENABLE;
949410e230b6Smaya#define NOOPNever                                0
949510e230b6Smaya#define NOOPonResult2clear                       1
949610e230b6Smaya#define NOOPonResult2set                         2
949710e230b6Smaya#define NOOPonResultclear                        3
949810e230b6Smaya#define NOOPonResultset                          4
949910e230b6Smaya#define NOOPAlways                               15
950010e230b6Smaya   uint32_t                             MICommandOpcode;
950110e230b6Smaya   uint32_t                             CommandType;
950210e230b6Smaya};
950310e230b6Smaya
950410e230b6Smayastatic inline void
950510e230b6SmayaGEN10_MI_SET_PREDICATE_pack(__attribute__((unused)) __gen_user_data *data,
950610e230b6Smaya                            __attribute__((unused)) void * restrict dst,
950710e230b6Smaya                            __attribute__((unused)) const struct GEN10_MI_SET_PREDICATE * restrict values)
950810e230b6Smaya{
950910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
951010e230b6Smaya
951110e230b6Smaya   dw[0] =
951210e230b6Smaya      __gen_uint(values->PREDICATEENABLE, 0, 3) |
951310e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
951410e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
951510e230b6Smaya}
951610e230b6Smaya
951710e230b6Smaya#define GEN10_MI_STORE_DATA_IMM_length         4
951810e230b6Smaya#define GEN10_MI_STORE_DATA_IMM_length_bias      2
951910e230b6Smaya#define GEN10_MI_STORE_DATA_IMM_header          \
952010e230b6Smaya   .DWordLength                         =      2,  \
952110e230b6Smaya   .MICommandOpcode                     =     32,  \
952210e230b6Smaya   .CommandType                         =      0
952310e230b6Smaya
952410e230b6Smayastruct GEN10_MI_STORE_DATA_IMM {
952510e230b6Smaya   uint32_t                             DWordLength;
952610e230b6Smaya   uint32_t                             StoreQword;
952710e230b6Smaya   bool                                 UseGlobalGTT;
952810e230b6Smaya   uint32_t                             MICommandOpcode;
952910e230b6Smaya   uint32_t                             CommandType;
953010e230b6Smaya   uint32_t                             CoreModeEnable;
953110e230b6Smaya   __gen_address_type                   Address;
953210e230b6Smaya   uint64_t                             ImmediateData;
953310e230b6Smaya};
953410e230b6Smaya
953510e230b6Smayastatic inline void
953610e230b6SmayaGEN10_MI_STORE_DATA_IMM_pack(__attribute__((unused)) __gen_user_data *data,
953710e230b6Smaya                             __attribute__((unused)) void * restrict dst,
953810e230b6Smaya                             __attribute__((unused)) const struct GEN10_MI_STORE_DATA_IMM * restrict values)
953910e230b6Smaya{
954010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
954110e230b6Smaya
954210e230b6Smaya   dw[0] =
954310e230b6Smaya      __gen_uint(values->DWordLength, 0, 9) |
954410e230b6Smaya      __gen_uint(values->StoreQword, 21, 21) |
954510e230b6Smaya      __gen_uint(values->UseGlobalGTT, 22, 22) |
954610e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
954710e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
954810e230b6Smaya
954910e230b6Smaya   const uint64_t v1 =
955010e230b6Smaya      __gen_uint(values->CoreModeEnable, 0, 0);
955110e230b6Smaya   const uint64_t v1_address =
955210e230b6Smaya      __gen_combine_address(data, &dw[1], values->Address, v1);
955310e230b6Smaya   dw[1] = v1_address;
955410e230b6Smaya   dw[2] = (v1_address >> 32) | (v1 >> 32);
955510e230b6Smaya
955610e230b6Smaya   const uint64_t v3 =
955710e230b6Smaya      __gen_uint(values->ImmediateData, 0, 63);
955810e230b6Smaya   dw[3] = v3;
955910e230b6Smaya   dw[4] = v3 >> 32;
956010e230b6Smaya}
956110e230b6Smaya
956210e230b6Smaya#define GEN10_MI_STORE_DATA_INDEX_length       3
956310e230b6Smaya#define GEN10_MI_STORE_DATA_INDEX_length_bias      2
956410e230b6Smaya#define GEN10_MI_STORE_DATA_INDEX_header        \
956510e230b6Smaya   .DWordLength                         =      1,  \
956610e230b6Smaya   .MICommandOpcode                     =     33,  \
956710e230b6Smaya   .CommandType                         =      0
956810e230b6Smaya
956910e230b6Smayastruct GEN10_MI_STORE_DATA_INDEX {
957010e230b6Smaya   uint32_t                             DWordLength;
957110e230b6Smaya   uint32_t                             UsePerProcessHardwareStatusPage;
957210e230b6Smaya   uint32_t                             MICommandOpcode;
957310e230b6Smaya   uint32_t                             CommandType;
957410e230b6Smaya   uint32_t                             Offset;
957510e230b6Smaya   uint32_t                             DataDWord0;
957610e230b6Smaya   uint32_t                             DataDWord1;
957710e230b6Smaya};
957810e230b6Smaya
957910e230b6Smayastatic inline void
958010e230b6SmayaGEN10_MI_STORE_DATA_INDEX_pack(__attribute__((unused)) __gen_user_data *data,
958110e230b6Smaya                               __attribute__((unused)) void * restrict dst,
958210e230b6Smaya                               __attribute__((unused)) const struct GEN10_MI_STORE_DATA_INDEX * restrict values)
958310e230b6Smaya{
958410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
958510e230b6Smaya
958610e230b6Smaya   dw[0] =
958710e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
958810e230b6Smaya      __gen_uint(values->UsePerProcessHardwareStatusPage, 21, 21) |
958910e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
959010e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
959110e230b6Smaya
959210e230b6Smaya   dw[1] =
959310e230b6Smaya      __gen_uint(values->Offset, 2, 11);
959410e230b6Smaya
959510e230b6Smaya   dw[2] =
959610e230b6Smaya      __gen_uint(values->DataDWord0, 0, 31);
959710e230b6Smaya}
959810e230b6Smaya
959910e230b6Smaya#define GEN10_MI_STORE_REGISTER_MEM_length      4
960010e230b6Smaya#define GEN10_MI_STORE_REGISTER_MEM_length_bias      2
960110e230b6Smaya#define GEN10_MI_STORE_REGISTER_MEM_header      \
960210e230b6Smaya   .DWordLength                         =      2,  \
960310e230b6Smaya   .MICommandOpcode                     =     36,  \
960410e230b6Smaya   .CommandType                         =      0
960510e230b6Smaya
960610e230b6Smayastruct GEN10_MI_STORE_REGISTER_MEM {
960710e230b6Smaya   uint32_t                             DWordLength;
960810e230b6Smaya   bool                                 PredicateEnable;
960910e230b6Smaya   bool                                 UseGlobalGTT;
961010e230b6Smaya   uint32_t                             MICommandOpcode;
961110e230b6Smaya   uint32_t                             CommandType;
961210e230b6Smaya   uint64_t                             RegisterAddress;
961310e230b6Smaya   __gen_address_type                   MemoryAddress;
961410e230b6Smaya};
961510e230b6Smaya
961610e230b6Smayastatic inline void
961710e230b6SmayaGEN10_MI_STORE_REGISTER_MEM_pack(__attribute__((unused)) __gen_user_data *data,
961810e230b6Smaya                                 __attribute__((unused)) void * restrict dst,
961910e230b6Smaya                                 __attribute__((unused)) const struct GEN10_MI_STORE_REGISTER_MEM * restrict values)
962010e230b6Smaya{
962110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
962210e230b6Smaya
962310e230b6Smaya   dw[0] =
962410e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
962510e230b6Smaya      __gen_uint(values->PredicateEnable, 21, 21) |
962610e230b6Smaya      __gen_uint(values->UseGlobalGTT, 22, 22) |
962710e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
962810e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
962910e230b6Smaya
963010e230b6Smaya   dw[1] =
963110e230b6Smaya      __gen_offset(values->RegisterAddress, 2, 22);
963210e230b6Smaya
963310e230b6Smaya   const uint64_t v2_address =
963410e230b6Smaya      __gen_combine_address(data, &dw[2], values->MemoryAddress, 0);
963510e230b6Smaya   dw[2] = v2_address;
963610e230b6Smaya   dw[3] = v2_address >> 32;
963710e230b6Smaya}
963810e230b6Smaya
963910e230b6Smaya#define GEN10_MI_SUSPEND_FLUSH_length          1
964010e230b6Smaya#define GEN10_MI_SUSPEND_FLUSH_length_bias      1
964110e230b6Smaya#define GEN10_MI_SUSPEND_FLUSH_header           \
964210e230b6Smaya   .MICommandOpcode                     =     11,  \
964310e230b6Smaya   .CommandType                         =      0
964410e230b6Smaya
964510e230b6Smayastruct GEN10_MI_SUSPEND_FLUSH {
964610e230b6Smaya   bool                                 SuspendFlush;
964710e230b6Smaya   uint32_t                             MICommandOpcode;
964810e230b6Smaya   uint32_t                             CommandType;
964910e230b6Smaya};
965010e230b6Smaya
965110e230b6Smayastatic inline void
965210e230b6SmayaGEN10_MI_SUSPEND_FLUSH_pack(__attribute__((unused)) __gen_user_data *data,
965310e230b6Smaya                            __attribute__((unused)) void * restrict dst,
965410e230b6Smaya                            __attribute__((unused)) const struct GEN10_MI_SUSPEND_FLUSH * restrict values)
965510e230b6Smaya{
965610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
965710e230b6Smaya
965810e230b6Smaya   dw[0] =
965910e230b6Smaya      __gen_uint(values->SuspendFlush, 0, 0) |
966010e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
966110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
966210e230b6Smaya}
966310e230b6Smaya
966410e230b6Smaya#define GEN10_MI_TOPOLOGY_FILTER_length        1
966510e230b6Smaya#define GEN10_MI_TOPOLOGY_FILTER_length_bias      1
966610e230b6Smaya#define GEN10_MI_TOPOLOGY_FILTER_header         \
966710e230b6Smaya   .MICommandOpcode                     =     13,  \
966810e230b6Smaya   .CommandType                         =      0
966910e230b6Smaya
967010e230b6Smayastruct GEN10_MI_TOPOLOGY_FILTER {
967110e230b6Smaya   enum GEN10_3D_Prim_Topo_Type         TopologyFilterValue;
967210e230b6Smaya   uint32_t                             MICommandOpcode;
967310e230b6Smaya   uint32_t                             CommandType;
967410e230b6Smaya};
967510e230b6Smaya
967610e230b6Smayastatic inline void
967710e230b6SmayaGEN10_MI_TOPOLOGY_FILTER_pack(__attribute__((unused)) __gen_user_data *data,
967810e230b6Smaya                              __attribute__((unused)) void * restrict dst,
967910e230b6Smaya                              __attribute__((unused)) const struct GEN10_MI_TOPOLOGY_FILTER * restrict values)
968010e230b6Smaya{
968110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
968210e230b6Smaya
968310e230b6Smaya   dw[0] =
968410e230b6Smaya      __gen_uint(values->TopologyFilterValue, 0, 5) |
968510e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
968610e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
968710e230b6Smaya}
968810e230b6Smaya
968910e230b6Smaya#define GEN10_MI_UPDATE_GTT_length_bias        2
969010e230b6Smaya#define GEN10_MI_UPDATE_GTT_header              \
969110e230b6Smaya   .DWordLength                         =      0,  \
969210e230b6Smaya   .MICommandOpcode                     =     35,  \
969310e230b6Smaya   .CommandType                         =      0
969410e230b6Smaya
969510e230b6Smayastruct GEN10_MI_UPDATE_GTT {
969610e230b6Smaya   uint32_t                             DWordLength;
969710e230b6Smaya   uint32_t                             MICommandOpcode;
969810e230b6Smaya   uint32_t                             CommandType;
969910e230b6Smaya   __gen_address_type                   EntryAddress;
970010e230b6Smaya   /* variable length fields follow */
970110e230b6Smaya};
970210e230b6Smaya
970310e230b6Smayastatic inline void
970410e230b6SmayaGEN10_MI_UPDATE_GTT_pack(__attribute__((unused)) __gen_user_data *data,
970510e230b6Smaya                         __attribute__((unused)) void * restrict dst,
970610e230b6Smaya                         __attribute__((unused)) const struct GEN10_MI_UPDATE_GTT * restrict values)
970710e230b6Smaya{
970810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
970910e230b6Smaya
971010e230b6Smaya   dw[0] =
971110e230b6Smaya      __gen_uint(values->DWordLength, 0, 9) |
971210e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
971310e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
971410e230b6Smaya
971510e230b6Smaya   dw[1] = __gen_combine_address(data, &dw[1], values->EntryAddress, 0);
971610e230b6Smaya}
971710e230b6Smaya
971810e230b6Smaya#define GEN10_MI_USER_INTERRUPT_length         1
971910e230b6Smaya#define GEN10_MI_USER_INTERRUPT_length_bias      1
972010e230b6Smaya#define GEN10_MI_USER_INTERRUPT_header          \
972110e230b6Smaya   .MICommandOpcode                     =      2,  \
972210e230b6Smaya   .CommandType                         =      0
972310e230b6Smaya
972410e230b6Smayastruct GEN10_MI_USER_INTERRUPT {
972510e230b6Smaya   uint32_t                             MICommandOpcode;
972610e230b6Smaya   uint32_t                             CommandType;
972710e230b6Smaya};
972810e230b6Smaya
972910e230b6Smayastatic inline void
973010e230b6SmayaGEN10_MI_USER_INTERRUPT_pack(__attribute__((unused)) __gen_user_data *data,
973110e230b6Smaya                             __attribute__((unused)) void * restrict dst,
973210e230b6Smaya                             __attribute__((unused)) const struct GEN10_MI_USER_INTERRUPT * restrict values)
973310e230b6Smaya{
973410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
973510e230b6Smaya
973610e230b6Smaya   dw[0] =
973710e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
973810e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
973910e230b6Smaya}
974010e230b6Smaya
974110e230b6Smaya#define GEN10_MI_WAIT_FOR_EVENT_length         1
974210e230b6Smaya#define GEN10_MI_WAIT_FOR_EVENT_length_bias      1
974310e230b6Smaya#define GEN10_MI_WAIT_FOR_EVENT_header          \
974410e230b6Smaya   .MICommandOpcode                     =      3,  \
974510e230b6Smaya   .CommandType                         =      0
974610e230b6Smaya
974710e230b6Smayastruct GEN10_MI_WAIT_FOR_EVENT {
974810e230b6Smaya   bool                                 DisplayPlnae1AScanLineWaitEnable;
974910e230b6Smaya   bool                                 DisplayPlane1FlipPendingWaitEnable;
975010e230b6Smaya   bool                                 DisplayPlane4FlipPendingWaitEnable;
975110e230b6Smaya   bool                                 DisplayPlane1AVerticalBlankWaitEnable;
975210e230b6Smaya   bool                                 DisplayPlane7FlipPendingWaitEnable;
975310e230b6Smaya   bool                                 DisplayPlane8FlipPendingWaitEnable;
975410e230b6Smaya   bool                                 DisplayPlane1BScanLineWaitEnable;
975510e230b6Smaya   bool                                 DisplayPlane2FlipPendingWaitEnable;
975610e230b6Smaya   bool                                 DisplayPlane5FlipPendingWaitEnable;
975710e230b6Smaya   bool                                 DisplayPlane1BVerticalBlankWaitEnable;
975810e230b6Smaya   bool                                 DisplayPlane1CScanLineWaitEnable;
975910e230b6Smaya   bool                                 DisplayPlane3FlipPendingWaitEnable;
976010e230b6Smaya   bool                                 DisplayPlane9FlipPendingWaitEnable;
976110e230b6Smaya   bool                                 DisplayPlane10FlipPendingWaitEnable;
976210e230b6Smaya   bool                                 DisplayPlane11FlipPendingWaitEnable;
976310e230b6Smaya   bool                                 DisplayPlane12FlipPendingWaitEnable;
976410e230b6Smaya   bool                                 DisplayPlane6FlipPendingWaitEnable;
976510e230b6Smaya   bool                                 DisplayPlane1CVerticalBlankWaitEnable;
976610e230b6Smaya   uint32_t                             MICommandOpcode;
976710e230b6Smaya   uint32_t                             CommandType;
976810e230b6Smaya};
976910e230b6Smaya
977010e230b6Smayastatic inline void
977110e230b6SmayaGEN10_MI_WAIT_FOR_EVENT_pack(__attribute__((unused)) __gen_user_data *data,
977210e230b6Smaya                             __attribute__((unused)) void * restrict dst,
977310e230b6Smaya                             __attribute__((unused)) const struct GEN10_MI_WAIT_FOR_EVENT * restrict values)
977410e230b6Smaya{
977510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
977610e230b6Smaya
977710e230b6Smaya   dw[0] =
977810e230b6Smaya      __gen_uint(values->DisplayPlnae1AScanLineWaitEnable, 0, 0) |
977910e230b6Smaya      __gen_uint(values->DisplayPlane1FlipPendingWaitEnable, 1, 1) |
978010e230b6Smaya      __gen_uint(values->DisplayPlane4FlipPendingWaitEnable, 2, 2) |
978110e230b6Smaya      __gen_uint(values->DisplayPlane1AVerticalBlankWaitEnable, 3, 3) |
978210e230b6Smaya      __gen_uint(values->DisplayPlane7FlipPendingWaitEnable, 6, 6) |
978310e230b6Smaya      __gen_uint(values->DisplayPlane8FlipPendingWaitEnable, 7, 7) |
978410e230b6Smaya      __gen_uint(values->DisplayPlane1BScanLineWaitEnable, 8, 8) |
978510e230b6Smaya      __gen_uint(values->DisplayPlane2FlipPendingWaitEnable, 9, 9) |
978610e230b6Smaya      __gen_uint(values->DisplayPlane5FlipPendingWaitEnable, 10, 10) |
978710e230b6Smaya      __gen_uint(values->DisplayPlane1BVerticalBlankWaitEnable, 11, 11) |
978810e230b6Smaya      __gen_uint(values->DisplayPlane1CScanLineWaitEnable, 14, 14) |
978910e230b6Smaya      __gen_uint(values->DisplayPlane3FlipPendingWaitEnable, 15, 15) |
979010e230b6Smaya      __gen_uint(values->DisplayPlane9FlipPendingWaitEnable, 16, 16) |
979110e230b6Smaya      __gen_uint(values->DisplayPlane10FlipPendingWaitEnable, 17, 17) |
979210e230b6Smaya      __gen_uint(values->DisplayPlane11FlipPendingWaitEnable, 18, 18) |
979310e230b6Smaya      __gen_uint(values->DisplayPlane12FlipPendingWaitEnable, 19, 19) |
979410e230b6Smaya      __gen_uint(values->DisplayPlane6FlipPendingWaitEnable, 20, 20) |
979510e230b6Smaya      __gen_uint(values->DisplayPlane1CVerticalBlankWaitEnable, 21, 21) |
979610e230b6Smaya      __gen_uint(values->MICommandOpcode, 23, 28) |
979710e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
979810e230b6Smaya}
979910e230b6Smaya
980010e230b6Smaya#define GEN10_PIPELINE_SELECT_length           1
980110e230b6Smaya#define GEN10_PIPELINE_SELECT_length_bias      1
980210e230b6Smaya#define GEN10_PIPELINE_SELECT_header            \
980310e230b6Smaya   ._3DCommandSubOpcode                 =      4,  \
980410e230b6Smaya   ._3DCommandOpcode                    =      1,  \
980510e230b6Smaya   .CommandSubType                      =      1,  \
980610e230b6Smaya   .CommandType                         =      3
980710e230b6Smaya
980810e230b6Smayastruct GEN10_PIPELINE_SELECT {
980910e230b6Smaya   uint32_t                             PipelineSelection;
981010e230b6Smaya#define _3D                                      0
981110e230b6Smaya#define Media                                    1
981210e230b6Smaya#define GPGPU                                    2
981310e230b6Smaya   bool                                 MediaSamplerDOPClockGateEnable;
981410e230b6Smaya   bool                                 ForceMediaAwake;
981510e230b6Smaya   uint32_t                             MaskBits;
981610e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
981710e230b6Smaya   uint32_t                             _3DCommandOpcode;
981810e230b6Smaya   uint32_t                             CommandSubType;
981910e230b6Smaya   uint32_t                             CommandType;
982010e230b6Smaya};
982110e230b6Smaya
982210e230b6Smayastatic inline void
982310e230b6SmayaGEN10_PIPELINE_SELECT_pack(__attribute__((unused)) __gen_user_data *data,
982410e230b6Smaya                           __attribute__((unused)) void * restrict dst,
982510e230b6Smaya                           __attribute__((unused)) const struct GEN10_PIPELINE_SELECT * restrict values)
982610e230b6Smaya{
982710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
982810e230b6Smaya
982910e230b6Smaya   dw[0] =
983010e230b6Smaya      __gen_uint(values->PipelineSelection, 0, 1) |
983110e230b6Smaya      __gen_uint(values->MediaSamplerDOPClockGateEnable, 4, 4) |
983210e230b6Smaya      __gen_uint(values->ForceMediaAwake, 5, 5) |
983310e230b6Smaya      __gen_uint(values->MaskBits, 8, 15) |
983410e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
983510e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
983610e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
983710e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
983810e230b6Smaya}
983910e230b6Smaya
984010e230b6Smaya#define GEN10_PIPE_CONTROL_length              6
984110e230b6Smaya#define GEN10_PIPE_CONTROL_length_bias         2
984210e230b6Smaya#define GEN10_PIPE_CONTROL_header               \
984310e230b6Smaya   .DWordLength                         =      4,  \
984410e230b6Smaya   ._3DCommandSubOpcode                 =      0,  \
984510e230b6Smaya   ._3DCommandOpcode                    =      2,  \
984610e230b6Smaya   .CommandSubType                      =      3,  \
984710e230b6Smaya   .CommandType                         =      3
984810e230b6Smaya
984910e230b6Smayastruct GEN10_PIPE_CONTROL {
985010e230b6Smaya   uint32_t                             DWordLength;
985110e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
985210e230b6Smaya   uint32_t                             _3DCommandOpcode;
985310e230b6Smaya   uint32_t                             CommandSubType;
985410e230b6Smaya   uint32_t                             CommandType;
985510e230b6Smaya   bool                                 DepthCacheFlushEnable;
985610e230b6Smaya   bool                                 StallAtPixelScoreboard;
985710e230b6Smaya   bool                                 StateCacheInvalidationEnable;
985810e230b6Smaya   bool                                 ConstantCacheInvalidationEnable;
985910e230b6Smaya   bool                                 VFCacheInvalidationEnable;
986010e230b6Smaya   bool                                 DCFlushEnable;
986110e230b6Smaya   bool                                 PipeControlFlushEnable;
986210e230b6Smaya   bool                                 NotifyEnable;
986310e230b6Smaya   bool                                 IndirectStatePointersDisable;
986410e230b6Smaya   bool                                 TextureCacheInvalidationEnable;
986510e230b6Smaya   bool                                 InstructionCacheInvalidateEnable;
986610e230b6Smaya   bool                                 RenderTargetCacheFlushEnable;
986710e230b6Smaya   bool                                 DepthStallEnable;
986810e230b6Smaya   uint32_t                             PostSyncOperation;
986910e230b6Smaya#define NoWrite                                  0
987010e230b6Smaya#define WriteImmediateData                       1
987110e230b6Smaya#define WritePSDepthCount                        2
987210e230b6Smaya#define WriteTimestamp                           3
987310e230b6Smaya   bool                                 GenericMediaStateClear;
987410e230b6Smaya   bool                                 PSDSyncEnable;
987510e230b6Smaya   bool                                 TLBInvalidate;
987610e230b6Smaya   bool                                 GlobalSnapshotCountReset;
987710e230b6Smaya   bool                                 CommandStreamerStallEnable;
987810e230b6Smaya   uint32_t                             StoreDataIndex;
987910e230b6Smaya   uint32_t                             LRIPostSyncOperation;
988010e230b6Smaya#define NoLRIOperation                           0
988110e230b6Smaya#define MMIOWriteImmediateData                   1
988210e230b6Smaya   uint32_t                             DestinationAddressType;
988310e230b6Smaya#define DAT_PPGTT                                0
988410e230b6Smaya#define DAT_GGTT                                 1
988510e230b6Smaya   bool                                 FlushLLC;
988610e230b6Smaya   __gen_address_type                   Address;
988710e230b6Smaya   uint64_t                             ImmediateData;
988810e230b6Smaya};
988910e230b6Smaya
989010e230b6Smayastatic inline void
989110e230b6SmayaGEN10_PIPE_CONTROL_pack(__attribute__((unused)) __gen_user_data *data,
989210e230b6Smaya                        __attribute__((unused)) void * restrict dst,
989310e230b6Smaya                        __attribute__((unused)) const struct GEN10_PIPE_CONTROL * restrict values)
989410e230b6Smaya{
989510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
989610e230b6Smaya
989710e230b6Smaya   dw[0] =
989810e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
989910e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
990010e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
990110e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
990210e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
990310e230b6Smaya
990410e230b6Smaya   dw[1] =
990510e230b6Smaya      __gen_uint(values->DepthCacheFlushEnable, 0, 0) |
990610e230b6Smaya      __gen_uint(values->StallAtPixelScoreboard, 1, 1) |
990710e230b6Smaya      __gen_uint(values->StateCacheInvalidationEnable, 2, 2) |
990810e230b6Smaya      __gen_uint(values->ConstantCacheInvalidationEnable, 3, 3) |
990910e230b6Smaya      __gen_uint(values->VFCacheInvalidationEnable, 4, 4) |
991010e230b6Smaya      __gen_uint(values->DCFlushEnable, 5, 5) |
991110e230b6Smaya      __gen_uint(values->PipeControlFlushEnable, 7, 7) |
991210e230b6Smaya      __gen_uint(values->NotifyEnable, 8, 8) |
991310e230b6Smaya      __gen_uint(values->IndirectStatePointersDisable, 9, 9) |
991410e230b6Smaya      __gen_uint(values->TextureCacheInvalidationEnable, 10, 10) |
991510e230b6Smaya      __gen_uint(values->InstructionCacheInvalidateEnable, 11, 11) |
991610e230b6Smaya      __gen_uint(values->RenderTargetCacheFlushEnable, 12, 12) |
991710e230b6Smaya      __gen_uint(values->DepthStallEnable, 13, 13) |
991810e230b6Smaya      __gen_uint(values->PostSyncOperation, 14, 15) |
991910e230b6Smaya      __gen_uint(values->GenericMediaStateClear, 16, 16) |
992010e230b6Smaya      __gen_uint(values->PSDSyncEnable, 17, 17) |
992110e230b6Smaya      __gen_uint(values->TLBInvalidate, 18, 18) |
992210e230b6Smaya      __gen_uint(values->GlobalSnapshotCountReset, 19, 19) |
992310e230b6Smaya      __gen_uint(values->CommandStreamerStallEnable, 20, 20) |
992410e230b6Smaya      __gen_uint(values->StoreDataIndex, 21, 21) |
992510e230b6Smaya      __gen_uint(values->LRIPostSyncOperation, 23, 23) |
992610e230b6Smaya      __gen_uint(values->DestinationAddressType, 24, 24) |
992710e230b6Smaya      __gen_uint(values->FlushLLC, 26, 26);
992810e230b6Smaya
992910e230b6Smaya   const uint64_t v2_address =
993010e230b6Smaya      __gen_combine_address(data, &dw[2], values->Address, 0);
993110e230b6Smaya   dw[2] = v2_address;
993210e230b6Smaya   dw[3] = v2_address >> 32;
993310e230b6Smaya
993410e230b6Smaya   const uint64_t v4 =
993510e230b6Smaya      __gen_uint(values->ImmediateData, 0, 63);
993610e230b6Smaya   dw[4] = v4;
993710e230b6Smaya   dw[5] = v4 >> 32;
993810e230b6Smaya}
993910e230b6Smaya
994010e230b6Smaya#define GEN10_STATE_BASE_ADDRESS_length       22
994110e230b6Smaya#define GEN10_STATE_BASE_ADDRESS_length_bias      2
994210e230b6Smaya#define GEN10_STATE_BASE_ADDRESS_header         \
994310e230b6Smaya   .DWordLength                         =     20,  \
994410e230b6Smaya   ._3DCommandSubOpcode                 =      1,  \
994510e230b6Smaya   ._3DCommandOpcode                    =      1,  \
994610e230b6Smaya   .CommandSubType                      =      0,  \
994710e230b6Smaya   .CommandType                         =      3
994810e230b6Smaya
994910e230b6Smayastruct GEN10_STATE_BASE_ADDRESS {
995010e230b6Smaya   uint32_t                             DWordLength;
995110e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
995210e230b6Smaya   uint32_t                             _3DCommandOpcode;
995310e230b6Smaya   uint32_t                             CommandSubType;
995410e230b6Smaya   uint32_t                             CommandType;
995510e230b6Smaya   bool                                 GeneralStateBaseAddressModifyEnable;
995610e230b6Smaya   uint32_t                             GeneralStateMOCS;
995710e230b6Smaya   __gen_address_type                   GeneralStateBaseAddress;
995810e230b6Smaya   uint32_t                             StatelessDataPortAccessMOCS;
995910e230b6Smaya   bool                                 SurfaceStateBaseAddressModifyEnable;
996010e230b6Smaya   uint32_t                             SurfaceStateMOCS;
996110e230b6Smaya   __gen_address_type                   SurfaceStateBaseAddress;
996210e230b6Smaya   bool                                 DynamicStateBaseAddressModifyEnable;
996310e230b6Smaya   uint32_t                             DynamicStateMOCS;
996410e230b6Smaya   __gen_address_type                   DynamicStateBaseAddress;
996510e230b6Smaya   bool                                 IndirectObjectBaseAddressModifyEnable;
996610e230b6Smaya   uint32_t                             IndirectObjectMOCS;
996710e230b6Smaya   __gen_address_type                   IndirectObjectBaseAddress;
996810e230b6Smaya   bool                                 InstructionBaseAddressModifyEnable;
996910e230b6Smaya   uint32_t                             InstructionMOCS;
997010e230b6Smaya   __gen_address_type                   InstructionBaseAddress;
997110e230b6Smaya   bool                                 GeneralStateBufferSizeModifyEnable;
997210e230b6Smaya   uint32_t                             GeneralStateBufferSize;
997310e230b6Smaya   bool                                 DynamicStateBufferSizeModifyEnable;
997410e230b6Smaya   uint32_t                             DynamicStateBufferSize;
997510e230b6Smaya   bool                                 IndirectObjectBufferSizeModifyEnable;
997610e230b6Smaya   uint32_t                             IndirectObjectBufferSize;
997710e230b6Smaya   bool                                 InstructionBuffersizeModifyEnable;
997810e230b6Smaya   uint32_t                             InstructionBufferSize;
997910e230b6Smaya   bool                                 BindlessSurfaceStateBaseAddressModifyEnable;
998010e230b6Smaya   uint32_t                             BindlessSurfaceStateMOCS;
998110e230b6Smaya   __gen_address_type                   BindlessSurfaceStateBaseAddress;
998210e230b6Smaya   uint32_t                             BindlessSurfaceStateSize;
998310e230b6Smaya   bool                                 BindlessSamplerStateBaseAddressModifyEnable;
998410e230b6Smaya   uint32_t                             BindlessSamplerStateMOCS;
998510e230b6Smaya   __gen_address_type                   BindlessSamplerStateBaseAddress;
998610e230b6Smaya   uint32_t                             BindlessSamplerStateBufferSize;
998710e230b6Smaya};
998810e230b6Smaya
998910e230b6Smayastatic inline void
999010e230b6SmayaGEN10_STATE_BASE_ADDRESS_pack(__attribute__((unused)) __gen_user_data *data,
999110e230b6Smaya                              __attribute__((unused)) void * restrict dst,
999210e230b6Smaya                              __attribute__((unused)) const struct GEN10_STATE_BASE_ADDRESS * restrict values)
999310e230b6Smaya{
999410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
999510e230b6Smaya
999610e230b6Smaya   dw[0] =
999710e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
999810e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
999910e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
1000010e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
1000110e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
1000210e230b6Smaya
1000310e230b6Smaya   const uint64_t v1 =
1000410e230b6Smaya      __gen_uint(values->GeneralStateBaseAddressModifyEnable, 0, 0) |
1000510e230b6Smaya      __gen_uint(values->GeneralStateMOCS, 4, 10);
1000610e230b6Smaya   const uint64_t v1_address =
1000710e230b6Smaya      __gen_combine_address(data, &dw[1], values->GeneralStateBaseAddress, v1);
1000810e230b6Smaya   dw[1] = v1_address;
1000910e230b6Smaya   dw[2] = (v1_address >> 32) | (v1 >> 32);
1001010e230b6Smaya
1001110e230b6Smaya   dw[3] =
1001210e230b6Smaya      __gen_uint(values->StatelessDataPortAccessMOCS, 16, 22);
1001310e230b6Smaya
1001410e230b6Smaya   const uint64_t v4 =
1001510e230b6Smaya      __gen_uint(values->SurfaceStateBaseAddressModifyEnable, 0, 0) |
1001610e230b6Smaya      __gen_uint(values->SurfaceStateMOCS, 4, 10);
1001710e230b6Smaya   const uint64_t v4_address =
1001810e230b6Smaya      __gen_combine_address(data, &dw[4], values->SurfaceStateBaseAddress, v4);
1001910e230b6Smaya   dw[4] = v4_address;
1002010e230b6Smaya   dw[5] = (v4_address >> 32) | (v4 >> 32);
1002110e230b6Smaya
1002210e230b6Smaya   const uint64_t v6 =
1002310e230b6Smaya      __gen_uint(values->DynamicStateBaseAddressModifyEnable, 0, 0) |
1002410e230b6Smaya      __gen_uint(values->DynamicStateMOCS, 4, 10);
1002510e230b6Smaya   const uint64_t v6_address =
1002610e230b6Smaya      __gen_combine_address(data, &dw[6], values->DynamicStateBaseAddress, v6);
1002710e230b6Smaya   dw[6] = v6_address;
1002810e230b6Smaya   dw[7] = (v6_address >> 32) | (v6 >> 32);
1002910e230b6Smaya
1003010e230b6Smaya   const uint64_t v8 =
1003110e230b6Smaya      __gen_uint(values->IndirectObjectBaseAddressModifyEnable, 0, 0) |
1003210e230b6Smaya      __gen_uint(values->IndirectObjectMOCS, 4, 10);
1003310e230b6Smaya   const uint64_t v8_address =
1003410e230b6Smaya      __gen_combine_address(data, &dw[8], values->IndirectObjectBaseAddress, v8);
1003510e230b6Smaya   dw[8] = v8_address;
1003610e230b6Smaya   dw[9] = (v8_address >> 32) | (v8 >> 32);
1003710e230b6Smaya
1003810e230b6Smaya   const uint64_t v10 =
1003910e230b6Smaya      __gen_uint(values->InstructionBaseAddressModifyEnable, 0, 0) |
1004010e230b6Smaya      __gen_uint(values->InstructionMOCS, 4, 10);
1004110e230b6Smaya   const uint64_t v10_address =
1004210e230b6Smaya      __gen_combine_address(data, &dw[10], values->InstructionBaseAddress, v10);
1004310e230b6Smaya   dw[10] = v10_address;
1004410e230b6Smaya   dw[11] = (v10_address >> 32) | (v10 >> 32);
1004510e230b6Smaya
1004610e230b6Smaya   dw[12] =
1004710e230b6Smaya      __gen_uint(values->GeneralStateBufferSizeModifyEnable, 0, 0) |
1004810e230b6Smaya      __gen_uint(values->GeneralStateBufferSize, 12, 31);
1004910e230b6Smaya
1005010e230b6Smaya   dw[13] =
1005110e230b6Smaya      __gen_uint(values->DynamicStateBufferSizeModifyEnable, 0, 0) |
1005210e230b6Smaya      __gen_uint(values->DynamicStateBufferSize, 12, 31);
1005310e230b6Smaya
1005410e230b6Smaya   dw[14] =
1005510e230b6Smaya      __gen_uint(values->IndirectObjectBufferSizeModifyEnable, 0, 0) |
1005610e230b6Smaya      __gen_uint(values->IndirectObjectBufferSize, 12, 31);
1005710e230b6Smaya
1005810e230b6Smaya   dw[15] =
1005910e230b6Smaya      __gen_uint(values->InstructionBuffersizeModifyEnable, 0, 0) |
1006010e230b6Smaya      __gen_uint(values->InstructionBufferSize, 12, 31);
1006110e230b6Smaya
1006210e230b6Smaya   const uint64_t v16 =
1006310e230b6Smaya      __gen_uint(values->BindlessSurfaceStateBaseAddressModifyEnable, 0, 0) |
1006410e230b6Smaya      __gen_uint(values->BindlessSurfaceStateMOCS, 4, 10);
1006510e230b6Smaya   const uint64_t v16_address =
1006610e230b6Smaya      __gen_combine_address(data, &dw[16], values->BindlessSurfaceStateBaseAddress, v16);
1006710e230b6Smaya   dw[16] = v16_address;
1006810e230b6Smaya   dw[17] = (v16_address >> 32) | (v16 >> 32);
1006910e230b6Smaya
1007010e230b6Smaya   dw[18] =
1007110e230b6Smaya      __gen_uint(values->BindlessSurfaceStateSize, 12, 31);
1007210e230b6Smaya
1007310e230b6Smaya   const uint64_t v19 =
1007410e230b6Smaya      __gen_uint(values->BindlessSamplerStateBaseAddressModifyEnable, 0, 0) |
1007510e230b6Smaya      __gen_uint(values->BindlessSamplerStateMOCS, 4, 10);
1007610e230b6Smaya   const uint64_t v19_address =
1007710e230b6Smaya      __gen_combine_address(data, &dw[19], values->BindlessSamplerStateBaseAddress, v19);
1007810e230b6Smaya   dw[19] = v19_address;
1007910e230b6Smaya   dw[20] = (v19_address >> 32) | (v19 >> 32);
1008010e230b6Smaya
1008110e230b6Smaya   dw[21] =
1008210e230b6Smaya      __gen_uint(values->BindlessSamplerStateBufferSize, 12, 31);
1008310e230b6Smaya}
1008410e230b6Smaya
1008510e230b6Smaya#define GEN10_STATE_SIP_length                 3
1008610e230b6Smaya#define GEN10_STATE_SIP_length_bias            2
1008710e230b6Smaya#define GEN10_STATE_SIP_header                  \
1008810e230b6Smaya   .DWordLength                         =      1,  \
1008910e230b6Smaya   ._3DCommandSubOpcode                 =      2,  \
1009010e230b6Smaya   ._3DCommandOpcode                    =      1,  \
1009110e230b6Smaya   .CommandSubType                      =      0,  \
1009210e230b6Smaya   .CommandType                         =      3
1009310e230b6Smaya
1009410e230b6Smayastruct GEN10_STATE_SIP {
1009510e230b6Smaya   uint32_t                             DWordLength;
1009610e230b6Smaya   uint32_t                             _3DCommandSubOpcode;
1009710e230b6Smaya   uint32_t                             _3DCommandOpcode;
1009810e230b6Smaya   uint32_t                             CommandSubType;
1009910e230b6Smaya   uint32_t                             CommandType;
1010010e230b6Smaya   uint64_t                             SystemInstructionPointer;
1010110e230b6Smaya};
1010210e230b6Smaya
1010310e230b6Smayastatic inline void
1010410e230b6SmayaGEN10_STATE_SIP_pack(__attribute__((unused)) __gen_user_data *data,
1010510e230b6Smaya                     __attribute__((unused)) void * restrict dst,
1010610e230b6Smaya                     __attribute__((unused)) const struct GEN10_STATE_SIP * restrict values)
1010710e230b6Smaya{
1010810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1010910e230b6Smaya
1011010e230b6Smaya   dw[0] =
1011110e230b6Smaya      __gen_uint(values->DWordLength, 0, 7) |
1011210e230b6Smaya      __gen_uint(values->_3DCommandSubOpcode, 16, 23) |
1011310e230b6Smaya      __gen_uint(values->_3DCommandOpcode, 24, 26) |
1011410e230b6Smaya      __gen_uint(values->CommandSubType, 27, 28) |
1011510e230b6Smaya      __gen_uint(values->CommandType, 29, 31);
1011610e230b6Smaya
1011710e230b6Smaya   const uint64_t v1 =
1011810e230b6Smaya      __gen_offset(values->SystemInstructionPointer, 4, 63);
1011910e230b6Smaya   dw[1] = v1;
1012010e230b6Smaya   dw[2] = v1 >> 32;
1012110e230b6Smaya}
1012210e230b6Smaya
1012310e230b6Smaya#define GEN10_BCS_INSTDONE_num            0x2206c
1012410e230b6Smaya#define GEN10_BCS_INSTDONE_length              1
1012510e230b6Smayastruct GEN10_BCS_INSTDONE {
1012610e230b6Smaya   bool                                 RingEnable;
1012710e230b6Smaya   bool                                 BlitterIDLE;
1012810e230b6Smaya   bool                                 GABIDLE;
1012910e230b6Smaya   bool                                 BCSDone;
1013010e230b6Smaya};
1013110e230b6Smaya
1013210e230b6Smayastatic inline void
1013310e230b6SmayaGEN10_BCS_INSTDONE_pack(__attribute__((unused)) __gen_user_data *data,
1013410e230b6Smaya                        __attribute__((unused)) void * restrict dst,
1013510e230b6Smaya                        __attribute__((unused)) const struct GEN10_BCS_INSTDONE * restrict values)
1013610e230b6Smaya{
1013710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1013810e230b6Smaya
1013910e230b6Smaya   dw[0] =
1014010e230b6Smaya      __gen_uint(values->RingEnable, 0, 0) |
1014110e230b6Smaya      __gen_uint(values->BlitterIDLE, 1, 1) |
1014210e230b6Smaya      __gen_uint(values->GABIDLE, 2, 2) |
1014310e230b6Smaya      __gen_uint(values->BCSDone, 3, 3);
1014410e230b6Smaya}
1014510e230b6Smaya
1014610e230b6Smaya#define GEN10_CACHE_MODE_0_num            0x7000
1014710e230b6Smaya#define GEN10_CACHE_MODE_0_length              1
1014810e230b6Smayastruct GEN10_CACHE_MODE_0 {
1014910e230b6Smaya   bool                                 Nulltilefixdisable;
1015010e230b6Smaya   bool                                 Disableclockgatinginthepixelbackend;
1015110e230b6Smaya   bool                                 HierarchicalZRAWStallOptimizationDisable;
1015210e230b6Smaya   bool                                 RCCEvictionPolicy;
1015310e230b6Smaya   bool                                 STCPMAOptimizationEnable;
1015410e230b6Smaya   uint32_t                             SamplerL2RequestArbitration;
1015510e230b6Smaya#define RoundRobin                               0
1015610e230b6Smaya#define FetchareHighestPriority                  1
1015710e230b6Smaya#define ConstantsareHighestPriority              2
1015810e230b6Smaya   bool                                 SamplerL2TLBPrefetchEnable;
1015910e230b6Smaya   bool                                 SamplerSetRemappingfor3DDisable;
1016010e230b6Smaya   uint32_t                             MSAACompressionPlaneNumberThresholdforeLLC;
1016110e230b6Smaya   bool                                 SamplerL2Disable;
1016210e230b6Smaya   bool                                 NulltilefixdisableMask;
1016310e230b6Smaya   bool                                 DisableclockgatinginthepixelbackendMask;
1016410e230b6Smaya   bool                                 HierarchicalZRAWStallOptimizationDisableMask;
1016510e230b6Smaya   bool                                 RCCEvictionPolicyMask;
1016610e230b6Smaya   bool                                 STCPMAOptimizationEnableMask;
1016710e230b6Smaya   uint32_t                             SamplerL2RequestArbitrationMask;
1016810e230b6Smaya   bool                                 SamplerL2TLBPrefetchEnableMask;
1016910e230b6Smaya   bool                                 SamplerSetRemappingfor3DDisableMask;
1017010e230b6Smaya   uint32_t                             MSAACompressionPlaneNumberThresholdforeLLCMask;
1017110e230b6Smaya   bool                                 SamplerL2DisableMask;
1017210e230b6Smaya};
1017310e230b6Smaya
1017410e230b6Smayastatic inline void
1017510e230b6SmayaGEN10_CACHE_MODE_0_pack(__attribute__((unused)) __gen_user_data *data,
1017610e230b6Smaya                        __attribute__((unused)) void * restrict dst,
1017710e230b6Smaya                        __attribute__((unused)) const struct GEN10_CACHE_MODE_0 * restrict values)
1017810e230b6Smaya{
1017910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1018010e230b6Smaya
1018110e230b6Smaya   dw[0] =
1018210e230b6Smaya      __gen_uint(values->Nulltilefixdisable, 0, 0) |
1018310e230b6Smaya      __gen_uint(values->Disableclockgatinginthepixelbackend, 1, 1) |
1018410e230b6Smaya      __gen_uint(values->HierarchicalZRAWStallOptimizationDisable, 2, 2) |
1018510e230b6Smaya      __gen_uint(values->RCCEvictionPolicy, 4, 4) |
1018610e230b6Smaya      __gen_uint(values->STCPMAOptimizationEnable, 5, 5) |
1018710e230b6Smaya      __gen_uint(values->SamplerL2RequestArbitration, 6, 7) |
1018810e230b6Smaya      __gen_uint(values->SamplerL2TLBPrefetchEnable, 9, 9) |
1018910e230b6Smaya      __gen_uint(values->SamplerSetRemappingfor3DDisable, 11, 11) |
1019010e230b6Smaya      __gen_uint(values->MSAACompressionPlaneNumberThresholdforeLLC, 12, 14) |
1019110e230b6Smaya      __gen_uint(values->SamplerL2Disable, 15, 15) |
1019210e230b6Smaya      __gen_uint(values->NulltilefixdisableMask, 16, 16) |
1019310e230b6Smaya      __gen_uint(values->DisableclockgatinginthepixelbackendMask, 17, 17) |
1019410e230b6Smaya      __gen_uint(values->HierarchicalZRAWStallOptimizationDisableMask, 18, 18) |
1019510e230b6Smaya      __gen_uint(values->RCCEvictionPolicyMask, 20, 20) |
1019610e230b6Smaya      __gen_uint(values->STCPMAOptimizationEnableMask, 21, 21) |
1019710e230b6Smaya      __gen_uint(values->SamplerL2RequestArbitrationMask, 22, 23) |
1019810e230b6Smaya      __gen_uint(values->SamplerL2TLBPrefetchEnableMask, 25, 25) |
1019910e230b6Smaya      __gen_uint(values->SamplerSetRemappingfor3DDisableMask, 27, 27) |
1020010e230b6Smaya      __gen_uint(values->MSAACompressionPlaneNumberThresholdforeLLCMask, 28, 30) |
1020110e230b6Smaya      __gen_uint(values->SamplerL2DisableMask, 31, 31);
1020210e230b6Smaya}
1020310e230b6Smaya
1020410e230b6Smaya#define GEN10_CACHE_MODE_1_num            0x7004
1020510e230b6Smaya#define GEN10_CACHE_MODE_1_length              1
1020610e230b6Smayastruct GEN10_CACHE_MODE_1 {
1020710e230b6Smaya   bool                                 PartialResolveDisableInVC;
1020810e230b6Smaya   bool                                 RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisable;
1020910e230b6Smaya   bool                                 MCSCacheDisable;
1021010e230b6Smaya   bool                                 MSCRAWHazardAvoidanceBit;
1021110e230b6Smaya   uint32_t                             NPEarlyZFailsDisable;
1021210e230b6Smaya   bool                                 BlendOptimizationFixDisable;
1021310e230b6Smaya   bool                                 ColorCompressionDisable;
1021410e230b6Smaya   bool                                 PartialResolveDisableInVCMask;
1021510e230b6Smaya   bool                                 RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisableMask;
1021610e230b6Smaya   bool                                 MCSCacheDisableMask;
1021710e230b6Smaya   bool                                 MSCRAWHazardAvoidanceBitMask;
1021810e230b6Smaya   bool                                 NPEarlyZFailsDisableMask;
1021910e230b6Smaya   bool                                 BlendOptimizationFixDisableMask;
1022010e230b6Smaya   bool                                 ColorCompressionDisableMask;
1022110e230b6Smaya};
1022210e230b6Smaya
1022310e230b6Smayastatic inline void
1022410e230b6SmayaGEN10_CACHE_MODE_1_pack(__attribute__((unused)) __gen_user_data *data,
1022510e230b6Smaya                        __attribute__((unused)) void * restrict dst,
1022610e230b6Smaya                        __attribute__((unused)) const struct GEN10_CACHE_MODE_1 * restrict values)
1022710e230b6Smaya{
1022810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1022910e230b6Smaya
1023010e230b6Smaya   dw[0] =
1023110e230b6Smaya      __gen_uint(values->PartialResolveDisableInVC, 1, 1) |
1023210e230b6Smaya      __gen_uint(values->RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisable, 3, 3) |
1023310e230b6Smaya      __gen_uint(values->MCSCacheDisable, 5, 5) |
1023410e230b6Smaya      __gen_uint(values->MSCRAWHazardAvoidanceBit, 9, 9) |
1023510e230b6Smaya      __gen_uint(values->NPEarlyZFailsDisable, 13, 13) |
1023610e230b6Smaya      __gen_uint(values->BlendOptimizationFixDisable, 14, 14) |
1023710e230b6Smaya      __gen_uint(values->ColorCompressionDisable, 15, 15) |
1023810e230b6Smaya      __gen_uint(values->PartialResolveDisableInVCMask, 17, 17) |
1023910e230b6Smaya      __gen_uint(values->RCZPMAPromoted2NotPromotedAllocationstalloptimizationDisableMask, 19, 19) |
1024010e230b6Smaya      __gen_uint(values->MCSCacheDisableMask, 21, 21) |
1024110e230b6Smaya      __gen_uint(values->MSCRAWHazardAvoidanceBitMask, 25, 25) |
1024210e230b6Smaya      __gen_uint(values->NPEarlyZFailsDisableMask, 29, 29) |
1024310e230b6Smaya      __gen_uint(values->BlendOptimizationFixDisableMask, 30, 30) |
1024410e230b6Smaya      __gen_uint(values->ColorCompressionDisableMask, 31, 31);
1024510e230b6Smaya}
1024610e230b6Smaya
1024710e230b6Smaya#define GEN10_CACHE_MODE_SS_num           0xe420
1024810e230b6Smaya#define GEN10_CACHE_MODE_SS_length             1
1024910e230b6Smayastruct GEN10_CACHE_MODE_SS {
1025010e230b6Smaya   bool                                 InstructionLevel1CacheDisable;
1025110e230b6Smaya   bool                                 InstructionLevel1CacheandInFlightQueueDisable;
1025210e230b6Smaya   bool                                 FloatBlendOptimizationEnable;
1025310e230b6Smaya   bool                                 PerSampleBlendOptDisable;
1025410e230b6Smaya   bool                                 InstructionLevel1CacheDisableMask;
1025510e230b6Smaya   bool                                 InstructionLevel1CacheandInFlightQueueDisableMask;
1025610e230b6Smaya   bool                                 FloatBlendOptimizationEnableMask;
1025710e230b6Smaya   bool                                 PerSampleBlendOptDisableMask;
1025810e230b6Smaya};
1025910e230b6Smaya
1026010e230b6Smayastatic inline void
1026110e230b6SmayaGEN10_CACHE_MODE_SS_pack(__attribute__((unused)) __gen_user_data *data,
1026210e230b6Smaya                         __attribute__((unused)) void * restrict dst,
1026310e230b6Smaya                         __attribute__((unused)) const struct GEN10_CACHE_MODE_SS * restrict values)
1026410e230b6Smaya{
1026510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1026610e230b6Smaya
1026710e230b6Smaya   dw[0] =
1026810e230b6Smaya      __gen_uint(values->InstructionLevel1CacheDisable, 0, 0) |
1026910e230b6Smaya      __gen_uint(values->InstructionLevel1CacheandInFlightQueueDisable, 1, 1) |
1027010e230b6Smaya      __gen_uint(values->FloatBlendOptimizationEnable, 4, 4) |
1027110e230b6Smaya      __gen_uint(values->PerSampleBlendOptDisable, 11, 11) |
1027210e230b6Smaya      __gen_uint(values->InstructionLevel1CacheDisableMask, 16, 16) |
1027310e230b6Smaya      __gen_uint(values->InstructionLevel1CacheandInFlightQueueDisableMask, 17, 17) |
1027410e230b6Smaya      __gen_uint(values->FloatBlendOptimizationEnableMask, 20, 20) |
1027510e230b6Smaya      __gen_uint(values->PerSampleBlendOptDisableMask, 27, 27);
1027610e230b6Smaya}
1027710e230b6Smaya
1027810e230b6Smaya#define GEN10_CL_INVOCATION_COUNT_num     0x2338
1027910e230b6Smaya#define GEN10_CL_INVOCATION_COUNT_length       2
1028010e230b6Smayastruct GEN10_CL_INVOCATION_COUNT {
1028110e230b6Smaya   uint64_t                             CLInvocationCountReport;
1028210e230b6Smaya};
1028310e230b6Smaya
1028410e230b6Smayastatic inline void
1028510e230b6SmayaGEN10_CL_INVOCATION_COUNT_pack(__attribute__((unused)) __gen_user_data *data,
1028610e230b6Smaya                               __attribute__((unused)) void * restrict dst,
1028710e230b6Smaya                               __attribute__((unused)) const struct GEN10_CL_INVOCATION_COUNT * restrict values)
1028810e230b6Smaya{
1028910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1029010e230b6Smaya
1029110e230b6Smaya   const uint64_t v0 =
1029210e230b6Smaya      __gen_uint(values->CLInvocationCountReport, 0, 63);
1029310e230b6Smaya   dw[0] = v0;
1029410e230b6Smaya   dw[1] = v0 >> 32;
1029510e230b6Smaya}
1029610e230b6Smaya
1029710e230b6Smaya#define GEN10_CL_PRIMITIVES_COUNT_num     0x2340
1029810e230b6Smaya#define GEN10_CL_PRIMITIVES_COUNT_length       2
1029910e230b6Smayastruct GEN10_CL_PRIMITIVES_COUNT {
1030010e230b6Smaya   uint64_t                             CLPrimitivesCountReport;
1030110e230b6Smaya};
1030210e230b6Smaya
1030310e230b6Smayastatic inline void
1030410e230b6SmayaGEN10_CL_PRIMITIVES_COUNT_pack(__attribute__((unused)) __gen_user_data *data,
1030510e230b6Smaya                               __attribute__((unused)) void * restrict dst,
1030610e230b6Smaya                               __attribute__((unused)) const struct GEN10_CL_PRIMITIVES_COUNT * restrict values)
1030710e230b6Smaya{
1030810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1030910e230b6Smaya
1031010e230b6Smaya   const uint64_t v0 =
1031110e230b6Smaya      __gen_uint(values->CLPrimitivesCountReport, 0, 63);
1031210e230b6Smaya   dw[0] = v0;
1031310e230b6Smaya   dw[1] = v0 >> 32;
1031410e230b6Smaya}
1031510e230b6Smaya
1031610e230b6Smaya#define GEN10_CS_CHICKEN1_num             0x2580
1031710e230b6Smaya#define GEN10_CS_CHICKEN1_length               1
1031810e230b6Smayastruct GEN10_CS_CHICKEN1 {
1031910e230b6Smaya   uint32_t                             ReplayMode;
1032010e230b6Smaya#define MidcmdbufferPreemption                   0
1032110e230b6Smaya#define ObjectLevelPreemption                    1
1032210e230b6Smaya   bool                                 ReplayModeMask;
1032310e230b6Smaya};
1032410e230b6Smaya
1032510e230b6Smayastatic inline void
1032610e230b6SmayaGEN10_CS_CHICKEN1_pack(__attribute__((unused)) __gen_user_data *data,
1032710e230b6Smaya                       __attribute__((unused)) void * restrict dst,
1032810e230b6Smaya                       __attribute__((unused)) const struct GEN10_CS_CHICKEN1 * restrict values)
1032910e230b6Smaya{
1033010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1033110e230b6Smaya
1033210e230b6Smaya   dw[0] =
1033310e230b6Smaya      __gen_uint(values->ReplayMode, 0, 0) |
1033410e230b6Smaya      __gen_uint(values->ReplayModeMask, 16, 16);
1033510e230b6Smaya}
1033610e230b6Smaya
1033710e230b6Smaya#define GEN10_CS_DEBUG_MODE2_num          0x20d8
1033810e230b6Smaya#define GEN10_CS_DEBUG_MODE2_length            1
1033910e230b6Smayastruct GEN10_CS_DEBUG_MODE2 {
1034010e230b6Smaya   bool                                 _3DRenderingInstructionDisable;
1034110e230b6Smaya   bool                                 MediaInstructionDisable;
1034210e230b6Smaya   bool                                 CONSTANT_BUFFERAddressOffsetDisable;
1034310e230b6Smaya   bool                                 _3DRenderingInstructionDisableMask;
1034410e230b6Smaya   bool                                 MediaInstructionDisableMask;
1034510e230b6Smaya   bool                                 CONSTANT_BUFFERAddressOffsetDisableMask;
1034610e230b6Smaya};
1034710e230b6Smaya
1034810e230b6Smayastatic inline void
1034910e230b6SmayaGEN10_CS_DEBUG_MODE2_pack(__attribute__((unused)) __gen_user_data *data,
1035010e230b6Smaya                          __attribute__((unused)) void * restrict dst,
1035110e230b6Smaya                          __attribute__((unused)) const struct GEN10_CS_DEBUG_MODE2 * restrict values)
1035210e230b6Smaya{
1035310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1035410e230b6Smaya
1035510e230b6Smaya   dw[0] =
1035610e230b6Smaya      __gen_uint(values->_3DRenderingInstructionDisable, 0, 0) |
1035710e230b6Smaya      __gen_uint(values->MediaInstructionDisable, 1, 1) |
1035810e230b6Smaya      __gen_uint(values->CONSTANT_BUFFERAddressOffsetDisable, 4, 4) |
1035910e230b6Smaya      __gen_uint(values->_3DRenderingInstructionDisableMask, 16, 16) |
1036010e230b6Smaya      __gen_uint(values->MediaInstructionDisableMask, 17, 17) |
1036110e230b6Smaya      __gen_uint(values->CONSTANT_BUFFERAddressOffsetDisableMask, 20, 20);
1036210e230b6Smaya}
1036310e230b6Smaya
1036410e230b6Smaya#define GEN10_CS_INVOCATION_COUNT_num     0x2290
1036510e230b6Smaya#define GEN10_CS_INVOCATION_COUNT_length       2
1036610e230b6Smayastruct GEN10_CS_INVOCATION_COUNT {
1036710e230b6Smaya   uint64_t                             CSInvocationCountReport;
1036810e230b6Smaya};
1036910e230b6Smaya
1037010e230b6Smayastatic inline void
1037110e230b6SmayaGEN10_CS_INVOCATION_COUNT_pack(__attribute__((unused)) __gen_user_data *data,
1037210e230b6Smaya                               __attribute__((unused)) void * restrict dst,
1037310e230b6Smaya                               __attribute__((unused)) const struct GEN10_CS_INVOCATION_COUNT * restrict values)
1037410e230b6Smaya{
1037510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1037610e230b6Smaya
1037710e230b6Smaya   const uint64_t v0 =
1037810e230b6Smaya      __gen_uint(values->CSInvocationCountReport, 0, 63);
1037910e230b6Smaya   dw[0] = v0;
1038010e230b6Smaya   dw[1] = v0 >> 32;
1038110e230b6Smaya}
1038210e230b6Smaya
1038310e230b6Smaya#define GEN10_DS_INVOCATION_COUNT_num     0x2308
1038410e230b6Smaya#define GEN10_DS_INVOCATION_COUNT_length       2
1038510e230b6Smayastruct GEN10_DS_INVOCATION_COUNT {
1038610e230b6Smaya   uint64_t                             DSInvocationCountReport;
1038710e230b6Smaya};
1038810e230b6Smaya
1038910e230b6Smayastatic inline void
1039010e230b6SmayaGEN10_DS_INVOCATION_COUNT_pack(__attribute__((unused)) __gen_user_data *data,
1039110e230b6Smaya                               __attribute__((unused)) void * restrict dst,
1039210e230b6Smaya                               __attribute__((unused)) const struct GEN10_DS_INVOCATION_COUNT * restrict values)
1039310e230b6Smaya{
1039410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1039510e230b6Smaya
1039610e230b6Smaya   const uint64_t v0 =
1039710e230b6Smaya      __gen_uint(values->DSInvocationCountReport, 0, 63);
1039810e230b6Smaya   dw[0] = v0;
1039910e230b6Smaya   dw[1] = v0 >> 32;
1040010e230b6Smaya}
1040110e230b6Smaya
1040210e230b6Smaya#define GEN10_GS_INVOCATION_COUNT_num     0x2328
1040310e230b6Smaya#define GEN10_GS_INVOCATION_COUNT_length       2
1040410e230b6Smayastruct GEN10_GS_INVOCATION_COUNT {
1040510e230b6Smaya   uint64_t                             GSInvocationCountReport;
1040610e230b6Smaya};
1040710e230b6Smaya
1040810e230b6Smayastatic inline void
1040910e230b6SmayaGEN10_GS_INVOCATION_COUNT_pack(__attribute__((unused)) __gen_user_data *data,
1041010e230b6Smaya                               __attribute__((unused)) void * restrict dst,
1041110e230b6Smaya                               __attribute__((unused)) const struct GEN10_GS_INVOCATION_COUNT * restrict values)
1041210e230b6Smaya{
1041310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1041410e230b6Smaya
1041510e230b6Smaya   const uint64_t v0 =
1041610e230b6Smaya      __gen_uint(values->GSInvocationCountReport, 0, 63);
1041710e230b6Smaya   dw[0] = v0;
1041810e230b6Smaya   dw[1] = v0 >> 32;
1041910e230b6Smaya}
1042010e230b6Smaya
1042110e230b6Smaya#define GEN10_GS_PRIMITIVES_COUNT_num     0x2330
1042210e230b6Smaya#define GEN10_GS_PRIMITIVES_COUNT_length       2
1042310e230b6Smayastruct GEN10_GS_PRIMITIVES_COUNT {
1042410e230b6Smaya   uint64_t                             GSPrimitivesCountReport;
1042510e230b6Smaya};
1042610e230b6Smaya
1042710e230b6Smayastatic inline void
1042810e230b6SmayaGEN10_GS_PRIMITIVES_COUNT_pack(__attribute__((unused)) __gen_user_data *data,
1042910e230b6Smaya                               __attribute__((unused)) void * restrict dst,
1043010e230b6Smaya                               __attribute__((unused)) const struct GEN10_GS_PRIMITIVES_COUNT * restrict values)
1043110e230b6Smaya{
1043210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1043310e230b6Smaya
1043410e230b6Smaya   const uint64_t v0 =
1043510e230b6Smaya      __gen_uint(values->GSPrimitivesCountReport, 0, 63);
1043610e230b6Smaya   dw[0] = v0;
1043710e230b6Smaya   dw[1] = v0 >> 32;
1043810e230b6Smaya}
1043910e230b6Smaya
1044010e230b6Smaya#define GEN10_HS_INVOCATION_COUNT_num     0x2300
1044110e230b6Smaya#define GEN10_HS_INVOCATION_COUNT_length       2
1044210e230b6Smayastruct GEN10_HS_INVOCATION_COUNT {
1044310e230b6Smaya   uint64_t                             HSInvocationCountReport;
1044410e230b6Smaya};
1044510e230b6Smaya
1044610e230b6Smayastatic inline void
1044710e230b6SmayaGEN10_HS_INVOCATION_COUNT_pack(__attribute__((unused)) __gen_user_data *data,
1044810e230b6Smaya                               __attribute__((unused)) void * restrict dst,
1044910e230b6Smaya                               __attribute__((unused)) const struct GEN10_HS_INVOCATION_COUNT * restrict values)
1045010e230b6Smaya{
1045110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1045210e230b6Smaya
1045310e230b6Smaya   const uint64_t v0 =
1045410e230b6Smaya      __gen_uint(values->HSInvocationCountReport, 0, 63);
1045510e230b6Smaya   dw[0] = v0;
1045610e230b6Smaya   dw[1] = v0 >> 32;
1045710e230b6Smaya}
1045810e230b6Smaya
1045910e230b6Smaya#define GEN10_IA_PRIMITIVES_COUNT_num     0x2318
1046010e230b6Smaya#define GEN10_IA_PRIMITIVES_COUNT_length       2
1046110e230b6Smayastruct GEN10_IA_PRIMITIVES_COUNT {
1046210e230b6Smaya   uint64_t                             IAPrimitivesCountReport;
1046310e230b6Smaya};
1046410e230b6Smaya
1046510e230b6Smayastatic inline void
1046610e230b6SmayaGEN10_IA_PRIMITIVES_COUNT_pack(__attribute__((unused)) __gen_user_data *data,
1046710e230b6Smaya                               __attribute__((unused)) void * restrict dst,
1046810e230b6Smaya                               __attribute__((unused)) const struct GEN10_IA_PRIMITIVES_COUNT * restrict values)
1046910e230b6Smaya{
1047010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1047110e230b6Smaya
1047210e230b6Smaya   const uint64_t v0 =
1047310e230b6Smaya      __gen_uint(values->IAPrimitivesCountReport, 0, 63);
1047410e230b6Smaya   dw[0] = v0;
1047510e230b6Smaya   dw[1] = v0 >> 32;
1047610e230b6Smaya}
1047710e230b6Smaya
1047810e230b6Smaya#define GEN10_IA_VERTICES_COUNT_num       0x2310
1047910e230b6Smaya#define GEN10_IA_VERTICES_COUNT_length         2
1048010e230b6Smayastruct GEN10_IA_VERTICES_COUNT {
1048110e230b6Smaya   uint64_t                             IAVerticesCountReport;
1048210e230b6Smaya};
1048310e230b6Smaya
1048410e230b6Smayastatic inline void
1048510e230b6SmayaGEN10_IA_VERTICES_COUNT_pack(__attribute__((unused)) __gen_user_data *data,
1048610e230b6Smaya                             __attribute__((unused)) void * restrict dst,
1048710e230b6Smaya                             __attribute__((unused)) const struct GEN10_IA_VERTICES_COUNT * restrict values)
1048810e230b6Smaya{
1048910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1049010e230b6Smaya
1049110e230b6Smaya   const uint64_t v0 =
1049210e230b6Smaya      __gen_uint(values->IAVerticesCountReport, 0, 63);
1049310e230b6Smaya   dw[0] = v0;
1049410e230b6Smaya   dw[1] = v0 >> 32;
1049510e230b6Smaya}
1049610e230b6Smaya
1049710e230b6Smaya#define GEN10_INSTDONE_1_num              0x206c
1049810e230b6Smaya#define GEN10_INSTDONE_1_length                1
1049910e230b6Smayastruct GEN10_INSTDONE_1 {
1050010e230b6Smaya   bool                                 PRB0RingEnable;
1050110e230b6Smaya   bool                                 VFGDone;
1050210e230b6Smaya   bool                                 VSDone;
1050310e230b6Smaya   bool                                 HSDone;
1050410e230b6Smaya   bool                                 TEDone;
1050510e230b6Smaya   bool                                 DSDone;
1050610e230b6Smaya   bool                                 GSDone;
1050710e230b6Smaya   bool                                 SOLDone;
1050810e230b6Smaya   bool                                 CLDone;
1050910e230b6Smaya   bool                                 SFDone;
1051010e230b6Smaya   bool                                 TDGDone;
1051110e230b6Smaya   bool                                 URBMDone;
1051210e230b6Smaya   bool                                 SVGDone;
1051310e230b6Smaya   bool                                 GAFSDone;
1051410e230b6Smaya   bool                                 VFEDone;
1051510e230b6Smaya   bool                                 TSGDone;
1051610e230b6Smaya   bool                                 GAFMDone;
1051710e230b6Smaya   bool                                 GAMDone;
1051810e230b6Smaya   bool                                 RSDone;
1051910e230b6Smaya   bool                                 CSDone;
1052010e230b6Smaya   bool                                 SDEDone;
1052110e230b6Smaya   bool                                 RCCFBCCSDone;
1052210e230b6Smaya};
1052310e230b6Smaya
1052410e230b6Smayastatic inline void
1052510e230b6SmayaGEN10_INSTDONE_1_pack(__attribute__((unused)) __gen_user_data *data,
1052610e230b6Smaya                      __attribute__((unused)) void * restrict dst,
1052710e230b6Smaya                      __attribute__((unused)) const struct GEN10_INSTDONE_1 * restrict values)
1052810e230b6Smaya{
1052910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1053010e230b6Smaya
1053110e230b6Smaya   dw[0] =
1053210e230b6Smaya      __gen_uint(values->PRB0RingEnable, 0, 0) |
1053310e230b6Smaya      __gen_uint(values->VFGDone, 1, 1) |
1053410e230b6Smaya      __gen_uint(values->VSDone, 2, 2) |
1053510e230b6Smaya      __gen_uint(values->HSDone, 3, 3) |
1053610e230b6Smaya      __gen_uint(values->TEDone, 4, 4) |
1053710e230b6Smaya      __gen_uint(values->DSDone, 5, 5) |
1053810e230b6Smaya      __gen_uint(values->GSDone, 6, 6) |
1053910e230b6Smaya      __gen_uint(values->SOLDone, 7, 7) |
1054010e230b6Smaya      __gen_uint(values->CLDone, 8, 8) |
1054110e230b6Smaya      __gen_uint(values->SFDone, 9, 9) |
1054210e230b6Smaya      __gen_uint(values->TDGDone, 12, 12) |
1054310e230b6Smaya      __gen_uint(values->URBMDone, 13, 13) |
1054410e230b6Smaya      __gen_uint(values->SVGDone, 14, 14) |
1054510e230b6Smaya      __gen_uint(values->GAFSDone, 15, 15) |
1054610e230b6Smaya      __gen_uint(values->VFEDone, 16, 16) |
1054710e230b6Smaya      __gen_uint(values->TSGDone, 17, 17) |
1054810e230b6Smaya      __gen_uint(values->GAFMDone, 18, 18) |
1054910e230b6Smaya      __gen_uint(values->GAMDone, 19, 19) |
1055010e230b6Smaya      __gen_uint(values->RSDone, 20, 20) |
1055110e230b6Smaya      __gen_uint(values->CSDone, 21, 21) |
1055210e230b6Smaya      __gen_uint(values->SDEDone, 22, 22) |
1055310e230b6Smaya      __gen_uint(values->RCCFBCCSDone, 23, 23);
1055410e230b6Smaya}
1055510e230b6Smaya
1055610e230b6Smaya#define GEN10_L3CNTLREG_num               0x7034
1055710e230b6Smaya#define GEN10_L3CNTLREG_length                 1
1055810e230b6Smayastruct GEN10_L3CNTLREG {
1055910e230b6Smaya   bool                                 SLMEnable;
1056010e230b6Smaya   uint32_t                             URBAllocation;
1056110e230b6Smaya   uint32_t                             ROAllocation;
1056210e230b6Smaya   uint32_t                             DCAllocation;
1056310e230b6Smaya   uint32_t                             AllAllocation;
1056410e230b6Smaya};
1056510e230b6Smaya
1056610e230b6Smayastatic inline void
1056710e230b6SmayaGEN10_L3CNTLREG_pack(__attribute__((unused)) __gen_user_data *data,
1056810e230b6Smaya                     __attribute__((unused)) void * restrict dst,
1056910e230b6Smaya                     __attribute__((unused)) const struct GEN10_L3CNTLREG * restrict values)
1057010e230b6Smaya{
1057110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1057210e230b6Smaya
1057310e230b6Smaya   dw[0] =
1057410e230b6Smaya      __gen_uint(values->SLMEnable, 0, 0) |
1057510e230b6Smaya      __gen_uint(values->URBAllocation, 1, 7) |
1057610e230b6Smaya      __gen_uint(values->ROAllocation, 11, 17) |
1057710e230b6Smaya      __gen_uint(values->DCAllocation, 18, 24) |
1057810e230b6Smaya      __gen_uint(values->AllAllocation, 25, 31);
1057910e230b6Smaya}
1058010e230b6Smaya
1058110e230b6Smaya#define GEN10_PS_INVOCATION_COUNT_num     0x2348
1058210e230b6Smaya#define GEN10_PS_INVOCATION_COUNT_length       2
1058310e230b6Smayastruct GEN10_PS_INVOCATION_COUNT {
1058410e230b6Smaya   uint64_t                             PSInvocationCountReport;
1058510e230b6Smaya};
1058610e230b6Smaya
1058710e230b6Smayastatic inline void
1058810e230b6SmayaGEN10_PS_INVOCATION_COUNT_pack(__attribute__((unused)) __gen_user_data *data,
1058910e230b6Smaya                               __attribute__((unused)) void * restrict dst,
1059010e230b6Smaya                               __attribute__((unused)) const struct GEN10_PS_INVOCATION_COUNT * restrict values)
1059110e230b6Smaya{
1059210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1059310e230b6Smaya
1059410e230b6Smaya   const uint64_t v0 =
1059510e230b6Smaya      __gen_uint(values->PSInvocationCountReport, 0, 63);
1059610e230b6Smaya   dw[0] = v0;
1059710e230b6Smaya   dw[1] = v0 >> 32;
1059810e230b6Smaya}
1059910e230b6Smaya
1060010e230b6Smaya#define GEN10_ROW_INSTDONE_num            0xe164
1060110e230b6Smaya#define GEN10_ROW_INSTDONE_length              1
1060210e230b6Smayastruct GEN10_ROW_INSTDONE {
1060310e230b6Smaya   bool                                 BCDone;
1060410e230b6Smaya   bool                                 PSDDone;
1060510e230b6Smaya   bool                                 DAPRDone;
1060610e230b6Smaya   bool                                 TDLDone;
1060710e230b6Smaya   bool                                 ICDone;
1060810e230b6Smaya   bool                                 MA0Done;
1060910e230b6Smaya   bool                                 EU00DoneSS0;
1061010e230b6Smaya   bool                                 EU01DoneSS0;
1061110e230b6Smaya   bool                                 EU02DoneSS0;
1061210e230b6Smaya   bool                                 EU03DoneSS0;
1061310e230b6Smaya   bool                                 EU10DoneSS0;
1061410e230b6Smaya   bool                                 EU11DoneSS0;
1061510e230b6Smaya   bool                                 EU12DoneSS0;
1061610e230b6Smaya   bool                                 EU13DoneSS0;
1061710e230b6Smaya   bool                                 MA1DoneSS0;
1061810e230b6Smaya};
1061910e230b6Smaya
1062010e230b6Smayastatic inline void
1062110e230b6SmayaGEN10_ROW_INSTDONE_pack(__attribute__((unused)) __gen_user_data *data,
1062210e230b6Smaya                        __attribute__((unused)) void * restrict dst,
1062310e230b6Smaya                        __attribute__((unused)) const struct GEN10_ROW_INSTDONE * restrict values)
1062410e230b6Smaya{
1062510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1062610e230b6Smaya
1062710e230b6Smaya   dw[0] =
1062810e230b6Smaya      __gen_uint(values->BCDone, 0, 0) |
1062910e230b6Smaya      __gen_uint(values->PSDDone, 1, 1) |
1063010e230b6Smaya      __gen_uint(values->DAPRDone, 3, 3) |
1063110e230b6Smaya      __gen_uint(values->TDLDone, 6, 6) |
1063210e230b6Smaya      __gen_uint(values->ICDone, 12, 12) |
1063310e230b6Smaya      __gen_uint(values->MA0Done, 15, 15) |
1063410e230b6Smaya      __gen_uint(values->EU00DoneSS0, 16, 16) |
1063510e230b6Smaya      __gen_uint(values->EU01DoneSS0, 17, 17) |
1063610e230b6Smaya      __gen_uint(values->EU02DoneSS0, 18, 18) |
1063710e230b6Smaya      __gen_uint(values->EU03DoneSS0, 19, 19) |
1063810e230b6Smaya      __gen_uint(values->EU10DoneSS0, 21, 21) |
1063910e230b6Smaya      __gen_uint(values->EU11DoneSS0, 22, 22) |
1064010e230b6Smaya      __gen_uint(values->EU12DoneSS0, 23, 23) |
1064110e230b6Smaya      __gen_uint(values->EU13DoneSS0, 24, 24) |
1064210e230b6Smaya      __gen_uint(values->MA1DoneSS0, 26, 26);
1064310e230b6Smaya}
1064410e230b6Smaya
1064510e230b6Smaya#define GEN10_SAMPLER_INSTDONE_num        0xe160
1064610e230b6Smaya#define GEN10_SAMPLER_INSTDONE_length          1
1064710e230b6Smayastruct GEN10_SAMPLER_INSTDONE {
1064810e230b6Smaya   bool                                 IMEDone;
1064910e230b6Smaya   bool                                 PL0Done;
1065010e230b6Smaya   bool                                 SO0Done;
1065110e230b6Smaya   bool                                 DG0Done;
1065210e230b6Smaya   bool                                 FT0Done;
1065310e230b6Smaya   bool                                 DM0Done;
1065410e230b6Smaya   bool                                 SCDone;
1065510e230b6Smaya   bool                                 FL0Done;
1065610e230b6Smaya   bool                                 QCDone;
1065710e230b6Smaya   bool                                 SVSMDone;
1065810e230b6Smaya   bool                                 SI0Done;
1065910e230b6Smaya   bool                                 MT0Done;
1066010e230b6Smaya   bool                                 AVSDone;
1066110e230b6Smaya   bool                                 IEFDone;
1066210e230b6Smaya   bool                                 CREDone;
1066310e230b6Smaya   bool                                 SVSM_ARB_SIFM;
1066410e230b6Smaya   bool                                 SVSMARB2;
1066510e230b6Smaya   bool                                 SVSMARB1;
1066610e230b6Smaya   bool                                 SVSMAdapter;
1066710e230b6Smaya   bool                                 BDMDone;
1066810e230b6Smaya};
1066910e230b6Smaya
1067010e230b6Smayastatic inline void
1067110e230b6SmayaGEN10_SAMPLER_INSTDONE_pack(__attribute__((unused)) __gen_user_data *data,
1067210e230b6Smaya                            __attribute__((unused)) void * restrict dst,
1067310e230b6Smaya                            __attribute__((unused)) const struct GEN10_SAMPLER_INSTDONE * restrict values)
1067410e230b6Smaya{
1067510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1067610e230b6Smaya
1067710e230b6Smaya   dw[0] =
1067810e230b6Smaya      __gen_uint(values->IMEDone, 0, 0) |
1067910e230b6Smaya      __gen_uint(values->PL0Done, 1, 1) |
1068010e230b6Smaya      __gen_uint(values->SO0Done, 2, 2) |
1068110e230b6Smaya      __gen_uint(values->DG0Done, 3, 3) |
1068210e230b6Smaya      __gen_uint(values->FT0Done, 4, 4) |
1068310e230b6Smaya      __gen_uint(values->DM0Done, 5, 5) |
1068410e230b6Smaya      __gen_uint(values->SCDone, 6, 6) |
1068510e230b6Smaya      __gen_uint(values->FL0Done, 7, 7) |
1068610e230b6Smaya      __gen_uint(values->QCDone, 8, 8) |
1068710e230b6Smaya      __gen_uint(values->SVSMDone, 9, 9) |
1068810e230b6Smaya      __gen_uint(values->SI0Done, 10, 10) |
1068910e230b6Smaya      __gen_uint(values->MT0Done, 11, 11) |
1069010e230b6Smaya      __gen_uint(values->AVSDone, 12, 12) |
1069110e230b6Smaya      __gen_uint(values->IEFDone, 13, 13) |
1069210e230b6Smaya      __gen_uint(values->CREDone, 14, 14) |
1069310e230b6Smaya      __gen_uint(values->SVSM_ARB_SIFM, 15, 15) |
1069410e230b6Smaya      __gen_uint(values->SVSMARB2, 16, 16) |
1069510e230b6Smaya      __gen_uint(values->SVSMARB1, 17, 17) |
1069610e230b6Smaya      __gen_uint(values->SVSMAdapter, 18, 18) |
1069710e230b6Smaya      __gen_uint(values->BDMDone, 19, 19);
1069810e230b6Smaya}
1069910e230b6Smaya
1070010e230b6Smaya#define GEN10_SC_INSTDONE_num             0x7100
1070110e230b6Smaya#define GEN10_SC_INSTDONE_length               1
1070210e230b6Smayastruct GEN10_SC_INSTDONE {
1070310e230b6Smaya   bool                                 SVLDone;
1070410e230b6Smaya   bool                                 WMFEDone;
1070510e230b6Smaya   bool                                 WMBEDone;
1070610e230b6Smaya   bool                                 HIZDone;
1070710e230b6Smaya   bool                                 STCDone;
1070810e230b6Smaya   bool                                 IZDone;
1070910e230b6Smaya   bool                                 SBEDone;
1071010e230b6Smaya   bool                                 RCZDone;
1071110e230b6Smaya   bool                                 RCCDone;
1071210e230b6Smaya   bool                                 RCPBEDone;
1071310e230b6Smaya   bool                                 RCPFEDone;
1071410e230b6Smaya   bool                                 DAPBDone;
1071510e230b6Smaya   bool                                 DAPRBEDone;
1071610e230b6Smaya   bool                                 SARBDone;
1071710e230b6Smaya   bool                                 DC0Done;
1071810e230b6Smaya   bool                                 DC1Done;
1071910e230b6Smaya   bool                                 DC2Done;
1072010e230b6Smaya   bool                                 DC3Done;
1072110e230b6Smaya   bool                                 GW0Done;
1072210e230b6Smaya   bool                                 GW1Done;
1072310e230b6Smaya   bool                                 GW2Done;
1072410e230b6Smaya   bool                                 GW3Done;
1072510e230b6Smaya   bool                                 TDCDone;
1072610e230b6Smaya   bool                                 SFBEDone;
1072710e230b6Smaya};
1072810e230b6Smaya
1072910e230b6Smayastatic inline void
1073010e230b6SmayaGEN10_SC_INSTDONE_pack(__attribute__((unused)) __gen_user_data *data,
1073110e230b6Smaya                       __attribute__((unused)) void * restrict dst,
1073210e230b6Smaya                       __attribute__((unused)) const struct GEN10_SC_INSTDONE * restrict values)
1073310e230b6Smaya{
1073410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1073510e230b6Smaya
1073610e230b6Smaya   dw[0] =
1073710e230b6Smaya      __gen_uint(values->SVLDone, 0, 0) |
1073810e230b6Smaya      __gen_uint(values->WMFEDone, 1, 1) |
1073910e230b6Smaya      __gen_uint(values->WMBEDone, 2, 2) |
1074010e230b6Smaya      __gen_uint(values->HIZDone, 3, 3) |
1074110e230b6Smaya      __gen_uint(values->STCDone, 4, 4) |
1074210e230b6Smaya      __gen_uint(values->IZDone, 5, 5) |
1074310e230b6Smaya      __gen_uint(values->SBEDone, 6, 6) |
1074410e230b6Smaya      __gen_uint(values->RCZDone, 8, 8) |
1074510e230b6Smaya      __gen_uint(values->RCCDone, 9, 9) |
1074610e230b6Smaya      __gen_uint(values->RCPBEDone, 10, 10) |
1074710e230b6Smaya      __gen_uint(values->RCPFEDone, 11, 11) |
1074810e230b6Smaya      __gen_uint(values->DAPBDone, 12, 12) |
1074910e230b6Smaya      __gen_uint(values->DAPRBEDone, 13, 13) |
1075010e230b6Smaya      __gen_uint(values->SARBDone, 15, 15) |
1075110e230b6Smaya      __gen_uint(values->DC0Done, 16, 16) |
1075210e230b6Smaya      __gen_uint(values->DC1Done, 17, 17) |
1075310e230b6Smaya      __gen_uint(values->DC2Done, 18, 18) |
1075410e230b6Smaya      __gen_uint(values->DC3Done, 19, 19) |
1075510e230b6Smaya      __gen_uint(values->GW0Done, 20, 20) |
1075610e230b6Smaya      __gen_uint(values->GW1Done, 21, 21) |
1075710e230b6Smaya      __gen_uint(values->GW2Done, 22, 22) |
1075810e230b6Smaya      __gen_uint(values->GW3Done, 23, 23) |
1075910e230b6Smaya      __gen_uint(values->TDCDone, 24, 24) |
1076010e230b6Smaya      __gen_uint(values->SFBEDone, 25, 25);
1076110e230b6Smaya}
1076210e230b6Smaya
1076310e230b6Smaya#define GEN10_SO_NUM_PRIMS_WRITTEN0_num   0x5200
1076410e230b6Smaya#define GEN10_SO_NUM_PRIMS_WRITTEN0_length      2
1076510e230b6Smayastruct GEN10_SO_NUM_PRIMS_WRITTEN0 {
1076610e230b6Smaya   uint64_t                             NumPrimsWrittenCount;
1076710e230b6Smaya};
1076810e230b6Smaya
1076910e230b6Smayastatic inline void
1077010e230b6SmayaGEN10_SO_NUM_PRIMS_WRITTEN0_pack(__attribute__((unused)) __gen_user_data *data,
1077110e230b6Smaya                                 __attribute__((unused)) void * restrict dst,
1077210e230b6Smaya                                 __attribute__((unused)) const struct GEN10_SO_NUM_PRIMS_WRITTEN0 * restrict values)
1077310e230b6Smaya{
1077410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1077510e230b6Smaya
1077610e230b6Smaya   const uint64_t v0 =
1077710e230b6Smaya      __gen_uint(values->NumPrimsWrittenCount, 0, 63);
1077810e230b6Smaya   dw[0] = v0;
1077910e230b6Smaya   dw[1] = v0 >> 32;
1078010e230b6Smaya}
1078110e230b6Smaya
1078210e230b6Smaya#define GEN10_SO_NUM_PRIMS_WRITTEN1_num   0x5208
1078310e230b6Smaya#define GEN10_SO_NUM_PRIMS_WRITTEN1_length      2
1078410e230b6Smayastruct GEN10_SO_NUM_PRIMS_WRITTEN1 {
1078510e230b6Smaya   uint64_t                             NumPrimsWrittenCount;
1078610e230b6Smaya};
1078710e230b6Smaya
1078810e230b6Smayastatic inline void
1078910e230b6SmayaGEN10_SO_NUM_PRIMS_WRITTEN1_pack(__attribute__((unused)) __gen_user_data *data,
1079010e230b6Smaya                                 __attribute__((unused)) void * restrict dst,
1079110e230b6Smaya                                 __attribute__((unused)) const struct GEN10_SO_NUM_PRIMS_WRITTEN1 * restrict values)
1079210e230b6Smaya{
1079310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1079410e230b6Smaya
1079510e230b6Smaya   const uint64_t v0 =
1079610e230b6Smaya      __gen_uint(values->NumPrimsWrittenCount, 0, 63);
1079710e230b6Smaya   dw[0] = v0;
1079810e230b6Smaya   dw[1] = v0 >> 32;
1079910e230b6Smaya}
1080010e230b6Smaya
1080110e230b6Smaya#define GEN10_SO_NUM_PRIMS_WRITTEN2_num   0x5210
1080210e230b6Smaya#define GEN10_SO_NUM_PRIMS_WRITTEN2_length      2
1080310e230b6Smayastruct GEN10_SO_NUM_PRIMS_WRITTEN2 {
1080410e230b6Smaya   uint64_t                             NumPrimsWrittenCount;
1080510e230b6Smaya};
1080610e230b6Smaya
1080710e230b6Smayastatic inline void
1080810e230b6SmayaGEN10_SO_NUM_PRIMS_WRITTEN2_pack(__attribute__((unused)) __gen_user_data *data,
1080910e230b6Smaya                                 __attribute__((unused)) void * restrict dst,
1081010e230b6Smaya                                 __attribute__((unused)) const struct GEN10_SO_NUM_PRIMS_WRITTEN2 * restrict values)
1081110e230b6Smaya{
1081210e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1081310e230b6Smaya
1081410e230b6Smaya   const uint64_t v0 =
1081510e230b6Smaya      __gen_uint(values->NumPrimsWrittenCount, 0, 63);
1081610e230b6Smaya   dw[0] = v0;
1081710e230b6Smaya   dw[1] = v0 >> 32;
1081810e230b6Smaya}
1081910e230b6Smaya
1082010e230b6Smaya#define GEN10_SO_NUM_PRIMS_WRITTEN3_num   0x5218
1082110e230b6Smaya#define GEN10_SO_NUM_PRIMS_WRITTEN3_length      2
1082210e230b6Smayastruct GEN10_SO_NUM_PRIMS_WRITTEN3 {
1082310e230b6Smaya   uint64_t                             NumPrimsWrittenCount;
1082410e230b6Smaya};
1082510e230b6Smaya
1082610e230b6Smayastatic inline void
1082710e230b6SmayaGEN10_SO_NUM_PRIMS_WRITTEN3_pack(__attribute__((unused)) __gen_user_data *data,
1082810e230b6Smaya                                 __attribute__((unused)) void * restrict dst,
1082910e230b6Smaya                                 __attribute__((unused)) const struct GEN10_SO_NUM_PRIMS_WRITTEN3 * restrict values)
1083010e230b6Smaya{
1083110e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1083210e230b6Smaya
1083310e230b6Smaya   const uint64_t v0 =
1083410e230b6Smaya      __gen_uint(values->NumPrimsWrittenCount, 0, 63);
1083510e230b6Smaya   dw[0] = v0;
1083610e230b6Smaya   dw[1] = v0 >> 32;
1083710e230b6Smaya}
1083810e230b6Smaya
1083910e230b6Smaya#define GEN10_SO_PRIM_STORAGE_NEEDED0_num 0x5240
1084010e230b6Smaya#define GEN10_SO_PRIM_STORAGE_NEEDED0_length      2
1084110e230b6Smayastruct GEN10_SO_PRIM_STORAGE_NEEDED0 {
1084210e230b6Smaya   uint64_t                             PrimStorageNeededCount;
1084310e230b6Smaya};
1084410e230b6Smaya
1084510e230b6Smayastatic inline void
1084610e230b6SmayaGEN10_SO_PRIM_STORAGE_NEEDED0_pack(__attribute__((unused)) __gen_user_data *data,
1084710e230b6Smaya                                   __attribute__((unused)) void * restrict dst,
1084810e230b6Smaya                                   __attribute__((unused)) const struct GEN10_SO_PRIM_STORAGE_NEEDED0 * restrict values)
1084910e230b6Smaya{
1085010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1085110e230b6Smaya
1085210e230b6Smaya   const uint64_t v0 =
1085310e230b6Smaya      __gen_uint(values->PrimStorageNeededCount, 0, 63);
1085410e230b6Smaya   dw[0] = v0;
1085510e230b6Smaya   dw[1] = v0 >> 32;
1085610e230b6Smaya}
1085710e230b6Smaya
1085810e230b6Smaya#define GEN10_SO_PRIM_STORAGE_NEEDED1_num 0x5248
1085910e230b6Smaya#define GEN10_SO_PRIM_STORAGE_NEEDED1_length      2
1086010e230b6Smayastruct GEN10_SO_PRIM_STORAGE_NEEDED1 {
1086110e230b6Smaya   uint64_t                             PrimStorageNeededCount;
1086210e230b6Smaya};
1086310e230b6Smaya
1086410e230b6Smayastatic inline void
1086510e230b6SmayaGEN10_SO_PRIM_STORAGE_NEEDED1_pack(__attribute__((unused)) __gen_user_data *data,
1086610e230b6Smaya                                   __attribute__((unused)) void * restrict dst,
1086710e230b6Smaya                                   __attribute__((unused)) const struct GEN10_SO_PRIM_STORAGE_NEEDED1 * restrict values)
1086810e230b6Smaya{
1086910e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1087010e230b6Smaya
1087110e230b6Smaya   const uint64_t v0 =
1087210e230b6Smaya      __gen_uint(values->PrimStorageNeededCount, 0, 63);
1087310e230b6Smaya   dw[0] = v0;
1087410e230b6Smaya   dw[1] = v0 >> 32;
1087510e230b6Smaya}
1087610e230b6Smaya
1087710e230b6Smaya#define GEN10_SO_PRIM_STORAGE_NEEDED2_num 0x5250
1087810e230b6Smaya#define GEN10_SO_PRIM_STORAGE_NEEDED2_length      2
1087910e230b6Smayastruct GEN10_SO_PRIM_STORAGE_NEEDED2 {
1088010e230b6Smaya   uint64_t                             PrimStorageNeededCount;
1088110e230b6Smaya};
1088210e230b6Smaya
1088310e230b6Smayastatic inline void
1088410e230b6SmayaGEN10_SO_PRIM_STORAGE_NEEDED2_pack(__attribute__((unused)) __gen_user_data *data,
1088510e230b6Smaya                                   __attribute__((unused)) void * restrict dst,
1088610e230b6Smaya                                   __attribute__((unused)) const struct GEN10_SO_PRIM_STORAGE_NEEDED2 * restrict values)
1088710e230b6Smaya{
1088810e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1088910e230b6Smaya
1089010e230b6Smaya   const uint64_t v0 =
1089110e230b6Smaya      __gen_uint(values->PrimStorageNeededCount, 0, 63);
1089210e230b6Smaya   dw[0] = v0;
1089310e230b6Smaya   dw[1] = v0 >> 32;
1089410e230b6Smaya}
1089510e230b6Smaya
1089610e230b6Smaya#define GEN10_SO_PRIM_STORAGE_NEEDED3_num 0x5258
1089710e230b6Smaya#define GEN10_SO_PRIM_STORAGE_NEEDED3_length      2
1089810e230b6Smayastruct GEN10_SO_PRIM_STORAGE_NEEDED3 {
1089910e230b6Smaya   uint64_t                             PrimStorageNeededCount;
1090010e230b6Smaya};
1090110e230b6Smaya
1090210e230b6Smayastatic inline void
1090310e230b6SmayaGEN10_SO_PRIM_STORAGE_NEEDED3_pack(__attribute__((unused)) __gen_user_data *data,
1090410e230b6Smaya                                   __attribute__((unused)) void * restrict dst,
1090510e230b6Smaya                                   __attribute__((unused)) const struct GEN10_SO_PRIM_STORAGE_NEEDED3 * restrict values)
1090610e230b6Smaya{
1090710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1090810e230b6Smaya
1090910e230b6Smaya   const uint64_t v0 =
1091010e230b6Smaya      __gen_uint(values->PrimStorageNeededCount, 0, 63);
1091110e230b6Smaya   dw[0] = v0;
1091210e230b6Smaya   dw[1] = v0 >> 32;
1091310e230b6Smaya}
1091410e230b6Smaya
1091510e230b6Smaya#define GEN10_SO_WRITE_OFFSET0_num        0x5280
1091610e230b6Smaya#define GEN10_SO_WRITE_OFFSET0_length          1
1091710e230b6Smayastruct GEN10_SO_WRITE_OFFSET0 {
1091810e230b6Smaya   uint64_t                             WriteOffset;
1091910e230b6Smaya};
1092010e230b6Smaya
1092110e230b6Smayastatic inline void
1092210e230b6SmayaGEN10_SO_WRITE_OFFSET0_pack(__attribute__((unused)) __gen_user_data *data,
1092310e230b6Smaya                            __attribute__((unused)) void * restrict dst,
1092410e230b6Smaya                            __attribute__((unused)) const struct GEN10_SO_WRITE_OFFSET0 * restrict values)
1092510e230b6Smaya{
1092610e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1092710e230b6Smaya
1092810e230b6Smaya   dw[0] =
1092910e230b6Smaya      __gen_offset(values->WriteOffset, 2, 31);
1093010e230b6Smaya}
1093110e230b6Smaya
1093210e230b6Smaya#define GEN10_SO_WRITE_OFFSET1_num        0x5284
1093310e230b6Smaya#define GEN10_SO_WRITE_OFFSET1_length          1
1093410e230b6Smayastruct GEN10_SO_WRITE_OFFSET1 {
1093510e230b6Smaya   uint64_t                             WriteOffset;
1093610e230b6Smaya};
1093710e230b6Smaya
1093810e230b6Smayastatic inline void
1093910e230b6SmayaGEN10_SO_WRITE_OFFSET1_pack(__attribute__((unused)) __gen_user_data *data,
1094010e230b6Smaya                            __attribute__((unused)) void * restrict dst,
1094110e230b6Smaya                            __attribute__((unused)) const struct GEN10_SO_WRITE_OFFSET1 * restrict values)
1094210e230b6Smaya{
1094310e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1094410e230b6Smaya
1094510e230b6Smaya   dw[0] =
1094610e230b6Smaya      __gen_offset(values->WriteOffset, 2, 31);
1094710e230b6Smaya}
1094810e230b6Smaya
1094910e230b6Smaya#define GEN10_SO_WRITE_OFFSET2_num        0x5288
1095010e230b6Smaya#define GEN10_SO_WRITE_OFFSET2_length          1
1095110e230b6Smayastruct GEN10_SO_WRITE_OFFSET2 {
1095210e230b6Smaya   uint64_t                             WriteOffset;
1095310e230b6Smaya};
1095410e230b6Smaya
1095510e230b6Smayastatic inline void
1095610e230b6SmayaGEN10_SO_WRITE_OFFSET2_pack(__attribute__((unused)) __gen_user_data *data,
1095710e230b6Smaya                            __attribute__((unused)) void * restrict dst,
1095810e230b6Smaya                            __attribute__((unused)) const struct GEN10_SO_WRITE_OFFSET2 * restrict values)
1095910e230b6Smaya{
1096010e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1096110e230b6Smaya
1096210e230b6Smaya   dw[0] =
1096310e230b6Smaya      __gen_offset(values->WriteOffset, 2, 31);
1096410e230b6Smaya}
1096510e230b6Smaya
1096610e230b6Smaya#define GEN10_SO_WRITE_OFFSET3_num        0x528c
1096710e230b6Smaya#define GEN10_SO_WRITE_OFFSET3_length          1
1096810e230b6Smayastruct GEN10_SO_WRITE_OFFSET3 {
1096910e230b6Smaya   uint64_t                             WriteOffset;
1097010e230b6Smaya};
1097110e230b6Smaya
1097210e230b6Smayastatic inline void
1097310e230b6SmayaGEN10_SO_WRITE_OFFSET3_pack(__attribute__((unused)) __gen_user_data *data,
1097410e230b6Smaya                            __attribute__((unused)) void * restrict dst,
1097510e230b6Smaya                            __attribute__((unused)) const struct GEN10_SO_WRITE_OFFSET3 * restrict values)
1097610e230b6Smaya{
1097710e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1097810e230b6Smaya
1097910e230b6Smaya   dw[0] =
1098010e230b6Smaya      __gen_offset(values->WriteOffset, 2, 31);
1098110e230b6Smaya}
1098210e230b6Smaya
1098310e230b6Smaya#define GEN10_VCS_INSTDONE_num            0x1206c
1098410e230b6Smaya#define GEN10_VCS_INSTDONE_length              1
1098510e230b6Smayastruct GEN10_VCS_INSTDONE {
1098610e230b6Smaya   bool                                 RingEnable;
1098710e230b6Smaya   bool                                 USBDone;
1098810e230b6Smaya   bool                                 QRCDone;
1098910e230b6Smaya   bool                                 SECDone;
1099010e230b6Smaya   bool                                 MPCDone;
1099110e230b6Smaya   bool                                 VFTDone;
1099210e230b6Smaya   bool                                 BSPDone;
1099310e230b6Smaya   bool                                 VLFDone;
1099410e230b6Smaya   bool                                 VOPDone;
1099510e230b6Smaya   bool                                 VMCDone;
1099610e230b6Smaya   bool                                 VIPDone;
1099710e230b6Smaya   bool                                 VITDone;
1099810e230b6Smaya   bool                                 VDSDone;
1099910e230b6Smaya   bool                                 VMXDone;
1100010e230b6Smaya   bool                                 VCPDone;
1100110e230b6Smaya   bool                                 VCDDone;
1100210e230b6Smaya   bool                                 VADDone;
1100310e230b6Smaya   bool                                 VMDDone;
1100410e230b6Smaya   bool                                 VISDone;
1100510e230b6Smaya   bool                                 VACDone;
1100610e230b6Smaya   bool                                 VAMDone;
1100710e230b6Smaya   bool                                 JPGDone;
1100810e230b6Smaya   bool                                 VBPDone;
1100910e230b6Smaya   bool                                 VHRDone;
1101010e230b6Smaya   bool                                 VCIDone;
1101110e230b6Smaya   bool                                 VCRDone;
1101210e230b6Smaya   bool                                 VINDone;
1101310e230b6Smaya   bool                                 VPRDone;
1101410e230b6Smaya   bool                                 VTQDone;
1101510e230b6Smaya   bool                                 Reserved;
1101610e230b6Smaya   bool                                 VCSDone;
1101710e230b6Smaya   bool                                 GACDone;
1101810e230b6Smaya};
1101910e230b6Smaya
1102010e230b6Smayastatic inline void
1102110e230b6SmayaGEN10_VCS_INSTDONE_pack(__attribute__((unused)) __gen_user_data *data,
1102210e230b6Smaya                        __attribute__((unused)) void * restrict dst,
1102310e230b6Smaya                        __attribute__((unused)) const struct GEN10_VCS_INSTDONE * restrict values)
1102410e230b6Smaya{
1102510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1102610e230b6Smaya
1102710e230b6Smaya   dw[0] =
1102810e230b6Smaya      __gen_uint(values->RingEnable, 0, 0) |
1102910e230b6Smaya      __gen_uint(values->USBDone, 1, 1) |
1103010e230b6Smaya      __gen_uint(values->QRCDone, 2, 2) |
1103110e230b6Smaya      __gen_uint(values->SECDone, 3, 3) |
1103210e230b6Smaya      __gen_uint(values->MPCDone, 4, 4) |
1103310e230b6Smaya      __gen_uint(values->VFTDone, 5, 5) |
1103410e230b6Smaya      __gen_uint(values->BSPDone, 6, 6) |
1103510e230b6Smaya      __gen_uint(values->VLFDone, 7, 7) |
1103610e230b6Smaya      __gen_uint(values->VOPDone, 8, 8) |
1103710e230b6Smaya      __gen_uint(values->VMCDone, 9, 9) |
1103810e230b6Smaya      __gen_uint(values->VIPDone, 10, 10) |
1103910e230b6Smaya      __gen_uint(values->VITDone, 11, 11) |
1104010e230b6Smaya      __gen_uint(values->VDSDone, 12, 12) |
1104110e230b6Smaya      __gen_uint(values->VMXDone, 13, 13) |
1104210e230b6Smaya      __gen_uint(values->VCPDone, 14, 14) |
1104310e230b6Smaya      __gen_uint(values->VCDDone, 15, 15) |
1104410e230b6Smaya      __gen_uint(values->VADDone, 16, 16) |
1104510e230b6Smaya      __gen_uint(values->VMDDone, 17, 17) |
1104610e230b6Smaya      __gen_uint(values->VISDone, 18, 18) |
1104710e230b6Smaya      __gen_uint(values->VACDone, 19, 19) |
1104810e230b6Smaya      __gen_uint(values->VAMDone, 20, 20) |
1104910e230b6Smaya      __gen_uint(values->JPGDone, 21, 21) |
1105010e230b6Smaya      __gen_uint(values->VBPDone, 22, 22) |
1105110e230b6Smaya      __gen_uint(values->VHRDone, 23, 23) |
1105210e230b6Smaya      __gen_uint(values->VCIDone, 24, 24) |
1105310e230b6Smaya      __gen_uint(values->VCRDone, 25, 25) |
1105410e230b6Smaya      __gen_uint(values->VINDone, 26, 26) |
1105510e230b6Smaya      __gen_uint(values->VPRDone, 27, 27) |
1105610e230b6Smaya      __gen_uint(values->VTQDone, 28, 28) |
1105710e230b6Smaya      __gen_uint(values->Reserved, 29, 29) |
1105810e230b6Smaya      __gen_uint(values->VCSDone, 30, 30) |
1105910e230b6Smaya      __gen_uint(values->GACDone, 31, 31);
1106010e230b6Smaya}
1106110e230b6Smaya
1106210e230b6Smaya#define GEN10_VECS_INSTDONE_num           0x1a06c
1106310e230b6Smaya#define GEN10_VECS_INSTDONE_length             1
1106410e230b6Smayastruct GEN10_VECS_INSTDONE {
1106510e230b6Smaya   bool                                 RingEnable;
1106610e230b6Smaya   bool                                 VECSDone;
1106710e230b6Smaya   bool                                 GAMDone;
1106810e230b6Smaya};
1106910e230b6Smaya
1107010e230b6Smayastatic inline void
1107110e230b6SmayaGEN10_VECS_INSTDONE_pack(__attribute__((unused)) __gen_user_data *data,
1107210e230b6Smaya                         __attribute__((unused)) void * restrict dst,
1107310e230b6Smaya                         __attribute__((unused)) const struct GEN10_VECS_INSTDONE * restrict values)
1107410e230b6Smaya{
1107510e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1107610e230b6Smaya
1107710e230b6Smaya   dw[0] =
1107810e230b6Smaya      __gen_uint(values->RingEnable, 0, 0) |
1107910e230b6Smaya      __gen_uint(values->VECSDone, 30, 30) |
1108010e230b6Smaya      __gen_uint(values->GAMDone, 31, 31);
1108110e230b6Smaya}
1108210e230b6Smaya
1108310e230b6Smaya#define GEN10_VS_INVOCATION_COUNT_num     0x2320
1108410e230b6Smaya#define GEN10_VS_INVOCATION_COUNT_length       2
1108510e230b6Smayastruct GEN10_VS_INVOCATION_COUNT {
1108610e230b6Smaya   uint64_t                             VSInvocationCountReport;
1108710e230b6Smaya};
1108810e230b6Smaya
1108910e230b6Smayastatic inline void
1109010e230b6SmayaGEN10_VS_INVOCATION_COUNT_pack(__attribute__((unused)) __gen_user_data *data,
1109110e230b6Smaya                               __attribute__((unused)) void * restrict dst,
1109210e230b6Smaya                               __attribute__((unused)) const struct GEN10_VS_INVOCATION_COUNT * restrict values)
1109310e230b6Smaya{
1109410e230b6Smaya   uint32_t * restrict dw = (uint32_t * restrict) dst;
1109510e230b6Smaya
1109610e230b6Smaya   const uint64_t v0 =
1109710e230b6Smaya      __gen_uint(values->VSInvocationCountReport, 0, 63);
1109810e230b6Smaya   dw[0] = v0;
1109910e230b6Smaya   dw[1] = v0 >> 32;
1110010e230b6Smaya}
1110110e230b6Smaya
1110210e230b6Smaya#endif /* GEN10_PACK_H */
11103