xref: /aosp_15_r20/external/mesa3d/src/gallium/drivers/svga/include/svga3d_caps.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright (c) 2007-2024 Broadcom. All Rights Reserved.
3  * The term “Broadcom” refers to Broadcom Inc.
4  * and/or its subsidiaries.
5  * SPDX-License-Identifier: GPL-2.0 OR MIT
6  */
7 
8 /*
9  * svga3d_caps.h --
10  *
11  *       Definitions for SVGA3D hardware capabilities.  Capabilities
12  *       are used to query for optional rendering features during
13  *       driver initialization. The capability data is stored as very
14  *       basic key/value dictionary within the "FIFO register" memory
15  *       area at the beginning of BAR2.
16  *
17  *       Note that these definitions are only for 3D capabilities.
18  *       The SVGA device also has "device capabilities" and "FIFO
19  *       capabilities", which are non-3D-specific and are stored as
20  *       bitfields rather than key/value pairs.
21  */
22 
23 #ifndef _SVGA3D_CAPS_H_
24 #define _SVGA3D_CAPS_H_
25 
26 #define INCLUDE_ALLOW_MODULE
27 #define INCLUDE_ALLOW_USERLEVEL
28 
29 #include "includeCheck.h"
30 
31 #include <string.h>
32 #include "svga_reg.h"
33 
34 #define SVGA_FIFO_3D_CAPS_SIZE   (SVGA_FIFO_3D_CAPS_LAST - \
35                                   SVGA_FIFO_3D_CAPS + 1)
36 
37 
38 /*
39  * SVGA3dCapsRecordType
40  *
41  *    Record types that can be found in the caps block.
42  *    Related record types are grouped together numerically so that
43  *    SVGA3dCaps_FindRecord() can be applied on a range of record
44  *    types.
45  */
46 
47 typedef enum {
48    SVGA3DCAPS_RECORD_UNKNOWN        = 0,
49    SVGA3DCAPS_RECORD_DEVCAPS_MIN    = 0x100,
50    SVGA3DCAPS_RECORD_DEVCAPS        = 0x100,
51    SVGA3DCAPS_RECORD_DEVCAPS_MAX    = 0x1ff,
52 } SVGA3dCapsRecordType;
53 
54 
55 /*
56  * SVGA3dCapsRecordHeader
57  *
58  *    Header field leading each caps block record. Contains the offset (in
59  *    register words, NOT bytes) to the next caps block record (or the end
60  *    of caps block records which will be a zero word) and the record type
61  *    as defined above.
62  */
63 
64 typedef
65 #include "vmware_pack_begin.h"
66 struct SVGA3dCapsRecordHeader {
67    uint32 length;
68    SVGA3dCapsRecordType type;
69 }
70 #include "vmware_pack_end.h"
71 SVGA3dCapsRecordHeader;
72 
73 
74 /*
75  * SVGA3dCapsRecord
76  *
77  *    Caps block record; "data" is a placeholder for the actual data structure
78  *    contained within the record; for example a record containing a FOOBAR
79  *    structure would be of size "sizeof(SVGA3dCapsRecordHeader) +
80  *    sizeof(FOOBAR)".
81  */
82 
83 typedef
84 #include "vmware_pack_begin.h"
85 struct SVGA3dCapsRecord {
86    SVGA3dCapsRecordHeader header;
87    uint32 data[1];
88 }
89 #include "vmware_pack_end.h"
90 SVGA3dCapsRecord;
91 
92 
93 typedef uint32 SVGA3dCapPair[2];
94 
95 
96 #endif
97