xref: /netbsd-src/sys/external/bsd/drm2/dist/drm/vmwgfx/device_include/svga3d_caps.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: svga3d_caps.h,v 1.3 2021/12/18 23:45:45 riastradh Exp $	*/
2 
3 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
4 /**********************************************************
5  * Copyright 2007-2015 VMware, Inc.
6  *
7  * Permission is hereby granted, free of charge, to any person
8  * obtaining a copy of this software and associated documentation
9  * files (the "Software"), to deal in the Software without
10  * restriction, including without limitation the rights to use, copy,
11  * modify, merge, publish, distribute, sublicense, and/or sell copies
12  * of the Software, and to permit persons to whom the Software is
13  * furnished to do so, subject to the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be
16  * included in all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
22  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25  * SOFTWARE.
26  *
27  **********************************************************/
28 
29 /*
30  * svga3d_caps.h --
31  *
32  *       Definitions for SVGA3D hardware capabilities.  Capabilities
33  *       are used to query for optional rendering features during
34  *       driver initialization. The capability data is stored as very
35  *       basic key/value dictionary within the "FIFO register" memory
36  *       area at the beginning of BAR2.
37  *
38  *       Note that these definitions are only for 3D capabilities.
39  *       The SVGA device also has "device capabilities" and "FIFO
40  *       capabilities", which are non-3D-specific and are stored as
41  *       bitfields rather than key/value pairs.
42  */
43 
44 #ifndef _SVGA3D_CAPS_H_
45 #define _SVGA3D_CAPS_H_
46 
47 #define INCLUDE_ALLOW_MODULE
48 #define INCLUDE_ALLOW_USERLEVEL
49 
50 #include "includeCheck.h"
51 
52 #include "svga_reg.h"
53 
54 #define SVGA_FIFO_3D_CAPS_SIZE   (SVGA_FIFO_3D_CAPS_LAST - \
55                                   SVGA_FIFO_3D_CAPS + 1)
56 
57 
58 /*
59  * SVGA3dCapsRecordType
60  *
61  *    Record types that can be found in the caps block.
62  *    Related record types are grouped together numerically so that
63  *    SVGA3dCaps_FindRecord() can be applied on a range of record
64  *    types.
65  */
66 
67 typedef enum {
68    SVGA3DCAPS_RECORD_UNKNOWN        = 0,
69    SVGA3DCAPS_RECORD_DEVCAPS_MIN    = 0x100,
70    SVGA3DCAPS_RECORD_DEVCAPS        = 0x100,
71    SVGA3DCAPS_RECORD_DEVCAPS_MAX    = 0x1ff,
72 } SVGA3dCapsRecordType;
73 
74 
75 /*
76  * SVGA3dCapsRecordHeader
77  *
78  *    Header field leading each caps block record. Contains the offset (in
79  *    register words, NOT bytes) to the next caps block record (or the end
80  *    of caps block records which will be a zero word) and the record type
81  *    as defined above.
82  */
83 
84 typedef
85 #include "vmware_pack_begin.h"
86 struct SVGA3dCapsRecordHeader {
87    uint32 length;
88    SVGA3dCapsRecordType type;
89 }
90 #include "vmware_pack_end.h"
91 SVGA3dCapsRecordHeader;
92 
93 
94 /*
95  * SVGA3dCapsRecord
96  *
97  *    Caps block record; "data" is a placeholder for the actual data structure
98  *    contained within the record;
99  */
100 
101 typedef
102 #include "vmware_pack_begin.h"
103 struct SVGA3dCapsRecord {
104    SVGA3dCapsRecordHeader header;
105    uint32 data[1];
106 }
107 #include "vmware_pack_end.h"
108 SVGA3dCapsRecord;
109 
110 
111 typedef uint32 SVGA3dCapPair[2];
112 
113 #endif
114