ReactOS 0.4.15-dev-7681-g776c3a3
vbemp.h
Go to the documentation of this file.
1/*
2 * ReactOS VBE miniport video driver
3 *
4 * Copyright (C) 2004 Filip Navara
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#ifndef _VBEMP_PCH_
22#define _VBEMP_PCH_
23
24/* INCLUDES *******************************************************************/
25
26#include <ntdef.h>
27#include <dderror.h>
28#include <miniport.h>
29#include <video.h>
30
31#define TAG_VBE ' EBV'
32
33/*
34 * Compile-time define to get VBE 1.2 support. The implementation
35 * is far from complete now and so it's left undefined.
36 */
37
38/* #define VBE12_SUPPORT */
39
40#include <pshpack1.h>
41
42/*
43 * VBE Command Definitions
44 */
45
46#define VBE_GET_CONTROLLER_INFORMATION 0x4F00
47#define VBE_GET_MODE_INFORMATION 0x4F01
48#define VBE_SET_VBE_MODE 0x4F02
49#define VBE_GET_CURRENT_VBE_MODE 0x4F03
50#define VBE_SAVE_RESTORE_STATE 0x4F04
51#define VBE_DISPLAY_WINDOW_CONTROL 0x4F05
52#define VBE_SET_GET_LOGICAL_SCAN_LINE_LENGTH 0x4F06
53#define VBE_SET_GET_DISPLAY_START 0x4F07
54#define VBE_SET_GET_DAC_PALETTE_FORMAT 0x4F08
55#define VBE_SET_GET_PALETTE_DATA 0x4F09
56
57/* VBE 2.0+ */
58#define VBE_RETURN_PROTECTED_MODE_INTERFACE 0x4F0A
59#define VBE_GET_SET_PIXEL_CLOCK 0x4F0B
60
61/* Extensions */
62#define VBE_POWER_MANAGEMENT_EXTENSIONS 0x4F10
63#define VBE_FLAT_PANEL_INTERFACE_EXTENSIONS 0x4F11
64#define VBE_AUDIO_INTERFACE_EXTENSIONS 0x4F12
65#define VBE_OEM_EXTENSIONS 0x4F13
66#define VBE_DISPLAY_DATA_CHANNEL 0x4F14
67#define VBE_DDC 0x4F15
68
69/*
70 * VBE DDC Sub-Functions
71 */
72
73#define VBE_DDC_READ_EDID 0x01
74#define VBE_DDC_REPORT_CAPABILITIES 0x10
75#define VBE_DDC_BEGIN_SCL_SDA_CONTROL 0x11
76#define VBE_DDC_END_SCL_SDA_CONTROL 0x12
77#define VBE_DDC_WRITE_SCL_CLOCK_LINE 0x13
78#define VBE_DDC_WRITE_SDA_DATA_LINE 0x14
79#define VBE_DDC_READ_SCL_CLOCK_LINE 0x15
80#define VBE_DDC_READ_SDA_DATA_LINE 0x16
81
82/*
83 * VBE Video Mode Information Definitions
84 */
85
86#define VBE_MODEATTR_LINEAR 0x80
87
88#define VBE_MEMORYMODEL_PACKEDPIXEL 0x04
89#define VBE_MEMORYMODEL_DIRECTCOLOR 0x06
90
91/*
92 * VBE Return Codes
93 */
94
95#define VBE_SUCCESS 0x4F
96#define VBE_UNSUCCESSFUL 0x14F
97#define VBE_NOT_SUPPORTED 0x24F
98#define VBE_FUNCTION_INVALID 0x34F
99
100#define VBE_GETRETURNCODE(x) (x & 0xFFFF)
101
102/*
103 * VBE specification defined structure for general adapter info
104 * returned by function VBE_GET_CONTROLLER_INFORMATION command.
105 */
106
107typedef struct
108{
120 CHAR OemData[256];
122
123/*
124 * VBE specification defined structure for specific video mode
125 * info returned by function VBE_GET_MODE_INFORMATION command.
126 */
127
128typedef struct
129{
130 /* Mandatory information for all VBE revisions */
140
141 /* Mandatory information for VBE 1.2 and above */
153
154 /* Direct Color fields (required for Direct/6 and YUV/7 memory models) */
164
165 /* Mandatory information for VBE 2.0 and above */
169
170 /* Mandatory information for VBE 3.0 and above */
183
186
187#define MAX_SIZE_OF_EDID 256
188
189#include <poppack.h>
190
191typedef struct
192{
193 /* Interface to Int10 calls */
195
196 /* Trampoline memory for communication with VBE real-mode interface */
199
200 /* General controller/BIOS information */
202
203 /* Saved information about video modes */
208
209 /* Current child been enumerated */
212
213/* edid.c */
214
217 IN PVOID HwDeviceExtension,
218 IN PVIDEO_CHILD_ENUM_INFO ChildEnumInfo,
219 OUT PVIDEO_CHILD_TYPE VideoChildType,
220 OUT PUCHAR pChildDescriptor,
221 OUT PULONG UId,
222 OUT PULONG pUnused);
223
224/* vbemp.c */
227 IN PVOID HwDeviceExtension,
229 IN PWSTR ArgumentString,
230 IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo,
231 OUT PUCHAR Again);
232
234VBEInitialize(PVOID HwDeviceExtension);
235
238 PVOID HwDeviceExtension,
239 PVIDEO_REQUEST_PACKET RequestPacket);
240
243 PVOID DeviceExtension,
245 ULONG Rows);
246
249 PVOID HwDeviceExtension,
250 ULONG HwId,
251 PVIDEO_POWER_MANAGEMENT VideoPowerControl);
252
255 PVOID HwDeviceExtension,
256 ULONG HwId,
257 PVIDEO_POWER_MANAGEMENT VideoPowerControl);
258
261 PVBE_DEVICE_EXTENSION DeviceExtension,
262 PVIDEO_MODE RequestedMode,
263 PSTATUS_BLOCK StatusBlock);
264
267 PVBE_DEVICE_EXTENSION DeviceExtension,
268 PSTATUS_BLOCK StatusBlock);
269
272 PVBE_DEVICE_EXTENSION DeviceExtension,
273 PVIDEO_MEMORY RequestedAddress,
274 PVIDEO_MEMORY_INFORMATION MapInformation,
275 PSTATUS_BLOCK StatusBlock);
276
279 PVBE_DEVICE_EXTENSION DeviceExtension,
280 PVIDEO_MEMORY VideoMemory,
281 PSTATUS_BLOCK StatusBlock);
282
285 PVBE_DEVICE_EXTENSION DeviceExtension,
287 PSTATUS_BLOCK StatusBlock);
288
291 PVBE_DEVICE_EXTENSION DeviceExtension,
292 PVIDEO_MODE_INFORMATION ReturnedModes,
293 PSTATUS_BLOCK StatusBlock);
294
297 PVBE_DEVICE_EXTENSION DeviceExtension,
298 PVIDEO_MODE_INFORMATION VideoModeInfo,
299 PSTATUS_BLOCK StatusBlock);
300
303 PVBE_DEVICE_EXTENSION DeviceExtension,
304 PVIDEO_CLUT ColorLookUpTable,
305 PSTATUS_BLOCK StatusBlock);
306
307#endif /* _VBEMP_PCH_ */
unsigned char BOOLEAN
static const COLUMN_LIST Columns[]
Definition: listview.c:19
static const WCHAR Signature[]
Definition: parser.c:141
#define FASTCALL
Definition: nt_native.h:50
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
@ Reserved4
Definition: sacdrv.h:1472
_Must_inspect_result_ _In_ PVOID _In_ struct _HW_INITIALIZATION_DATA _In_ PVOID HwContext
Definition: srb.h:907
LONG VP_STATUS
Definition: video.h:153
enum _VIDEO_CHILD_TYPE * PVIDEO_CHILD_TYPE
VIDEO_PORT_INT10_INTERFACE Int10Interface
Definition: vbemp.h:194
PVBE_MODEINFO ModeInfo
Definition: vbemp.h:206
USHORT TrampolineMemorySegment
Definition: vbemp.h:197
USHORT * ModeNumbers
Definition: vbemp.h:205
USHORT TrampolineMemoryOffset
Definition: vbemp.h:198
VBE_INFO VbeInfo
Definition: vbemp.h:201
ULONG CurrentChildIndex
Definition: vbemp.h:210
USHORT CurrentMode
Definition: vbemp.h:207
ULONG OemStringPtr
Definition: vbemp.h:111
USHORT OemSoftwareRevision
Definition: vbemp.h:115
ULONG OemVendorNamePtr
Definition: vbemp.h:116
USHORT Version
Definition: vbemp.h:110
USHORT TotalMemory
Definition: vbemp.h:114
ULONG VideoModePtr
Definition: vbemp.h:113
ULONG OemProductRevPtr
Definition: vbemp.h:118
ULONG OemProductNamePtr
Definition: vbemp.h:117
LONG Capabilities
Definition: vbemp.h:112
UCHAR ReservedFieldPosition
Definition: vbemp.h:162
USHORT ModeAttributes
Definition: vbemp.h:131
UCHAR GreenFieldPosition
Definition: vbemp.h:158
UCHAR LinRedFieldPosition
Definition: vbemp.h:175
UCHAR LinGreenFieldPosition
Definition: vbemp.h:177
USHORT Reserved3
Definition: vbemp.h:168
UCHAR DirectColorModeInfo
Definition: vbemp.h:163
UCHAR BlueFieldPosition
Definition: vbemp.h:160
USHORT WinBSegment
Definition: vbemp.h:137
UCHAR NumberOfBanks
Definition: vbemp.h:148
USHORT WinSize
Definition: vbemp.h:135
UCHAR LinGreenMaskSize
Definition: vbemp.h:176
UCHAR NumberOfPlanes
Definition: vbemp.h:146
UCHAR LinBlueFieldPosition
Definition: vbemp.h:179
UCHAR LinReservedFieldPosition
Definition: vbemp.h:181
UCHAR RedMaskSize
Definition: vbemp.h:155
UCHAR BankSize
Definition: vbemp.h:150
UCHAR LinBlueMaskSize
Definition: vbemp.h:178
ULONG MaxPixelClock
Definition: vbemp.h:182
UCHAR BitsPerPixel
Definition: vbemp.h:147
UCHAR GreenMaskSize
Definition: vbemp.h:157
UCHAR WinBAttributes
Definition: vbemp.h:133
USHORT YResolution
Definition: vbemp.h:143
UCHAR WinAAttributes
Definition: vbemp.h:132
USHORT WinASegment
Definition: vbemp.h:136
UCHAR YCharSize
Definition: vbemp.h:145
ULONG WinFuncPtr
Definition: vbemp.h:138
UCHAR BnkNumberOfImagePages
Definition: vbemp.h:172
USHORT LinBytesPerScanLine
Definition: vbemp.h:171
UCHAR RedFieldPosition
Definition: vbemp.h:156
UCHAR LinNumberOfImagePages
Definition: vbemp.h:173
USHORT BytesPerScanLine
Definition: vbemp.h:139
UCHAR ReservedMaskSize
Definition: vbemp.h:161
UCHAR LinReservedMaskSize
Definition: vbemp.h:180
USHORT XResolution
Definition: vbemp.h:142
ULONG Reserved2
Definition: vbemp.h:167
UCHAR Reserved1
Definition: vbemp.h:152
UCHAR BlueMaskSize
Definition: vbemp.h:159
UCHAR XCharSize
Definition: vbemp.h:144
UCHAR LinRedMaskSize
Definition: vbemp.h:174
ULONG PhysBasePtr
Definition: vbemp.h:166
UCHAR MemoryModel
Definition: vbemp.h:149
UCHAR NumberOfImagePages
Definition: vbemp.h:151
USHORT WinGranularity
Definition: vbemp.h:134
static const VBE_MODE Modes[VBE_MODE_COUNT]
Definition: vbe.c:189
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
struct VBE_MODEINFO * PVBE_MODEINFO
BOOLEAN FASTCALL VBEResetDevice(PVBE_DEVICE_EXTENSION DeviceExtension, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:745
BOOLEAN NTAPI VBEResetHw(PVOID DeviceExtension, ULONG Columns, ULONG Rows)
Definition: vbemp.c:566
BOOLEAN FASTCALL VBEQueryAvailModes(PVBE_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION ReturnedModes, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:942
VP_STATUS NTAPI VBEGetPowerState(PVOID HwDeviceExtension, ULONG HwId, PVIDEO_POWER_MANAGEMENT VideoPowerControl)
Definition: vbemp.c:582
BOOLEAN FASTCALL VBESetCurrentMode(PVBE_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE RequestedMode, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:705
VP_STATUS NTAPI VBEGetVideoChildDescriptor(IN PVOID HwDeviceExtension, IN PVIDEO_CHILD_ENUM_INFO ChildEnumInfo, OUT PVIDEO_CHILD_TYPE VideoChildType, OUT PUCHAR pChildDescriptor, OUT PULONG UId, OUT PULONG pUnused)
Definition: edid.c:230
BOOLEAN FASTCALL VBEQueryCurrentMode(PVBE_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION VideoModeInfo, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:972
VP_STATUS NTAPI VBEFindAdapter(IN PVOID HwDeviceExtension, IN PVOID HwContext, IN PWSTR ArgumentString, IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo, OUT PUCHAR Again)
Definition: vbemp.c:78
BOOLEAN NTAPI VBEStartIO(PVOID HwDeviceExtension, PVIDEO_REQUEST_PACKET RequestPacket)
Definition: vbemp.c:442
BOOLEAN NTAPI VBEInitialize(PVOID HwDeviceExtension)
Definition: vbemp.c:182
VP_STATUS NTAPI VBESetPowerState(PVOID HwDeviceExtension, ULONG HwId, PVIDEO_POWER_MANAGEMENT VideoPowerControl)
Definition: vbemp.c:652
struct VBE_INFO * PVBE_INFO
BOOLEAN FASTCALL VBEUnmapVideoMemory(PVBE_DEVICE_EXTENSION DeviceExtension, PVIDEO_MEMORY VideoMemory, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:826
BOOLEAN FASTCALL VBESetColorRegisters(PVBE_DEVICE_EXTENSION DeviceExtension, PVIDEO_CLUT ColorLookUpTable, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:997
BOOLEAN FASTCALL VBEQueryNumAvailModes(PVBE_DEVICE_EXTENSION DeviceExtension, PVIDEO_NUM_MODES Modes, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:845
struct VBE_DEVICE_EXTENSION * PVBE_DEVICE_EXTENSION
BOOLEAN FASTCALL VBEMapVideoMemory(PVBE_DEVICE_EXTENSION DeviceExtension, PVIDEO_MEMORY RequestedAddress, PVIDEO_MEMORY_INFORMATION MapInformation, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:769
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
_In_ ULONG Rows
Definition: haltypes.h:7
unsigned char UCHAR
Definition: xmlstorage.h:181
char CHAR
Definition: xmlstorage.h:175