1 | /** @file
|
---|
2 | * VirtualBox graphics card definitions, private interface for firmware
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2017 Oracle Corporation
|
---|
7 | *
|
---|
8 | * Permission is hereby granted, free of charge, to any person
|
---|
9 | * obtaining a copy of this software and associated documentation
|
---|
10 | * files (the "Software"), to deal in the Software without
|
---|
11 | * restriction, including without limitation the rights to use,
|
---|
12 | * copy, modify, merge, publish, distribute, sublicense, and/or sell
|
---|
13 | * copies of the Software, and to permit persons to whom the
|
---|
14 | * Software is furnished to do so, subject to the following
|
---|
15 | * conditions:
|
---|
16 | *
|
---|
17 | * The above copyright notice and this permission notice shall be
|
---|
18 | * included in all copies or substantial portions of the Software.
|
---|
19 | *
|
---|
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
---|
21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
---|
22 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
---|
23 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
---|
24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
---|
25 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
---|
26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
---|
27 | * OTHER DEALINGS IN THE SOFTWARE.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef ___VBox_Graphics_VBoxVideoVBEPrivate_h
|
---|
31 | #define ___VBox_Graphics_VBoxVideoVBEPrivate_h
|
---|
32 |
|
---|
33 | #ifdef VBE
|
---|
34 | # include <stdint.h>
|
---|
35 | #else
|
---|
36 | # include <iprt/types.h>
|
---|
37 | #endif
|
---|
38 |
|
---|
39 | /* VBE Mode Numbers */
|
---|
40 | #define VBE_MODE_VESA_DEFINED 0x0100
|
---|
41 | #define VBE_MODE_REFRESH_RATE_USE_CRTC 0x0800
|
---|
42 | #define VBE_MODE_LINEAR_FRAME_BUFFER 0x4000
|
---|
43 | #define VBE_MODE_PRESERVE_DISPLAY_MEMORY 0x8000
|
---|
44 |
|
---|
45 | /* VBE GFX Mode Number */
|
---|
46 | #define VBE_VESA_MODE_640X400X8 0x100
|
---|
47 | #define VBE_VESA_MODE_640X480X8 0x101
|
---|
48 | #define VBE_VESA_MODE_800X600X4 0x102
|
---|
49 | #define VBE_VESA_MODE_800X600X8 0x103
|
---|
50 | #define VBE_VESA_MODE_1024X768X4 0x104
|
---|
51 | #define VBE_VESA_MODE_1024X768X8 0x105
|
---|
52 | #define VBE_VESA_MODE_1280X1024X4 0x106
|
---|
53 | #define VBE_VESA_MODE_1280X1024X8 0x107
|
---|
54 | #define VBE_VESA_MODE_320X200X1555 0x10D
|
---|
55 | #define VBE_VESA_MODE_320X200X565 0x10E
|
---|
56 | #define VBE_VESA_MODE_320X200X888 0x10F
|
---|
57 | #define VBE_VESA_MODE_640X480X1555 0x110
|
---|
58 | #define VBE_VESA_MODE_640X480X565 0x111
|
---|
59 | #define VBE_VESA_MODE_640X480X888 0x112
|
---|
60 | #define VBE_VESA_MODE_800X600X1555 0x113
|
---|
61 | #define VBE_VESA_MODE_800X600X565 0x114
|
---|
62 | #define VBE_VESA_MODE_800X600X888 0x115
|
---|
63 | #define VBE_VESA_MODE_1024X768X1555 0x116
|
---|
64 | #define VBE_VESA_MODE_1024X768X565 0x117
|
---|
65 | #define VBE_VESA_MODE_1024X768X888 0x118
|
---|
66 | #define VBE_VESA_MODE_1280X1024X1555 0x119
|
---|
67 | #define VBE_VESA_MODE_1280X1024X565 0x11A
|
---|
68 | #define VBE_VESA_MODE_1280X1024X888 0x11B
|
---|
69 | #define VBE_VESA_MODE_1600X1200X8 0x11C
|
---|
70 | #define VBE_VESA_MODE_1600X1200X1555 0x11D
|
---|
71 | #define VBE_VESA_MODE_1600X1200X565 0x11E
|
---|
72 | #define VBE_VESA_MODE_1600X1200X888 0x11F
|
---|
73 |
|
---|
74 | /* BOCHS/PLEX86 'own' mode numbers */
|
---|
75 | #define VBE_OWN_MODE_320X200X8888 0x140
|
---|
76 | #define VBE_OWN_MODE_640X400X8888 0x141
|
---|
77 | #define VBE_OWN_MODE_640X480X8888 0x142
|
---|
78 | #define VBE_OWN_MODE_800X600X8888 0x143
|
---|
79 | #define VBE_OWN_MODE_1024X768X8888 0x144
|
---|
80 | #define VBE_OWN_MODE_1280X1024X8888 0x145
|
---|
81 | #define VBE_OWN_MODE_320X200X8 0x146
|
---|
82 | #define VBE_OWN_MODE_1600X1200X8888 0x147
|
---|
83 | #define VBE_OWN_MODE_1152X864X8 0x148
|
---|
84 | #define VBE_OWN_MODE_1152X864X1555 0x149
|
---|
85 | #define VBE_OWN_MODE_1152X864X565 0x14a
|
---|
86 | #define VBE_OWN_MODE_1152X864X888 0x14b
|
---|
87 | #define VBE_OWN_MODE_1152X864X8888 0x14c
|
---|
88 |
|
---|
89 | /* VirtualBox 'own' mode numbers */
|
---|
90 | #define VBE_VBOX_MODE_CUSTOM1 0x160
|
---|
91 | #define VBE_VBOX_MODE_CUSTOM2 0x161
|
---|
92 | #define VBE_VBOX_MODE_CUSTOM3 0x162
|
---|
93 | #define VBE_VBOX_MODE_CUSTOM4 0x163
|
---|
94 | #define VBE_VBOX_MODE_CUSTOM5 0x164
|
---|
95 | #define VBE_VBOX_MODE_CUSTOM6 0x165
|
---|
96 | #define VBE_VBOX_MODE_CUSTOM7 0x166
|
---|
97 | #define VBE_VBOX_MODE_CUSTOM8 0x167
|
---|
98 | #define VBE_VBOX_MODE_CUSTOM9 0x168
|
---|
99 | #define VBE_VBOX_MODE_CUSTOM10 0x169
|
---|
100 | #define VBE_VBOX_MODE_CUSTOM11 0x16a
|
---|
101 | #define VBE_VBOX_MODE_CUSTOM12 0x16b
|
---|
102 | #define VBE_VBOX_MODE_CUSTOM13 0x16c
|
---|
103 | #define VBE_VBOX_MODE_CUSTOM14 0x16d
|
---|
104 | #define VBE_VBOX_MODE_CUSTOM15 0x16e
|
---|
105 | #define VBE_VBOX_MODE_CUSTOM16 0x16f
|
---|
106 |
|
---|
107 | #define VBE_VESA_MODE_END_OF_LIST 0xFFFF
|
---|
108 |
|
---|
109 | /* Capabilities */
|
---|
110 | #define VBE_CAPABILITY_8BIT_DAC 0x0001
|
---|
111 | #define VBE_CAPABILITY_NOT_VGA_COMPATIBLE 0x0002
|
---|
112 | #define VBE_CAPABILITY_RAMDAC_USE_BLANK_BIT 0x0004
|
---|
113 | #define VBE_CAPABILITY_STEREOSCOPIC_SUPPORT 0x0008
|
---|
114 | #define VBE_CAPABILITY_STEREO_VIA_VESA_EVC 0x0010
|
---|
115 |
|
---|
116 | /* Mode Attributes */
|
---|
117 | #define VBE_MODE_ATTRIBUTE_SUPPORTED 0x0001
|
---|
118 | #define VBE_MODE_ATTRIBUTE_EXTENDED_INFORMATION_AVAILABLE 0x0002
|
---|
119 | #define VBE_MODE_ATTRIBUTE_TTY_BIOS_SUPPORT 0x0004
|
---|
120 | #define VBE_MODE_ATTRIBUTE_COLOR_MODE 0x0008
|
---|
121 | #define VBE_MODE_ATTRIBUTE_GRAPHICS_MODE 0x0010
|
---|
122 | #define VBE_MODE_ATTRIBUTE_NOT_VGA_COMPATIBLE 0x0020
|
---|
123 | #define VBE_MODE_ATTRIBUTE_NO_VGA_COMPATIBLE_WINDOW 0x0040
|
---|
124 | #define VBE_MODE_ATTRIBUTE_LINEAR_FRAME_BUFFER_MODE 0x0080
|
---|
125 | #define VBE_MODE_ATTRIBUTE_DOUBLE_SCAN_MODE 0x0100
|
---|
126 | #define VBE_MODE_ATTRIBUTE_INTERLACE_MODE 0x0200
|
---|
127 | #define VBE_MODE_ATTRIBUTE_HARDWARE_TRIPLE_BUFFER 0x0400
|
---|
128 | #define VBE_MODE_ATTRIBUTE_HARDWARE_STEREOSCOPIC_DISPLAY 0x0800
|
---|
129 | #define VBE_MODE_ATTRIBUTE_DUAL_DISPLAY_START_ADDRESS 0x1000
|
---|
130 |
|
---|
131 | #define VBE_MODE_ATTTRIBUTE_LFB_ONLY ( VBE_MODE_ATTRIBUTE_NO_VGA_COMPATIBLE_WINDOW | VBE_MODE_ATTRIBUTE_LINEAR_FRAME_BUFFER_MODE )
|
---|
132 |
|
---|
133 | /* Window attributes */
|
---|
134 | #define VBE_WINDOW_ATTRIBUTE_RELOCATABLE 0x01
|
---|
135 | #define VBE_WINDOW_ATTRIBUTE_READABLE 0x02
|
---|
136 | #define VBE_WINDOW_ATTRIBUTE_WRITEABLE 0x04
|
---|
137 |
|
---|
138 | /* Memory model */
|
---|
139 | #define VBE_MEMORYMODEL_TEXT_MODE 0x00
|
---|
140 | #define VBE_MEMORYMODEL_CGA_GRAPHICS 0x01
|
---|
141 | #define VBE_MEMORYMODEL_HERCULES_GRAPHICS 0x02
|
---|
142 | #define VBE_MEMORYMODEL_PLANAR 0x03
|
---|
143 | #define VBE_MEMORYMODEL_PACKED_PIXEL 0x04
|
---|
144 | #define VBE_MEMORYMODEL_NON_CHAIN_4_256 0x05
|
---|
145 | #define VBE_MEMORYMODEL_DIRECT_COLOR 0x06
|
---|
146 | #define VBE_MEMORYMODEL_YUV 0x07
|
---|
147 |
|
---|
148 | /* DirectColorModeInfo */
|
---|
149 | #define VBE_DIRECTCOLOR_COLOR_RAMP_PROGRAMMABLE 0x01
|
---|
150 | #define VBE_DIRECTCOLOR_RESERVED_BITS_AVAILABLE 0x02
|
---|
151 |
|
---|
152 | /* Video memory */
|
---|
153 | #define VGAMEM_GRAPH 0xA000
|
---|
154 |
|
---|
155 | /**
|
---|
156 | * VBE Bios Extra Data structure.
|
---|
157 | */
|
---|
158 | typedef struct VBEHeader
|
---|
159 | {
|
---|
160 | /** Signature (VBEHEADER_MAGIC). */
|
---|
161 | uint16_t u16Signature;
|
---|
162 | /** Data size. */
|
---|
163 | uint16_t cbData;
|
---|
164 | } VBEHeader;
|
---|
165 |
|
---|
166 | /** The value of the VBEHeader::u16Signature field. */
|
---|
167 | #define VBEHEADER_MAGIC 0x77CC
|
---|
168 |
|
---|
169 | /** The extra port which is used to read the mode list. */
|
---|
170 | #define VBE_EXTRA_PORT 0x3b6
|
---|
171 |
|
---|
172 | /** The extra port which is used for debug printf. */
|
---|
173 | #define VBE_PRINTF_PORT 0x3b7
|
---|
174 |
|
---|
175 | /*
|
---|
176 | * This one is for compactly storing a list of mode info blocks
|
---|
177 | */
|
---|
178 | #pragma pack(1) /* pack(1) is important! (you'll get a byte extra for each of the u8 fields elsewise...) */
|
---|
179 | typedef struct ModeInfoBlockCompact
|
---|
180 | {
|
---|
181 | /* Mandatory information for all VBE revisions */
|
---|
182 | uint16_t ModeAttributes;
|
---|
183 | uint8_t WinAAttributes;
|
---|
184 | uint8_t WinBAttributes;
|
---|
185 | uint16_t WinGranularity;
|
---|
186 | uint16_t WinSize;
|
---|
187 | uint16_t WinASegment;
|
---|
188 | uint16_t WinBSegment;
|
---|
189 | uint32_t WinFuncPtr;
|
---|
190 | uint16_t BytesPerScanLine;
|
---|
191 | /* Mandatory information for VBE 1.2 and above */
|
---|
192 | uint16_t XResolution;
|
---|
193 | uint16_t YResolution;
|
---|
194 | uint8_t XCharSize;
|
---|
195 | uint8_t YCharSize;
|
---|
196 | uint8_t NumberOfPlanes;
|
---|
197 | uint8_t BitsPerPixel;
|
---|
198 | uint8_t NumberOfBanks;
|
---|
199 | uint8_t MemoryModel;
|
---|
200 | uint8_t BankSize;
|
---|
201 | uint8_t NumberOfImagePages;
|
---|
202 | uint8_t Reserved_page;
|
---|
203 | /* Direct Color fields (required for direct/6 and YUV/7 memory models) */
|
---|
204 | uint8_t RedMaskSize;
|
---|
205 | uint8_t RedFieldPosition;
|
---|
206 | uint8_t GreenMaskSize;
|
---|
207 | uint8_t GreenFieldPosition;
|
---|
208 | uint8_t BlueMaskSize;
|
---|
209 | uint8_t BlueFieldPosition;
|
---|
210 | uint8_t RsvdMaskSize;
|
---|
211 | uint8_t RsvdFieldPosition;
|
---|
212 | uint8_t DirectColorModeInfo;
|
---|
213 | /* Mandatory information for VBE 2.0 and above */
|
---|
214 | uint32_t PhysBasePtr;
|
---|
215 | uint32_t OffScreenMemOffset;
|
---|
216 | uint16_t OffScreenMemSize;
|
---|
217 | /* Mandatory information for VBE 3.0 and above */
|
---|
218 | uint16_t LinBytesPerScanLine;
|
---|
219 | uint8_t BnkNumberOfPages;
|
---|
220 | uint8_t LinNumberOfPages;
|
---|
221 | uint8_t LinRedMaskSize;
|
---|
222 | uint8_t LinRedFieldPosition;
|
---|
223 | uint8_t LinGreenMaskSize;
|
---|
224 | uint8_t LinGreenFieldPosition;
|
---|
225 | uint8_t LinBlueMaskSize;
|
---|
226 | uint8_t LinBlueFieldPosition;
|
---|
227 | uint8_t LinRsvdMaskSize;
|
---|
228 | uint8_t LinRsvdFieldPosition;
|
---|
229 | uint32_t MaxPixelClock;
|
---|
230 | } ModeInfoBlockCompact;
|
---|
231 | #pragma pack()
|
---|
232 |
|
---|
233 | typedef struct ModeInfoListItem
|
---|
234 | {
|
---|
235 | uint16_t mode;
|
---|
236 | ModeInfoBlockCompact info;
|
---|
237 | } ModeInfoListItem;
|
---|
238 |
|
---|
239 |
|
---|
240 | #endif /* !___VBox_Graphics_VBoxVideoVBEPrivate_h */
|
---|
241 |
|
---|