ReactOS 0.4.16-dev-297-gc569aee
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
97{
111
112/*
113 * VBE specification defined structure for specific video mode
114 * info returned by function VBE_GET_MODE_INFORMATION command.
115 */
116
117typedef 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
178typedef struct _VBE_INFO
179{
184
186C_ASSERT(sizeof(VBE_MODE_INFO) == 0x100);
187
189{
195
196VOID
197NTAPI
199
201NTAPI
202VbeSetMode(IN PHW_DEVICE_EXTENSION VgaDeviceExtension,
204 OUT PULONG PhysPtrChange);
205
207NTAPI
209 IN PVIDEO_CLUT ClutBuffer);
210
212NTAPI
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 */
unsigned char BOOLEAN
static BOOLEAN VgaMode
Definition: options.c:87
#define C_ASSERT(e)
Definition: intsafe.h:73
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
LONG VP_STATUS
Definition: video.h:153
ULONG VideoModePtr
Definition: vbe.h:102
USHORT TotalMemory
Definition: vbe.h:103
USHORT OemSoftwareRevision
Definition: vbe.h:104
ULONG Signature
Definition: vbe.h:98
LONG Capabilities
Definition: vbe.h:101
ULONG OemStringPtr
Definition: vbe.h:100
ULONG OemProductNamePtr
Definition: vbe.h:106
USHORT Version
Definition: vbe.h:99
CHAR OemData[256]
Definition: vbe.h:109
ULONG OemProductRevPtr
Definition: vbe.h:107
ULONG OemVendorNamePtr
Definition: vbe.h:105
Definition: vbe.h:179
VBE_MODE_INFO Modes
Definition: vbe.h:181
VBE_CONTROLLER_INFO Info
Definition: vbe.h:180
USHORT ModeArray[129]
Definition: vbe.h:182
UCHAR MemoryModel
Definition: vbe.h:138
USHORT WinGranularity
Definition: vbe.h:123
UCHAR BankSize
Definition: vbe.h:139
UCHAR LinGreenFieldPosition
Definition: vbe.h:166
UCHAR BlueMaskSize
Definition: vbe.h:148
USHORT ModeAttributes
Definition: vbe.h:120
USHORT Reserved3
Definition: vbe.h:157
CHAR Reserved4[190]
Definition: vbe.h:173
UCHAR BnkNumberOfImagePages
Definition: vbe.h:161
USHORT YResolution
Definition: vbe.h:132
UCHAR LinNumberOfImagePages
Definition: vbe.h:162
USHORT BytesPerScanLine
Definition: vbe.h:128
ULONG WinFuncPtr
Definition: vbe.h:127
UCHAR GreenMaskSize
Definition: vbe.h:146
USHORT LinBytesPerScanLine
Definition: vbe.h:160
USHORT WinSize
Definition: vbe.h:124
UCHAR ReservedFieldPosition
Definition: vbe.h:151
UCHAR GreenFieldPosition
Definition: vbe.h:147
UCHAR RedFieldPosition
Definition: vbe.h:145
UCHAR XCharSize
Definition: vbe.h:133
UCHAR LinBlueFieldPosition
Definition: vbe.h:168
UCHAR NumberOfImagePages
Definition: vbe.h:140
USHORT WinASegment
Definition: vbe.h:125
UCHAR BitsPerPixel
Definition: vbe.h:136
UCHAR LinReservedFieldPosition
Definition: vbe.h:170
UCHAR NumberOfPlanes
Definition: vbe.h:135
ULONG Reserved2
Definition: vbe.h:156
ULONG MaxPixelClock
Definition: vbe.h:171
UCHAR RedMaskSize
Definition: vbe.h:144
UCHAR WinAAttributes
Definition: vbe.h:121
USHORT WinBSegment
Definition: vbe.h:126
UCHAR LinReservedMaskSize
Definition: vbe.h:169
UCHAR LinRedMaskSize
Definition: vbe.h:163
UCHAR LinBlueMaskSize
Definition: vbe.h:167
USHORT XResolution
Definition: vbe.h:131
UCHAR YCharSize
Definition: vbe.h:134
UCHAR Reserved1
Definition: vbe.h:141
UCHAR WinBAttributes
Definition: vbe.h:122
UCHAR ReservedMaskSize
Definition: vbe.h:150
UCHAR NumberOfBanks
Definition: vbe.h:137
UCHAR BlueFieldPosition
Definition: vbe.h:149
ULONG PhysBasePtr
Definition: vbe.h:155
UCHAR LinRedFieldPosition
Definition: vbe.h:164
UCHAR LinGreenMaskSize
Definition: vbe.h:165
UCHAR DirectColorModeInfo
Definition: vbe.h:152
struct _VBE_MODE_INFO VBE_MODE_INFO
struct _VBE_MODE_INFO * PVBE_MODE_INFO
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
struct _VBE_CONTROLLER_INFO * PVBE_CONTROLLER_INFO
struct _VBE_INFO VBE_INFO
struct _VBE_COLOR_REGISTER VBE_COLOR_REGISTER
VOID NTAPI InitializeModeTable(IN PHW_DEVICE_EXTENSION VgaExtension)
Definition: vbemodes.c:159
VP_STATUS NTAPI VbeSetMode(IN PHW_DEVICE_EXTENSION VgaDeviceExtension, IN PVIDEOMODE VgaMode, OUT PULONG PhysPtrChange)
Definition: vbemodes.c:88
BOOLEAN g_bIntelBrookdaleBIOS
Definition: vbe.c:31
struct _VBE_INFO * PVBE_INFO
BOOLEAN NTAPI ValidateVbeInfo(IN PHW_DEVICE_EXTENSION VgaExtension, IN PVBE_INFO VbeInfo)
Definition: vbe.c:78
struct _VBE_COLOR_REGISTER * PVBE_COLOR_REGISTER
struct _VBE_CONTROLLER_INFO VBE_CONTROLLER_INFO
VP_STATUS NTAPI VbeSetColorLookup(IN PHW_DEVICE_EXTENSION VgaExtension, IN PVIDEO_CLUT ClutBuffer)
Definition: vbe.c:141
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
unsigned char UCHAR
Definition: xmlstorage.h:181
char CHAR
Definition: xmlstorage.h:175