1 | /** @file
|
---|
2 | * VirtualBox graphics card definitions, private interface for firmware
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2024 Oracle and/or its affiliates.
|
---|
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_INCLUDED_Graphics_VBoxVideoVBEPrivate_h
|
---|
31 | #define VBOX_INCLUDED_Graphics_VBoxVideoVBEPrivate_h
|
---|
32 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
33 | # pragma once
|
---|
34 | #endif
|
---|
35 |
|
---|
36 | #ifdef VBE
|
---|
37 | # include <stdint.h>
|
---|
38 | #else
|
---|
39 | # include <iprt/types.h>
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | /* VBE Mode Numbers */
|
---|
43 | #define VBE_MODE_VESA_DEFINED 0x0100
|
---|
44 | #define VBE_MODE_REFRESH_RATE_USE_CRTC 0x0800
|
---|
45 | #define VBE_MODE_LINEAR_FRAME_BUFFER 0x4000
|
---|
46 | #define VBE_MODE_PRESERVE_DISPLAY_MEMORY 0x8000
|
---|
47 |
|
---|
48 | /* VBE GFX Mode Number */
|
---|
49 | #define VBE_VESA_MODE_640X400X8 0x100
|
---|
50 | #define VBE_VESA_MODE_640X480X8 0x101
|
---|
51 | #define VBE_VESA_MODE_800X600X4 0x102
|
---|
52 | #define VBE_VESA_MODE_800X600X8 0x103
|
---|
53 | #define VBE_VESA_MODE_1024X768X4 0x104
|
---|
54 | #define VBE_VESA_MODE_1024X768X8 0x105
|
---|
55 | #define VBE_VESA_MODE_1280X1024X4 0x106
|
---|
56 | #define VBE_VESA_MODE_1280X1024X8 0x107
|
---|
57 | #define VBE_VESA_MODE_320X200X1555 0x10D
|
---|
58 | #define VBE_VESA_MODE_320X200X565 0x10E
|
---|
59 | #define VBE_VESA_MODE_320X200X888 0x10F
|
---|
60 | #define VBE_VESA_MODE_640X480X1555 0x110
|
---|
61 | #define VBE_VESA_MODE_640X480X565 0x111
|
---|
62 | #define VBE_VESA_MODE_640X480X888 0x112
|
---|
63 | #define VBE_VESA_MODE_800X600X1555 0x113
|
---|
64 | #define VBE_VESA_MODE_800X600X565 0x114
|
---|
65 | #define VBE_VESA_MODE_800X600X888 0x115
|
---|
66 | #define VBE_VESA_MODE_1024X768X1555 0x116
|
---|
67 | #define VBE_VESA_MODE_1024X768X565 0x117
|
---|
68 | #define VBE_VESA_MODE_1024X768X888 0x118
|
---|
69 | #define VBE_VESA_MODE_1280X1024X1555 0x119
|
---|
70 | #define VBE_VESA_MODE_1280X1024X565 0x11A
|
---|
71 | #define VBE_VESA_MODE_1280X1024X888 0x11B
|
---|
72 | #define VBE_VESA_MODE_1600X1200X8 0x11C
|
---|
73 | #define VBE_VESA_MODE_1600X1200X1555 0x11D
|
---|
74 | #define VBE_VESA_MODE_1600X1200X565 0x11E
|
---|
75 | #define VBE_VESA_MODE_1600X1200X888 0x11F
|
---|
76 |
|
---|
77 | /* BOCHS/PLEX86 'own' mode numbers */
|
---|
78 | #define VBE_OWN_MODE_320X200X8888 0x140
|
---|
79 | #define VBE_OWN_MODE_640X400X8888 0x141
|
---|
80 | #define VBE_OWN_MODE_640X480X8888 0x142
|
---|
81 | #define VBE_OWN_MODE_800X600X8888 0x143
|
---|
82 | #define VBE_OWN_MODE_1024X768X8888 0x144
|
---|
83 | #define VBE_OWN_MODE_1280X1024X8888 0x145
|
---|
84 | #define VBE_OWN_MODE_320X200X8 0x146
|
---|
85 | #define VBE_OWN_MODE_1600X1200X8888 0x147
|
---|
86 | #define VBE_OWN_MODE_1152X864X8 0x148
|
---|
87 | #define VBE_OWN_MODE_1152X864X1555 0x149
|
---|
88 | #define VBE_OWN_MODE_1152X864X565 0x14a
|
---|
89 | #define VBE_OWN_MODE_1152X864X888 0x14b
|
---|
90 | #define VBE_OWN_MODE_1152X864X8888 0x14c
|
---|
91 |
|
---|
92 | /* VirtualBox 'own' mode numbers */
|
---|
93 | #define VBE_VBOX_MODE_CUSTOM1 0x160
|
---|
94 | #define VBE_VBOX_MODE_CUSTOM2 0x161
|
---|
95 | #define VBE_VBOX_MODE_CUSTOM3 0x162
|
---|
96 | #define VBE_VBOX_MODE_CUSTOM4 0x163
|
---|
97 | #define VBE_VBOX_MODE_CUSTOM5 0x164
|
---|
98 | #define VBE_VBOX_MODE_CUSTOM6 0x165
|
---|
99 | #define VBE_VBOX_MODE_CUSTOM7 0x166
|
---|
100 | #define VBE_VBOX_MODE_CUSTOM8 0x167
|
---|
101 | #define VBE_VBOX_MODE_CUSTOM9 0x168
|
---|
102 | #define VBE_VBOX_MODE_CUSTOM10 0x169
|
---|
103 | #define VBE_VBOX_MODE_CUSTOM11 0x16a
|
---|
104 | #define VBE_VBOX_MODE_CUSTOM12 0x16b
|
---|
105 | #define VBE_VBOX_MODE_CUSTOM13 0x16c
|
---|
106 | #define VBE_VBOX_MODE_CUSTOM14 0x16d
|
---|
107 | #define VBE_VBOX_MODE_CUSTOM15 0x16e
|
---|
108 | #define VBE_VBOX_MODE_CUSTOM16 0x16f
|
---|
109 |
|
---|
110 | #define VBE_VESA_MODE_END_OF_LIST 0xFFFF
|
---|
111 |
|
---|
112 | /* Capabilities */
|
---|
113 | #define VBE_CAPABILITY_8BIT_DAC 0x0001
|
---|
114 | #define VBE_CAPABILITY_NOT_VGA_COMPATIBLE 0x0002
|
---|
115 | #define VBE_CAPABILITY_RAMDAC_USE_BLANK_BIT 0x0004
|
---|
116 | #define VBE_CAPABILITY_STEREOSCOPIC_SUPPORT 0x0008
|
---|
117 | #define VBE_CAPABILITY_STEREO_VIA_VESA_EVC 0x0010
|
---|
118 |
|
---|
119 | /* Mode Attributes */
|
---|
120 | #define VBE_MODE_ATTRIBUTE_SUPPORTED 0x0001
|
---|
121 | #define VBE_MODE_ATTRIBUTE_EXTENDED_INFORMATION_AVAILABLE 0x0002
|
---|
122 | #define VBE_MODE_ATTRIBUTE_TTY_BIOS_SUPPORT 0x0004
|
---|
123 | #define VBE_MODE_ATTRIBUTE_COLOR_MODE 0x0008
|
---|
124 | #define VBE_MODE_ATTRIBUTE_GRAPHICS_MODE 0x0010
|
---|
125 | #define VBE_MODE_ATTRIBUTE_NOT_VGA_COMPATIBLE 0x0020
|
---|
126 | #define VBE_MODE_ATTRIBUTE_NO_VGA_COMPATIBLE_WINDOW 0x0040
|
---|
127 | #define VBE_MODE_ATTRIBUTE_LINEAR_FRAME_BUFFER_MODE 0x0080
|
---|
128 | #define VBE_MODE_ATTRIBUTE_DOUBLE_SCAN_MODE 0x0100
|
---|
129 | #define VBE_MODE_ATTRIBUTE_INTERLACE_MODE 0x0200
|
---|
130 | #define VBE_MODE_ATTRIBUTE_HARDWARE_TRIPLE_BUFFER 0x0400
|
---|
131 | #define VBE_MODE_ATTRIBUTE_HARDWARE_STEREOSCOPIC_DISPLAY 0x0800
|
---|
132 | #define VBE_MODE_ATTRIBUTE_DUAL_DISPLAY_START_ADDRESS 0x1000
|
---|
133 |
|
---|
134 | #define VBE_MODE_ATTTRIBUTE_LFB_ONLY ( VBE_MODE_ATTRIBUTE_NO_VGA_COMPATIBLE_WINDOW | VBE_MODE_ATTRIBUTE_LINEAR_FRAME_BUFFER_MODE )
|
---|
135 |
|
---|
136 | /* Window attributes */
|
---|
137 | #define VBE_WINDOW_ATTRIBUTE_RELOCATABLE 0x01
|
---|
138 | #define VBE_WINDOW_ATTRIBUTE_READABLE 0x02
|
---|
139 | #define VBE_WINDOW_ATTRIBUTE_WRITEABLE 0x04
|
---|
140 |
|
---|
141 | /* Memory model */
|
---|
142 | #define VBE_MEMORYMODEL_TEXT_MODE 0x00
|
---|
143 | #define VBE_MEMORYMODEL_CGA_GRAPHICS 0x01
|
---|
144 | #define VBE_MEMORYMODEL_HERCULES_GRAPHICS 0x02
|
---|
145 | #define VBE_MEMORYMODEL_PLANAR 0x03
|
---|
146 | #define VBE_MEMORYMODEL_PACKED_PIXEL 0x04
|
---|
147 | #define VBE_MEMORYMODEL_NON_CHAIN_4_256 0x05
|
---|
148 | #define VBE_MEMORYMODEL_DIRECT_COLOR 0x06
|
---|
149 | #define VBE_MEMORYMODEL_YUV 0x07
|
---|
150 |
|
---|
151 | /* DirectColorModeInfo */
|
---|
152 | #define VBE_DIRECTCOLOR_COLOR_RAMP_PROGRAMMABLE 0x01
|
---|
153 | #define VBE_DIRECTCOLOR_RESERVED_BITS_AVAILABLE 0x02
|
---|
154 |
|
---|
155 | /* Video memory */
|
---|
156 | #define VGAMEM_GRAPH 0xA000
|
---|
157 |
|
---|
158 | /**
|
---|
159 | * VBE Bios Extra Data structure.
|
---|
160 | */
|
---|
161 | typedef struct VBEHeader
|
---|
162 | {
|
---|
163 | /** Signature (VBEHEADER_MAGIC). */
|
---|
164 | uint16_t u16Signature;
|
---|
165 | /** Data size. */
|
---|
166 | uint16_t cbData;
|
---|
167 | } VBEHeader;
|
---|
168 |
|
---|
169 | /** The value of the VBEHeader::u16Signature field. */
|
---|
170 | #define VBEHEADER_MAGIC 0x77CC
|
---|
171 |
|
---|
172 | /** The extra port which is used to read the mode list. */
|
---|
173 | #define VBE_EXTRA_PORT 0x3b6
|
---|
174 |
|
---|
175 | /** The extra port which is used for debug printf. */
|
---|
176 | #define VBE_PRINTF_PORT 0x3b7
|
---|
177 |
|
---|
178 | /**
|
---|
179 | * This one is for compactly storing a list of mode info blocks
|
---|
180 | */
|
---|
181 | #pragma pack(1) /* pack(1) is important! (you'll get a byte extra for each of the u8 fields elsewise...)
|
---|
182 | * bird: Load of non-sense. You'll get two extra bytes before MaxPixelClock if you don't pack it. */
|
---|
183 | typedef struct ModeInfoBlockCompact
|
---|
184 | {
|
---|
185 | /* Mandatory information for all VBE revisions */
|
---|
186 | uint16_t ModeAttributes;
|
---|
187 | uint8_t WinAAttributes;
|
---|
188 | uint8_t WinBAttributes;
|
---|
189 | uint16_t WinGranularity;
|
---|
190 | uint16_t WinSize;
|
---|
191 | uint16_t WinASegment;
|
---|
192 | uint16_t WinBSegment;
|
---|
193 | uint32_t WinFuncPtr;
|
---|
194 | uint16_t BytesPerScanLine;
|
---|
195 | /* Mandatory information for VBE 1.2 and above */
|
---|
196 | uint16_t XResolution;
|
---|
197 | uint16_t YResolution;
|
---|
198 | uint8_t XCharSize;
|
---|
199 | uint8_t YCharSize;
|
---|
200 | uint8_t NumberOfPlanes;
|
---|
201 | uint8_t BitsPerPixel;
|
---|
202 | uint8_t NumberOfBanks;
|
---|
203 | uint8_t MemoryModel;
|
---|
204 | uint8_t BankSize;
|
---|
205 | uint8_t NumberOfImagePages;
|
---|
206 | uint8_t Reserved_page;
|
---|
207 | /* Direct Color fields (required for direct/6 and YUV/7 memory models) */
|
---|
208 | uint8_t RedMaskSize;
|
---|
209 | uint8_t RedFieldPosition;
|
---|
210 | uint8_t GreenMaskSize;
|
---|
211 | uint8_t GreenFieldPosition;
|
---|
212 | uint8_t BlueMaskSize;
|
---|
213 | uint8_t BlueFieldPosition;
|
---|
214 | uint8_t RsvdMaskSize;
|
---|
215 | uint8_t RsvdFieldPosition;
|
---|
216 | uint8_t DirectColorModeInfo;
|
---|
217 | /* Mandatory information for VBE 2.0 and above */
|
---|
218 | uint32_t PhysBasePtr;
|
---|
219 | uint32_t OffScreenMemOffset;
|
---|
220 | uint16_t OffScreenMemSize;
|
---|
221 | /* Mandatory information for VBE 3.0 and above */
|
---|
222 | uint16_t LinBytesPerScanLine;
|
---|
223 | uint8_t BnkNumberOfPages;
|
---|
224 | uint8_t LinNumberOfPages;
|
---|
225 | uint8_t LinRedMaskSize;
|
---|
226 | uint8_t LinRedFieldPosition;
|
---|
227 | uint8_t LinGreenMaskSize;
|
---|
228 | uint8_t LinGreenFieldPosition;
|
---|
229 | uint8_t LinBlueMaskSize;
|
---|
230 | uint8_t LinBlueFieldPosition;
|
---|
231 | uint8_t LinRsvdMaskSize;
|
---|
232 | uint8_t LinRsvdFieldPosition;
|
---|
233 | uint32_t MaxPixelClock;
|
---|
234 | } ModeInfoBlockCompact;
|
---|
235 | #pragma pack()
|
---|
236 |
|
---|
237 | typedef struct ModeInfoListItem
|
---|
238 | {
|
---|
239 | uint16_t mode;
|
---|
240 | ModeInfoBlockCompact info;
|
---|
241 | } ModeInfoListItem;
|
---|
242 |
|
---|
243 |
|
---|
244 | #endif /* !VBOX_INCLUDED_Graphics_VBoxVideoVBEPrivate_h */
|
---|
245 |
|
---|