ReactOS  0.4.14-dev-297-g23e575c
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 
107 typedef struct
108 {
120  CHAR OemData[256];
121 } VBE_INFO, *PVBE_INFO;
122 
123 /*
124  * VBE specification defined structure for specific video mode
125  * info returned by function VBE_GET_MODE_INFORMATION command.
126  */
127 
128 typedef 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 
191 typedef 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 
234 VBEInitialize(PVOID HwDeviceExtension);
235 
237 VBEStartIO(
238  PVOID HwDeviceExtension,
239  PVIDEO_REQUEST_PACKET RequestPacket);
240 
242 VBEResetHw(
243  PVOID DeviceExtension,
244  ULONG Columns,
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_ */
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:218
USHORT WinGranularity
Definition: vbemp.h:134
USHORT BytesPerScanLine
Definition: vbemp.h:139
USHORT WinBSegment
Definition: vbemp.h:137
USHORT LinBytesPerScanLine
Definition: vbemp.h:171
UCHAR LinReservedMaskSize
Definition: vbemp.h:180
#define IN
Definition: typedefs.h:38
USHORT Version
Definition: vbemp.h:110
UCHAR BitsPerPixel
Definition: vbemp.h:147
UCHAR ReservedMaskSize
Definition: vbemp.h:161
UCHAR YCharSize
Definition: vbemp.h:145
UCHAR NumberOfImagePages
Definition: vbemp.h:151
UCHAR BnkNumberOfImagePages
Definition: vbemp.h:172
uint16_t * PWSTR
Definition: typedefs.h:54
UCHAR LinReservedFieldPosition
Definition: vbemp.h:181
unsigned char * PUCHAR
Definition: retypes.h:3
char CHAR
Definition: xmlstorage.h:175
static const VBE_MODE Modes[VBE_MODE_COUNT]
Definition: vbe.c:189
UCHAR RedFieldPosition
Definition: vbemp.h:156
UCHAR WinAAttributes
Definition: vbemp.h:132
_Must_inspect_result_ _In_ PVOID _In_ struct _HW_INITIALIZATION_DATA _In_ PVOID HwContext
Definition: srb.h:664
UCHAR MemoryModel
Definition: vbemp.h:149
ULONG WinFuncPtr
Definition: vbemp.h:138
ULONG OemProductNamePtr
Definition: vbemp.h:117
UCHAR NumberOfBanks
Definition: vbemp.h:148
USHORT XResolution
Definition: vbemp.h:142
LONG Capabilities
Definition: vbemp.h:112
#define FASTCALL
Definition: nt_native.h:50
UCHAR WinBAttributes
Definition: vbemp.h:133
USHORT OemSoftwareRevision
Definition: vbemp.h:115
BOOLEAN NTAPI VBEInitialize(PVOID HwDeviceExtension)
Definition: vbemp.c:174
UCHAR LinGreenMaskSize
Definition: vbemp.h:176
UCHAR XCharSize
Definition: vbemp.h:144
ULONG MaxPixelClock
Definition: vbemp.h:182
struct VBE_INFO * PVBE_INFO
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VP_STATUS NTAPI VBEGetPowerState(PVOID HwDeviceExtension, ULONG HwId, PVIDEO_POWER_MANAGEMENT VideoPowerControl)
Definition: vbemp.c:567
BOOLEAN FASTCALL VBESetCurrentMode(PVBE_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE RequestedMode, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:690
long LONG
Definition: pedump.c:60
USHORT WinSize
Definition: vbemp.h:135
ULONG PhysBasePtr
Definition: vbemp.h:166
unsigned char BOOLEAN
struct VBE_MODEINFO * PVBE_MODEINFO
UCHAR RedMaskSize
Definition: vbemp.h:155
_In_ ULONG Rows
Definition: haltypes.h:7
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
USHORT TrampolineMemorySegment
Definition: vbemp.h:197
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:69
UCHAR ReservedFieldPosition
Definition: vbemp.h:162
UCHAR LinBlueFieldPosition
Definition: vbemp.h:179
UCHAR BlueMaskSize
Definition: vbemp.h:159
VBE_INFO VbeInfo
Definition: vbemp.h:201
PVBE_MODEINFO ModeInfo
Definition: vbemp.h:206
USHORT WinASegment
Definition: vbemp.h:136
BOOLEAN FASTCALL VBEQueryAvailModes(PVBE_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION ReturnedModes, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:927
UCHAR LinBlueMaskSize
Definition: vbemp.h:178
UCHAR DirectColorModeInfo
Definition: vbemp.h:163
BOOLEAN FASTCALL VBEQueryNumAvailModes(PVBE_DEVICE_EXTENSION DeviceExtension, PVIDEO_NUM_MODES Modes, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:830
ULONG OemProductRevPtr
Definition: vbemp.h:118
BOOLEAN FASTCALL VBESetColorRegisters(PVBE_DEVICE_EXTENSION DeviceExtension, PVIDEO_CLUT ColorLookUpTable, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:982
unsigned char UCHAR
Definition: xmlstorage.h:181
USHORT ModeAttributes
Definition: vbemp.h:131
UCHAR LinRedFieldPosition
Definition: vbemp.h:175
VIDEO_PORT_INT10_INTERFACE Int10Interface
Definition: vbemp.h:194
ULONG OemVendorNamePtr
Definition: vbemp.h:116
BOOLEAN FASTCALL VBEUnmapVideoMemory(PVBE_DEVICE_EXTENSION DeviceExtension, PVIDEO_MEMORY VideoMemory, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:811
static const COLUMN_LIST Columns[]
Definition: listview.c:19
UCHAR LinNumberOfImagePages
Definition: vbemp.h:173
struct _VBE_INFO VBE_INFO
ULONG CurrentChildIndex
Definition: vbemp.h:210
UCHAR GreenFieldPosition
Definition: vbemp.h:158
BOOLEAN FASTCALL VBEResetDevice(PVBE_DEVICE_EXTENSION DeviceExtension, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:730
BOOLEAN FASTCALL VBEQueryCurrentMode(PVBE_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION VideoModeInfo, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:957
ULONG OemStringPtr
Definition: vbemp.h:111
unsigned short USHORT
Definition: pedump.c:61
UCHAR BlueFieldPosition
Definition: vbemp.h:160
USHORT TrampolineMemoryOffset
Definition: vbemp.h:198
ULONG Reserved2
Definition: vbemp.h:167
UCHAR BankSize
Definition: vbemp.h:150
unsigned int * PULONG
Definition: retypes.h:1
USHORT YResolution
Definition: vbemp.h:143
ULONG VideoModePtr
Definition: vbemp.h:113
UCHAR LinRedMaskSize
Definition: vbemp.h:174
struct VBE_DEVICE_EXTENSION * PVBE_DEVICE_EXTENSION
USHORT * ModeNumbers
Definition: vbemp.h:205
USHORT TotalMemory
Definition: vbemp.h:114
#define OUT
Definition: typedefs.h:39
UCHAR GreenMaskSize
Definition: vbemp.h:157
unsigned int ULONG
Definition: retypes.h:1
UCHAR NumberOfPlanes
Definition: vbemp.h:146
LONG VP_STATUS
Definition: video.h:153
enum _VIDEO_CHILD_TYPE * PVIDEO_CHILD_TYPE
UCHAR LinGreenFieldPosition
Definition: vbemp.h:177
static const WCHAR Signature[]
Definition: parser.c:141
USHORT Reserved3
Definition: vbemp.h:168
BOOLEAN FASTCALL VBEMapVideoMemory(PVBE_DEVICE_EXTENSION DeviceExtension, PVIDEO_MEMORY RequestedAddress, PVIDEO_MEMORY_INFORMATION MapInformation, PSTATUS_BLOCK StatusBlock)
Definition: vbemp.c:754
VP_STATUS NTAPI VBESetPowerState(PVOID HwDeviceExtension, ULONG HwId, PVIDEO_POWER_MANAGEMENT VideoPowerControl)
Definition: vbemp.c:637
BOOLEAN NTAPI VBEStartIO(PVOID HwDeviceExtension, PVIDEO_REQUEST_PACKET RequestPacket)
Definition: vbemp.c:427
USHORT CurrentMode
Definition: vbemp.h:207
BOOLEAN NTAPI VBEResetHw(PVOID DeviceExtension, ULONG Columns, ULONG Rows)
Definition: vbemp.c:551
UCHAR Reserved1
Definition: vbemp.h:152