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
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 /* INCLUDES *******************************************************************/
31 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
32 #define TAG_VBE TAG('V', 'B', 'E', ' ')
35 * Compile-time define to get VBE 1.2 support. The implementation
36 * is far from complete now and so it's left undefined.
39 /* #define VBE12_SUPPORT */
44 * VBE Command Definitions
47 #define VBE_GET_CONTROLLER_INFORMATION 0x4F00
48 #define VBE_GET_MODE_INFORMATION 0x4F01
49 #define VBE_SET_VBE_MODE 0x4F02
50 #define VBE_GET_CURRENT_VBE_MODE 0x4F03
51 #define VBE_SAVE_RESTORE_STATE 0x4F04
52 #define VBE_DISPLAY_WINDOW_CONTROL 0x4F05
53 #define VBE_SET_GET_LOGICAL_SCAN_LINE_LENGTH 0x4F06
54 #define VBE_SET_GET_DISPLAY_START 0x4F07
55 #define VBE_SET_GET_DAC_PALETTE_FORMAT 0x4F08
56 #define VBE_SET_GET_PALETTE_DATA 0x4F09
59 #define VBE_RETURN_PROTECTED_MODE_INTERFACE 0x4F0A
60 #define VBE_GET_SET_PIXEL_CLOCK 0x4F0B
63 #define VBE_POWER_MANAGEMENT_EXTENSIONS 0x4F10
64 #define VBE_FLAT_PANEL_INTERFACE_EXTENSIONS 0x4F11
65 #define VBE_AUDIO_INTERFACE_EXTENSIONS 0x4F12
66 #define VBE_OEM_EXTENSIONS 0x4F13
67 #define VBE_DISPLAY_DATA_CHANNEL 0x4F14
70 * VBE Video Mode Information Definitions
73 #define VBE_MODEATTR_LINEAR 0x80
75 #define VBE_MEMORYMODEL_PACKEDPIXEL 0x04
76 #define VBE_MEMORYMODEL_DIRECTCOLOR 0x06
82 #define VBE_SUCCESS 0x4F
83 #define VBE_UNSUCCESSFUL 0x14F
84 #define VBE_NOT_SUPPORTED 0x24F
85 #define VBE_FUNCTION_INVALID 0x34F
88 * VBE specification defined structure for general adapter info
89 * returned by function VBE_GET_CONTROLLER_INFORMATION command.
100 WORD OemSoftwareRevision
;
101 DWORD OemVendorNamePtr
;
102 DWORD OemProductNamePtr
;
103 DWORD OemProductRevPtr
;
106 } VBE_INFO
, *PVBE_INFO
;
109 * VBE specification defined structure for specific video mode
110 * info returned by function VBE_GET_MODE_INFORMATION command.
115 /* Mandatory information for all VBE revisions */
124 WORD BytesPerScanLine
;
126 /* Mandatory information for VBE 1.2 and above */
136 BYTE NumberOfImagePages
;
139 /* Direct Color fields (required for Direct/6 and YUV/7 memory models) */
141 BYTE RedFieldPosition
;
143 BYTE GreenFieldPosition
;
145 BYTE BlueFieldPosition
;
146 BYTE ReservedMaskSize
;
147 BYTE ReservedFieldPosition
;
148 BYTE DirectColorModeInfo
;
150 /* Mandatory information for VBE 2.0 and above */
155 /* Mandatory information for VBE 3.0 and above */
156 WORD LinBytesPerScanLine
;
157 BYTE BnkNumberOfImagePages
;
158 BYTE LinNumberOfImagePages
;
160 BYTE LinRedFieldPosition
;
161 BYTE LinGreenMaskSize
;
162 BYTE LinGreenFieldPosition
;
163 BYTE LinBlueMaskSize
;
164 BYTE LinBlueFieldPosition
;
165 BYTE LinReservedMaskSize
;
166 BYTE LinReservedFieldPosition
;
170 } VBE_MODEINFO
, *PVBE_MODEINFO
;
176 /* Interface to Int10 calls */
177 VIDEO_PORT_INT10_INTERFACE Int10Interface
;
179 /* Trampoline memory for communication with VBE real-mode interface */
180 USHORT TrampolineMemorySegment
;
181 USHORT TrampolineMemoryOffset
;
183 /* General controller/BIOS information */
186 /* Saved information about video modes */
189 PVBE_MODEINFO ModeInfo
;
191 } VBE_DEVICE_EXTENSION
, *PVBE_DEVICE_EXTENSION
;
195 IN PVOID HwDeviceExtension
,
197 IN PWSTR ArgumentString
,
198 IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo
,
202 VBEInitialize(PVOID HwDeviceExtension
);
206 PVOID HwDeviceExtension
,
207 PVIDEO_REQUEST_PACKET RequestPacket
);
211 PVOID DeviceExtension
,
217 PVOID HwDeviceExtension
,
219 PVIDEO_POWER_MANAGEMENT VideoPowerControl
);
223 PVOID HwDeviceExtension
,
225 PVIDEO_POWER_MANAGEMENT VideoPowerControl
);
229 PVBE_DEVICE_EXTENSION DeviceExtension
,
230 PVIDEO_MODE RequestedMode
,
231 PSTATUS_BLOCK StatusBlock
);
235 PVBE_DEVICE_EXTENSION DeviceExtension
,
236 PSTATUS_BLOCK StatusBlock
);
240 PVBE_DEVICE_EXTENSION DeviceExtension
,
241 PVIDEO_MEMORY RequestedAddress
,
242 PVIDEO_MEMORY_INFORMATION MapInformation
,
243 PSTATUS_BLOCK StatusBlock
);
247 PVBE_DEVICE_EXTENSION DeviceExtension
,
248 PVIDEO_MEMORY VideoMemory
,
249 PSTATUS_BLOCK StatusBlock
);
252 VBEQueryNumAvailModes(
253 PVBE_DEVICE_EXTENSION DeviceExtension
,
254 PVIDEO_NUM_MODES Modes
,
255 PSTATUS_BLOCK StatusBlock
);
259 PVBE_DEVICE_EXTENSION DeviceExtension
,
260 PVIDEO_MODE_INFORMATION ReturnedModes
,
261 PSTATUS_BLOCK StatusBlock
);
265 PVBE_DEVICE_EXTENSION DeviceExtension
,
266 PVIDEO_MODE_INFORMATION VideoModeInfo
,
267 PSTATUS_BLOCK StatusBlock
);
270 VBESetColorRegisters(
271 PVBE_DEVICE_EXTENSION DeviceExtension
,
272 PVIDEO_CLUT ColorLookUpTable
,
273 PSTATUS_BLOCK StatusBlock
);