VirtualBox

source: vbox/trunk/include/VBox/Graphics/VBoxVideoVBEPrivate.h@ 69179

最後變更 在這個檔案從69179是 69055,由 vboxsync 提交於 7 年 前

build fix: VGABIOS can't use IPRT types

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

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