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.
23 /* INCLUDES *******************************************************************/
26 #pragma message ("INVESTIGATE ME")
29 #if 0 //#ifdef _MSC_VER
40 #define TAG_VBE ' EBV'
43 * Compile-time define to get VBE 1.2 support. The implementation
44 * is far from complete now and so it's left undefined.
47 /* #define VBE12_SUPPORT */
52 * VBE Command Definitions
55 #define VBE_GET_CONTROLLER_INFORMATION 0x4F00
56 #define VBE_GET_MODE_INFORMATION 0x4F01
57 #define VBE_SET_VBE_MODE 0x4F02
58 #define VBE_GET_CURRENT_VBE_MODE 0x4F03
59 #define VBE_SAVE_RESTORE_STATE 0x4F04
60 #define VBE_DISPLAY_WINDOW_CONTROL 0x4F05
61 #define VBE_SET_GET_LOGICAL_SCAN_LINE_LENGTH 0x4F06
62 #define VBE_SET_GET_DISPLAY_START 0x4F07
63 #define VBE_SET_GET_DAC_PALETTE_FORMAT 0x4F08
64 #define VBE_SET_GET_PALETTE_DATA 0x4F09
67 #define VBE_RETURN_PROTECTED_MODE_INTERFACE 0x4F0A
68 #define VBE_GET_SET_PIXEL_CLOCK 0x4F0B
71 #define VBE_POWER_MANAGEMENT_EXTENSIONS 0x4F10
72 #define VBE_FLAT_PANEL_INTERFACE_EXTENSIONS 0x4F11
73 #define VBE_AUDIO_INTERFACE_EXTENSIONS 0x4F12
74 #define VBE_OEM_EXTENSIONS 0x4F13
75 #define VBE_DISPLAY_DATA_CHANNEL 0x4F14
76 #define VBE_DDC 0x4F15
79 * VBE DDC Sub-Functions
82 #define VBE_DDC_READ_EDID 0x01
83 #define VBE_DDC_REPORT_CAPABILITIES 0x10
84 #define VBE_DDC_BEGIN_SCL_SDA_CONTROL 0x11
85 #define VBE_DDC_END_SCL_SDA_CONTROL 0x12
86 #define VBE_DDC_WRITE_SCL_CLOCK_LINE 0x13
87 #define VBE_DDC_WRITE_SDA_DATA_LINE 0x14
88 #define VBE_DDC_READ_SCL_CLOCK_LINE 0x15
89 #define VBE_DDC_READ_SDA_DATA_LINE 0x16
92 * VBE Video Mode Information Definitions
95 #define VBE_MODEATTR_LINEAR 0x80
97 #define VBE_MEMORYMODEL_PACKEDPIXEL 0x04
98 #define VBE_MEMORYMODEL_DIRECTCOLOR 0x06
104 #define VBE_SUCCESS 0x4F
105 #define VBE_UNSUCCESSFUL 0x14F
106 #define VBE_NOT_SUPPORTED 0x24F
107 #define VBE_FUNCTION_INVALID 0x34F
109 #define VBE_GETRETURNCODE(x) (x & 0xFFFF)
112 * VBE specification defined structure for general adapter info
113 * returned by function VBE_GET_CONTROLLER_INFORMATION command.
124 USHORT OemSoftwareRevision
;
125 ULONG OemVendorNamePtr
;
126 ULONG OemProductNamePtr
;
127 ULONG OemProductRevPtr
;
130 } VBE_INFO
, *PVBE_INFO
;
133 * VBE specification defined structure for specific video mode
134 * info returned by function VBE_GET_MODE_INFORMATION command.
139 /* Mandatory information for all VBE revisions */
140 USHORT ModeAttributes
;
141 UCHAR WinAAttributes
;
142 UCHAR WinBAttributes
;
143 USHORT WinGranularity
;
148 USHORT BytesPerScanLine
;
150 /* Mandatory information for VBE 1.2 and above */
155 UCHAR NumberOfPlanes
;
160 UCHAR NumberOfImagePages
;
163 /* Direct Color fields (required for Direct/6 and YUV/7 memory models) */
165 UCHAR RedFieldPosition
;
167 UCHAR GreenFieldPosition
;
169 UCHAR BlueFieldPosition
;
170 UCHAR ReservedMaskSize
;
171 UCHAR ReservedFieldPosition
;
172 UCHAR DirectColorModeInfo
;
174 /* Mandatory information for VBE 2.0 and above */
179 /* Mandatory information for VBE 3.0 and above */
180 USHORT LinBytesPerScanLine
;
181 UCHAR BnkNumberOfImagePages
;
182 UCHAR LinNumberOfImagePages
;
183 UCHAR LinRedMaskSize
;
184 UCHAR LinRedFieldPosition
;
185 UCHAR LinGreenMaskSize
;
186 UCHAR LinGreenFieldPosition
;
187 UCHAR LinBlueMaskSize
;
188 UCHAR LinBlueFieldPosition
;
189 UCHAR LinReservedMaskSize
;
190 UCHAR LinReservedFieldPosition
;
194 } VBE_MODEINFO
, *PVBE_MODEINFO
;
196 #define MAX_SIZE_OF_EDID 256
202 /* Interface to Int10 calls */
203 VIDEO_PORT_INT10_INTERFACE Int10Interface
;
205 /* Trampoline memory for communication with VBE real-mode interface */
206 USHORT TrampolineMemorySegment
;
207 USHORT TrampolineMemoryOffset
;
209 /* General controller/BIOS information */
212 /* Saved information about video modes */
215 PVBE_MODEINFO ModeInfo
;
218 /* Current child been enumerated */
219 ULONG CurrentChildIndex
;
220 } VBE_DEVICE_EXTENSION
, *PVBE_DEVICE_EXTENSION
;
225 VBEGetVideoChildDescriptor(
226 IN PVOID HwDeviceExtension
,
227 IN PVIDEO_CHILD_ENUM_INFO ChildEnumInfo
,
228 OUT PVIDEO_CHILD_TYPE VideoChildType
,
229 OUT PUCHAR pChildDescriptor
,
236 IN PVOID HwDeviceExtension
,
238 IN PWSTR ArgumentString
,
239 IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo
,
243 VBEInitialize(PVOID HwDeviceExtension
);
247 PVOID HwDeviceExtension
,
248 PVIDEO_REQUEST_PACKET RequestPacket
);
252 PVOID DeviceExtension
,
258 PVOID HwDeviceExtension
,
260 PVIDEO_POWER_MANAGEMENT VideoPowerControl
);
264 PVOID HwDeviceExtension
,
266 PVIDEO_POWER_MANAGEMENT VideoPowerControl
);
270 PVBE_DEVICE_EXTENSION DeviceExtension
,
271 PVIDEO_MODE RequestedMode
,
272 PSTATUS_BLOCK StatusBlock
);
276 PVBE_DEVICE_EXTENSION DeviceExtension
,
277 PSTATUS_BLOCK StatusBlock
);
281 PVBE_DEVICE_EXTENSION DeviceExtension
,
282 PVIDEO_MEMORY RequestedAddress
,
283 PVIDEO_MEMORY_INFORMATION MapInformation
,
284 PSTATUS_BLOCK StatusBlock
);
288 PVBE_DEVICE_EXTENSION DeviceExtension
,
289 PVIDEO_MEMORY VideoMemory
,
290 PSTATUS_BLOCK StatusBlock
);
293 VBEQueryNumAvailModes(
294 PVBE_DEVICE_EXTENSION DeviceExtension
,
295 PVIDEO_NUM_MODES Modes
,
296 PSTATUS_BLOCK StatusBlock
);
300 PVBE_DEVICE_EXTENSION DeviceExtension
,
301 PVIDEO_MODE_INFORMATION ReturnedModes
,
302 PSTATUS_BLOCK StatusBlock
);
306 PVBE_DEVICE_EXTENSION DeviceExtension
,
307 PVIDEO_MODE_INFORMATION VideoModeInfo
,
308 PSTATUS_BLOCK StatusBlock
);
311 VBESetColorRegisters(
312 PVBE_DEVICE_EXTENSION DeviceExtension
,
313 PVIDEO_CLUT ColorLookUpTable
,
314 PSTATUS_BLOCK StatusBlock
);