VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/vmsvga/svga_reg.h@ 50667

Last change on this file since 50667 was 49983, checked in by vboxsync, 11 years ago

Devices/Graphics: VMware SVGA II compatible graphics emulation (2D only), including the associated small API and VBoxManage changes, contributed by trivirt AG.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.7 KB
Line 
1/*
2 * VMware SVGA II hardware definitions
3 */
4
5#ifndef _SVGA_REG_H_
6#define _SVGA_REG_H_
7
8#define PCI_VENDOR_ID_VMWARE 0x15AD
9#define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405
10
11#define SVGA_IRQFLAG_ANY_FENCE 0x1
12#define SVGA_IRQFLAG_FIFO_PROGRESS 0x2
13#define SVGA_IRQFLAG_FENCE_GOAL 0x4
14
15#define SVGA_MAX_PSEUDOCOLOR_DEPTH 8
16#define SVGA_MAX_PSEUDOCOLORS (1 << SVGA_MAX_PSEUDOCOLOR_DEPTH)
17#define SVGA_NUM_PALETTE_REGS (3 * SVGA_MAX_PSEUDOCOLORS)
18
19#define SVGA_MAGIC 0x900000UL
20#define SVGA_MAKE_ID(ver) (SVGA_MAGIC << 8 | (ver))
21
22#define SVGA_VERSION_2 2
23#define SVGA_ID_2 SVGA_MAKE_ID(SVGA_VERSION_2)
24
25#define SVGA_VERSION_1 1
26#define SVGA_ID_1 SVGA_MAKE_ID(SVGA_VERSION_1)
27
28#define SVGA_VERSION_0 0
29#define SVGA_ID_0 SVGA_MAKE_ID(SVGA_VERSION_0)
30
31#define SVGA_ID_INVALID 0xFFFFFFFF
32
33#define SVGA_INDEX_PORT 0x0
34#define SVGA_VALUE_PORT 0x1
35#define SVGA_BIOS_PORT 0x2
36#define SVGA_IRQSTATUS_PORT 0x8
37
38#define SVGA_IRQFLAG_ANY_FENCE 0x1
39#define SVGA_IRQFLAG_FIFO_PROGRESS 0x2
40#define SVGA_IRQFLAG_FENCE_GOAL 0x4
41
42enum
43{
44 SVGA_REG_ID = 0,
45 SVGA_REG_ENABLE = 1,
46 SVGA_REG_WIDTH = 2,
47 SVGA_REG_HEIGHT = 3,
48 SVGA_REG_MAX_WIDTH = 4,
49 SVGA_REG_MAX_HEIGHT = 5,
50 SVGA_REG_DEPTH = 6,
51 SVGA_REG_BITS_PER_PIXEL = 7,
52 SVGA_REG_PSEUDOCOLOR = 8,
53 SVGA_REG_RED_MASK = 9,
54 SVGA_REG_GREEN_MASK = 10,
55 SVGA_REG_BLUE_MASK = 11,
56 SVGA_REG_BYTES_PER_LINE = 12,
57 SVGA_REG_FB_START = 13,
58 SVGA_REG_FB_OFFSET = 14,
59 SVGA_REG_VRAM_SIZE = 15,
60 SVGA_REG_FB_SIZE = 16,
61 SVGA_REG_CAPABILITIES = 17,
62 SVGA_REG_MEM_START = 18,
63 SVGA_REG_MEM_SIZE = 19,
64 SVGA_REG_CONFIG_DONE = 20,
65 SVGA_REG_SYNC = 21,
66 SVGA_REG_BUSY = 22,
67 SVGA_REG_GUEST_ID = 23,
68 SVGA_REG_CURSOR_ID = 24,
69 SVGA_REG_CURSOR_X = 25,
70 SVGA_REG_CURSOR_Y = 26,
71 SVGA_REG_CURSOR_ON = 27,
72 SVGA_REG_HOST_BITS_PER_PIXEL = 28,
73 SVGA_REG_SCRATCH_SIZE = 29,
74 SVGA_REG_MEM_REGS = 30,
75 SVGA_REG_NUM_DISPLAYS = 31,
76 SVGA_REG_PITCHLOCK = 32,
77 SVGA_REG_IRQMASK = 33,
78 SVGA_REG_NUM_GUEST_DISPLAYS = 34,
79 SVGA_REG_DISPLAY_ID = 35,
80 SVGA_REG_DISPLAY_IS_PRIMARY = 36,
81 SVGA_REG_DISPLAY_POSITION_X = 37,
82 SVGA_REG_DISPLAY_POSITION_Y = 38,
83 SVGA_REG_DISPLAY_WIDTH = 39,
84 SVGA_REG_DISPLAY_HEIGHT = 40,
85 SVGA_REG_GMR_ID = 41,
86 SVGA_REG_GMR_DESCRIPTOR = 42,
87 SVGA_REG_GMR_MAX_IDS = 43,
88 SVGA_REG_GMR_MAX_DESCRIPTOR_LENGTH = 44,
89 SVGA_REG_TRACES = 45,
90 SVGA_REG_GMRS_MAX_PAGES = 46,
91 SVGA_REG_MEMORY_SIZE = 47,
92 SVGA_REG_TOP = 48,
93 SVGA_PALETTE_BASE = 1024,
94 SVGA_SCRATCH_BASE = SVGA_PALETTE_BASE + SVGA_NUM_PALETTE_REGS
95};
96
97enum
98{
99 SVGA_FIFO_MIN = 0,
100 SVGA_FIFO_MAX,
101 SVGA_FIFO_NEXT_CMD,
102 SVGA_FIFO_STOP,
103 SVGA_FIFO_CAPABILITIES = 4,
104 SVGA_FIFO_FLAGS,
105 SVGA_FIFO_FENCE,
106 SVGA_FIFO_3D_HWVERSION,
107 SVGA_FIFO_PITCHLOCK,
108 SVGA_FIFO_CURSOR_ON,
109 SVGA_FIFO_CURSOR_X,
110 SVGA_FIFO_CURSOR_Y,
111 SVGA_FIFO_CURSOR_COUNT,
112 SVGA_FIFO_CURSOR_LAST_UPDATED,
113 SVGA_FIFO_RESERVED,
114 SVGA_FIFO_CURSOR_SCREEN_ID,
115 SVGA_FIFO_DEAD,
116 SVGA_FIFO_3D_HWVERSION_REVISED,
117 SVGA_FIFO_3D_CAPS = 32,
118 SVGA_FIFO_3D_CAPS_LAST = 32 + 255,
119 SVGA_FIFO_GUEST_3D_HWVERSION,
120 SVGA_FIFO_FENCE_GOAL,
121 SVGA_FIFO_BUSY,
122 SVGA_FIFO_NUM_REGS
123};
124
125typedef enum
126{
127 SVGA_CMD_INVALID_CMD = 0,
128 SVGA_CMD_UPDATE = 1,
129 SVGA_CMD_RECT_COPY = 3,
130 SVGA_CMD_DEFINE_CURSOR = 19,
131 SVGA_CMD_DEFINE_ALPHA_CURSOR = 22,
132 SVGA_CMD_UPDATE_VERBOSE = 25,
133 SVGA_CMD_FRONT_ROP_FILL = 29,
134 SVGA_CMD_FENCE = 30,
135 SVGA_CMD_ESCAPE = 33,
136 SVGA_CMD_DEFINE_SCREEN = 34,
137 SVGA_CMD_DESTROY_SCREEN = 35,
138 SVGA_CMD_DEFINE_GMRFB = 36,
139 SVGA_CMD_BLIT_GMRFB_TO_SCREEN = 37,
140 SVGA_CMD_BLIT_SCREEN_TO_GMRFB = 38,
141 SVGA_CMD_ANNOTATION_FILL = 39,
142 SVGA_CMD_ANNOTATION_COPY = 40,
143 SVGA_CMD_DEFINE_GMR2 = 41,
144 SVGA_CMD_REMAP_GMR2 = 42,
145 SVGA_CMD_MAX
146} SVGAFifoCmdId;
147
148typedef struct SVGAColorBGRX
149{
150 union
151 {
152 struct
153 {
154 uint32_t b : 8;
155 uint32_t g : 8;
156 uint32_t r : 8;
157 uint32_t x : 8;
158 } s;
159
160 uint32_t value;
161 };
162} SVGAColorBGRX;
163
164typedef struct SVGASignedPoint
165{
166 int32_t x;
167 int32_t y;
168} SVGASignedPoint;
169
170#define SVGA_CAP_NONE 0x00000000
171#define SVGA_CAP_RECT_COPY 0x00000002
172#define SVGA_CAP_CURSOR 0x00000020
173#define SVGA_CAP_CURSOR_BYPASS 0x00000040
174#define SVGA_CAP_CURSOR_BYPASS_2 0x00000080
175#define SVGA_CAP_8BIT_EMULATION 0x00000100
176#define SVGA_CAP_ALPHA_CURSOR 0x00000200
177#define SVGA_CAP_3D 0x00004000
178#define SVGA_CAP_EXTENDED_FIFO 0x00008000
179#define SVGA_CAP_MULTIMON 0x00010000
180#define SVGA_CAP_PITCHLOCK 0x00020000
181#define SVGA_CAP_IRQMASK 0x00040000
182#define SVGA_CAP_DISPLAY_TOPOLOGY 0x00080000
183#define SVGA_CAP_GMR 0x00100000
184#define SVGA_CAP_TRACES 0x00200000
185#define SVGA_CAP_GMR2 0x00400000
186#define SVGA_CAP_SCREEN_OBJECT_2 0x00800000
187
188#define SVGA_GMR_NULL ((uint32_t) -1)
189#define SVGA_GMR_FRAMEBUFFER ((uint32_t) -2)
190
191typedef struct SVGAGuestPtr
192{
193 uint32_t gmrId;
194 uint32_t offset;
195} SVGAGuestPtr;
196
197typedef struct SVGAGMRImageFormat
198{
199 union
200 {
201 struct
202 {
203 uint32_t bitsPerPixel : 8;
204 uint32_t colorDepth : 8;
205 uint32_t reserved : 16;
206 } s;
207
208 uint32_t value;
209 };
210} SVGAGMRImageFormat;
211
212typedef struct SVGAGuestImage
213{
214 SVGAGuestPtr ptr;
215 uint32_t pitch;
216} SVGAGuestImage;
217
218#define SVGA_SCREEN_MUST_BE_SET (1 << 0)
219#define SVGA_SCREEN_HAS_ROOT SVGA_SCREEN_MUST_BE_SET
220#define SVGA_SCREEN_IS_PRIMARY (1 << 1)
221#define SVGA_SCREEN_FULLSCREEN_HINT (1 << 2)
222#define SVGA_SCREEN_DEACTIVATE (1 << 3)
223#define SVGA_SCREEN_BLANKING (1 << 4)
224
225typedef struct SVGAScreenObject
226{
227 uint32_t structSize;
228 uint32_t id;
229 uint32_t flags;
230 struct
231 {
232 uint32_t width;
233 uint32_t height;
234 } size;
235 struct
236 {
237 int32_t x;
238 int32_t y;
239 } root;
240 SVGAGuestImage backingStore;
241 uint32_t cloneCount;
242} SVGAScreenObject;
243
244typedef struct
245{
246 uint32_t screenId;
247} SVGAFifoCmdDestroyScreen;
248
249typedef struct
250{
251 uint32_t x;
252 uint32_t y;
253 uint32_t width;
254 uint32_t height;
255} SVGAFifoCmdUpdate;
256
257typedef struct
258{
259 uint32_t fence;
260} SVGAFifoCmdFence;
261
262typedef struct
263{
264 uint32_t nsid;
265 uint32_t size;
266} SVGAFifoCmdEscape;
267
268typedef struct
269{
270 uint32_t id;
271 uint32_t hotspotX;
272 uint32_t hotspotY;
273 uint32_t width;
274 uint32_t height;
275 uint32_t andMaskDepth;
276 uint32_t xorMaskDepth;
277} SVGAFifoCmdDefineCursor;
278
279typedef struct
280{
281 uint32_t id;
282 uint32_t hotspotX;
283 uint32_t hotspotY;
284 uint32_t width;
285 uint32_t height;
286} SVGAFifoCmdDefineAlphaCursor;
287
288typedef struct
289{
290 SVGAScreenObject screen;
291} SVGAFifoCmdDefineScreen;
292
293typedef struct
294{
295 SVGAColorBGRX color;
296} SVGAFifoCmdAnnotationFill;
297
298typedef struct
299{
300 SVGASignedPoint srcOrigin;
301 uint32_t srcScreenId;
302} SVGAFifoCmdAnnotationCopy;
303
304#define SVGA_FIFO_CAP_NONE 0
305#define SVGA_FIFO_CAP_FENCE (1<<0)
306#define SVGA_FIFO_CAP_ACCELFRONT (1<<1)
307#define SVGA_FIFO_CAP_PITCHLOCK (1<<2)
308#define SVGA_FIFO_CAP_VIDEO (1<<3)
309#define SVGA_FIFO_CAP_CURSOR_BYPASS_3 (1<<4)
310#define SVGA_FIFO_CAP_ESCAPE (1<<5)
311#define SVGA_FIFO_CAP_RESERVE (1<<6)
312#define SVGA_FIFO_CAP_SCREEN_OBJECT (1<<7)
313#define SVGA_FIFO_CAP_GMR2 (1<<8)
314#define SVGA_FIFO_CAP_3D_HWVERSION_REVISED SVGA_FIFO_CAP_GMR2
315#define SVGA_FIFO_CAP_SCREEN_OBJECT_2 (1<<9)
316#define SVGA_FIFO_CAP_DEAD (1<<10)
317
318#endif /* _SVGA_REG_H_ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette