Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenvbemp.h
Go to the documentation of this file.
00001 /* 00002 * ReactOS VBE miniport video driver 00003 * 00004 * Copyright (C) 2004 Filip Navara 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with this program; if not, write to the Free Software Foundation, Inc., 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00019 */ 00020 00021 /* INCLUDES *******************************************************************/ 00022 00023 #include "ntdef.h" 00024 #include "dderror.h" 00025 #include "devioctl.h" 00026 #include "miniport.h" 00027 #include "ntddvdeo.h" 00028 #include "video.h" 00029 00030 #define TAG_VBE ' EBV' 00031 00032 /* 00033 * Compile-time define to get VBE 1.2 support. The implementation 00034 * is far from complete now and so it's left undefined. 00035 */ 00036 00037 /* #define VBE12_SUPPORT */ 00038 00039 #include <pshpack1.h> 00040 00041 /* 00042 * VBE Command Definitions 00043 */ 00044 00045 #define VBE_GET_CONTROLLER_INFORMATION 0x4F00 00046 #define VBE_GET_MODE_INFORMATION 0x4F01 00047 #define VBE_SET_VBE_MODE 0x4F02 00048 #define VBE_GET_CURRENT_VBE_MODE 0x4F03 00049 #define VBE_SAVE_RESTORE_STATE 0x4F04 00050 #define VBE_DISPLAY_WINDOW_CONTROL 0x4F05 00051 #define VBE_SET_GET_LOGICAL_SCAN_LINE_LENGTH 0x4F06 00052 #define VBE_SET_GET_DISPLAY_START 0x4F07 00053 #define VBE_SET_GET_DAC_PALETTE_FORMAT 0x4F08 00054 #define VBE_SET_GET_PALETTE_DATA 0x4F09 00055 00056 /* VBE 2.0+ */ 00057 #define VBE_RETURN_PROTECTED_MODE_INTERFACE 0x4F0A 00058 #define VBE_GET_SET_PIXEL_CLOCK 0x4F0B 00059 00060 /* Extensions */ 00061 #define VBE_POWER_MANAGEMENT_EXTENSIONS 0x4F10 00062 #define VBE_FLAT_PANEL_INTERFACE_EXTENSIONS 0x4F11 00063 #define VBE_AUDIO_INTERFACE_EXTENSIONS 0x4F12 00064 #define VBE_OEM_EXTENSIONS 0x4F13 00065 #define VBE_DISPLAY_DATA_CHANNEL 0x4F14 00066 #define VBE_DDC 0x4F15 00067 00068 /* 00069 * VBE DDC Sub-Functions 00070 */ 00071 00072 #define VBE_DDC_READ_EDID 0x01 00073 #define VBE_DDC_REPORT_CAPABILITIES 0x10 00074 #define VBE_DDC_BEGIN_SCL_SDA_CONTROL 0x11 00075 #define VBE_DDC_END_SCL_SDA_CONTROL 0x12 00076 #define VBE_DDC_WRITE_SCL_CLOCK_LINE 0x13 00077 #define VBE_DDC_WRITE_SDA_DATA_LINE 0x14 00078 #define VBE_DDC_READ_SCL_CLOCK_LINE 0x15 00079 #define VBE_DDC_READ_SDA_DATA_LINE 0x16 00080 00081 /* 00082 * VBE Video Mode Information Definitions 00083 */ 00084 00085 #define VBE_MODEATTR_LINEAR 0x80 00086 00087 #define VBE_MEMORYMODEL_PACKEDPIXEL 0x04 00088 #define VBE_MEMORYMODEL_DIRECTCOLOR 0x06 00089 00090 /* 00091 * VBE Return Codes 00092 */ 00093 00094 #define VBE_SUCCESS 0x4F 00095 #define VBE_UNSUCCESSFUL 0x14F 00096 #define VBE_NOT_SUPPORTED 0x24F 00097 #define VBE_FUNCTION_INVALID 0x34F 00098 00099 #define VBE_GETRETURNCODE(x) (x & 0xFFFF) 00100 00101 /* 00102 * VBE specification defined structure for general adapter info 00103 * returned by function VBE_GET_CONTROLLER_INFORMATION command. 00104 */ 00105 00106 typedef struct 00107 { 00108 CHAR Signature[4]; 00109 USHORT Version; 00110 ULONG OemStringPtr; 00111 LONG Capabilities; 00112 ULONG VideoModePtr; 00113 USHORT TotalMemory; 00114 USHORT OemSoftwareRevision; 00115 ULONG OemVendorNamePtr; 00116 ULONG OemProductNamePtr; 00117 ULONG OemProductRevPtr; 00118 CHAR Reserved[222]; 00119 CHAR OemData[256]; 00120 } VBE_INFO, *PVBE_INFO; 00121 00122 /* 00123 * VBE specification defined structure for specific video mode 00124 * info returned by function VBE_GET_MODE_INFORMATION command. 00125 */ 00126 00127 typedef struct 00128 { 00129 /* Mandatory information for all VBE revisions */ 00130 USHORT ModeAttributes; 00131 UCHAR WinAAttributes; 00132 UCHAR WinBAttributes; 00133 USHORT WinGranularity; 00134 USHORT WinSize; 00135 USHORT WinASegment; 00136 USHORT WinBSegment; 00137 ULONG WinFuncPtr; 00138 USHORT BytesPerScanLine; 00139 00140 /* Mandatory information for VBE 1.2 and above */ 00141 USHORT XResolution; 00142 USHORT YResolution; 00143 UCHAR XCharSize; 00144 UCHAR YCharSize; 00145 UCHAR NumberOfPlanes; 00146 UCHAR BitsPerPixel; 00147 UCHAR NumberOfBanks; 00148 UCHAR MemoryModel; 00149 UCHAR BankSize; 00150 UCHAR NumberOfImagePages; 00151 UCHAR Reserved1; 00152 00153 /* Direct Color fields (required for Direct/6 and YUV/7 memory models) */ 00154 UCHAR RedMaskSize; 00155 UCHAR RedFieldPosition; 00156 UCHAR GreenMaskSize; 00157 UCHAR GreenFieldPosition; 00158 UCHAR BlueMaskSize; 00159 UCHAR BlueFieldPosition; 00160 UCHAR ReservedMaskSize; 00161 UCHAR ReservedFieldPosition; 00162 UCHAR DirectColorModeInfo; 00163 00164 /* Mandatory information for VBE 2.0 and above */ 00165 ULONG PhysBasePtr; 00166 ULONG Reserved2; 00167 USHORT Reserved3; 00168 00169 /* Mandatory information for VBE 3.0 and above */ 00170 USHORT LinBytesPerScanLine; 00171 UCHAR BnkNumberOfImagePages; 00172 UCHAR LinNumberOfImagePages; 00173 UCHAR LinRedMaskSize; 00174 UCHAR LinRedFieldPosition; 00175 UCHAR LinGreenMaskSize; 00176 UCHAR LinGreenFieldPosition; 00177 UCHAR LinBlueMaskSize; 00178 UCHAR LinBlueFieldPosition; 00179 UCHAR LinReservedMaskSize; 00180 UCHAR LinReservedFieldPosition; 00181 ULONG MaxPixelClock; 00182 00183 CHAR Reserved4[189]; 00184 } VBE_MODEINFO, *PVBE_MODEINFO; 00185 00186 #define MAX_SIZE_OF_EDID 256 00187 00188 #include <poppack.h> 00189 00190 typedef struct 00191 { 00192 /* Interface to Int10 calls */ 00193 VIDEO_PORT_INT10_INTERFACE Int10Interface; 00194 00195 /* Trampoline memory for communication with VBE real-mode interface */ 00196 USHORT TrampolineMemorySegment; 00197 USHORT TrampolineMemoryOffset; 00198 00199 /* General controller/BIOS information */ 00200 VBE_INFO VbeInfo; 00201 00202 /* Saved information about video modes */ 00203 ULONG ModeCount; 00204 USHORT *ModeNumbers; 00205 PVBE_MODEINFO ModeInfo; 00206 USHORT CurrentMode; 00207 00208 /* Current child been enumerated */ 00209 ULONG CurrentChildIndex; 00210 } VBE_DEVICE_EXTENSION, *PVBE_DEVICE_EXTENSION; 00211 00212 /* edid.c */ 00213 00214 VP_STATUS NTAPI 00215 VBEGetVideoChildDescriptor( 00216 IN PVOID HwDeviceExtension, 00217 IN PVIDEO_CHILD_ENUM_INFO ChildEnumInfo, 00218 OUT PVIDEO_CHILD_TYPE VideoChildType, 00219 OUT PUCHAR pChildDescriptor, 00220 OUT PULONG UId, 00221 OUT PULONG pUnused); 00222 00223 /* vbemp.c */ 00224 VP_STATUS NTAPI 00225 VBEFindAdapter( 00226 IN PVOID HwDeviceExtension, 00227 IN PVOID HwContext, 00228 IN PWSTR ArgumentString, 00229 IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo, 00230 OUT PUCHAR Again); 00231 00232 BOOLEAN NTAPI 00233 VBEInitialize(PVOID HwDeviceExtension); 00234 00235 BOOLEAN NTAPI 00236 VBEStartIO( 00237 PVOID HwDeviceExtension, 00238 PVIDEO_REQUEST_PACKET RequestPacket); 00239 00240 BOOLEAN NTAPI 00241 VBEResetHw( 00242 PVOID DeviceExtension, 00243 ULONG Columns, 00244 ULONG Rows); 00245 00246 VP_STATUS NTAPI 00247 VBEGetPowerState( 00248 PVOID HwDeviceExtension, 00249 ULONG HwId, 00250 PVIDEO_POWER_MANAGEMENT VideoPowerControl); 00251 00252 VP_STATUS NTAPI 00253 VBESetPowerState( 00254 PVOID HwDeviceExtension, 00255 ULONG HwId, 00256 PVIDEO_POWER_MANAGEMENT VideoPowerControl); 00257 00258 BOOLEAN FASTCALL 00259 VBESetCurrentMode( 00260 PVBE_DEVICE_EXTENSION DeviceExtension, 00261 PVIDEO_MODE RequestedMode, 00262 PSTATUS_BLOCK StatusBlock); 00263 00264 BOOLEAN FASTCALL 00265 VBEResetDevice( 00266 PVBE_DEVICE_EXTENSION DeviceExtension, 00267 PSTATUS_BLOCK StatusBlock); 00268 00269 BOOLEAN FASTCALL 00270 VBEMapVideoMemory( 00271 PVBE_DEVICE_EXTENSION DeviceExtension, 00272 PVIDEO_MEMORY RequestedAddress, 00273 PVIDEO_MEMORY_INFORMATION MapInformation, 00274 PSTATUS_BLOCK StatusBlock); 00275 00276 BOOLEAN FASTCALL 00277 VBEUnmapVideoMemory( 00278 PVBE_DEVICE_EXTENSION DeviceExtension, 00279 PVIDEO_MEMORY VideoMemory, 00280 PSTATUS_BLOCK StatusBlock); 00281 00282 BOOLEAN FASTCALL 00283 VBEQueryNumAvailModes( 00284 PVBE_DEVICE_EXTENSION DeviceExtension, 00285 PVIDEO_NUM_MODES Modes, 00286 PSTATUS_BLOCK StatusBlock); 00287 00288 BOOLEAN FASTCALL 00289 VBEQueryAvailModes( 00290 PVBE_DEVICE_EXTENSION DeviceExtension, 00291 PVIDEO_MODE_INFORMATION ReturnedModes, 00292 PSTATUS_BLOCK StatusBlock); 00293 00294 BOOLEAN FASTCALL 00295 VBEQueryCurrentMode( 00296 PVBE_DEVICE_EXTENSION DeviceExtension, 00297 PVIDEO_MODE_INFORMATION VideoModeInfo, 00298 PSTATUS_BLOCK StatusBlock); 00299 00300 BOOLEAN FASTCALL 00301 VBESetColorRegisters( 00302 PVBE_DEVICE_EXTENSION DeviceExtension, 00303 PVIDEO_CLUT ColorLookUpTable, 00304 PSTATUS_BLOCK StatusBlock); Generated on Fri May 25 2012 04:36:26 for ReactOS by
1.7.6.1
|