2 * ReactOS VBE miniport video driver
4 * Copyright (C) 2004 Filip Navara
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.
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.
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.
24 /* INCLUDES *******************************************************************/
31 #define TAG_VBE ' EBV'
34 * Compile-time define to get VBE 1.2 support. The implementation
35 * is far from complete now and so it's left undefined.
38 /* #define VBE12_SUPPORT */
43 * VBE Command Definitions
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
58 #define VBE_RETURN_PROTECTED_MODE_INTERFACE 0x4F0A
59 #define VBE_GET_SET_PIXEL_CLOCK 0x4F0B
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
70 * VBE DDC Sub-Functions
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
83 * VBE Video Mode Information Definitions
86 #define VBE_MODEATTR_LINEAR 0x80
88 #define VBE_MEMORYMODEL_PACKEDPIXEL 0x04
89 #define VBE_MEMORYMODEL_DIRECTCOLOR 0x06
95 #define VBE_SUCCESS 0x4F
96 #define VBE_UNSUCCESSFUL 0x14F
97 #define VBE_NOT_SUPPORTED 0x24F
98 #define VBE_FUNCTION_INVALID 0x34F
100 #define VBE_GETRETURNCODE(x) (x & 0xFFFF)
103 * VBE specification defined structure for general adapter info
104 * returned by function VBE_GET_CONTROLLER_INFORMATION command.
115 USHORT OemSoftwareRevision
;
116 ULONG OemVendorNamePtr
;
117 ULONG OemProductNamePtr
;
118 ULONG OemProductRevPtr
;
121 } VBE_INFO
, *PVBE_INFO
;
124 * VBE specification defined structure for specific video mode
125 * info returned by function VBE_GET_MODE_INFORMATION command.
130 /* Mandatory information for all VBE revisions */
131 USHORT ModeAttributes
;
132 UCHAR WinAAttributes
;
133 UCHAR WinBAttributes
;
134 USHORT WinGranularity
;
139 USHORT BytesPerScanLine
;
141 /* Mandatory information for VBE 1.2 and above */
146 UCHAR NumberOfPlanes
;
151 UCHAR NumberOfImagePages
;
154 /* Direct Color fields (required for Direct/6 and YUV/7 memory models) */
156 UCHAR RedFieldPosition
;
158 UCHAR GreenFieldPosition
;
160 UCHAR BlueFieldPosition
;
161 UCHAR ReservedMaskSize
;
162 UCHAR ReservedFieldPosition
;
163 UCHAR DirectColorModeInfo
;
165 /* Mandatory information for VBE 2.0 and above */
170 /* Mandatory information for VBE 3.0 and above */
171 USHORT LinBytesPerScanLine
;
172 UCHAR BnkNumberOfImagePages
;
173 UCHAR LinNumberOfImagePages
;
174 UCHAR LinRedMaskSize
;
175 UCHAR LinRedFieldPosition
;
176 UCHAR LinGreenMaskSize
;
177 UCHAR LinGreenFieldPosition
;
178 UCHAR LinBlueMaskSize
;
179 UCHAR LinBlueFieldPosition
;
180 UCHAR LinReservedMaskSize
;
181 UCHAR LinReservedFieldPosition
;
185 } VBE_MODEINFO
, *PVBE_MODEINFO
;
187 #define MAX_SIZE_OF_EDID 256
193 /* Interface to Int10 calls */
194 VIDEO_PORT_INT10_INTERFACE Int10Interface
;
196 /* Trampoline memory for communication with VBE real-mode interface */
197 USHORT TrampolineMemorySegment
;
198 USHORT TrampolineMemoryOffset
;
200 /* General controller/BIOS information */
203 /* Saved information about video modes */
206 PVBE_MODEINFO ModeInfo
;
209 /* Current child been enumerated */
210 ULONG CurrentChildIndex
;
211 } VBE_DEVICE_EXTENSION
, *PVBE_DEVICE_EXTENSION
;
216 VBEGetVideoChildDescriptor(
217 IN PVOID HwDeviceExtension
,
218 IN PVIDEO_CHILD_ENUM_INFO ChildEnumInfo
,
219 OUT PVIDEO_CHILD_TYPE VideoChildType
,
220 OUT PUCHAR pChildDescriptor
,
227 IN PVOID HwDeviceExtension
,
229 IN PWSTR ArgumentString
,
230 IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo
,
234 VBEInitialize(PVOID HwDeviceExtension
);
238 PVOID HwDeviceExtension
,
239 PVIDEO_REQUEST_PACKET RequestPacket
);
243 PVOID DeviceExtension
,
249 PVOID HwDeviceExtension
,
251 PVIDEO_POWER_MANAGEMENT VideoPowerControl
);
255 PVOID HwDeviceExtension
,
257 PVIDEO_POWER_MANAGEMENT VideoPowerControl
);
261 PVBE_DEVICE_EXTENSION DeviceExtension
,
262 PVIDEO_MODE RequestedMode
,
263 PSTATUS_BLOCK StatusBlock
);
267 PVBE_DEVICE_EXTENSION DeviceExtension
,
268 PSTATUS_BLOCK StatusBlock
);
272 PVBE_DEVICE_EXTENSION DeviceExtension
,
273 PVIDEO_MEMORY RequestedAddress
,
274 PVIDEO_MEMORY_INFORMATION MapInformation
,
275 PSTATUS_BLOCK StatusBlock
);
279 PVBE_DEVICE_EXTENSION DeviceExtension
,
280 PVIDEO_MEMORY VideoMemory
,
281 PSTATUS_BLOCK StatusBlock
);
284 VBEQueryNumAvailModes(
285 PVBE_DEVICE_EXTENSION DeviceExtension
,
286 PVIDEO_NUM_MODES Modes
,
287 PSTATUS_BLOCK StatusBlock
);
291 PVBE_DEVICE_EXTENSION DeviceExtension
,
292 PVIDEO_MODE_INFORMATION ReturnedModes
,
293 PSTATUS_BLOCK StatusBlock
);
297 PVBE_DEVICE_EXTENSION DeviceExtension
,
298 PVIDEO_MODE_INFORMATION VideoModeInfo
,
299 PSTATUS_BLOCK StatusBlock
);
302 VBESetColorRegisters(
303 PVBE_DEVICE_EXTENSION DeviceExtension
,
304 PVIDEO_CLUT ColorLookUpTable
,
305 PSTATUS_BLOCK StatusBlock
);
307 #endif /* _VBEMP_PCH_ */