ReactOS  0.4.14-dev-317-g96040ec
vbe.h
Go to the documentation of this file.
1 /*
2  * PROJECT: VGA Miniport Driver
3  * LICENSE: BSD - See COPYING.ARM in the top level directory
4  * FILE: win32ss/drivers/miniport/vga_new/vbe.h
5  * PURPOSE: VESA VBE Registers and Structures
6  * PROGRAMMERS: ReactOS Portable Systems Group
7  */
8 
9 #pragma once
10 
11 #define LOWORD(l) ((USHORT)((ULONG_PTR)(l)))
12 #define HIWORD(l) ((USHORT)(((ULONG_PTR)(l)>>16)&0xFFFF))
13 
14 
15 /*
16  * VBE Command Definitions
17  */
18 
19 #define VBE_GET_CONTROLLER_INFORMATION 0x4F00
20 #define VBE_GET_MODE_INFORMATION 0x4F01
21 #define VBE_SET_VBE_MODE 0x4F02
22 #define VBE_GET_CURRENT_VBE_MODE 0x4F03
23 #define VBE_SAVE_RESTORE_STATE 0x4F04
24 #define VBE_DISPLAY_WINDOW_CONTROL 0x4F05
25 #define VBE_SET_GET_LOGICAL_SCAN_LINE_LENGTH 0x4F06
26 #define VBE_SET_GET_DISPLAY_START 0x4F07
27 #define VBE_SET_GET_DAC_PALETTE_FORMAT 0x4F08
28 #define VBE_SET_GET_PALETTE_DATA 0x4F09
29 
30 /* VBE 2.0+ */
31 #define VBE_RETURN_PROTECTED_MODE_INTERFACE 0x4F0A
32 #define VBE_GET_SET_PIXEL_CLOCK 0x4F0B
33 
34 /* Extensions */
35 #define VBE_POWER_MANAGEMENT_EXTENSIONS 0x4F10
36 #define VBE_FLAT_PANEL_INTERFACE_EXTENSIONS 0x4F11
37 #define VBE_AUDIO_INTERFACE_EXTENSIONS 0x4F12
38 #define VBE_OEM_EXTENSIONS 0x4F13
39 #define VBE_DISPLAY_DATA_CHANNEL 0x4F14
40 #define VBE_DDC 0x4F15
41 
42 /*
43  * VBE DDC Sub-Functions
44  */
45 
46 #define VBE_DDC_READ_EDID 0x01
47 #define VBE_DDC_REPORT_CAPABILITIES 0x10
48 #define VBE_DDC_BEGIN_SCL_SDA_CONTROL 0x11
49 #define VBE_DDC_END_SCL_SDA_CONTROL 0x12
50 #define VBE_DDC_WRITE_SCL_CLOCK_LINE 0x13
51 #define VBE_DDC_WRITE_SDA_DATA_LINE 0x14
52 #define VBE_DDC_READ_SCL_CLOCK_LINE 0x15
53 #define VBE_DDC_READ_SDA_DATA_LINE 0x16
54 
55 /*
56  * VBE Video Mode Information Definitions
57  */
58 #define VBE_MODEATTR_VALID 0x01
59 #define VBE_MODEATTR_COLOR 0x08
60 #define VBE_MODEATTR_GRAPHICS 0x10
61 #define VBE_MODEATTR_NON_VGA 0x20
62 #define VBE_MODEATTR_NO_BANK_SWITCH 0x40
63 #define VBE_MODEATTR_LINEAR 0x80
64 
65 #define VBE_MODE_BITS 8
66 #define VBE_MODE_RESERVED_1 0x200
67 #define VBE_MODE_RESERVED_2 0x400
68 #define VBE_MODE_REFRESH_CONTROL 0x800
69 #define VBE_MODE_ACCELERATED_1 0x1000
70 #define VBE_MODE_ACCELERATED_2 0x2000
71 #define VBE_MODE_LINEAR_FRAMEBUFFER 0x4000
72 #define VBE_MODE_PRESERVE_DISPLAY 0x8000
73 #define VBE_MODE_MASK ((1 << (VBE_MODE_BITS + 1)) - 1)
74 
75 #define VBE_MEMORYMODEL_PACKEDPIXEL 0x04
76 #define VBE_MEMORYMODEL_DIRECTCOLOR 0x06
77 
78 /*
79  * VBE Return Codes
80  */
81 
82 #define VBE_SUCCESS 0x4F
83 #define VBE_UNSUCCESSFUL 0x14F
84 #define VBE_NOT_SUPPORTED 0x24F
85 #define VBE_FUNCTION_INVALID 0x34F
86 
87 #define VBE_GETRETURNCODE(x) (x & 0xFFFF)
88 
89 #include <pshpack1.h>
90 
91 /*
92  * VBE specification defined structure for general adapter info
93  * returned by function VBE_GET_CONTROLLER_INFORMATION command.
94  */
95 
96 typedef struct _VBE_CONTROLLER_INFO
97 {
109  CHAR OemData[256];
111 
112 /*
113  * VBE specification defined structure for specific video mode
114  * info returned by function VBE_GET_MODE_INFORMATION command.
115  */
116 
117 typedef struct _VBE_MODE_INFO
118 {
119  /* Mandatory information for all VBE revisions */
129 
130  /* Mandatory information for VBE 1.2 and above */
142 
143  /* Direct Color fields (required for Direct/6 and YUV/7 memory models) */
153 
154  /* Mandatory information for VBE 2.0 and above */
158 
159  /* Mandatory information for VBE 3.0 and above */
172 
175 
176 #include <poppack.h>
177 
178 typedef struct _VBE_INFO
179 {
183 } VBE_INFO, *PVBE_INFO;
184 
185 C_ASSERT(sizeof(VBE_CONTROLLER_INFO) == 0x200);
186 C_ASSERT(sizeof(VBE_MODE_INFO) == 0x100);
187 
188 typedef struct _VBE_COLOR_REGISTER
189 {
195 
196 VOID
197 NTAPI
199 
200 VP_STATUS
201 NTAPI
202 VbeSetMode(IN PHW_DEVICE_EXTENSION VgaDeviceExtension,
204  OUT PULONG PhysPtrChange);
205 
206 VP_STATUS
207 NTAPI
209  IN PVIDEO_CLUT ClutBuffer);
210 
211 BOOLEAN
212 NTAPI
214  IN PVBE_INFO VbeInfo);
215 
217 
218 /* VBE2 magic number */
219 #define VBE2_MAGIC ('V' + ('B' << 8) + ('E' << 16) + ('2' << 24))
220 
221 /* EOF */
struct _VBE_COLOR_REGISTER VBE_COLOR_REGISTER
ULONG PhysBasePtr
Definition: vbe.h:155
CHAR Reserved4[190]
Definition: vbe.h:173
#define IN
Definition: typedefs.h:38
struct _VBE_CONTROLLER_INFO * PVBE_CONTROLLER_INFO
ULONG OemVendorNamePtr
Definition: vbe.h:105
UCHAR LinGreenFieldPosition
Definition: vbe.h:166
UCHAR BlueMaskSize
Definition: vbe.h:148
USHORT Version
Definition: vbe.h:99
UCHAR LinBlueFieldPosition
Definition: vbe.h:168
USHORT ModeArray[129]
Definition: vbe.h:182
char CHAR
Definition: xmlstorage.h:175
UCHAR NumberOfImagePages
Definition: vbe.h:140
ULONG Signature
Definition: vbe.h:98
UCHAR LinReservedFieldPosition
Definition: vbe.h:170
UCHAR BlueFieldPosition
Definition: vbe.h:149
USHORT ModeAttributes
Definition: vbe.h:120
UCHAR XCharSize
Definition: vbe.h:133
ULONG MaxPixelClock
Definition: vbe.h:171
UCHAR MemoryModel
Definition: vbe.h:138
USHORT WinASegment
Definition: vbe.h:125
UCHAR LinGreenMaskSize
Definition: vbe.h:165
LONG Capabilities
Definition: vbe.h:101
UCHAR BankSize
Definition: vbe.h:139
BOOLEAN g_bIntelBrookdaleBIOS
Definition: vbe.c:31
Definition: vga.h:250
ULONG OemProductRevPtr
Definition: vbe.h:107
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VBE_MODE_INFO Modes
Definition: vbe.h:181
long LONG
Definition: pedump.c:60
UCHAR BitsPerPixel
Definition: vbe.h:136
UCHAR WinBAttributes
Definition: vbe.h:122
UCHAR ReservedMaskSize
Definition: vbe.h:150
C_ASSERT(sizeof(VBE_INFORMATION)==256)
UCHAR NumberOfBanks
Definition: vbe.h:137
USHORT WinBSegment
Definition: vbe.h:126
unsigned char BOOLEAN
VOID NTAPI InitializeModeTable(IN PHW_DEVICE_EXTENSION VgaExtension)
Definition: vbemodes.c:159
UCHAR LinRedMaskSize
Definition: vbe.h:163
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
UCHAR ReservedFieldPosition
Definition: vbe.h:151
USHORT Reserved3
Definition: vbe.h:157
ULONG WinFuncPtr
Definition: vbe.h:127
USHORT WinGranularity
Definition: vbe.h:123
USHORT WinSize
Definition: vbe.h:124
Definition: vbe.h:178
UCHAR RedFieldPosition
Definition: vbe.h:145
UCHAR WinAAttributes
Definition: vbe.h:121
UCHAR RedMaskSize
Definition: vbe.h:144
USHORT LinBytesPerScanLine
Definition: vbe.h:160
ULONG OemStringPtr
Definition: vbe.h:100
UCHAR DirectColorModeInfo
Definition: vbe.h:152
UCHAR GreenMaskSize
Definition: vbe.h:146
struct _VBE_INFO * PVBE_INFO
USHORT BytesPerScanLine
Definition: vbe.h:128
ULONG Reserved2
Definition: vbe.h:156
unsigned char UCHAR
Definition: xmlstorage.h:181
ULONG VideoModePtr
Definition: vbe.h:102
UCHAR GreenFieldPosition
Definition: vbe.h:147
UCHAR LinRedFieldPosition
Definition: vbe.h:164
USHORT TotalMemory
Definition: vbe.h:103
CHAR OemData[256]
Definition: vbe.h:109
USHORT XResolution
Definition: vbe.h:131
BOOLEAN NTAPI ValidateVbeInfo(IN PHW_DEVICE_EXTENSION VgaExtension, IN PVBE_INFO VbeInfo)
Definition: vbe.c:78
VBE_CONTROLLER_INFO Info
Definition: vbe.h:180
struct _VBE_MODE_INFO * PVBE_MODE_INFO
struct _VBE_INFO VBE_INFO
UCHAR Reserved1
Definition: vbe.h:141
struct _VBE_CONTROLLER_INFO VBE_CONTROLLER_INFO
unsigned short USHORT
Definition: pedump.c:61
unsigned int * PULONG
Definition: retypes.h:1
UCHAR LinNumberOfImagePages
Definition: vbe.h:162
UCHAR BnkNumberOfImagePages
Definition: vbe.h:161
struct _VBE_MODE_INFO VBE_MODE_INFO
VP_STATUS NTAPI VbeSetColorLookup(IN PHW_DEVICE_EXTENSION VgaExtension, IN PVIDEO_CLUT ClutBuffer)
Definition: vbe.c:141
static BOOLEAN VgaMode
Definition: options.c:87
#define OUT
Definition: typedefs.h:39
UCHAR YCharSize
Definition: vbe.h:134
USHORT OemSoftwareRevision
Definition: vbe.h:104
unsigned int ULONG
Definition: retypes.h:1
LONG VP_STATUS
Definition: video.h:153
UCHAR LinBlueMaskSize
Definition: vbe.h:167
UCHAR NumberOfPlanes
Definition: vbe.h:135
struct _VBE_COLOR_REGISTER * PVBE_COLOR_REGISTER
ULONG OemProductNamePtr
Definition: vbe.h:106
UCHAR LinReservedMaskSize
Definition: vbe.h:169
VP_STATUS NTAPI VbeSetMode(IN PHW_DEVICE_EXTENSION VgaDeviceExtension, IN PVIDEOMODE VgaMode, OUT PULONG PhysPtrChange)
Definition: vbemodes.c:88
USHORT YResolution
Definition: vbe.h:132