1bf215546Sopenharmony_ci/**************************************************************************
2bf215546Sopenharmony_ci *
3bf215546Sopenharmony_ci * Copyright 1998-2022 VMware, Inc.
4bf215546Sopenharmony_ci * SPDX-License-Identifier: GPL-2.0 OR MIT
5bf215546Sopenharmony_ci *
6bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
7bf215546Sopenharmony_ci * copy of this software and associated documentation files (the
8bf215546Sopenharmony_ci * "Software"), to deal in the Software without restriction, including
9bf215546Sopenharmony_ci * without limitation the rights to use, copy, modify, merge, publish,
10bf215546Sopenharmony_ci * distribute, sub license, and/or sell copies of the Software, and to
11bf215546Sopenharmony_ci * permit persons to whom the Software is furnished to do so, subject to
12bf215546Sopenharmony_ci * the following conditions:
13bf215546Sopenharmony_ci *
14bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the
15bf215546Sopenharmony_ci * next paragraph) shall be included in all copies or substantial portions
16bf215546Sopenharmony_ci * of the Software.
17bf215546Sopenharmony_ci *
18bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21bf215546Sopenharmony_ci * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
22bf215546Sopenharmony_ci * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23bf215546Sopenharmony_ci * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24bf215546Sopenharmony_ci * USE OR OTHER DEALINGS IN THE SOFTWARE.
25bf215546Sopenharmony_ci *
26bf215546Sopenharmony_ci **************************************************************************/
27bf215546Sopenharmony_ci
28bf215546Sopenharmony_ci/*
29bf215546Sopenharmony_ci * svga3d_surfacedefs.h --
30bf215546Sopenharmony_ci *
31bf215546Sopenharmony_ci *       Surface/format/image helper code.
32bf215546Sopenharmony_ci */
33bf215546Sopenharmony_ci
34bf215546Sopenharmony_ci#ifndef SVGA3D_SURFACEDEFS_H
35bf215546Sopenharmony_ci#define SVGA3D_SURFACEDEFS_H
36bf215546Sopenharmony_ci
37bf215546Sopenharmony_ci#include "svga3d_reg.h"
38bf215546Sopenharmony_ci
39bf215546Sopenharmony_ci#define max_t(type, x, y)  ((x) > (y) ? (x) : (y))
40bf215546Sopenharmony_ci
41bf215546Sopenharmony_ci/*
42bf215546Sopenharmony_ci * enum svga3d_block_desc describes the active data channels in a block.
43bf215546Sopenharmony_ci *
44bf215546Sopenharmony_ci * There can be at-most four active channels in a block:
45bf215546Sopenharmony_ci *    1. Red, bump W, luminance and depth are stored in the first channel.
46bf215546Sopenharmony_ci *    2. Green, bump V and stencil are stored in the second channel.
47bf215546Sopenharmony_ci *    3. Blue and bump U are stored in the third channel.
48bf215546Sopenharmony_ci *    4. Alpha and bump Q are stored in the fourth channel.
49bf215546Sopenharmony_ci *
50bf215546Sopenharmony_ci * Block channels can be used to store compressed and buffer data:
51bf215546Sopenharmony_ci *    1. For compressed formats, only the data channel is used and its size
52bf215546Sopenharmony_ci *       is equal to that of a singular block in the compression scheme.
53bf215546Sopenharmony_ci *    2. For buffer formats, only the data channel is used and its size is
54bf215546Sopenharmony_ci *       exactly one byte in length.
55bf215546Sopenharmony_ci *    3. In each case the bit depth represent the size of a singular block.
56bf215546Sopenharmony_ci *
57bf215546Sopenharmony_ci * Note: Compressed and IEEE formats do not use the bitMask structure.
58bf215546Sopenharmony_ci */
59bf215546Sopenharmony_ci
60bf215546Sopenharmony_cienum svga3d_block_desc {
61bf215546Sopenharmony_ci
62bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_NONE        = 0,         /* No channels are active */
63bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BLUE        = 1 << 0,    /* Block with red channel data */
64bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_W           = 1 << 0,
65bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BUMP_L      = 1 << 0,
66bf215546Sopenharmony_ci
67bf215546Sopenharmony_ci   /* Format contains Green/V data */
68bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_GREEN       = 1 << 1,
69bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_V           = 1 << 1,
70bf215546Sopenharmony_ci
71bf215546Sopenharmony_ci   /* Format contains Red/W/Luminance data */
72bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RED         = 1 << 2,
73bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_U           = 1 << 2,
74bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_LUMINANCE   = 1 << 2,
75bf215546Sopenharmony_ci
76bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_ALPHA       = 1 << 3,    /* Block with an alpha channel */
77bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_Q           = 1 << 3,    /* Block with bump Q channel data */
78bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BUFFER      = 1 << 4,    /* Block stores 1 byte of data */
79bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_COMPRESSED  = 1 << 5,    /* Block stores n bytes of data depending
80bf215546Sopenharmony_ci                                               on the compression method used */
81bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_FP          = 1 << 6,
82bf215546Sopenharmony_ci
83bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_PLANAR_YUV  = 1 << 7,
84bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_2PLANAR_YUV = 1 << 8,
85bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_3PLANAR_YUV = 1 << 9,
86bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_STENCIL     = 1 << 11,
87bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_TYPELESS    = 1 << 12,
88bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_SINT        = 1 << 13,
89bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_UINT        = 1 << 14,
90bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_NORM        = 1 << 15,
91bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_SRGB        = 1 << 16,
92bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_EXP         = 1 << 17,
93bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_COLOR       = 1 << 18,
94bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_DEPTH       = 1 << 19,
95bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BUMP        = 1 << 20,
96bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_YUV_VIDEO   = 1 << 21,
97bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_MIXED       = 1 << 22,
98bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_CX          = 1 << 23,
99bf215546Sopenharmony_ci
100bf215546Sopenharmony_ci   /* Different compressed format groups. */
101bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC1         = 1 << 24,
102bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC2         = 1 << 25,
103bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC3         = 1 << 26,
104bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC4         = 1 << 27,
105bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC5         = 1 << 28,
106bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC6H        = 1 << 29,
107bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC7         = 1 << 30,
108bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_COMPRESSED_MASK = SVGA3DBLOCKDESC_BC1  |
109bf215546Sopenharmony_ci                                     SVGA3DBLOCKDESC_BC2  |
110bf215546Sopenharmony_ci                                     SVGA3DBLOCKDESC_BC3  |
111bf215546Sopenharmony_ci                                     SVGA3DBLOCKDESC_BC4  |
112bf215546Sopenharmony_ci                                     SVGA3DBLOCKDESC_BC5  |
113bf215546Sopenharmony_ci                                     SVGA3DBLOCKDESC_BC6H |
114bf215546Sopenharmony_ci                                     SVGA3DBLOCKDESC_BC7,
115bf215546Sopenharmony_ci
116bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_A_UINT    = SVGA3DBLOCKDESC_ALPHA |
117bf215546Sopenharmony_ci                               SVGA3DBLOCKDESC_UINT |
118bf215546Sopenharmony_ci                               SVGA3DBLOCKDESC_COLOR,
119bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_A_UNORM   = SVGA3DBLOCKDESC_A_UINT |
120bf215546Sopenharmony_ci                               SVGA3DBLOCKDESC_NORM,
121bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_R_UINT    = SVGA3DBLOCKDESC_RED |
122bf215546Sopenharmony_ci                               SVGA3DBLOCKDESC_UINT |
123bf215546Sopenharmony_ci                               SVGA3DBLOCKDESC_COLOR,
124bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_R_UNORM   = SVGA3DBLOCKDESC_R_UINT |
125bf215546Sopenharmony_ci                               SVGA3DBLOCKDESC_NORM,
126bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_R_SINT    = SVGA3DBLOCKDESC_RED |
127bf215546Sopenharmony_ci                               SVGA3DBLOCKDESC_SINT |
128bf215546Sopenharmony_ci                               SVGA3DBLOCKDESC_COLOR,
129bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_R_SNORM   = SVGA3DBLOCKDESC_R_SINT |
130bf215546Sopenharmony_ci                               SVGA3DBLOCKDESC_NORM,
131bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_G_UINT    = SVGA3DBLOCKDESC_GREEN |
132bf215546Sopenharmony_ci                               SVGA3DBLOCKDESC_UINT |
133bf215546Sopenharmony_ci                               SVGA3DBLOCKDESC_COLOR,
134bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RG_UINT    = SVGA3DBLOCKDESC_RED |
135bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_GREEN |
136bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_UINT |
137bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
138bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RG_UNORM   = SVGA3DBLOCKDESC_RG_UINT |
139bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_NORM,
140bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RG_SINT    = SVGA3DBLOCKDESC_RED |
141bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_GREEN |
142bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_SINT |
143bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
144bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RG_SNORM   = SVGA3DBLOCKDESC_RG_SINT |
145bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_NORM,
146bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RGB_UINT   = SVGA3DBLOCKDESC_RED |
147bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_GREEN |
148bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_BLUE |
149bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_UINT |
150bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
151bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RGB_SINT   = SVGA3DBLOCKDESC_RED |
152bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_GREEN |
153bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_BLUE |
154bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_SINT |
155bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
156bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RGB_UNORM   = SVGA3DBLOCKDESC_RGB_UINT |
157bf215546Sopenharmony_ci                                 SVGA3DBLOCKDESC_NORM,
158bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RGB_UNORM_SRGB = SVGA3DBLOCKDESC_RGB_UNORM |
159bf215546Sopenharmony_ci                                    SVGA3DBLOCKDESC_SRGB,
160bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RGBA_UINT  = SVGA3DBLOCKDESC_RED |
161bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_GREEN |
162bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_BLUE |
163bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_ALPHA |
164bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_UINT |
165bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
166bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RGBA_UNORM = SVGA3DBLOCKDESC_RGBA_UINT |
167bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_NORM,
168bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RGBA_UNORM_SRGB = SVGA3DBLOCKDESC_RGBA_UNORM |
169bf215546Sopenharmony_ci                                     SVGA3DBLOCKDESC_SRGB,
170bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RGBA_SINT  = SVGA3DBLOCKDESC_RED |
171bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_GREEN |
172bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_BLUE |
173bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_ALPHA |
174bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_SINT |
175bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
176bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RGBA_SNORM = SVGA3DBLOCKDESC_RGBA_SINT |
177bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_NORM,
178bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RGBA_FP    = SVGA3DBLOCKDESC_RED |
179bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_GREEN |
180bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_BLUE |
181bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_ALPHA |
182bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_FP |
183bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
184bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_UV         = SVGA3DBLOCKDESC_U |
185bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_V |
186bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_BUMP,
187bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_UVL        = SVGA3DBLOCKDESC_UV |
188bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_BUMP_L |
189bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_MIXED |
190bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_BUMP,
191bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_UVW        = SVGA3DBLOCKDESC_UV |
192bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_W |
193bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_BUMP,
194bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_UVWA       = SVGA3DBLOCKDESC_UVW |
195bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_ALPHA |
196bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_MIXED |
197bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_BUMP,
198bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_UVWQ       = SVGA3DBLOCKDESC_U |
199bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_V |
200bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_W |
201bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_Q |
202bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_BUMP,
203bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_L_UNORM    = SVGA3DBLOCKDESC_LUMINANCE |
204bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_UINT |
205bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_NORM |
206bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
207bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_LA_UNORM   = SVGA3DBLOCKDESC_LUMINANCE |
208bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_ALPHA |
209bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_UINT |
210bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_NORM |
211bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
212bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_R_FP       = SVGA3DBLOCKDESC_RED |
213bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_FP |
214bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
215bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RG_FP      = SVGA3DBLOCKDESC_R_FP |
216bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_GREEN |
217bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
218bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RGB_FP     = SVGA3DBLOCKDESC_RG_FP |
219bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_BLUE |
220bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
221bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_YUV        = SVGA3DBLOCKDESC_YUV_VIDEO |
222bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
223bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_AYUV       = SVGA3DBLOCKDESC_ALPHA |
224bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_YUV_VIDEO |
225bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
226bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_RGB_EXP       = SVGA3DBLOCKDESC_RED |
227bf215546Sopenharmony_ci                                   SVGA3DBLOCKDESC_GREEN |
228bf215546Sopenharmony_ci                                   SVGA3DBLOCKDESC_BLUE |
229bf215546Sopenharmony_ci                                   SVGA3DBLOCKDESC_EXP |
230bf215546Sopenharmony_ci                                   SVGA3DBLOCKDESC_COLOR,
231bf215546Sopenharmony_ci
232bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_COMP_TYPELESS = SVGA3DBLOCKDESC_COMPRESSED |
233bf215546Sopenharmony_ci                                   SVGA3DBLOCKDESC_TYPELESS,
234bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_COMP_UNORM = SVGA3DBLOCKDESC_COMPRESSED |
235bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_UINT |
236bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_NORM |
237bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
238bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_COMP_SNORM = SVGA3DBLOCKDESC_COMPRESSED |
239bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_SINT |
240bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_NORM |
241bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
242bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_COMP_UNORM_SRGB = SVGA3DBLOCKDESC_COMP_UNORM |
243bf215546Sopenharmony_ci                                     SVGA3DBLOCKDESC_SRGB,
244bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC1_COMP_TYPELESS = SVGA3DBLOCKDESC_BC1 |
245bf215546Sopenharmony_ci                                       SVGA3DBLOCKDESC_COMP_TYPELESS,
246bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC1_COMP_UNORM = SVGA3DBLOCKDESC_BC1 |
247bf215546Sopenharmony_ci                                    SVGA3DBLOCKDESC_COMP_UNORM,
248bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC1_COMP_UNORM_SRGB = SVGA3DBLOCKDESC_BC1_COMP_UNORM |
249bf215546Sopenharmony_ci                                         SVGA3DBLOCKDESC_SRGB,
250bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC2_COMP_TYPELESS = SVGA3DBLOCKDESC_BC2 |
251bf215546Sopenharmony_ci                                       SVGA3DBLOCKDESC_COMP_TYPELESS,
252bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC2_COMP_UNORM = SVGA3DBLOCKDESC_BC2 |
253bf215546Sopenharmony_ci                                    SVGA3DBLOCKDESC_COMP_UNORM,
254bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC2_COMP_UNORM_SRGB = SVGA3DBLOCKDESC_BC2_COMP_UNORM |
255bf215546Sopenharmony_ci                                         SVGA3DBLOCKDESC_SRGB,
256bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC3_COMP_TYPELESS = SVGA3DBLOCKDESC_BC3 |
257bf215546Sopenharmony_ci                                       SVGA3DBLOCKDESC_COMP_TYPELESS,
258bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC3_COMP_UNORM = SVGA3DBLOCKDESC_BC3 |
259bf215546Sopenharmony_ci                                    SVGA3DBLOCKDESC_COMP_UNORM,
260bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC3_COMP_UNORM_SRGB = SVGA3DBLOCKDESC_BC3_COMP_UNORM |
261bf215546Sopenharmony_ci                                         SVGA3DBLOCKDESC_SRGB,
262bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC4_COMP_TYPELESS = SVGA3DBLOCKDESC_BC4 |
263bf215546Sopenharmony_ci                                       SVGA3DBLOCKDESC_COMP_TYPELESS,
264bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC4_COMP_UNORM = SVGA3DBLOCKDESC_BC4 |
265bf215546Sopenharmony_ci                                    SVGA3DBLOCKDESC_COMP_UNORM,
266bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC4_COMP_SNORM = SVGA3DBLOCKDESC_BC4 |
267bf215546Sopenharmony_ci                                    SVGA3DBLOCKDESC_COMP_SNORM,
268bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC5_COMP_TYPELESS = SVGA3DBLOCKDESC_BC5 |
269bf215546Sopenharmony_ci                                       SVGA3DBLOCKDESC_COMP_TYPELESS,
270bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC5_COMP_UNORM = SVGA3DBLOCKDESC_BC5 |
271bf215546Sopenharmony_ci                                    SVGA3DBLOCKDESC_COMP_UNORM,
272bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC5_COMP_SNORM = SVGA3DBLOCKDESC_BC5 |
273bf215546Sopenharmony_ci                                    SVGA3DBLOCKDESC_COMP_SNORM,
274bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC6H_COMP_TYPELESS = SVGA3DBLOCKDESC_BC6H |
275bf215546Sopenharmony_ci                                        SVGA3DBLOCKDESC_COMP_TYPELESS,
276bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC6H_COMP_UF16 = SVGA3DBLOCKDESC_BC6H |
277bf215546Sopenharmony_ci                                    SVGA3DBLOCKDESC_COMPRESSED,
278bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC6H_COMP_SF16 = SVGA3DBLOCKDESC_BC6H |
279bf215546Sopenharmony_ci                                    SVGA3DBLOCKDESC_COMPRESSED,
280bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC7_COMP_TYPELESS = SVGA3DBLOCKDESC_BC7 |
281bf215546Sopenharmony_ci                                       SVGA3DBLOCKDESC_COMP_TYPELESS,
282bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC7_COMP_UNORM = SVGA3DBLOCKDESC_BC7 |
283bf215546Sopenharmony_ci                                    SVGA3DBLOCKDESC_COMP_UNORM,
284bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_BC7_COMP_UNORM_SRGB = SVGA3DBLOCKDESC_BC7_COMP_UNORM |
285bf215546Sopenharmony_ci                                         SVGA3DBLOCKDESC_SRGB,
286bf215546Sopenharmony_ci
287bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_NV12       = SVGA3DBLOCKDESC_YUV_VIDEO |
288bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_PLANAR_YUV |
289bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_2PLANAR_YUV |
290bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
291bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_YV12       = SVGA3DBLOCKDESC_YUV_VIDEO |
292bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_PLANAR_YUV |
293bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_3PLANAR_YUV |
294bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_COLOR,
295bf215546Sopenharmony_ci
296bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_DEPTH_UINT = SVGA3DBLOCKDESC_DEPTH |
297bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_UINT,
298bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_DEPTH_UNORM = SVGA3DBLOCKDESC_DEPTH_UINT |
299bf215546Sopenharmony_ci                                 SVGA3DBLOCKDESC_NORM,
300bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_DS      =    SVGA3DBLOCKDESC_DEPTH |
301bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_STENCIL,
302bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_DS_UINT =    SVGA3DBLOCKDESC_DEPTH |
303bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_STENCIL |
304bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_UINT,
305bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_DS_UNORM =   SVGA3DBLOCKDESC_DS_UINT |
306bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_NORM,
307bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_DEPTH_FP   = SVGA3DBLOCKDESC_DEPTH |
308bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_FP,
309bf215546Sopenharmony_ci
310bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_UV_UINT    = SVGA3DBLOCKDESC_UV |
311bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_UINT,
312bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_UV_SNORM   = SVGA3DBLOCKDESC_UV |
313bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_SINT |
314bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_NORM,
315bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_UVCX_SNORM = SVGA3DBLOCKDESC_UV_SNORM |
316bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_CX,
317bf215546Sopenharmony_ci   SVGA3DBLOCKDESC_UVWQ_SNORM = SVGA3DBLOCKDESC_UVWQ |
318bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_SINT |
319bf215546Sopenharmony_ci                                SVGA3DBLOCKDESC_NORM,
320bf215546Sopenharmony_ci};
321bf215546Sopenharmony_ci
322bf215546Sopenharmony_ci
323bf215546Sopenharmony_citypedef struct SVGA3dChannelDef {
324bf215546Sopenharmony_ci	union {
325bf215546Sopenharmony_ci		uint8 blue;
326bf215546Sopenharmony_ci		uint8 w_bump;
327bf215546Sopenharmony_ci		uint8 l_bump;
328bf215546Sopenharmony_ci		uint8 uv_video;
329bf215546Sopenharmony_ci		uint8 u_video;
330bf215546Sopenharmony_ci	};
331bf215546Sopenharmony_ci	union {
332bf215546Sopenharmony_ci		uint8 green;
333bf215546Sopenharmony_ci		uint8 stencil;
334bf215546Sopenharmony_ci		uint8 v_bump;
335bf215546Sopenharmony_ci		uint8 v_video;
336bf215546Sopenharmony_ci	};
337bf215546Sopenharmony_ci	union {
338bf215546Sopenharmony_ci		uint8 red;
339bf215546Sopenharmony_ci		uint8 u_bump;
340bf215546Sopenharmony_ci		uint8 luminance;
341bf215546Sopenharmony_ci		uint8 y_video;
342bf215546Sopenharmony_ci		uint8 depth;
343bf215546Sopenharmony_ci		uint8 data;
344bf215546Sopenharmony_ci	};
345bf215546Sopenharmony_ci	union {
346bf215546Sopenharmony_ci		uint8 alpha;
347bf215546Sopenharmony_ci		uint8 q_bump;
348bf215546Sopenharmony_ci		uint8 exp;
349bf215546Sopenharmony_ci	};
350bf215546Sopenharmony_ci} SVGA3dChannelDef;
351bf215546Sopenharmony_ci
352bf215546Sopenharmony_cistruct svga3d_surface_desc {
353bf215546Sopenharmony_ci   SVGA3dSurfaceFormat format;
354bf215546Sopenharmony_ci   enum svga3d_block_desc block_desc;
355bf215546Sopenharmony_ci
356bf215546Sopenharmony_ci   SVGA3dSize block_size;
357bf215546Sopenharmony_ci   uint32 bytes_per_block;
358bf215546Sopenharmony_ci   uint32 pitch_bytes_per_block;
359bf215546Sopenharmony_ci
360bf215546Sopenharmony_ci	SVGA3dChannelDef bitDepth;
361bf215546Sopenharmony_ci	SVGA3dChannelDef bitOffset;
362bf215546Sopenharmony_ci};
363bf215546Sopenharmony_ci
364bf215546Sopenharmony_cistatic const struct svga3d_surface_desc svga3d_surface_descs[] = {
365bf215546Sopenharmony_ci   {SVGA3D_FORMAT_INVALID, SVGA3DBLOCKDESC_NONE,
366bf215546Sopenharmony_ci      {1, 1, 1},  0, 0,
367bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}},
368bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
369bf215546Sopenharmony_ci
370bf215546Sopenharmony_ci   {SVGA3D_X8R8G8B8, SVGA3DBLOCKDESC_RGB_UNORM,
371bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
372bf215546Sopenharmony_ci      {{8}, {8}, {8}, {0}},
373bf215546Sopenharmony_ci      {{0}, {8}, {16}, {24}}},
374bf215546Sopenharmony_ci
375bf215546Sopenharmony_ci   {SVGA3D_A8R8G8B8, SVGA3DBLOCKDESC_RGBA_UNORM,
376bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
377bf215546Sopenharmony_ci      {{8}, {8}, {8}, {8}},
378bf215546Sopenharmony_ci      {{0}, {8}, {16}, {24}}},
379bf215546Sopenharmony_ci
380bf215546Sopenharmony_ci   {SVGA3D_R5G6B5, SVGA3DBLOCKDESC_RGB_UNORM,
381bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
382bf215546Sopenharmony_ci      {{5}, {6}, {5}, {0}},
383bf215546Sopenharmony_ci      {{0}, {5}, {11}, {0}}},
384bf215546Sopenharmony_ci
385bf215546Sopenharmony_ci   {SVGA3D_X1R5G5B5, SVGA3DBLOCKDESC_RGB_UNORM,
386bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
387bf215546Sopenharmony_ci      {{5}, {5}, {5}, {0}},
388bf215546Sopenharmony_ci      {{0}, {5}, {10}, {0}}},
389bf215546Sopenharmony_ci
390bf215546Sopenharmony_ci   {SVGA3D_A1R5G5B5, SVGA3DBLOCKDESC_RGBA_UNORM,
391bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
392bf215546Sopenharmony_ci      {{5}, {5}, {5}, {1}},
393bf215546Sopenharmony_ci      {{0}, {5}, {10}, {15}}},
394bf215546Sopenharmony_ci
395bf215546Sopenharmony_ci   {SVGA3D_A4R4G4B4, SVGA3DBLOCKDESC_RGBA_UNORM,
396bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
397bf215546Sopenharmony_ci      {{4}, {4}, {4}, {4}},
398bf215546Sopenharmony_ci      {{0}, {4}, {8}, {12}}},
399bf215546Sopenharmony_ci
400bf215546Sopenharmony_ci   {SVGA3D_Z_D32, SVGA3DBLOCKDESC_DEPTH_UNORM,
401bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
402bf215546Sopenharmony_ci      {{0}, {0}, {32}, {0}},
403bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
404bf215546Sopenharmony_ci
405bf215546Sopenharmony_ci   {SVGA3D_Z_D16, SVGA3DBLOCKDESC_DEPTH_UNORM,
406bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
407bf215546Sopenharmony_ci      {{0}, {0}, {16}, {0}},
408bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
409bf215546Sopenharmony_ci
410bf215546Sopenharmony_ci   {SVGA3D_Z_D24S8, SVGA3DBLOCKDESC_DS_UNORM,
411bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
412bf215546Sopenharmony_ci      {{0}, {8}, {24}, {0}},
413bf215546Sopenharmony_ci      {{0}, {0}, {8}, {0}}},
414bf215546Sopenharmony_ci
415bf215546Sopenharmony_ci   {SVGA3D_Z_D15S1, SVGA3DBLOCKDESC_DS_UNORM,
416bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
417bf215546Sopenharmony_ci      {{0}, {1}, {15}, {0}},
418bf215546Sopenharmony_ci      {{0}, {0}, {1}, {0}}},
419bf215546Sopenharmony_ci
420bf215546Sopenharmony_ci   {SVGA3D_LUMINANCE8, SVGA3DBLOCKDESC_L_UNORM,
421bf215546Sopenharmony_ci      {1, 1, 1},  1, 1,
422bf215546Sopenharmony_ci      {{0}, {0}, {8}, {0}},
423bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
424bf215546Sopenharmony_ci
425bf215546Sopenharmony_ci   {SVGA3D_LUMINANCE4_ALPHA4, SVGA3DBLOCKDESC_LA_UNORM,
426bf215546Sopenharmony_ci      {1, 1, 1},  1, 1,
427bf215546Sopenharmony_ci      {{0}, {0}, {4}, {4}},
428bf215546Sopenharmony_ci      {{0}, {0}, {0}, {4}}},
429bf215546Sopenharmony_ci
430bf215546Sopenharmony_ci   {SVGA3D_LUMINANCE16, SVGA3DBLOCKDESC_L_UNORM,
431bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
432bf215546Sopenharmony_ci      {{0}, {0}, {16}, {0}},
433bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
434bf215546Sopenharmony_ci
435bf215546Sopenharmony_ci   {SVGA3D_LUMINANCE8_ALPHA8, SVGA3DBLOCKDESC_LA_UNORM,
436bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
437bf215546Sopenharmony_ci      {{0}, {0}, {8}, {8}},
438bf215546Sopenharmony_ci      {{0}, {0}, {0}, {8}}},
439bf215546Sopenharmony_ci
440bf215546Sopenharmony_ci   {SVGA3D_DXT1, SVGA3DBLOCKDESC_BC1_COMP_UNORM,
441bf215546Sopenharmony_ci      {4, 4, 1},  8, 8,
442bf215546Sopenharmony_ci      {{0}, {0}, {64}, {0}},
443bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
444bf215546Sopenharmony_ci
445bf215546Sopenharmony_ci   {SVGA3D_DXT2, SVGA3DBLOCKDESC_BC2_COMP_UNORM,
446bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
447bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
448bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
449bf215546Sopenharmony_ci
450bf215546Sopenharmony_ci   {SVGA3D_DXT3, SVGA3DBLOCKDESC_BC2_COMP_UNORM,
451bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
452bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
453bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
454bf215546Sopenharmony_ci
455bf215546Sopenharmony_ci   {SVGA3D_DXT4, SVGA3DBLOCKDESC_BC3_COMP_UNORM,
456bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
457bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
458bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
459bf215546Sopenharmony_ci
460bf215546Sopenharmony_ci   {SVGA3D_DXT5, SVGA3DBLOCKDESC_BC3_COMP_UNORM,
461bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
462bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
463bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
464bf215546Sopenharmony_ci
465bf215546Sopenharmony_ci   {SVGA3D_BUMPU8V8, SVGA3DBLOCKDESC_UV_SNORM,
466bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
467bf215546Sopenharmony_ci      {{0}, {8}, {8}, {0}},
468bf215546Sopenharmony_ci      {{0}, {8}, {0}, {0}}},
469bf215546Sopenharmony_ci
470bf215546Sopenharmony_ci   {SVGA3D_BUMPL6V5U5, SVGA3DBLOCKDESC_UVL,
471bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
472bf215546Sopenharmony_ci      {{6}, {5}, {5}, {0}},
473bf215546Sopenharmony_ci      {{10}, {5}, {0}, {0}}},
474bf215546Sopenharmony_ci
475bf215546Sopenharmony_ci   {SVGA3D_BUMPX8L8V8U8, SVGA3DBLOCKDESC_UVL,
476bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
477bf215546Sopenharmony_ci      {{8}, {8}, {8}, {0}},
478bf215546Sopenharmony_ci      {{16}, {8}, {0}, {0}}},
479bf215546Sopenharmony_ci
480bf215546Sopenharmony_ci   {SVGA3D_FORMAT_DEAD1, SVGA3DBLOCKDESC_NONE,
481bf215546Sopenharmony_ci      {1, 1, 1},  3, 3,
482bf215546Sopenharmony_ci      {{8}, {8}, {8}, {0}},
483bf215546Sopenharmony_ci      {{16}, {8}, {0}, {0}}},
484bf215546Sopenharmony_ci
485bf215546Sopenharmony_ci   {SVGA3D_ARGB_S10E5, SVGA3DBLOCKDESC_RGBA_FP,
486bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
487bf215546Sopenharmony_ci      {{16}, {16}, {16}, {16}},
488bf215546Sopenharmony_ci      {{32}, {16}, {0}, {48}}},
489bf215546Sopenharmony_ci
490bf215546Sopenharmony_ci   {SVGA3D_ARGB_S23E8, SVGA3DBLOCKDESC_RGBA_FP,
491bf215546Sopenharmony_ci      {1, 1, 1},  16, 16,
492bf215546Sopenharmony_ci      {{32}, {32}, {32}, {32}},
493bf215546Sopenharmony_ci      {{64}, {32}, {0}, {96}}},
494bf215546Sopenharmony_ci
495bf215546Sopenharmony_ci   {SVGA3D_A2R10G10B10, SVGA3DBLOCKDESC_RGBA_UNORM,
496bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
497bf215546Sopenharmony_ci      {{10}, {10}, {10}, {2}},
498bf215546Sopenharmony_ci      {{0}, {10}, {20}, {30}}},
499bf215546Sopenharmony_ci
500bf215546Sopenharmony_ci   {SVGA3D_V8U8, SVGA3DBLOCKDESC_UV_SNORM,
501bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
502bf215546Sopenharmony_ci      {{0}, {8}, {8}, {0}},
503bf215546Sopenharmony_ci      {{0}, {8}, {0}, {0}}},
504bf215546Sopenharmony_ci
505bf215546Sopenharmony_ci   {SVGA3D_Q8W8V8U8, SVGA3DBLOCKDESC_UVWQ_SNORM,
506bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
507bf215546Sopenharmony_ci      {{8}, {8}, {8}, {8}},
508bf215546Sopenharmony_ci      {{16}, {8}, {0}, {24}}},
509bf215546Sopenharmony_ci
510bf215546Sopenharmony_ci   {SVGA3D_CxV8U8, SVGA3DBLOCKDESC_UVCX_SNORM,
511bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
512bf215546Sopenharmony_ci      {{0}, {8}, {8}, {0}},
513bf215546Sopenharmony_ci      {{0}, {8}, {0}, {0}}},
514bf215546Sopenharmony_ci
515bf215546Sopenharmony_ci   {SVGA3D_X8L8V8U8, SVGA3DBLOCKDESC_UVL,
516bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
517bf215546Sopenharmony_ci      {{8}, {8}, {8}, {0}},
518bf215546Sopenharmony_ci      {{16}, {8}, {0}, {0}}},
519bf215546Sopenharmony_ci
520bf215546Sopenharmony_ci   {SVGA3D_A2W10V10U10, SVGA3DBLOCKDESC_UVWA,
521bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
522bf215546Sopenharmony_ci      {{10}, {10}, {10}, {2}},
523bf215546Sopenharmony_ci      {{20}, {10}, {0}, {30}}},
524bf215546Sopenharmony_ci
525bf215546Sopenharmony_ci   {SVGA3D_ALPHA8, SVGA3DBLOCKDESC_A_UNORM,
526bf215546Sopenharmony_ci      {1, 1, 1},  1, 1,
527bf215546Sopenharmony_ci      {{0}, {0}, {0}, {8}},
528bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
529bf215546Sopenharmony_ci
530bf215546Sopenharmony_ci   {SVGA3D_R_S10E5, SVGA3DBLOCKDESC_R_FP,
531bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
532bf215546Sopenharmony_ci      {{0}, {0}, {16}, {0}},
533bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
534bf215546Sopenharmony_ci
535bf215546Sopenharmony_ci   {SVGA3D_R_S23E8, SVGA3DBLOCKDESC_R_FP,
536bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
537bf215546Sopenharmony_ci      {{0}, {0}, {32}, {0}},
538bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
539bf215546Sopenharmony_ci
540bf215546Sopenharmony_ci   {SVGA3D_RG_S10E5, SVGA3DBLOCKDESC_RG_FP,
541bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
542bf215546Sopenharmony_ci      {{0}, {16}, {16}, {0}},
543bf215546Sopenharmony_ci      {{0}, {16}, {0}, {0}}},
544bf215546Sopenharmony_ci
545bf215546Sopenharmony_ci   {SVGA3D_RG_S23E8, SVGA3DBLOCKDESC_RG_FP,
546bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
547bf215546Sopenharmony_ci      {{0}, {32}, {32}, {0}},
548bf215546Sopenharmony_ci      {{0}, {32}, {0}, {0}}},
549bf215546Sopenharmony_ci
550bf215546Sopenharmony_ci   {SVGA3D_BUFFER, SVGA3DBLOCKDESC_BUFFER,
551bf215546Sopenharmony_ci      {1, 1, 1},  1, 1,
552bf215546Sopenharmony_ci      {{0}, {0}, {8}, {0}},
553bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
554bf215546Sopenharmony_ci
555bf215546Sopenharmony_ci   {SVGA3D_Z_D24X8, SVGA3DBLOCKDESC_DEPTH_UNORM,
556bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
557bf215546Sopenharmony_ci      {{0}, {0}, {24}, {0}},
558bf215546Sopenharmony_ci      {{0}, {0}, {8}, {0}}},
559bf215546Sopenharmony_ci
560bf215546Sopenharmony_ci   {SVGA3D_V16U16, SVGA3DBLOCKDESC_UV_SNORM,
561bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
562bf215546Sopenharmony_ci      {{0}, {16}, {16}, {0}},
563bf215546Sopenharmony_ci      {{0}, {16}, {0}, {0}}},
564bf215546Sopenharmony_ci
565bf215546Sopenharmony_ci   {SVGA3D_G16R16, SVGA3DBLOCKDESC_RG_UNORM,
566bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
567bf215546Sopenharmony_ci      {{0}, {16}, {16}, {0}},
568bf215546Sopenharmony_ci      {{0}, {16}, {0}, {0}}},
569bf215546Sopenharmony_ci
570bf215546Sopenharmony_ci   {SVGA3D_A16B16G16R16, SVGA3DBLOCKDESC_RGBA_UNORM,
571bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
572bf215546Sopenharmony_ci      {{16}, {16}, {16}, {16}},
573bf215546Sopenharmony_ci      {{32}, {16}, {0}, {48}}},
574bf215546Sopenharmony_ci
575bf215546Sopenharmony_ci   {SVGA3D_UYVY, SVGA3DBLOCKDESC_YUV,
576bf215546Sopenharmony_ci      {2, 1, 1},  4, 4,
577bf215546Sopenharmony_ci      {{8}, {0}, {8}, {0}},
578bf215546Sopenharmony_ci      {{0}, {0}, {8}, {0}}},
579bf215546Sopenharmony_ci
580bf215546Sopenharmony_ci   {SVGA3D_YUY2, SVGA3DBLOCKDESC_YUV,
581bf215546Sopenharmony_ci      {2, 1, 1},  4, 4,
582bf215546Sopenharmony_ci      {{8}, {0}, {8}, {0}},
583bf215546Sopenharmony_ci      {{8}, {0}, {0}, {0}}},
584bf215546Sopenharmony_ci
585bf215546Sopenharmony_ci   {SVGA3D_NV12, SVGA3DBLOCKDESC_NV12,
586bf215546Sopenharmony_ci      {2, 2, 1},  6, 2,
587bf215546Sopenharmony_ci      {{0}, {0}, {48}, {0}},
588bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
589bf215546Sopenharmony_ci
590bf215546Sopenharmony_ci   {SVGA3D_FORMAT_DEAD2, SVGA3DBLOCKDESC_NONE,
591bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
592bf215546Sopenharmony_ci      {{8}, {8}, {8}, {8}},
593bf215546Sopenharmony_ci      {{0}, {8}, {16}, {24}}},
594bf215546Sopenharmony_ci
595bf215546Sopenharmony_ci   {SVGA3D_R32G32B32A32_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
596bf215546Sopenharmony_ci      {1, 1, 1},  16, 16,
597bf215546Sopenharmony_ci      {{32}, {32}, {32}, {32}},
598bf215546Sopenharmony_ci      {{64}, {32}, {0}, {96}}},
599bf215546Sopenharmony_ci
600bf215546Sopenharmony_ci   {SVGA3D_R32G32B32A32_UINT, SVGA3DBLOCKDESC_RGBA_UINT,
601bf215546Sopenharmony_ci      {1, 1, 1},  16, 16,
602bf215546Sopenharmony_ci      {{32}, {32}, {32}, {32}},
603bf215546Sopenharmony_ci      {{64}, {32}, {0}, {96}}},
604bf215546Sopenharmony_ci
605bf215546Sopenharmony_ci   {SVGA3D_R32G32B32A32_SINT, SVGA3DBLOCKDESC_RGBA_SINT,
606bf215546Sopenharmony_ci      {1, 1, 1},  16, 16,
607bf215546Sopenharmony_ci      {{32}, {32}, {32}, {32}},
608bf215546Sopenharmony_ci      {{64}, {32}, {0}, {96}}},
609bf215546Sopenharmony_ci
610bf215546Sopenharmony_ci   {SVGA3D_R32G32B32_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
611bf215546Sopenharmony_ci      {1, 1, 1},  12, 12,
612bf215546Sopenharmony_ci      {{32}, {32}, {32}, {0}},
613bf215546Sopenharmony_ci      {{64}, {32}, {0}, {0}}},
614bf215546Sopenharmony_ci
615bf215546Sopenharmony_ci   {SVGA3D_R32G32B32_FLOAT, SVGA3DBLOCKDESC_RGB_FP,
616bf215546Sopenharmony_ci      {1, 1, 1},  12, 12,
617bf215546Sopenharmony_ci      {{32}, {32}, {32}, {0}},
618bf215546Sopenharmony_ci      {{64}, {32}, {0}, {0}}},
619bf215546Sopenharmony_ci
620bf215546Sopenharmony_ci   {SVGA3D_R32G32B32_UINT, SVGA3DBLOCKDESC_RGB_UINT,
621bf215546Sopenharmony_ci      {1, 1, 1},  12, 12,
622bf215546Sopenharmony_ci      {{32}, {32}, {32}, {0}},
623bf215546Sopenharmony_ci      {{64}, {32}, {0}, {0}}},
624bf215546Sopenharmony_ci
625bf215546Sopenharmony_ci   {SVGA3D_R32G32B32_SINT, SVGA3DBLOCKDESC_RGB_SINT,
626bf215546Sopenharmony_ci      {1, 1, 1},  12, 12,
627bf215546Sopenharmony_ci      {{32}, {32}, {32}, {0}},
628bf215546Sopenharmony_ci      {{64}, {32}, {0}, {0}}},
629bf215546Sopenharmony_ci
630bf215546Sopenharmony_ci   {SVGA3D_R16G16B16A16_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
631bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
632bf215546Sopenharmony_ci      {{16}, {16}, {16}, {16}},
633bf215546Sopenharmony_ci      {{32}, {16}, {0}, {48}}},
634bf215546Sopenharmony_ci
635bf215546Sopenharmony_ci   {SVGA3D_R16G16B16A16_UINT, SVGA3DBLOCKDESC_RGBA_UINT,
636bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
637bf215546Sopenharmony_ci      {{16}, {16}, {16}, {16}},
638bf215546Sopenharmony_ci      {{32}, {16}, {0}, {48}}},
639bf215546Sopenharmony_ci
640bf215546Sopenharmony_ci   {SVGA3D_R16G16B16A16_SNORM, SVGA3DBLOCKDESC_RGBA_SNORM,
641bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
642bf215546Sopenharmony_ci      {{16}, {16}, {16}, {16}},
643bf215546Sopenharmony_ci      {{32}, {16}, {0}, {48}}},
644bf215546Sopenharmony_ci
645bf215546Sopenharmony_ci   {SVGA3D_R16G16B16A16_SINT, SVGA3DBLOCKDESC_RGBA_SINT,
646bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
647bf215546Sopenharmony_ci      {{16}, {16}, {16}, {16}},
648bf215546Sopenharmony_ci      {{32}, {16}, {0}, {48}}},
649bf215546Sopenharmony_ci
650bf215546Sopenharmony_ci   {SVGA3D_R32G32_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
651bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
652bf215546Sopenharmony_ci      {{0}, {32}, {32}, {0}},
653bf215546Sopenharmony_ci      {{0}, {32}, {0}, {0}}},
654bf215546Sopenharmony_ci
655bf215546Sopenharmony_ci   {SVGA3D_R32G32_UINT, SVGA3DBLOCKDESC_RG_UINT,
656bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
657bf215546Sopenharmony_ci      {{0}, {32}, {32}, {0}},
658bf215546Sopenharmony_ci      {{0}, {32}, {0}, {0}}},
659bf215546Sopenharmony_ci
660bf215546Sopenharmony_ci   {SVGA3D_R32G32_SINT, SVGA3DBLOCKDESC_RG_SINT,
661bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
662bf215546Sopenharmony_ci      {{0}, {32}, {32}, {0}},
663bf215546Sopenharmony_ci      {{0}, {32}, {0}, {0}}},
664bf215546Sopenharmony_ci
665bf215546Sopenharmony_ci   {SVGA3D_R32G8X24_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
666bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
667bf215546Sopenharmony_ci      {{0}, {8}, {32}, {0}},
668bf215546Sopenharmony_ci      {{0}, {32}, {0}, {0}}},
669bf215546Sopenharmony_ci
670bf215546Sopenharmony_ci   {SVGA3D_D32_FLOAT_S8X24_UINT, SVGA3DBLOCKDESC_DS,
671bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
672bf215546Sopenharmony_ci      {{0}, {8}, {32}, {0}},
673bf215546Sopenharmony_ci      {{0}, {32}, {0}, {0}}},
674bf215546Sopenharmony_ci
675bf215546Sopenharmony_ci   {SVGA3D_R32_FLOAT_X8X24, SVGA3DBLOCKDESC_R_FP,
676bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
677bf215546Sopenharmony_ci      {{0}, {0}, {32}, {0}},
678bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
679bf215546Sopenharmony_ci
680bf215546Sopenharmony_ci   {SVGA3D_X32_G8X24_UINT, SVGA3DBLOCKDESC_G_UINT,
681bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
682bf215546Sopenharmony_ci      {{0}, {8}, {0}, {0}},
683bf215546Sopenharmony_ci      {{0}, {32}, {0}, {0}}},
684bf215546Sopenharmony_ci
685bf215546Sopenharmony_ci   {SVGA3D_R10G10B10A2_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
686bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
687bf215546Sopenharmony_ci      {{10}, {10}, {10}, {2}},
688bf215546Sopenharmony_ci      {{20}, {10}, {0}, {30}}},
689bf215546Sopenharmony_ci
690bf215546Sopenharmony_ci   {SVGA3D_R10G10B10A2_UINT, SVGA3DBLOCKDESC_RGBA_UINT,
691bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
692bf215546Sopenharmony_ci      {{10}, {10}, {10}, {2}},
693bf215546Sopenharmony_ci      {{20}, {10}, {0}, {30}}},
694bf215546Sopenharmony_ci
695bf215546Sopenharmony_ci   {SVGA3D_R11G11B10_FLOAT, SVGA3DBLOCKDESC_RGB_FP,
696bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
697bf215546Sopenharmony_ci      {{10}, {11}, {11}, {0}},
698bf215546Sopenharmony_ci      {{22}, {11}, {0}, {0}}},
699bf215546Sopenharmony_ci
700bf215546Sopenharmony_ci   {SVGA3D_R8G8B8A8_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
701bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
702bf215546Sopenharmony_ci      {{8}, {8}, {8}, {8}},
703bf215546Sopenharmony_ci      {{16}, {8}, {0}, {24}}},
704bf215546Sopenharmony_ci
705bf215546Sopenharmony_ci   {SVGA3D_R8G8B8A8_UNORM, SVGA3DBLOCKDESC_RGBA_UNORM,
706bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
707bf215546Sopenharmony_ci      {{8}, {8}, {8}, {8}},
708bf215546Sopenharmony_ci      {{16}, {8}, {0}, {24}}},
709bf215546Sopenharmony_ci
710bf215546Sopenharmony_ci   {SVGA3D_R8G8B8A8_UNORM_SRGB, SVGA3DBLOCKDESC_RGBA_UNORM_SRGB,
711bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
712bf215546Sopenharmony_ci      {{8}, {8}, {8}, {8}},
713bf215546Sopenharmony_ci      {{16}, {8}, {0}, {24}}},
714bf215546Sopenharmony_ci
715bf215546Sopenharmony_ci   {SVGA3D_R8G8B8A8_UINT, SVGA3DBLOCKDESC_RGBA_UINT,
716bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
717bf215546Sopenharmony_ci      {{8}, {8}, {8}, {8}},
718bf215546Sopenharmony_ci      {{16}, {8}, {0}, {24}}},
719bf215546Sopenharmony_ci
720bf215546Sopenharmony_ci   {SVGA3D_R8G8B8A8_SINT, SVGA3DBLOCKDESC_RGBA_SINT,
721bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
722bf215546Sopenharmony_ci      {{8}, {8}, {8}, {8}},
723bf215546Sopenharmony_ci      {{16}, {8}, {0}, {24}}},
724bf215546Sopenharmony_ci
725bf215546Sopenharmony_ci   {SVGA3D_R16G16_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
726bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
727bf215546Sopenharmony_ci      {{0}, {16}, {16}, {0}},
728bf215546Sopenharmony_ci      {{0}, {16}, {0}, {0}}},
729bf215546Sopenharmony_ci
730bf215546Sopenharmony_ci   {SVGA3D_R16G16_UINT, SVGA3DBLOCKDESC_RG_UINT,
731bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
732bf215546Sopenharmony_ci      {{0}, {16}, {16}, {0}},
733bf215546Sopenharmony_ci      {{0}, {16}, {0}, {0}}},
734bf215546Sopenharmony_ci
735bf215546Sopenharmony_ci   {SVGA3D_R16G16_SINT, SVGA3DBLOCKDESC_RG_SINT,
736bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
737bf215546Sopenharmony_ci      {{0}, {16}, {16}, {0}},
738bf215546Sopenharmony_ci      {{0}, {16}, {0}, {0}}},
739bf215546Sopenharmony_ci
740bf215546Sopenharmony_ci   {SVGA3D_R32_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
741bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
742bf215546Sopenharmony_ci      {{0}, {0}, {32}, {0}},
743bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
744bf215546Sopenharmony_ci
745bf215546Sopenharmony_ci   {SVGA3D_D32_FLOAT, SVGA3DBLOCKDESC_DEPTH_FP,
746bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
747bf215546Sopenharmony_ci      {{0}, {0}, {32}, {0}},
748bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
749bf215546Sopenharmony_ci
750bf215546Sopenharmony_ci   {SVGA3D_R32_UINT, SVGA3DBLOCKDESC_R_UINT,
751bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
752bf215546Sopenharmony_ci      {{0}, {0}, {32}, {0}},
753bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
754bf215546Sopenharmony_ci
755bf215546Sopenharmony_ci   {SVGA3D_R32_SINT, SVGA3DBLOCKDESC_R_SINT,
756bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
757bf215546Sopenharmony_ci      {{0}, {0}, {32}, {0}},
758bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
759bf215546Sopenharmony_ci
760bf215546Sopenharmony_ci   {SVGA3D_R24G8_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
761bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
762bf215546Sopenharmony_ci      {{0}, {8}, {24}, {0}},
763bf215546Sopenharmony_ci      {{0}, {24}, {0}, {0}}},
764bf215546Sopenharmony_ci
765bf215546Sopenharmony_ci   {SVGA3D_D24_UNORM_S8_UINT, SVGA3DBLOCKDESC_DS_UNORM,
766bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
767bf215546Sopenharmony_ci      {{0}, {8}, {24}, {0}},
768bf215546Sopenharmony_ci      {{0}, {24}, {0}, {0}}},
769bf215546Sopenharmony_ci
770bf215546Sopenharmony_ci   {SVGA3D_R24_UNORM_X8, SVGA3DBLOCKDESC_R_UNORM,
771bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
772bf215546Sopenharmony_ci      {{0}, {0}, {24}, {0}},
773bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
774bf215546Sopenharmony_ci
775bf215546Sopenharmony_ci   {SVGA3D_X24_G8_UINT, SVGA3DBLOCKDESC_G_UINT,
776bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
777bf215546Sopenharmony_ci      {{0}, {8}, {0}, {0}},
778bf215546Sopenharmony_ci      {{0}, {24}, {0}, {0}}},
779bf215546Sopenharmony_ci
780bf215546Sopenharmony_ci   {SVGA3D_R8G8_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
781bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
782bf215546Sopenharmony_ci      {{0}, {8}, {8}, {0}},
783bf215546Sopenharmony_ci      {{0}, {8}, {0}, {0}}},
784bf215546Sopenharmony_ci
785bf215546Sopenharmony_ci   {SVGA3D_R8G8_UNORM, SVGA3DBLOCKDESC_RG_UNORM,
786bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
787bf215546Sopenharmony_ci      {{0}, {8}, {8}, {0}},
788bf215546Sopenharmony_ci      {{0}, {8}, {0}, {0}}},
789bf215546Sopenharmony_ci
790bf215546Sopenharmony_ci   {SVGA3D_R8G8_UINT, SVGA3DBLOCKDESC_RG_UINT,
791bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
792bf215546Sopenharmony_ci      {{0}, {8}, {8}, {0}},
793bf215546Sopenharmony_ci      {{0}, {8}, {0}, {0}}},
794bf215546Sopenharmony_ci
795bf215546Sopenharmony_ci   {SVGA3D_R8G8_SINT, SVGA3DBLOCKDESC_RG_SINT,
796bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
797bf215546Sopenharmony_ci      {{0}, {8}, {8}, {0}},
798bf215546Sopenharmony_ci      {{0}, {8}, {0}, {0}}},
799bf215546Sopenharmony_ci
800bf215546Sopenharmony_ci   {SVGA3D_R16_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
801bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
802bf215546Sopenharmony_ci      {{0}, {0}, {16}, {0}},
803bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
804bf215546Sopenharmony_ci
805bf215546Sopenharmony_ci   {SVGA3D_R16_UNORM, SVGA3DBLOCKDESC_R_UNORM,
806bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
807bf215546Sopenharmony_ci      {{0}, {0}, {16}, {0}},
808bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
809bf215546Sopenharmony_ci
810bf215546Sopenharmony_ci   {SVGA3D_R16_UINT, SVGA3DBLOCKDESC_R_UINT,
811bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
812bf215546Sopenharmony_ci      {{0}, {0}, {16}, {0}},
813bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
814bf215546Sopenharmony_ci
815bf215546Sopenharmony_ci   {SVGA3D_R16_SNORM, SVGA3DBLOCKDESC_R_SNORM,
816bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
817bf215546Sopenharmony_ci      {{0}, {0}, {16}, {0}},
818bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
819bf215546Sopenharmony_ci
820bf215546Sopenharmony_ci   {SVGA3D_R16_SINT, SVGA3DBLOCKDESC_R_SINT,
821bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
822bf215546Sopenharmony_ci      {{0}, {0}, {16}, {0}},
823bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
824bf215546Sopenharmony_ci
825bf215546Sopenharmony_ci   {SVGA3D_R8_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
826bf215546Sopenharmony_ci      {1, 1, 1},  1, 1,
827bf215546Sopenharmony_ci      {{0}, {0}, {8}, {0}},
828bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
829bf215546Sopenharmony_ci
830bf215546Sopenharmony_ci   {SVGA3D_R8_UNORM, SVGA3DBLOCKDESC_R_UNORM,
831bf215546Sopenharmony_ci      {1, 1, 1},  1, 1,
832bf215546Sopenharmony_ci      {{0}, {0}, {8}, {0}},
833bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
834bf215546Sopenharmony_ci
835bf215546Sopenharmony_ci   {SVGA3D_R8_UINT, SVGA3DBLOCKDESC_R_UINT,
836bf215546Sopenharmony_ci      {1, 1, 1},  1, 1,
837bf215546Sopenharmony_ci      {{0}, {0}, {8}, {0}},
838bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
839bf215546Sopenharmony_ci
840bf215546Sopenharmony_ci   {SVGA3D_R8_SNORM, SVGA3DBLOCKDESC_R_SNORM,
841bf215546Sopenharmony_ci      {1, 1, 1},  1, 1,
842bf215546Sopenharmony_ci      {{0}, {0}, {8}, {0}},
843bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
844bf215546Sopenharmony_ci
845bf215546Sopenharmony_ci   {SVGA3D_R8_SINT, SVGA3DBLOCKDESC_R_SINT,
846bf215546Sopenharmony_ci      {1, 1, 1},  1, 1,
847bf215546Sopenharmony_ci      {{0}, {0}, {8}, {0}},
848bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
849bf215546Sopenharmony_ci
850bf215546Sopenharmony_ci   {SVGA3D_P8, SVGA3DBLOCKDESC_NONE,
851bf215546Sopenharmony_ci      {1, 1, 1},  1, 1,
852bf215546Sopenharmony_ci      {{0}, {0}, {8}, {0}},
853bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
854bf215546Sopenharmony_ci
855bf215546Sopenharmony_ci   {SVGA3D_R9G9B9E5_SHAREDEXP, SVGA3DBLOCKDESC_RGB_EXP,
856bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
857bf215546Sopenharmony_ci      {{9}, {9}, {9}, {5}},
858bf215546Sopenharmony_ci      {{18}, {9}, {0}, {27}}},
859bf215546Sopenharmony_ci
860bf215546Sopenharmony_ci   {SVGA3D_R8G8_B8G8_UNORM, SVGA3DBLOCKDESC_NONE,
861bf215546Sopenharmony_ci      {2, 1, 1},  4, 4,
862bf215546Sopenharmony_ci      {{0}, {8}, {8}, {0}},
863bf215546Sopenharmony_ci      {{0}, {0}, {8}, {0}}},
864bf215546Sopenharmony_ci
865bf215546Sopenharmony_ci   {SVGA3D_G8R8_G8B8_UNORM, SVGA3DBLOCKDESC_NONE,
866bf215546Sopenharmony_ci      {2, 1, 1},  4, 4,
867bf215546Sopenharmony_ci      {{0}, {8}, {8}, {0}},
868bf215546Sopenharmony_ci      {{0}, {8}, {0}, {0}}},
869bf215546Sopenharmony_ci
870bf215546Sopenharmony_ci   {SVGA3D_BC1_TYPELESS, SVGA3DBLOCKDESC_BC1_COMP_TYPELESS,
871bf215546Sopenharmony_ci      {4, 4, 1},  8, 8,
872bf215546Sopenharmony_ci      {{0}, {0}, {64}, {0}},
873bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
874bf215546Sopenharmony_ci
875bf215546Sopenharmony_ci   {SVGA3D_BC1_UNORM_SRGB, SVGA3DBLOCKDESC_BC1_COMP_UNORM_SRGB,
876bf215546Sopenharmony_ci      {4, 4, 1},  8, 8,
877bf215546Sopenharmony_ci      {{0}, {0}, {64}, {0}},
878bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
879bf215546Sopenharmony_ci
880bf215546Sopenharmony_ci   {SVGA3D_BC2_TYPELESS, SVGA3DBLOCKDESC_BC2_COMP_TYPELESS,
881bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
882bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
883bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
884bf215546Sopenharmony_ci
885bf215546Sopenharmony_ci   {SVGA3D_BC2_UNORM_SRGB, SVGA3DBLOCKDESC_BC2_COMP_UNORM_SRGB,
886bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
887bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
888bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
889bf215546Sopenharmony_ci
890bf215546Sopenharmony_ci   {SVGA3D_BC3_TYPELESS, SVGA3DBLOCKDESC_BC3_COMP_TYPELESS,
891bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
892bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
893bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
894bf215546Sopenharmony_ci
895bf215546Sopenharmony_ci   {SVGA3D_BC3_UNORM_SRGB, SVGA3DBLOCKDESC_BC3_COMP_UNORM_SRGB,
896bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
897bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
898bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
899bf215546Sopenharmony_ci
900bf215546Sopenharmony_ci   {SVGA3D_BC4_TYPELESS, SVGA3DBLOCKDESC_BC4_COMP_TYPELESS,
901bf215546Sopenharmony_ci      {4, 4, 1},  8, 8,
902bf215546Sopenharmony_ci      {{0}, {0}, {64}, {0}},
903bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
904bf215546Sopenharmony_ci
905bf215546Sopenharmony_ci   {SVGA3D_ATI1, SVGA3DBLOCKDESC_BC4_COMP_UNORM,
906bf215546Sopenharmony_ci      {4, 4, 1},  8, 8,
907bf215546Sopenharmony_ci      {{0}, {0}, {64}, {0}},
908bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
909bf215546Sopenharmony_ci
910bf215546Sopenharmony_ci   {SVGA3D_BC4_SNORM, SVGA3DBLOCKDESC_BC4_COMP_SNORM,
911bf215546Sopenharmony_ci      {4, 4, 1},  8, 8,
912bf215546Sopenharmony_ci      {{0}, {0}, {64}, {0}},
913bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
914bf215546Sopenharmony_ci
915bf215546Sopenharmony_ci   {SVGA3D_BC5_TYPELESS, SVGA3DBLOCKDESC_BC5_COMP_TYPELESS,
916bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
917bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
918bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
919bf215546Sopenharmony_ci
920bf215546Sopenharmony_ci   {SVGA3D_ATI2, SVGA3DBLOCKDESC_BC5_COMP_UNORM,
921bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
922bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
923bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
924bf215546Sopenharmony_ci
925bf215546Sopenharmony_ci   {SVGA3D_BC5_SNORM, SVGA3DBLOCKDESC_BC5_COMP_SNORM,
926bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
927bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
928bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
929bf215546Sopenharmony_ci
930bf215546Sopenharmony_ci   {SVGA3D_R10G10B10_XR_BIAS_A2_UNORM, SVGA3DBLOCKDESC_RGBA_UNORM,
931bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
932bf215546Sopenharmony_ci      {{10}, {10}, {10}, {2}},
933bf215546Sopenharmony_ci     {{20}, {10}, {0}, {30}}},
934bf215546Sopenharmony_ci
935bf215546Sopenharmony_ci   {SVGA3D_B8G8R8A8_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
936bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
937bf215546Sopenharmony_ci      {{8}, {8}, {8}, {8}},
938bf215546Sopenharmony_ci      {{0}, {8}, {16}, {24}}},
939bf215546Sopenharmony_ci
940bf215546Sopenharmony_ci   {SVGA3D_B8G8R8A8_UNORM_SRGB, SVGA3DBLOCKDESC_RGBA_UNORM_SRGB,
941bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
942bf215546Sopenharmony_ci      {{8}, {8}, {8}, {8}},
943bf215546Sopenharmony_ci      {{0}, {8}, {16}, {24}}},
944bf215546Sopenharmony_ci
945bf215546Sopenharmony_ci   {SVGA3D_B8G8R8X8_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
946bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
947bf215546Sopenharmony_ci      {{8}, {8}, {8}, {0}},
948bf215546Sopenharmony_ci      {{0}, {8}, {16}, {24}}},
949bf215546Sopenharmony_ci
950bf215546Sopenharmony_ci   {SVGA3D_B8G8R8X8_UNORM_SRGB, SVGA3DBLOCKDESC_RGB_UNORM_SRGB,
951bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
952bf215546Sopenharmony_ci      {{8}, {8}, {8}, {0}},
953bf215546Sopenharmony_ci      {{0}, {8}, {16}, {24}}},
954bf215546Sopenharmony_ci
955bf215546Sopenharmony_ci   {SVGA3D_Z_DF16, SVGA3DBLOCKDESC_DEPTH_UNORM,
956bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
957bf215546Sopenharmony_ci      {{0}, {0}, {16}, {0}},
958bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
959bf215546Sopenharmony_ci
960bf215546Sopenharmony_ci   {SVGA3D_Z_DF24, SVGA3DBLOCKDESC_DEPTH_UNORM,
961bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
962bf215546Sopenharmony_ci      {{0}, {0}, {24}, {0}},
963bf215546Sopenharmony_ci      {{0}, {0}, {8}, {0}}},
964bf215546Sopenharmony_ci
965bf215546Sopenharmony_ci   {SVGA3D_Z_D24S8_INT, SVGA3DBLOCKDESC_DS_UNORM,
966bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
967bf215546Sopenharmony_ci      {{0}, {8}, {24}, {0}},
968bf215546Sopenharmony_ci      {{0}, {0}, {8}, {0}}},
969bf215546Sopenharmony_ci
970bf215546Sopenharmony_ci   {SVGA3D_YV12, SVGA3DBLOCKDESC_YV12,
971bf215546Sopenharmony_ci      {2, 2, 1},  6, 2,
972bf215546Sopenharmony_ci      {{0}, {0}, {48}, {0}},
973bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
974bf215546Sopenharmony_ci
975bf215546Sopenharmony_ci   {SVGA3D_R32G32B32A32_FLOAT, SVGA3DBLOCKDESC_RGBA_FP,
976bf215546Sopenharmony_ci      {1, 1, 1},  16, 16,
977bf215546Sopenharmony_ci      {{32}, {32}, {32}, {32}},
978bf215546Sopenharmony_ci      {{64}, {32}, {0}, {96}}},
979bf215546Sopenharmony_ci
980bf215546Sopenharmony_ci   {SVGA3D_R16G16B16A16_FLOAT, SVGA3DBLOCKDESC_RGBA_FP,
981bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
982bf215546Sopenharmony_ci      {{16}, {16}, {16}, {16}},
983bf215546Sopenharmony_ci      {{32}, {16}, {0}, {48}}},
984bf215546Sopenharmony_ci
985bf215546Sopenharmony_ci   {SVGA3D_R16G16B16A16_UNORM, SVGA3DBLOCKDESC_RGBA_UNORM,
986bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
987bf215546Sopenharmony_ci      {{16}, {16}, {16}, {16}},
988bf215546Sopenharmony_ci      {{32}, {16}, {0}, {48}}},
989bf215546Sopenharmony_ci
990bf215546Sopenharmony_ci   {SVGA3D_R32G32_FLOAT, SVGA3DBLOCKDESC_RG_FP,
991bf215546Sopenharmony_ci      {1, 1, 1},  8, 8,
992bf215546Sopenharmony_ci      {{0}, {32}, {32}, {0}},
993bf215546Sopenharmony_ci      {{0}, {32}, {0}, {0}}},
994bf215546Sopenharmony_ci
995bf215546Sopenharmony_ci   {SVGA3D_R10G10B10A2_UNORM, SVGA3DBLOCKDESC_RGBA_UNORM,
996bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
997bf215546Sopenharmony_ci      {{10}, {10}, {10}, {2}},
998bf215546Sopenharmony_ci      {{20}, {10}, {0}, {30}}},
999bf215546Sopenharmony_ci
1000bf215546Sopenharmony_ci   {SVGA3D_R8G8B8A8_SNORM, SVGA3DBLOCKDESC_RGBA_SNORM,
1001bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
1002bf215546Sopenharmony_ci      {{8}, {8}, {8}, {8}},
1003bf215546Sopenharmony_ci      {{16}, {8}, {0}, {24}}},
1004bf215546Sopenharmony_ci
1005bf215546Sopenharmony_ci   {SVGA3D_R16G16_FLOAT, SVGA3DBLOCKDESC_RG_FP,
1006bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
1007bf215546Sopenharmony_ci      {{0}, {16}, {16}, {0}},
1008bf215546Sopenharmony_ci      {{0}, {16}, {0}, {0}}},
1009bf215546Sopenharmony_ci
1010bf215546Sopenharmony_ci   {SVGA3D_R16G16_UNORM, SVGA3DBLOCKDESC_RG_UNORM,
1011bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
1012bf215546Sopenharmony_ci      {{0}, {16}, {16}, {0}},
1013bf215546Sopenharmony_ci      {{0}, {16}, {0}, {0}}},
1014bf215546Sopenharmony_ci
1015bf215546Sopenharmony_ci   {SVGA3D_R16G16_SNORM, SVGA3DBLOCKDESC_RG_SNORM,
1016bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
1017bf215546Sopenharmony_ci      {{0}, {16}, {16}, {0}},
1018bf215546Sopenharmony_ci      {{0}, {16}, {0}, {0}}},
1019bf215546Sopenharmony_ci
1020bf215546Sopenharmony_ci   {SVGA3D_R32_FLOAT, SVGA3DBLOCKDESC_R_FP,
1021bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
1022bf215546Sopenharmony_ci      {{0}, {0}, {32}, {0}},
1023bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1024bf215546Sopenharmony_ci
1025bf215546Sopenharmony_ci   {SVGA3D_R8G8_SNORM, SVGA3DBLOCKDESC_RG_SNORM,
1026bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
1027bf215546Sopenharmony_ci      {{0}, {8}, {8}, {0}},
1028bf215546Sopenharmony_ci      {{0}, {8}, {0}, {0}}},
1029bf215546Sopenharmony_ci
1030bf215546Sopenharmony_ci   {SVGA3D_R16_FLOAT, SVGA3DBLOCKDESC_R_FP,
1031bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
1032bf215546Sopenharmony_ci      {{0}, {0}, {16}, {0}},
1033bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1034bf215546Sopenharmony_ci
1035bf215546Sopenharmony_ci   {SVGA3D_D16_UNORM, SVGA3DBLOCKDESC_DEPTH_UNORM,
1036bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
1037bf215546Sopenharmony_ci      {{0}, {0}, {16}, {0}},
1038bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1039bf215546Sopenharmony_ci
1040bf215546Sopenharmony_ci   {SVGA3D_A8_UNORM, SVGA3DBLOCKDESC_A_UNORM,
1041bf215546Sopenharmony_ci      {1, 1, 1},  1, 1,
1042bf215546Sopenharmony_ci      {{0}, {0}, {0}, {8}},
1043bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1044bf215546Sopenharmony_ci
1045bf215546Sopenharmony_ci   {SVGA3D_BC1_UNORM, SVGA3DBLOCKDESC_BC1_COMP_UNORM,
1046bf215546Sopenharmony_ci      {4, 4, 1},  8, 8,
1047bf215546Sopenharmony_ci      {{0}, {0}, {64}, {0}},
1048bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1049bf215546Sopenharmony_ci
1050bf215546Sopenharmony_ci   {SVGA3D_BC2_UNORM, SVGA3DBLOCKDESC_BC2_COMP_UNORM,
1051bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
1052bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
1053bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1054bf215546Sopenharmony_ci
1055bf215546Sopenharmony_ci   {SVGA3D_BC3_UNORM, SVGA3DBLOCKDESC_BC3_COMP_UNORM,
1056bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
1057bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
1058bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1059bf215546Sopenharmony_ci
1060bf215546Sopenharmony_ci   {SVGA3D_B5G6R5_UNORM, SVGA3DBLOCKDESC_RGB_UNORM,
1061bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
1062bf215546Sopenharmony_ci      {{5}, {6}, {5}, {0}},
1063bf215546Sopenharmony_ci      {{0}, {5}, {11}, {0}}},
1064bf215546Sopenharmony_ci
1065bf215546Sopenharmony_ci   {SVGA3D_B5G5R5A1_UNORM, SVGA3DBLOCKDESC_RGBA_UNORM,
1066bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
1067bf215546Sopenharmony_ci      {{5}, {5}, {5}, {1}},
1068bf215546Sopenharmony_ci      {{0}, {5}, {10}, {15}}},
1069bf215546Sopenharmony_ci
1070bf215546Sopenharmony_ci   {SVGA3D_B8G8R8A8_UNORM, SVGA3DBLOCKDESC_RGBA_UNORM,
1071bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
1072bf215546Sopenharmony_ci      {{8}, {8}, {8}, {8}},
1073bf215546Sopenharmony_ci      {{0}, {8}, {16}, {24}}},
1074bf215546Sopenharmony_ci
1075bf215546Sopenharmony_ci   {SVGA3D_B8G8R8X8_UNORM, SVGA3DBLOCKDESC_RGB_UNORM,
1076bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
1077bf215546Sopenharmony_ci      {{8}, {8}, {8}, {0}},
1078bf215546Sopenharmony_ci      {{0}, {8}, {16}, {24}}},
1079bf215546Sopenharmony_ci
1080bf215546Sopenharmony_ci   {SVGA3D_BC4_UNORM, SVGA3DBLOCKDESC_BC4_COMP_UNORM,
1081bf215546Sopenharmony_ci      {4, 4, 1},  8, 8,
1082bf215546Sopenharmony_ci      {{0}, {0}, {64}, {0}},
1083bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1084bf215546Sopenharmony_ci
1085bf215546Sopenharmony_ci   {SVGA3D_BC5_UNORM, SVGA3DBLOCKDESC_BC5_COMP_UNORM,
1086bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
1087bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
1088bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1089bf215546Sopenharmony_ci
1090bf215546Sopenharmony_ci   {SVGA3D_B4G4R4A4_UNORM, SVGA3DBLOCKDESC_RGBA_UNORM,
1091bf215546Sopenharmony_ci      {1, 1, 1},  2, 2,
1092bf215546Sopenharmony_ci      {{4}, {4}, {4}, {4}},
1093bf215546Sopenharmony_ci      {{0}, {4}, {8}, {12}}},
1094bf215546Sopenharmony_ci
1095bf215546Sopenharmony_ci   {SVGA3D_BC6H_TYPELESS, SVGA3DBLOCKDESC_BC6H_COMP_TYPELESS,
1096bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
1097bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
1098bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1099bf215546Sopenharmony_ci
1100bf215546Sopenharmony_ci   {SVGA3D_BC6H_UF16, SVGA3DBLOCKDESC_BC6H_COMP_UF16,
1101bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
1102bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
1103bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1104bf215546Sopenharmony_ci
1105bf215546Sopenharmony_ci   {SVGA3D_BC6H_SF16, SVGA3DBLOCKDESC_BC6H_COMP_SF16,
1106bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
1107bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
1108bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1109bf215546Sopenharmony_ci
1110bf215546Sopenharmony_ci   {SVGA3D_BC7_TYPELESS, SVGA3DBLOCKDESC_BC7_COMP_TYPELESS,
1111bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
1112bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
1113bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1114bf215546Sopenharmony_ci
1115bf215546Sopenharmony_ci   {SVGA3D_BC7_UNORM, SVGA3DBLOCKDESC_BC7_COMP_UNORM,
1116bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
1117bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
1118bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1119bf215546Sopenharmony_ci
1120bf215546Sopenharmony_ci   {SVGA3D_BC7_UNORM_SRGB, SVGA3DBLOCKDESC_BC7_COMP_UNORM_SRGB,
1121bf215546Sopenharmony_ci      {4, 4, 1},  16, 16,
1122bf215546Sopenharmony_ci      {{0}, {0}, {128}, {0}},
1123bf215546Sopenharmony_ci      {{0}, {0}, {0}, {0}}},
1124bf215546Sopenharmony_ci
1125bf215546Sopenharmony_ci   {SVGA3D_AYUV, SVGA3DBLOCKDESC_AYUV,
1126bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
1127bf215546Sopenharmony_ci      {{8}, {8}, {8}, {8}},
1128bf215546Sopenharmony_ci      {{0}, {8}, {16}, {24}}},
1129bf215546Sopenharmony_ci
1130bf215546Sopenharmony_ci   {SVGA3D_R11G11B10_TYPELESS, SVGA3DBLOCKDESC_TYPELESS,
1131bf215546Sopenharmony_ci      {1, 1, 1},  4, 4,
1132bf215546Sopenharmony_ci      {{10}, {11}, {11}, {0}},
1133bf215546Sopenharmony_ci      {{22}, {11}, {0}, {0}}},
1134bf215546Sopenharmony_ci};
1135bf215546Sopenharmony_ci
1136bf215546Sopenharmony_ci
1137bf215546Sopenharmony_ci
1138bf215546Sopenharmony_ciextern const struct svga3d_surface_desc g_SVGA3dSurfaceDescs[];
1139bf215546Sopenharmony_ciextern int g_SVGA3dSurfaceDescs_size;
1140bf215546Sopenharmony_ci
1141bf215546Sopenharmony_cistatic inline uint32 clamped_umul32(uint32 a, uint32 b)
1142bf215546Sopenharmony_ci{
1143bf215546Sopenharmony_ci	uint64_t tmp = (uint64_t) a*b;
1144bf215546Sopenharmony_ci	return (tmp > (uint64_t) ((uint32) -1)) ? (uint32) -1 : tmp;
1145bf215546Sopenharmony_ci}
1146bf215546Sopenharmony_ci
1147bf215546Sopenharmony_cistatic inline uint32 clamped_uadd32(uint32 a, uint32 b)
1148bf215546Sopenharmony_ci{
1149bf215546Sopenharmony_ci	uint32 c = a + b;
1150bf215546Sopenharmony_ci	if (c < a || c < b) {
1151bf215546Sopenharmony_ci		return MAX_UINT32;
1152bf215546Sopenharmony_ci	}
1153bf215546Sopenharmony_ci	return c;
1154bf215546Sopenharmony_ci}
1155bf215546Sopenharmony_ci
1156bf215546Sopenharmony_ci
1157bf215546Sopenharmony_cistatic inline const struct svga3d_surface_desc *
1158bf215546Sopenharmony_cisvga3dsurface_get_desc(SVGA3dSurfaceFormat format)
1159bf215546Sopenharmony_ci{
1160bf215546Sopenharmony_ci	if (format < ARRAY_SIZE(svga3d_surface_descs))
1161bf215546Sopenharmony_ci		return &svga3d_surface_descs[format];
1162bf215546Sopenharmony_ci
1163bf215546Sopenharmony_ci	return &svga3d_surface_descs[SVGA3D_FORMAT_INVALID];
1164bf215546Sopenharmony_ci}
1165bf215546Sopenharmony_ci
1166bf215546Sopenharmony_ci/*
1167bf215546Sopenharmony_ci *----------------------------------------------------------------------
1168bf215546Sopenharmony_ci *
1169bf215546Sopenharmony_ci * svga3dsurface_get_mip_size --
1170bf215546Sopenharmony_ci *
1171bf215546Sopenharmony_ci *      Given a base level size and the mip level, compute the size of
1172bf215546Sopenharmony_ci *      the mip level.
1173bf215546Sopenharmony_ci *
1174bf215546Sopenharmony_ci * Results:
1175bf215546Sopenharmony_ci *      See above.
1176bf215546Sopenharmony_ci *
1177bf215546Sopenharmony_ci * Side effects:
1178bf215546Sopenharmony_ci *      None.
1179bf215546Sopenharmony_ci *
1180bf215546Sopenharmony_ci *----------------------------------------------------------------------
1181bf215546Sopenharmony_ci */
1182bf215546Sopenharmony_ci
1183bf215546Sopenharmony_cistatic inline SVGA3dSize
1184bf215546Sopenharmony_cisvga3dsurface_get_mip_size(SVGA3dSize base_level, uint32 mip_level)
1185bf215546Sopenharmony_ci{
1186bf215546Sopenharmony_ci	SVGA3dSize size;
1187bf215546Sopenharmony_ci
1188bf215546Sopenharmony_ci	size.width = max_t(uint32, base_level.width >> mip_level, 1);
1189bf215546Sopenharmony_ci	size.height = max_t(uint32, base_level.height >> mip_level, 1);
1190bf215546Sopenharmony_ci	size.depth = max_t(uint32, base_level.depth >> mip_level, 1);
1191bf215546Sopenharmony_ci	return size;
1192bf215546Sopenharmony_ci}
1193bf215546Sopenharmony_ci
1194bf215546Sopenharmony_cistatic inline void
1195bf215546Sopenharmony_cisvga3dsurface_get_size_in_blocks(const struct svga3d_surface_desc *desc,
1196bf215546Sopenharmony_ci				 const SVGA3dSize *pixel_size,
1197bf215546Sopenharmony_ci				 SVGA3dSize *block_size)
1198bf215546Sopenharmony_ci{
1199bf215546Sopenharmony_ci	block_size->width = DIV_ROUND_UP(pixel_size->width,
1200bf215546Sopenharmony_ci					 desc->block_size.width);
1201bf215546Sopenharmony_ci	block_size->height = DIV_ROUND_UP(pixel_size->height,
1202bf215546Sopenharmony_ci					  desc->block_size.height);
1203bf215546Sopenharmony_ci	block_size->depth = DIV_ROUND_UP(pixel_size->depth,
1204bf215546Sopenharmony_ci					 desc->block_size.depth);
1205bf215546Sopenharmony_ci}
1206bf215546Sopenharmony_ci
1207bf215546Sopenharmony_cistatic inline bool
1208bf215546Sopenharmony_cisvga3dsurface_is_planar_surface(const struct svga3d_surface_desc *desc)
1209bf215546Sopenharmony_ci{
1210bf215546Sopenharmony_ci	return (desc->block_desc & SVGA3DBLOCKDESC_PLANAR_YUV) != 0;
1211bf215546Sopenharmony_ci}
1212bf215546Sopenharmony_ci
1213bf215546Sopenharmony_cistatic inline uint32
1214bf215546Sopenharmony_cisvga3dsurface_calculate_pitch(const struct svga3d_surface_desc *desc,
1215bf215546Sopenharmony_ci			      const SVGA3dSize *size)
1216bf215546Sopenharmony_ci{
1217bf215546Sopenharmony_ci	uint32 pitch;
1218bf215546Sopenharmony_ci	SVGA3dSize blocks;
1219bf215546Sopenharmony_ci
1220bf215546Sopenharmony_ci	svga3dsurface_get_size_in_blocks(desc, size, &blocks);
1221bf215546Sopenharmony_ci
1222bf215546Sopenharmony_ci	pitch = blocks.width * desc->pitch_bytes_per_block;
1223bf215546Sopenharmony_ci
1224bf215546Sopenharmony_ci	return pitch;
1225bf215546Sopenharmony_ci}
1226bf215546Sopenharmony_ci
1227bf215546Sopenharmony_ci/*
1228bf215546Sopenharmony_ci *-----------------------------------------------------------------------------
1229bf215546Sopenharmony_ci *
1230bf215546Sopenharmony_ci * svga3dsurface_get_image_buffer_size --
1231bf215546Sopenharmony_ci *
1232bf215546Sopenharmony_ci *      Return the number of bytes of buffer space required to store
1233bf215546Sopenharmony_ci *      one image of a surface, optionally using the specified pitch.
1234bf215546Sopenharmony_ci *
1235bf215546Sopenharmony_ci *      If pitch is zero, it is assumed that rows are tightly packed.
1236bf215546Sopenharmony_ci *
1237bf215546Sopenharmony_ci *      This function is overflow-safe. If the result would have
1238bf215546Sopenharmony_ci *      overflowed, instead we return MAX_UINT32.
1239bf215546Sopenharmony_ci *
1240bf215546Sopenharmony_ci * Results:
1241bf215546Sopenharmony_ci *      Byte count.
1242bf215546Sopenharmony_ci *
1243bf215546Sopenharmony_ci * Side effects:
1244bf215546Sopenharmony_ci *      None.
1245bf215546Sopenharmony_ci *
1246bf215546Sopenharmony_ci *-----------------------------------------------------------------------------
1247bf215546Sopenharmony_ci */
1248bf215546Sopenharmony_ci
1249bf215546Sopenharmony_cistatic inline uint32
1250bf215546Sopenharmony_cisvga3dsurface_get_image_buffer_size(const struct svga3d_surface_desc *desc,
1251bf215546Sopenharmony_ci				    const SVGA3dSize *size,
1252bf215546Sopenharmony_ci				    uint32 pitch)
1253bf215546Sopenharmony_ci{
1254bf215546Sopenharmony_ci	SVGA3dSize image_blocks;
1255bf215546Sopenharmony_ci	uint32 slice_size, total_size;
1256bf215546Sopenharmony_ci
1257bf215546Sopenharmony_ci	svga3dsurface_get_size_in_blocks(desc, size, &image_blocks);
1258bf215546Sopenharmony_ci
1259bf215546Sopenharmony_ci	if (svga3dsurface_is_planar_surface(desc)) {
1260bf215546Sopenharmony_ci		total_size = clamped_umul32(image_blocks.width,
1261bf215546Sopenharmony_ci					    image_blocks.height);
1262bf215546Sopenharmony_ci		total_size = clamped_umul32(total_size, image_blocks.depth);
1263bf215546Sopenharmony_ci		total_size = clamped_umul32(total_size, desc->bytes_per_block);
1264bf215546Sopenharmony_ci		return total_size;
1265bf215546Sopenharmony_ci	}
1266bf215546Sopenharmony_ci
1267bf215546Sopenharmony_ci	if (pitch == 0)
1268bf215546Sopenharmony_ci		pitch = svga3dsurface_calculate_pitch(desc, size);
1269bf215546Sopenharmony_ci
1270bf215546Sopenharmony_ci	slice_size = clamped_umul32(image_blocks.height, pitch);
1271bf215546Sopenharmony_ci	total_size = clamped_umul32(slice_size, image_blocks.depth);
1272bf215546Sopenharmony_ci
1273bf215546Sopenharmony_ci	return total_size;
1274bf215546Sopenharmony_ci}
1275bf215546Sopenharmony_ci
1276bf215546Sopenharmony_ci
1277bf215546Sopenharmony_cistatic inline uint32
1278bf215546Sopenharmony_cisvga3dsurface_get_image_offset(SVGA3dSurfaceFormat format,
1279bf215546Sopenharmony_ci                               SVGA3dSize baseLevelSize,
1280bf215546Sopenharmony_ci                               uint32 numMipLevels,
1281bf215546Sopenharmony_ci                               uint32 layer,
1282bf215546Sopenharmony_ci                               uint32 mip)
1283bf215546Sopenharmony_ci
1284bf215546Sopenharmony_ci{
1285bf215546Sopenharmony_ci   uint32 offset;
1286bf215546Sopenharmony_ci   uint32 mipChainBytes;
1287bf215546Sopenharmony_ci   uint32 mipChainBytesToLevel;
1288bf215546Sopenharmony_ci   uint32 i;
1289bf215546Sopenharmony_ci   const struct svga3d_surface_desc *desc;
1290bf215546Sopenharmony_ci   SVGA3dSize mipSize;
1291bf215546Sopenharmony_ci   uint32 bytes;
1292bf215546Sopenharmony_ci
1293bf215546Sopenharmony_ci   desc = svga3dsurface_get_desc(format);
1294bf215546Sopenharmony_ci
1295bf215546Sopenharmony_ci   mipChainBytes = 0;
1296bf215546Sopenharmony_ci   mipChainBytesToLevel = 0;
1297bf215546Sopenharmony_ci   for (i = 0; i < numMipLevels; i++) {
1298bf215546Sopenharmony_ci      mipSize = svga3dsurface_get_mip_size(baseLevelSize, i);
1299bf215546Sopenharmony_ci      bytes = svga3dsurface_get_image_buffer_size(desc, &mipSize, 0);
1300bf215546Sopenharmony_ci      mipChainBytes += bytes;
1301bf215546Sopenharmony_ci      if (i < mip) {
1302bf215546Sopenharmony_ci         mipChainBytesToLevel += bytes;
1303bf215546Sopenharmony_ci      }
1304bf215546Sopenharmony_ci   }
1305bf215546Sopenharmony_ci
1306bf215546Sopenharmony_ci   offset = mipChainBytes * layer + mipChainBytesToLevel;
1307bf215546Sopenharmony_ci
1308bf215546Sopenharmony_ci   return offset;
1309bf215546Sopenharmony_ci}
1310bf215546Sopenharmony_ci
1311bf215546Sopenharmony_ci
1312bf215546Sopenharmony_cistatic inline uint32
1313bf215546Sopenharmony_cisvga3dsurface_get_serialized_size(SVGA3dSurfaceFormat format,
1314bf215546Sopenharmony_ci				  SVGA3dSize base_level_size,
1315bf215546Sopenharmony_ci				  uint32 num_mip_levels,
1316bf215546Sopenharmony_ci                                  uint32 num_layers)
1317bf215546Sopenharmony_ci{
1318bf215546Sopenharmony_ci	const struct svga3d_surface_desc *desc = svga3dsurface_get_desc(format);
1319bf215546Sopenharmony_ci	uint64_t total_size = 0;
1320bf215546Sopenharmony_ci	uint32 mip;
1321bf215546Sopenharmony_ci
1322bf215546Sopenharmony_ci	for (mip = 0; mip < num_mip_levels; mip++) {
1323bf215546Sopenharmony_ci		SVGA3dSize size =
1324bf215546Sopenharmony_ci			svga3dsurface_get_mip_size(base_level_size, mip);
1325bf215546Sopenharmony_ci		total_size += svga3dsurface_get_image_buffer_size(desc,
1326bf215546Sopenharmony_ci								  &size, 0);
1327bf215546Sopenharmony_ci	}
1328bf215546Sopenharmony_ci
1329bf215546Sopenharmony_ci	total_size *= num_layers;
1330bf215546Sopenharmony_ci
1331bf215546Sopenharmony_ci	return (total_size > (uint64_t) MAX_UINT32) ? MAX_UINT32 :
1332bf215546Sopenharmony_ci                                                      (uint32) total_size;
1333bf215546Sopenharmony_ci}
1334bf215546Sopenharmony_ci
1335bf215546Sopenharmony_ci
1336bf215546Sopenharmony_ci/**
1337bf215546Sopenharmony_ci * svga3dsurface_get_serialized_size_extended - Returns the number of bytes
1338bf215546Sopenharmony_ci * required for a surface with given parameters. Support for sample count.
1339bf215546Sopenharmony_ci *
1340bf215546Sopenharmony_ci */
1341bf215546Sopenharmony_cistatic inline uint32
1342bf215546Sopenharmony_cisvga3dsurface_get_serialized_size_extended(SVGA3dSurfaceFormat format,
1343bf215546Sopenharmony_ci                                           SVGA3dSize base_level_size,
1344bf215546Sopenharmony_ci                                           uint32 num_mip_levels,
1345bf215546Sopenharmony_ci                                           uint32 num_layers,
1346bf215546Sopenharmony_ci                                           uint32 num_samples)
1347bf215546Sopenharmony_ci{
1348bf215546Sopenharmony_ci   uint64_t total_size = svga3dsurface_get_serialized_size(format,
1349bf215546Sopenharmony_ci                                                           base_level_size,
1350bf215546Sopenharmony_ci                                                           num_mip_levels,
1351bf215546Sopenharmony_ci                                                           num_layers);
1352bf215546Sopenharmony_ci
1353bf215546Sopenharmony_ci   total_size *= (num_samples > 1 ? num_samples : 1);
1354bf215546Sopenharmony_ci
1355bf215546Sopenharmony_ci   return (total_size > (uint64_t) MAX_UINT32) ? MAX_UINT32 :
1356bf215546Sopenharmony_ci      (uint32) total_size;
1357bf215546Sopenharmony_ci}
1358bf215546Sopenharmony_ci
1359bf215546Sopenharmony_ci
1360bf215546Sopenharmony_ci/**
1361bf215546Sopenharmony_ci * Compute the offset (in bytes) to a pixel in an image (or volume).
1362bf215546Sopenharmony_ci * 'width' is the image width in pixels
1363bf215546Sopenharmony_ci * 'height' is the image height in pixels
1364bf215546Sopenharmony_ci */
1365bf215546Sopenharmony_cistatic inline uint32
1366bf215546Sopenharmony_cisvga3dsurface_get_pixel_offset(SVGA3dSurfaceFormat format,
1367bf215546Sopenharmony_ci                               uint32 width, uint32 height,
1368bf215546Sopenharmony_ci                               uint32 x, uint32 y, uint32 z)
1369bf215546Sopenharmony_ci{
1370bf215546Sopenharmony_ci   const struct svga3d_surface_desc *desc = svga3dsurface_get_desc(format);
1371bf215546Sopenharmony_ci   const uint32 bw = desc->block_size.width, bh = desc->block_size.height;
1372bf215546Sopenharmony_ci   const uint32 bd = desc->block_size.depth;
1373bf215546Sopenharmony_ci   const uint32 rowstride = DIV_ROUND_UP(width, bw) * desc->bytes_per_block;
1374bf215546Sopenharmony_ci   const uint32 imgstride = DIV_ROUND_UP(height, bh) * rowstride;
1375bf215546Sopenharmony_ci   const uint32 offset = (z / bd * imgstride +
1376bf215546Sopenharmony_ci                          y / bh * rowstride +
1377bf215546Sopenharmony_ci                          x / bw * desc->bytes_per_block);
1378bf215546Sopenharmony_ci   return offset;
1379bf215546Sopenharmony_ci}
1380bf215546Sopenharmony_ci
1381bf215546Sopenharmony_ci#endif
1382