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