source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/ddk/video.h@ 1194

Last change on this file since 1194 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 35.7 KB
RevLine 
[1166]1/*
2 * video.h
3 *
4 * Video port and miniport driver interface
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22
23#pragma once
24
25#define __VIDEO_H__
26
27#include "ntddvdeo.h"
28#include "videoagp.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#ifndef _NTOSDEF_
35
36#ifdef PAGED_CODE
37#undef PAGED_CODE
38#endif
39
40#if defined(_MSC_VER)
41#define ALLOC_PRAGMA 1
42#endif
43
44#if defined(_VIDEOPORT_)
45#define VPAPI
46#else
47#define VPAPI DECLSPEC_IMPORT
48#endif
49
50#if DBG
51#define PAGED_CODE() \
52 if (VideoPortGetCurrentIrql() > 1 /* APC_LEVEL */) { \
53 VideoPortDebugPrint(Error, "Video: Pageable code called at IRQL %d\n", VideoPortGetCurrentIrql() ); \
54 ASSERT(FALSE); \
55 }
56#else
57#define PAGED_CODE()
58#endif /* DBG */
59
60ULONG
61NTAPI
62DriverEntry(
63 PVOID Context1,
64 PVOID Context2);
65
66#else
67
68#define VPAPI
69
70#endif /* _NTOSDEF_ */
71
72#if DBG
73#define VideoDebugPrint(x) VideoPortDebugPrint x
74#else
75#define VideoDebugPrint(x)
76#endif
77
78#define GET_VIDEO_PHYSICAL_ADDRESS(scatterList, \
79 VirtualAddress, \
80 InputBuffer, \
81 pLength, \
82 Address) \
83 do { \
84 ULONG_PTR byteOffset; \
85 \
86 byteOffset = (PCHAR) VirtualAddress - (PCHAR)InputBuffer; \
87 while (byteOffset >= scatterList->Length) { \
88 byteOffset -= scatterList->Length; \
89 scatterList++; \
90 } \
91 *pLength = scatterList->Length - byteOffset; \
92 Address = (ULONG_PTR) (scatterList->PhysicalAddress + byteOffset); \
93 } while (0)
94
95#define GET_VIDEO_SCATTERGATHER(ppDma) (**(PVRB_SG **)ppDma)
96
97/* VIDEO_ACCESS_RANGE.RangePassive */
98#define VIDEO_RANGE_PASSIVE_DECODE 1
99#define VIDEO_RANGE_10_BIT_DECODE 2
100
101#define SIZE_OF_NT4_VIDEO_PORT_CONFIG_INFO FIELD_OFFSET(VIDEO_PORT_CONFIG_INFO, Master)
102#define SIZE_OF_WXP_VIDEO_PORT_CONFIG_INFO sizeof(VIDEO_PORT_CONFIG_INFO)
103
104#define SET_USER_EVENT 0x01
105#define SET_DISPLAY_EVENT 0x02
106
107#define EVENT_TYPE_MASK 1
108#define SYNCHRONIZATION_EVENT 0
109#define NOTIFICATION_EVENT 1
110
111#define INITIAL_EVENT_STATE_MASK 2
112#define INITIAL_EVENT_NOT_SIGNALED 0
113#define INITIAL_EVENT_SIGNALED 2
114
115#define DISPLAY_ADAPTER_HW_ID 0xFFFFFFFF
116
117#define VIDEO_INVALID_CHILD_ID 0xFFFFFFFF
118
119#define SIZE_OF_NT4_VIDEO_HW_INITIALIZATION_DATA FIELD_OFFSET(VIDEO_HW_INITIALIZATION_DATA, HwStartDma)
120#define SIZE_OF_W2K_VIDEO_HW_INITIALIZATION_DATA FIELD_OFFSET(VIDEO_HW_INITIALIZATION_DATA, Reserved)
121#define SIZE_OF_WXP_VIDEO_HW_INITIALIZATION_DATA (SIZE_OF_W2K_VIDEO_HW_INITIALIZATION_DATA + sizeof(ULONG))
122
123#define VIDEO_PORT_AGP_INTERFACE_VERSION_1 1
124#define VIDEO_PORT_AGP_INTERFACE_VERSION_2 2
125#define VIDEO_PORT_I2C_INTERFACE_VERSION_1 1
126#define VIDEO_PORT_I2C_INTERFACE_VERSION_2 2
127#define VIDEO_PORT_INT10_INTERFACE_VERSION_1 1
128#define VIDEO_PORT_WCMEMORYPROTECTION_INTERFACE_VERSION_1 1
129#define VIDEO_PORT_DEBUG_REPORT_INTERFACE_VERSION_1 1
130
131/* Flags for VideoPortGetDeviceBase and VideoPortMapMemory */
132#define VIDEO_MEMORY_SPACE_MEMORY 0x00
133#define VIDEO_MEMORY_SPACE_IO 0x01
134#define VIDEO_MEMORY_SPACE_USER_MODE 0x02
135#define VIDEO_MEMORY_SPACE_DENSE 0x04
136#define VIDEO_MEMORY_SPACE_P6CACHE 0x08
137
138/* PVIDEO_HW_GET_CHILD_DESCRIPTOR return values */
139#define VIDEO_ENUM_MORE_DEVICES ERROR_CONTINUE
140#define VIDEO_ENUM_NO_MORE_DEVICES ERROR_NO_MORE_DEVICES
141#define VIDEO_ENUM_INVALID_DEVICE ERROR_INVALID_NAME
142
143#define DEVICE_VGA_ENABLED 1
144
145/* VideoPortCheckForDeviceExistence.Flags constants */
146#define CDE_USE_SUBSYSTEM_IDS 0x00000001
147#define CDE_USE_REVISION 0x00000002
148
149#define BUGCHECK_DATA_SIZE_RESERVED 48
150
151#define VIDEO_DEBUG_REPORT_MAX_SIZE 0x8000
152
153typedef LONG VP_STATUS, *PVP_STATUS;
154typedef ULONG DMA_EVENT_FLAGS;
155
156typedef struct _VIDEO_PORT_SPIN_LOCK *PSPIN_LOCK;
157typedef struct _VIDEO_DEBUG_REPORT *PVIDEO_DEBUG_REPORT;
158typedef struct __DMA_PARAMETERS *PDMA;
159typedef struct __VP_DMA_ADAPTER *PVP_DMA_ADAPTER;
160
161typedef PVOID
162(NTAPI *PVIDEO_PORT_GET_PROC_ADDRESS)(
163 IN PVOID HwDeviceExtension,
164 IN PUCHAR FunctionName);
165
166typedef struct _VIDEO_PORT_CONFIG_INFO {
167 ULONG Length;
168 ULONG SystemIoBusNumber;
169 INTERFACE_TYPE AdapterInterfaceType;
170 ULONG BusInterruptLevel;
171 ULONG BusInterruptVector;
172 KINTERRUPT_MODE InterruptMode;
173 ULONG NumEmulatorAccessEntries;
174 PEMULATOR_ACCESS_ENTRY EmulatorAccessEntries;
175 ULONG_PTR EmulatorAccessEntriesContext;
176 PHYSICAL_ADDRESS VdmPhysicalVideoMemoryAddress;
177 ULONG VdmPhysicalVideoMemoryLength;
178 ULONG HardwareStateSize;
179 ULONG DmaChannel;
180 ULONG DmaPort;
181 UCHAR DmaShareable;
182 UCHAR InterruptShareable;
183 BOOLEAN Master;
184 DMA_WIDTH DmaWidth;
185 DMA_SPEED DmaSpeed;
186 BOOLEAN bMapBuffers;
187 BOOLEAN NeedPhysicalAddresses;
188 BOOLEAN DemandMode;
189 ULONG MaximumTransferLength;
190 ULONG NumberOfPhysicalBreaks;
191 BOOLEAN ScatterGather;
192 ULONG MaximumScatterGatherChunkSize;
193 PVIDEO_PORT_GET_PROC_ADDRESS VideoPortGetProcAddress;
194 PWSTR DriverRegistryPath;
195 ULONGLONG SystemMemorySize;
196} VIDEO_PORT_CONFIG_INFO, *PVIDEO_PORT_CONFIG_INFO;
197
198typedef VP_STATUS
199(NTAPI *PVIDEO_HW_FIND_ADAPTER)(
200 IN PVOID HwDeviceExtension,
201 IN PVOID HwContext,
202 IN PWSTR ArgumentString,
203 IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo,
204 OUT PUCHAR Again);
205
206typedef BOOLEAN
207(NTAPI *PVIDEO_HW_INITIALIZE)(
208 IN PVOID HwDeviceExtension);
209
210typedef BOOLEAN
211(NTAPI *PVIDEO_HW_INTERRUPT)(
212 IN PVOID HwDeviceExtension);
213
214typedef struct _VIDEO_ACCESS_RANGE {
215 PHYSICAL_ADDRESS RangeStart;
216 ULONG RangeLength;
217 UCHAR RangeInIoSpace;
218 UCHAR RangeVisible;
219 UCHAR RangeShareable;
220 UCHAR RangePassive;
221} VIDEO_ACCESS_RANGE, *PVIDEO_ACCESS_RANGE;
222
223typedef VOID
224(NTAPI *PVIDEO_HW_LEGACYRESOURCES)(
225 IN ULONG VendorId,
226 IN ULONG DeviceId,
227 IN OUT PVIDEO_ACCESS_RANGE *LegacyResourceList,
228 IN OUT PULONG LegacyResourceCount);
229
230typedef enum _HW_DMA_RETURN {
231 DmaAsyncReturn,
232 DmaSyncReturn
233} HW_DMA_RETURN, *PHW_DMA_RETURN;
234
235typedef HW_DMA_RETURN
236(NTAPI *PVIDEO_HW_START_DMA)(
237 PVOID HwDeviceExtension,
238 PDMA pDma);
239
240typedef struct _VP_SCATTER_GATHER_ELEMENT {
241 PHYSICAL_ADDRESS Address;
242 ULONG Length;
243 ULONG_PTR Reserved;
244} VP_SCATTER_GATHER_ELEMENT, *PVP_SCATTER_GATHER_ELEMENT;
245
246typedef struct _VP_SCATTER_GATHER_LIST {
247 ULONG NumberOfElements;
248 ULONG_PTR Reserved;
249 VP_SCATTER_GATHER_ELEMENT Elements[0];
250} VP_SCATTER_GATHER_LIST, *PVP_SCATTER_GATHER_LIST;
251
252typedef VOID
253(NTAPI *PEXECUTE_DMA)(
254 IN PVOID HwDeviceExtension,
255 IN PVP_DMA_ADAPTER VpDmaAdapter,
256 IN PVP_SCATTER_GATHER_LIST SGList,
257 IN PVOID Context);
258
259/* PVIDEO_HW_GET_CHILD_DESCRIPTOR.ChildEnumInfo constants */
260typedef struct _VIDEO_CHILD_ENUM_INFO {
261 ULONG Size;
262 ULONG ChildDescriptorSize;
263 ULONG ChildIndex;
264 ULONG ACPIHwId;
265 PVOID ChildHwDeviceExtension;
266} VIDEO_CHILD_ENUM_INFO, *PVIDEO_CHILD_ENUM_INFO;
267
268/* PVIDEO_HW_GET_CHILD_DESCRIPTOR.VideoChildType constants */
269typedef enum _VIDEO_CHILD_TYPE {
270 Monitor = 1,
271 NonPrimaryChip,
272 VideoChip,
273 Other
274} VIDEO_CHILD_TYPE, *PVIDEO_CHILD_TYPE;
275
276typedef VP_STATUS
277(NTAPI *PVIDEO_HW_GET_CHILD_DESCRIPTOR)(
278 IN PVOID HwDeviceExtension,
279 IN PVIDEO_CHILD_ENUM_INFO ChildEnumInfo,
280 OUT PVIDEO_CHILD_TYPE VideoChildType,
281 OUT PUCHAR pChildDescriptor,
282 OUT PULONG UId,
283 OUT PULONG pUnused);
284
285typedef VP_STATUS
286(NTAPI *PVIDEO_HW_POWER_SET)(
287 IN PVOID HwDeviceExtension,
288 IN ULONG HwId,
289 IN PVIDEO_POWER_MANAGEMENT VideoPowerControl);
290
291typedef VP_STATUS
292(NTAPI *PVIDEO_HW_POWER_GET)(
293 IN PVOID HwDeviceExtension,
294 IN ULONG HwId,
295 IN OUT PVIDEO_POWER_MANAGEMENT VideoPowerControl);
296
297typedef struct _QUERY_INTERFACE {
298 CONST GUID *InterfaceType;
299 USHORT Size;
300 USHORT Version;
301 PINTERFACE Interface;
302 PVOID InterfaceSpecificData;
303} QUERY_INTERFACE, *PQUERY_INTERFACE;
304
305typedef VP_STATUS
306(NTAPI *PVIDEO_HW_QUERY_INTERFACE)(
307 IN PVOID HwDeviceExtension,
308 IN OUT PQUERY_INTERFACE QueryInterface);
309
310typedef VP_STATUS
311(NTAPI *PVIDEO_HW_CHILD_CALLBACK)(
312 PVOID HwDeviceExtension,
313 PVOID ChildDeviceExtension);
314
315typedef BOOLEAN
316(NTAPI *PVIDEO_HW_RESET_HW)(
317 IN PVOID HwDeviceExtension,
318 IN ULONG Columns,
319 IN ULONG Rows);
320
321typedef struct _STATUS_BLOCK {
322 _ANONYMOUS_UNION union {
323 VP_STATUS Status;
324 PVOID Pointer;
325 } DUMMYUNIONNAME;
326 ULONG_PTR Information;
327} STATUS_BLOCK, *PSTATUS_BLOCK;
328
329typedef struct _VIDEO_REQUEST_PACKET {
330 ULONG IoControlCode;
331 PSTATUS_BLOCK StatusBlock;
332 PVOID InputBuffer;
333 ULONG InputBufferLength;
334 PVOID OutputBuffer;
335 ULONG OutputBufferLength;
336} VIDEO_REQUEST_PACKET, *PVIDEO_REQUEST_PACKET;
337
338typedef BOOLEAN
339(NTAPI *PVIDEO_HW_START_IO)(
340 IN PVOID HwDeviceExtension,
341 IN PVIDEO_REQUEST_PACKET RequestPacket);
342
343typedef VOID
344(NTAPI *PVIDEO_HW_TIMER)(
345 IN PVOID HwDeviceExtension);
346
347typedef VOID
348(NTAPI *PVIDEO_WRITE_CLOCK_LINE)(
349 PVOID HwDeviceExtension,
350 UCHAR Data);
351
352typedef VOID
353(NTAPI *PVIDEO_WRITE_DATA_LINE)(
354 PVOID HwDeviceExtension,
355 UCHAR Data);
356
357typedef BOOLEAN
358(NTAPI *PVIDEO_READ_CLOCK_LINE)(
359 PVOID HwDeviceExtension);
360
361typedef BOOLEAN
362(NTAPI *PVIDEO_READ_DATA_LINE)(
363 PVOID HwDeviceExtension);
364
365typedef VOID
366(NTAPI *PVIDEO_WAIT_VSYNC_ACTIVE)(
367 PVOID HwDeviceExtension);
368
369typedef struct _I2C_CALLBACKS {
370 IN PVIDEO_WRITE_CLOCK_LINE WriteClockLine;
371 IN PVIDEO_WRITE_DATA_LINE WriteDataLine;
372 IN PVIDEO_READ_CLOCK_LINE ReadClockLine;
373 IN PVIDEO_READ_DATA_LINE ReadDataLine;
374} I2C_CALLBACKS, *PI2C_CALLBACKS;
375
376typedef BOOLEAN
377(NTAPI *PI2C_START)(
378 IN PVOID HwDeviceExtension,
379 IN PI2C_CALLBACKS I2CCallbacks);
380
381typedef BOOLEAN
382(NTAPI *PI2C_STOP)(
383 IN PVOID HwDeviceExtension,
384 IN PI2C_CALLBACKS I2CCallbacks);
385
386typedef BOOLEAN
387(NTAPI *PI2C_WRITE)(
388 IN PVOID HwDeviceExtension,
389 IN PI2C_CALLBACKS I2CCallbacks,
390 IN PUCHAR Buffer,
391 IN ULONG Length);
392
393typedef BOOLEAN
394(NTAPI *PI2C_READ)(
395 IN PVOID HwDeviceExtension,
396 IN PI2C_CALLBACKS I2CCallbacks,
397 OUT PUCHAR Buffer,
398 IN ULONG Length);
399
400typedef struct _VIDEO_I2C_CONTROL {
401 IN PVIDEO_WRITE_CLOCK_LINE WriteClockLine;
402 IN PVIDEO_WRITE_DATA_LINE WriteDataLine;
403 IN PVIDEO_READ_CLOCK_LINE ReadClockLine;
404 IN PVIDEO_READ_DATA_LINE ReadDataLine;
405 IN ULONG I2CDelay;
406} VIDEO_I2C_CONTROL, *PVIDEO_I2C_CONTROL;
407
408typedef BOOLEAN
409(NTAPI *PI2C_START_2)(
410 IN PVOID HwDeviceExtension,
411 IN PVIDEO_I2C_CONTROL I2CControl);
412
413typedef BOOLEAN
414(NTAPI *PI2C_STOP_2)(
415 IN PVOID HwDeviceExtension,
416 IN PVIDEO_I2C_CONTROL I2CControl);
417
418typedef BOOLEAN
419(NTAPI *PI2C_WRITE_2)(
420 IN PVOID HwDeviceExtension,
421 IN PVIDEO_I2C_CONTROL I2CControl,
422 IN PUCHAR Buffer,
423 IN ULONG Length);
424
425typedef BOOLEAN
426(NTAPI *PI2C_READ_2)(
427 IN PVOID HwDeviceExtension,
428 IN PVIDEO_I2C_CONTROL I2CControl,
429 OUT PUCHAR Buffer,
430 IN ULONG Length,
431 IN BOOLEAN EndOfRead);
432
433typedef struct _INT10_BIOS_ARGUMENTS {
434 ULONG Eax;
435 ULONG Ebx;
436 ULONG Ecx;
437 ULONG Edx;
438 ULONG Esi;
439 ULONG Edi;
440 ULONG Ebp;
441 USHORT SegDs;
442 USHORT SegEs;
443} INT10_BIOS_ARGUMENTS, *PINT10_BIOS_ARGUMENTS;
444
445typedef VP_STATUS
446(NTAPI *PINT10_CALL_BIOS)(
447 IN PVOID Context,
448 IN OUT PINT10_BIOS_ARGUMENTS BiosArguments);
449
450typedef VP_STATUS
451(NTAPI *PINT10_ALLOCATE_BUFFER)(
452 IN PVOID Context,
453 OUT PUSHORT Seg,
454 OUT PUSHORT Off,
455 IN OUT PULONG Length);
456
457typedef VP_STATUS
458(NTAPI *PINT10_FREE_BUFFER)(
459 IN PVOID Context,
460 IN USHORT Seg,
461 IN USHORT Off);
462
463typedef VP_STATUS
464(NTAPI *PINT10_READ_MEMORY)(
465 IN PVOID Context,
466 IN USHORT Seg,
467 IN USHORT Off,
468 OUT PVOID Buffer,
469 IN ULONG Length);
470
471typedef VP_STATUS
472(NTAPI *PINT10_WRITE_MEMORY)(
473 IN PVOID Context,
474 IN USHORT Seg,
475 IN USHORT Off,
476 IN PVOID Buffer,
477 IN ULONG Length);
478
479typedef VP_STATUS
480(NTAPI *PROTECT_WC_MEMORY)(
481 IN PVOID Context,
482 IN PVOID HwDeviceExtension);
483
484typedef VP_STATUS
485(NTAPI *RESTORE_WC_MEMORY)(
486 IN PVOID Context,
487 IN PVOID HwDeviceExtension);
488
489typedef enum _VIDEO_DEVICE_DATA_TYPE {
490 VpMachineData = 0,
491 VpCmosData,
492 VpBusData,
493 VpControllerData,
494 VpMonitorData
495} VIDEO_DEVICE_DATA_TYPE, *PVIDEO_DEVICE_DATA_TYPE;
496
497typedef VP_STATUS
498(NTAPI *PMINIPORT_QUERY_DEVICE_ROUTINE)(
499 IN PVOID HwDeviceExtension,
500 IN PVOID Context,
501 IN VIDEO_DEVICE_DATA_TYPE DeviceDataType,
502 IN PVOID Identifier,
503 IN ULONG IdentifierLength,
504 IN PVOID ConfigurationData,
505 IN ULONG ConfigurationDataLength,
506 IN OUT PVOID ComponentInformation,
507 IN ULONG ComponentInformationLength);
508
509typedef VP_STATUS
510(NTAPI *PMINIPORT_GET_REGISTRY_ROUTINE)(
511 IN PVOID HwDeviceExtension,
512 IN PVOID Context,
513 IN OUT PWSTR ValueName,
514 IN OUT PVOID ValueData,
515 IN ULONG ValueLength);
516
517typedef VOID
518(NTAPI *PMINIPORT_DPC_ROUTINE)(
519 IN PVOID HwDeviceExtension,
520 IN PVOID Context);
521
522typedef BOOLEAN
523(NTAPI *PMINIPORT_SYNCHRONIZE_ROUTINE)(
524 IN PVOID Context);
525
526typedef VOID
527(NTAPI *PVIDEO_BUGCHECK_CALLBACK)(
528 IN PVOID HwDeviceExtension,
529 IN ULONG BugcheckCode,
530 IN PUCHAR Buffer,
531 IN ULONG BufferSize);
532
533/* VideoPortSynchronizeExecution.Priority constants */
534typedef enum VIDEO_SYNCHRONIZE_PRIORITY {
535 VpLowPriority = 0,
536 VpMediumPriority,
537 VpHighPriority
538} VIDEO_SYNCHRONIZE_PRIORITY, *PVIDEO_SYNCHRONIZE_PRIORITY;
539
540/* VideoPortAllocatePool.PoolType constants */
541typedef enum _VP_POOL_TYPE {
542 VpNonPagedPool = 0,
543 VpPagedPool,
544 VpNonPagedPoolCacheAligned = 4,
545 VpPagedPoolCacheAligned
546} VP_POOL_TYPE, *PVP_POOL_TYPE;
547
548typedef enum _DMA_FLAGS {
549 VideoPortUnlockAfterDma = 1,
550 VideoPortKeepPagesLocked,
551 VideoPortDmaInitOnly
552} DMA_FLAGS;
553
554typedef struct _VIDEO_HARDWARE_CONFIGURATION_DATA {
555 INTERFACE_TYPE InterfaceType;
556 ULONG BusNumber;
557 USHORT Version;
558 USHORT Revision;
559 USHORT Irql;
560 USHORT Vector;
561 ULONG ControlBase;
562 ULONG ControlSize;
563 ULONG CursorBase;
564 ULONG CursorSize;
565 ULONG FrameBase;
566 ULONG FrameSize;
567} VIDEO_HARDWARE_CONFIGURATION_DATA, *PVIDEO_HARDWARE_CONFIGURATION_DATA;
568
569typedef struct _VIDEO_X86_BIOS_ARGUMENTS {
570 ULONG Eax;
571 ULONG Ebx;
572 ULONG Ecx;
573 ULONG Edx;
574 ULONG Esi;
575 ULONG Edi;
576 ULONG Ebp;
577} VIDEO_X86_BIOS_ARGUMENTS, *PVIDEO_X86_BIOS_ARGUMENTS;
578
579typedef enum VIDEO_DEBUG_LEVEL {
580 Error = 0,
581 Warn,
582 Trace,
583 Info
584} VIDEO_DEBUG_LEVEL, *PVIDEO_DEBUG_LEVEL;
585
586#ifndef _NTOS_
587
588typedef VP_STATUS
589(NTAPI *PDRIVER_IO_PORT_UCHAR)(
590 IN ULONG_PTR Context,
591 IN ULONG Port,
592 IN UCHAR AccessMode,
593 IN PUCHAR Data);
594
595typedef VP_STATUS
596(NTAPI *PDRIVER_IO_PORT_UCHAR_STRING)(
597 IN ULONG_PTR Context,
598 IN ULONG Port,
599 IN UCHAR AccessMode,
600 IN PUCHAR Data,
601 IN ULONG DataLength);
602
603typedef VP_STATUS
604(NTAPI *PDRIVER_IO_PORT_ULONG)(
605 IN ULONG_PTR Context,
606 IN ULONG Port,
607 IN UCHAR AccessMode,
608 IN PULONG Data);
609
610typedef VP_STATUS
611(NTAPI *PDRIVER_IO_PORT_ULONG_STRING)(
612 IN ULONG_PTR Context,
613 IN ULONG Port,
614 IN UCHAR AccessMode,
615 IN PULONG Data,
616 IN ULONG DataLength);
617
618typedef VP_STATUS
619(NTAPI *PDRIVER_IO_PORT_USHORT)(
620 IN ULONG_PTR Context,
621 IN ULONG Port,
622 IN UCHAR AccessMode,
623 IN PUSHORT Data);
624
625typedef VP_STATUS
626(NTAPI *PDRIVER_IO_PORT_USHORT_STRING)(
627 IN ULONG_PTR Context,
628 IN ULONG Port,
629 IN UCHAR AccessMode,
630 IN PUSHORT Data,
631 IN ULONG DataLength);
632
633#endif /* _NTOS_ */
634
635typedef struct __VRB_SG {
636 __int64 PhysicalAddress;
637 ULONG Length;
638} VRB_SG, *PVRB_SG;
639
640typedef enum _VP_LOCK_OPERATION {
641 VpReadAccess = 0,
642 VpWriteAccess,
643 VpModifyAccess
644} VP_LOCK_OPERATION;
645
646typedef struct _VP_DEVICE_DESCRIPTION {
647 BOOLEAN ScatterGather;
648 BOOLEAN Dma32BitAddresses;
649 BOOLEAN Dma64BitAddresses;
650 ULONG MaximumLength;
651} VP_DEVICE_DESCRIPTION, *PVP_DEVICE_DESCRIPTION;
652
653typedef struct _VIDEO_CHILD_STATE {
654 ULONG Id;
655 ULONG State;
656} VIDEO_CHILD_STATE, *PVIDEO_CHILD_STATE;
657
658typedef struct _VIDEO_CHILD_STATE_CONFIGURATION {
659 ULONG Count;
660 VIDEO_CHILD_STATE ChildStateArray[ANYSIZE_ARRAY];
661} VIDEO_CHILD_STATE_CONFIGURATION, *PVIDEO_CHILD_STATE_CONFIGURATION;
662
663typedef struct _VIDEO_HW_INITIALIZATION_DATA {
664 ULONG HwInitDataSize;
665 INTERFACE_TYPE AdapterInterfaceType;
666 PVIDEO_HW_FIND_ADAPTER HwFindAdapter;
667 PVIDEO_HW_INITIALIZE HwInitialize;
668 PVIDEO_HW_INTERRUPT HwInterrupt;
669 PVIDEO_HW_START_IO HwStartIO;
670 ULONG HwDeviceExtensionSize;
671 ULONG StartingDeviceNumber;
672 PVIDEO_HW_RESET_HW HwResetHw;
673 PVIDEO_HW_TIMER HwTimer;
674 PVIDEO_HW_START_DMA HwStartDma;
675 PVIDEO_HW_POWER_SET HwSetPowerState;
676 PVIDEO_HW_POWER_GET HwGetPowerState;
677 PVIDEO_HW_GET_CHILD_DESCRIPTOR HwGetVideoChildDescriptor;
678 PVIDEO_HW_QUERY_INTERFACE HwQueryInterface;
679 ULONG HwChildDeviceExtensionSize;
680 PVIDEO_ACCESS_RANGE HwLegacyResourceList;
681 ULONG HwLegacyResourceCount;
682 PVIDEO_HW_LEGACYRESOURCES HwGetLegacyResources;
683 BOOLEAN AllowEarlyEnumeration;
684 ULONG Reserved;
685} VIDEO_HW_INITIALIZATION_DATA, *PVIDEO_HW_INITIALIZATION_DATA;
686
687typedef struct _I2C_FNC_TABLE {
688 IN ULONG Size;
689 IN PVIDEO_WRITE_CLOCK_LINE WriteClockLine;
690 IN PVIDEO_WRITE_DATA_LINE WriteDataLine;
691 IN PVIDEO_READ_CLOCK_LINE ReadClockLine;
692 IN PVIDEO_READ_DATA_LINE ReadDataLine;
693 IN PVIDEO_WAIT_VSYNC_ACTIVE WaitVsync;
694 PVOID Reserved;
695} I2C_FNC_TABLE, *PI2C_FNC_TABLE;
696
697typedef struct _DDC_CONTROL {
698 IN ULONG Size;
699 IN I2C_CALLBACKS I2CCallbacks;
700 IN UCHAR EdidSegment;
701} DDC_CONTROL, *PDDC_CONTROL;
702
703/* VideoPortQueryServices.ServicesType constants */
704typedef enum _VIDEO_PORT_SERVICES {
705 VideoPortServicesAGP = 1,
706 VideoPortServicesI2C,
707 VideoPortServicesHeadless,
708 VideoPortServicesInt10,
709 VideoPortServicesDebugReport,
710 VideoPortServicesWCMemoryProtection
711} VIDEO_PORT_SERVICES;
712
713typedef struct _VIDEO_PORT_AGP_INTERFACE {
714 SHORT Size;
715 SHORT Version;
716 PVOID Context;
717 PINTERFACE_REFERENCE InterfaceReference;
718 PINTERFACE_DEREFERENCE InterfaceDereference;
719 PAGP_RESERVE_PHYSICAL AgpReservePhysical;
720 PAGP_RELEASE_PHYSICAL AgpReleasePhysical;
721 PAGP_COMMIT_PHYSICAL AgpCommitPhysical;
722 PAGP_FREE_PHYSICAL AgpFreePhysical;
723 PAGP_RESERVE_VIRTUAL AgpReserveVirtual;
724 PAGP_RELEASE_VIRTUAL AgpReleaseVirtual;
725 PAGP_COMMIT_VIRTUAL AgpCommitVirtual;
726 PAGP_FREE_VIRTUAL AgpFreeVirtual;
727 ULONGLONG AgpAllocationLimit;
728} VIDEO_PORT_AGP_INTERFACE, *PVIDEO_PORT_AGP_INTERFACE;
729
730typedef struct _VIDEO_PORT_AGP_INTERFACE_2 {
731 IN USHORT Size;
732 IN USHORT Version;
733 OUT PVOID Context;
734 OUT PINTERFACE_REFERENCE InterfaceReference;
735 OUT PINTERFACE_DEREFERENCE InterfaceDereference;
736 OUT PAGP_RESERVE_PHYSICAL AgpReservePhysical;
737 OUT PAGP_RELEASE_PHYSICAL AgpReleasePhysical;
738 OUT PAGP_COMMIT_PHYSICAL AgpCommitPhysical;
739 OUT PAGP_FREE_PHYSICAL AgpFreePhysical;
740 OUT PAGP_RESERVE_VIRTUAL AgpReserveVirtual;
741 OUT PAGP_RELEASE_VIRTUAL AgpReleaseVirtual;
742 OUT PAGP_COMMIT_VIRTUAL AgpCommitVirtual;
743 OUT PAGP_FREE_VIRTUAL AgpFreeVirtual;
744 OUT ULONGLONG AgpAllocationLimit;
745 OUT PAGP_SET_RATE AgpSetRate;
746} VIDEO_PORT_AGP_INTERFACE_2, *PVIDEO_PORT_AGP_INTERFACE_2;
747
748typedef struct _VIDEO_PORT_I2C_INTERFACE {
749 USHORT Size;
750 USHORT Version;
751 PVOID Context;
752 PINTERFACE_REFERENCE InterfaceReference;
753 PINTERFACE_DEREFERENCE InterfaceDereference;
754 PI2C_START I2CStart;
755 PI2C_STOP I2CStop;
756 PI2C_WRITE I2CWrite;
757 PI2C_READ I2CRead;
758} VIDEO_PORT_I2C_INTERFACE, *PVIDEO_PORT_I2C_INTERFACE;
759
760typedef struct _VIDEO_PORT_I2C_INTERFACE_2 {
761 IN USHORT Size;
762 IN USHORT Version;
763 OUT PVOID Context;
764 OUT PINTERFACE_REFERENCE InterfaceReference;
765 OUT PINTERFACE_DEREFERENCE InterfaceDereference;
766 OUT PI2C_START_2 I2CStart;
767 OUT PI2C_STOP_2 I2CStop;
768 OUT PI2C_WRITE_2 I2CWrite;
769 OUT PI2C_READ_2 I2CRead;
770} VIDEO_PORT_I2C_INTERFACE_2, *PVIDEO_PORT_I2C_INTERFACE_2;
771
772typedef struct _VIDEO_PORT_INT10_INTERFACE {
773 IN USHORT Size;
774 IN USHORT Version;
775 OUT PVOID Context;
776 OUT PINTERFACE_REFERENCE InterfaceReference;
777 OUT PINTERFACE_DEREFERENCE InterfaceDereference;
778 OUT PINT10_ALLOCATE_BUFFER Int10AllocateBuffer;
779 OUT PINT10_FREE_BUFFER Int10FreeBuffer;
780 OUT PINT10_READ_MEMORY Int10ReadMemory;
781 OUT PINT10_WRITE_MEMORY Int10WriteMemory;
782 OUT PINT10_CALL_BIOS Int10CallBios;
783} VIDEO_PORT_INT10_INTERFACE, *PVIDEO_PORT_INT10_INTERFACE;
784
785typedef struct _VIDEO_PORT_WCMEMORYPROTECTION_INTERFACE {
786 IN USHORT Size;
787 IN USHORT Version;
788 OUT PVOID Context;
789 OUT PINTERFACE_REFERENCE InterfaceReference;
790 OUT PINTERFACE_DEREFERENCE InterfaceDereference;
791 OUT PROTECT_WC_MEMORY VideoPortProtectWCMemory;
792 OUT RESTORE_WC_MEMORY VideoPortRestoreWCMemory;
793} VIDEO_PORT_WCMEMORYPROTECTION_INTERFACE, *PVIDEO_PORT_WCMEMORYPROTECTION_INTERFACE;
794
795typedef struct _VPOSVERSIONINFO {
796 IN ULONG Size;
797 OUT ULONG MajorVersion;
798 OUT ULONG MinorVersion;
799 OUT ULONG BuildNumber;
800 OUT USHORT ServicePackMajor;
801 OUT USHORT ServicePackMinor;
802} VPOSVERSIONINFO, *PVPOSVERSIONINFO;
803
804typedef struct _VIDEO_PORT_DEBUG_REPORT_INTERFACE {
805 IN USHORT Size;
806 IN USHORT Version;
807 OUT PVOID Context;
808 OUT PINTERFACE_REFERENCE InterfaceReference;
809 OUT PINTERFACE_DEREFERENCE InterfaceDereference;
810 OUT PVIDEO_DEBUG_REPORT (*DbgReportCreate)(
811 IN PVOID HwDeviceExtension,
812 IN ULONG ulCode,
813 IN ULONG_PTR ulpArg1,
814 IN ULONG_PTR ulpArg2,
815 IN ULONG_PTR ulpArg3,
816 IN ULONG_PTR ulpArg4
817 );
818 OUT BOOLEAN (*DbgReportSecondaryData)(
819 IN OUT PVIDEO_DEBUG_REPORT pReport,
820 IN PVOID pvData,
821 IN ULONG ulDataSize
822 );
823 OUT VOID (*DbgReportComplete)(
824 IN OUT PVIDEO_DEBUG_REPORT pReport
825 );
826} VIDEO_PORT_DEBUG_REPORT_INTERFACE, *PVIDEO_PORT_DEBUG_REPORT_INTERFACE;
827
828/* Video port functions for miniports */
829
830VPAPI
831VP_STATUS
832NTAPI
833VideoPortAllocateBuffer(
834 IN PVOID HwDeviceExtension,
835 IN ULONG Size,
836 OUT PVOID *Buffer);
837
838VPAPI
839VOID
840NTAPI
841VideoPortAcquireDeviceLock(
842 IN PVOID HwDeviceExtension);
843
844VPAPI
845ULONG
846NTAPI
847VideoPortCompareMemory(
848 IN PVOID Source1,
849 IN PVOID Source2,
850 IN SIZE_T Length);
851
852VPAPI
853BOOLEAN
854NTAPI
855VideoPortDDCMonitorHelper(
856 IN PVOID HwDeviceExtension,
857 IN PVOID DDCControl,
858 IN OUT PUCHAR EdidBuffer,
859 IN ULONG EdidBufferSize);
860
861VPAPI
862VOID
863__cdecl
864VideoPortDebugPrint(
865 IN VIDEO_DEBUG_LEVEL DebugPrintLevel,
866 IN PSTR DebugMessage,
867 IN ...);
868
869VPAPI
870VP_STATUS
871NTAPI
872VideoPortDisableInterrupt(
873 IN PVOID HwDeviceExtension);
874
875VPAPI
876VP_STATUS
877NTAPI
878VideoPortEnableInterrupt(
879 IN PVOID HwDeviceExtension);
880
881VPAPI
882VP_STATUS
883NTAPI
884VideoPortEnumerateChildren(
885 IN PVOID HwDeviceExtension,
886 IN PVOID Reserved);
887
888VPAPI
889VOID
890NTAPI
891VideoPortFreeDeviceBase(
892 IN PVOID HwDeviceExtension,
893 IN PVOID MappedAddress);
894
895VPAPI
896VP_STATUS
897NTAPI
898VideoPortGetAccessRanges(
899 IN PVOID HwDeviceExtension,
900 IN ULONG NumRequestedResources,
901 IN PIO_RESOURCE_DESCRIPTOR RequestedResources OPTIONAL,
902 IN ULONG NumAccessRanges,
903 OUT PVIDEO_ACCESS_RANGE AccessRanges,
904 IN PVOID VendorId,
905 IN PVOID DeviceId,
906 OUT PULONG Slot);
907
908VPAPI
909PVOID
910NTAPI
911VideoPortGetAssociatedDeviceExtension(
912 IN PVOID DeviceObject);
913
914VPAPI
915ULONG
916NTAPI
917VideoPortGetBusData(
918 IN PVOID HwDeviceExtension,
919 IN BUS_DATA_TYPE BusDataType,
920 IN ULONG SlotNumber,
921 IN OUT PVOID Buffer,
922 IN ULONG Offset,
923 IN ULONG Length);
924
925VPAPI
926UCHAR
927NTAPI
928VideoPortGetCurrentIrql(VOID);
929
930VPAPI
931PVOID
932NTAPI
933VideoPortGetDeviceBase(
934 IN PVOID HwDeviceExtension,
935 IN PHYSICAL_ADDRESS IoAddress,
936 IN ULONG NumberOfUchars,
937 IN UCHAR InIoSpace);
938
939VPAPI
940VP_STATUS
941NTAPI
942VideoPortGetDeviceData(
943 IN PVOID HwDeviceExtension,
944 IN VIDEO_DEVICE_DATA_TYPE DeviceDataType,
945 IN PMINIPORT_QUERY_DEVICE_ROUTINE CallbackRoutine,
946 IN PVOID Context);
947
948VPAPI
949VP_STATUS
950NTAPI
951VideoPortGetRegistryParameters(
952 IN PVOID HwDeviceExtension,
953 IN PWSTR ParameterName,
954 IN UCHAR IsParameterFileName,
955 IN PMINIPORT_GET_REGISTRY_ROUTINE CallbackRoutine,
956 IN PVOID Context);
957
958VPAPI
959PVOID
960NTAPI
961VideoPortGetRomImage(
962 IN PVOID HwDeviceExtension,
963 IN PVOID Unused1,
964 IN ULONG Unused2,
965 IN ULONG Length);
966
967VPAPI
968VP_STATUS
969NTAPI
970VideoPortGetVgaStatus(
971 IN PVOID HwDeviceExtension,
972 OUT PULONG VgaStatus);
973
974VPAPI
975LONG
976FASTCALL
977VideoPortInterlockedDecrement(
978 IN PLONG Addend);
979
980VPAPI
981LONG
982FASTCALL
983VideoPortInterlockedExchange(
984 IN OUT PLONG Target,
985 IN LONG Value);
986
987VPAPI
988LONG
989FASTCALL
990VideoPortInterlockedIncrement(
991 IN PLONG Addend);
992
993VPAPI
994ULONG
995NTAPI
996VideoPortInitialize(
997 IN PVOID Argument1,
998 IN PVOID Argument2,
999 IN PVIDEO_HW_INITIALIZATION_DATA HwInitializationData,
1000 IN PVOID HwContext);
1001
1002VPAPI
1003VP_STATUS
1004NTAPI
1005VideoPortInt10(
1006 IN PVOID HwDeviceExtension,
1007 IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments);
1008
1009VPAPI
1010VOID
1011NTAPI
1012VideoPortLogError(
1013 IN PVOID HwDeviceExtension,
1014 IN PVIDEO_REQUEST_PACKET Vrp OPTIONAL,
1015 IN VP_STATUS ErrorCode,
1016 IN ULONG UniqueId);
1017
1018VPAPI
1019VP_STATUS
1020NTAPI
1021VideoPortMapBankedMemory(
1022 IN PVOID HwDeviceExtension,
1023 IN PHYSICAL_ADDRESS PhysicalAddress,
1024 IN OUT PULONG Length,
1025 PULONG InIoSpace,
1026 PVOID *VirtualAddress,
1027 ULONG BankLength,
1028 UCHAR ReadWriteBank,
1029 PBANKED_SECTION_ROUTINE BankRoutine,
1030 PVOID Context);
1031
1032VPAPI
1033VP_STATUS
1034NTAPI
1035VideoPortMapMemory(
1036 IN PVOID HwDeviceExtension,
1037 IN PHYSICAL_ADDRESS PhysicalAddress,
1038 IN OUT PULONG Length,
1039 IN PULONG InIoSpace,
1040 IN OUT PVOID *VirtualAddress);
1041
1042VPAPI
1043VOID
1044NTAPI
1045VideoPortMoveMemory(
1046 IN PVOID Destination,
1047 IN PVOID Source,
1048 IN ULONG Length);
1049
1050VPAPI
1051LONGLONG
1052NTAPI
1053VideoPortQueryPerformanceCounter(
1054 IN PVOID HwDeviceExtension,
1055 OUT PLONGLONG PerformanceFrequency OPTIONAL);
1056
1057VPAPI
1058VP_STATUS
1059NTAPI
1060VideoPortQueryServices(
1061 IN PVOID HwDeviceExtension,
1062 IN VIDEO_PORT_SERVICES ServicesType,
1063 IN OUT PINTERFACE Interface);
1064
1065VPAPI
1066BOOLEAN
1067NTAPI
1068VideoPortQueueDpc(
1069 IN PVOID HwDeviceExtension,
1070 IN PMINIPORT_DPC_ROUTINE CallbackRoutine,
1071 IN PVOID Context);
1072
1073VPAPI
1074VOID
1075NTAPI
1076VideoPortReadPortBufferUchar(
1077 IN PUCHAR Port,
1078 OUT PUCHAR Buffer,
1079 IN ULONG Count);
1080
1081VPAPI
1082VOID
1083NTAPI
1084VideoPortReadPortBufferUlong(
1085 IN PULONG Port,
1086 OUT PULONG Buffer,
1087 IN ULONG Count);
1088
1089VPAPI
1090VOID
1091NTAPI
1092VideoPortReadPortBufferUshort(
1093 IN PUSHORT Port,
1094 OUT PUSHORT Buffer,
1095 IN ULONG Count);
1096
1097VPAPI
1098UCHAR
1099NTAPI
1100VideoPortReadPortUchar(
1101 IN PUCHAR Port);
1102
1103VPAPI
1104ULONG
1105NTAPI
1106VideoPortReadPortUlong(
1107 IN PULONG Port);
1108
1109VPAPI
1110USHORT
1111NTAPI
1112VideoPortReadPortUshort(
1113 IN PUSHORT Port);
1114
1115VPAPI
1116VOID
1117NTAPI
1118VideoPortReadRegisterBufferUchar(
1119 IN PUCHAR Register,
1120 OUT PUCHAR Buffer,
1121 IN ULONG Count);
1122
1123VPAPI
1124VOID
1125NTAPI
1126VideoPortReadRegisterBufferUlong(
1127 IN PULONG Register,
1128 OUT PULONG Buffer,
1129 IN ULONG Count);
1130
1131VPAPI
1132VOID
1133NTAPI
1134VideoPortReadRegisterBufferUshort(
1135 IN PUSHORT Register,
1136 OUT PUSHORT Buffer,
1137 IN ULONG Count);
1138
1139VPAPI
1140UCHAR
1141NTAPI
1142VideoPortReadRegisterUchar(
1143 IN PUCHAR Register);
1144
1145VPAPI
1146ULONG
1147NTAPI
1148VideoPortReadRegisterUlong(
1149 IN PULONG Register);
1150
1151VPAPI
1152USHORT
1153NTAPI
1154VideoPortReadRegisterUshort(
1155 IN PUSHORT Register);
1156
1157VPAPI
1158VOID
1159NTAPI
1160VideoPortReleaseBuffer(
1161 IN PVOID HwDeviceExtension,
1162 IN PVOID Buffer);
1163
1164VPAPI
1165VOID
1166NTAPI
1167VideoPortReleaseDeviceLock(
1168 IN PVOID HwDeviceExtension);
1169
1170VPAPI
1171BOOLEAN
1172NTAPI
1173VideoPortScanRom(
1174 PVOID HwDeviceExtension,
1175 PUCHAR RomBase,
1176 ULONG RomLength,
1177 PUCHAR String);
1178
1179VPAPI
1180ULONG
1181NTAPI
1182VideoPortSetBusData(
1183 IN PVOID HwDeviceExtension,
1184 IN BUS_DATA_TYPE BusDataType,
1185 IN ULONG SlotNumber,
1186 IN PVOID Buffer,
1187 IN ULONG Offset,
1188 IN ULONG Length);
1189
1190VPAPI
1191VP_STATUS
1192NTAPI
1193VideoPortSetRegistryParameters(
1194 IN PVOID HwDeviceExtension,
1195 IN PWSTR ValueName,
1196 IN PVOID ValueData,
1197 IN ULONG ValueLength);
1198
1199VPAPI
1200VP_STATUS
1201NTAPI
1202VideoPortSetTrappedEmulatorPorts(
1203 IN PVOID HwDeviceExtension,
1204 IN ULONG NumAccessRanges,
1205 IN PVIDEO_ACCESS_RANGE AccessRange);
1206
1207VPAPI
1208VOID
1209NTAPI
1210VideoPortStallExecution(
1211 IN ULONG Microseconds);
1212
1213VPAPI
1214VOID
1215NTAPI
1216VideoPortStartTimer(
1217 IN PVOID HwDeviceExtension);
1218
1219VPAPI
1220VOID
1221NTAPI
1222VideoPortStopTimer(
1223 IN PVOID HwDeviceExtension);
1224
1225VPAPI
1226BOOLEAN
1227NTAPI
1228VideoPortSynchronizeExecution(
1229 IN PVOID HwDeviceExtension,
1230 IN VIDEO_SYNCHRONIZE_PRIORITY Priority,
1231 IN PMINIPORT_SYNCHRONIZE_ROUTINE SynchronizeRoutine,
1232 IN PVOID Context);
1233
1234VPAPI
1235VP_STATUS
1236NTAPI
1237VideoPortUnmapMemory(
1238 IN PVOID HwDeviceExtension,
1239 IN OUT PVOID VirtualAddress,
1240 IN HANDLE ProcessHandle);
1241
1242VPAPI
1243VP_STATUS
1244NTAPI
1245VideoPortVerifyAccessRanges(
1246 IN PVOID HwDeviceExtension,
1247 IN ULONG NumAccessRanges,
1248 IN PVIDEO_ACCESS_RANGE AccessRanges);
1249
1250VPAPI
1251VOID
1252NTAPI
1253VideoPortWritePortBufferUchar(
1254 IN PUCHAR Port,
1255 IN PUCHAR Buffer,
1256 IN ULONG Count);
1257
1258VPAPI
1259VOID
1260NTAPI
1261VideoPortWritePortBufferUlong(
1262 IN PULONG Port,
1263 IN PULONG Buffer,
1264 IN ULONG Count);
1265
1266VPAPI
1267VOID
1268NTAPI
1269VideoPortWritePortBufferUshort(
1270 IN PUSHORT Port,
1271 IN PUSHORT Buffer,
1272 IN ULONG Count);
1273
1274VPAPI
1275VOID
1276NTAPI
1277VideoPortWritePortUchar(
1278 IN PUCHAR Port,
1279 IN UCHAR Value);
1280
1281VPAPI
1282VOID
1283NTAPI
1284VideoPortWritePortUlong(
1285 IN PULONG Port,
1286 IN ULONG Value);
1287
1288VPAPI
1289VOID
1290NTAPI
1291VideoPortWritePortUshort(
1292 IN PUSHORT Port,
1293 IN USHORT Value);
1294
1295VPAPI
1296VOID
1297NTAPI
1298VideoPortWriteRegisterBufferUchar(
1299 IN PUCHAR Register,
1300 IN PUCHAR Buffer,
1301 IN ULONG Count);
1302
1303VPAPI
1304VOID
1305NTAPI
1306VideoPortWriteRegisterBufferUlong(
1307 IN PULONG Register,
1308 IN PULONG Buffer,
1309 IN ULONG Count);
1310
1311VPAPI
1312VOID
1313NTAPI
1314VideoPortWriteRegisterBufferUshort(
1315 IN PUSHORT Register,
1316 IN PUSHORT Buffer,
1317 IN ULONG Count);
1318
1319VPAPI
1320VOID
1321NTAPI
1322VideoPortWriteRegisterUchar(
1323 IN PUCHAR Register,
1324 IN UCHAR Value);
1325
1326VPAPI
1327VOID
1328NTAPI
1329VideoPortWriteRegisterUlong(
1330 IN PULONG Register,
1331 IN ULONG Value);
1332
1333VPAPI
1334VOID
1335NTAPI
1336VideoPortWriteRegisterUshort(
1337 IN PUSHORT Register,
1338 IN USHORT Value);
1339
1340VPAPI
1341VOID
1342NTAPI
1343VideoPortZeroDeviceMemory(
1344 IN PVOID Destination,
1345 IN ULONG Length);
1346
1347VPAPI
1348VOID
1349NTAPI
1350VideoPortZeroMemory(
1351 IN PVOID Destination,
1352 IN ULONG Length);
1353
1354VPAPI
1355PVOID
1356NTAPI
1357VideoPortAllocateContiguousMemory(
1358 IN PVOID HwDeviceExtension,
1359 IN ULONG NumberOfBytes,
1360 IN PHYSICAL_ADDRESS HighestAcceptableAddress);
1361
1362VPAPI
1363PVOID
1364NTAPI
1365VideoPortGetCommonBuffer(
1366 IN PVOID HwDeviceExtension,
1367 IN ULONG DesiredLength,
1368 IN ULONG Alignment,
1369 OUT PPHYSICAL_ADDRESS LogicalAddress,
1370 OUT PULONG pActualLength,
1371 IN BOOLEAN CacheEnabled);
1372
1373VPAPI
1374VOID
1375NTAPI
1376VideoPortFreeCommonBuffer(
1377 IN PVOID HwDeviceExtension,
1378 IN ULONG Length,
1379 IN PVOID VirtualAddress,
1380 IN PHYSICAL_ADDRESS LogicalAddress,
1381 IN BOOLEAN CacheEnabled);
1382
1383VPAPI
1384PDMA
1385NTAPI
1386VideoPortDoDma(
1387 IN PVOID HwDeviceExtension,
1388 IN PDMA pDma,
1389 IN DMA_FLAGS DmaFlags);
1390
1391VPAPI
1392BOOLEAN
1393NTAPI
1394VideoPortLockPages(
1395 IN PVOID HwDeviceExtension,
1396 IN OUT PVIDEO_REQUEST_PACKET pVrp,
1397 IN OUT PEVENT pUEvent,
1398 IN PEVENT pDisplayEvent,
1399 IN DMA_FLAGS DmaFlags);
1400
1401VPAPI
1402BOOLEAN
1403NTAPI
1404VideoPortUnlockPages(
1405 IN PVOID hwDeviceExtension,
1406 IN OUT PDMA pDma);
1407
1408VPAPI
1409BOOLEAN
1410NTAPI
1411VideoPortSignalDmaComplete(
1412 IN PVOID HwDeviceExtension,
1413 IN PDMA pDmaHandle);
1414
1415VPAPI
1416PVOID
1417NTAPI
1418VideoPortGetMdl(
1419 IN PVOID HwDeviceExtension,
1420 IN PDMA pDma);
1421
1422VPAPI
1423PVOID
1424NTAPI
1425VideoPortGetDmaContext(
1426 IN PVOID HwDeviceExtension,
1427 IN PDMA pDma);
1428
1429VPAPI
1430VOID
1431NTAPI
1432VideoPortSetDmaContext(
1433 IN PVOID HwDeviceExtension,
1434 OUT PDMA pDma,
1435 IN PVOID InstanceContext);
1436
1437VPAPI
1438ULONG
1439NTAPI
1440VideoPortGetBytesUsed(
1441 IN PVOID HwDeviceExtension,
1442 IN PDMA pDma);
1443
1444VPAPI
1445VOID
1446NTAPI
1447VideoPortSetBytesUsed(
1448 IN PVOID HwDeviceExtension,
1449 IN OUT PDMA pDma,
1450 IN ULONG BytesUsed);
1451
1452VPAPI
1453PDMA
1454NTAPI
1455VideoPortAssociateEventsWithDmaHandle(
1456 IN PVOID HwDeviceExtension,
1457 IN OUT PVIDEO_REQUEST_PACKET pVrp,
1458 IN PVOID MappedUserEvent,
1459 IN PVOID DisplayDriverEvent);
1460
1461VPAPI
1462PDMA
1463NTAPI
1464VideoPortMapDmaMemory(
1465 IN PVOID HwDeviceExtension,
1466 IN PVIDEO_REQUEST_PACKET pVrp,
1467 IN PHYSICAL_ADDRESS BoardAddress,
1468 IN PULONG Length,
1469 IN PULONG InIoSpace,
1470 IN PVOID MappedUserEvent,
1471 IN PVOID DisplayDriverEvent,
1472 IN OUT PVOID *VirtualAddress);
1473
1474VPAPI
1475BOOLEAN
1476NTAPI
1477VideoPortUnmapDmaMemory(
1478 IN PVOID HwDeviceExtension,
1479 IN PVOID VirtualAddress,
1480 IN HANDLE ProcessHandle,
1481 IN PDMA BoardMemoryHandle);
1482
1483VPAPI
1484VP_STATUS
1485NTAPI
1486VideoPortCreateSecondaryDisplay(
1487 IN PVOID HwDeviceExtension,
1488 IN OUT PVOID *SecondaryDeviceExtension,
1489 IN ULONG ulFlag);
1490
1491VPAPI
1492PVP_DMA_ADAPTER
1493NTAPI
1494VideoPortGetDmaAdapter(
1495 IN PVOID HwDeviceExtension,
1496 IN PVP_DEVICE_DESCRIPTION VpDeviceDescription);
1497
1498VPAPI
1499VOID
1500NTAPI
1501VideoPortPutDmaAdapter(
1502 IN PVOID HwDeviceExtension,
1503 IN PVP_DMA_ADAPTER VpDmaAdapter);
1504
1505VPAPI
1506PVOID
1507NTAPI
1508VideoPortAllocateCommonBuffer(
1509 IN PVOID HwDeviceExtension,
1510 IN PVP_DMA_ADAPTER VpDmaAdapter,
1511 IN ULONG DesiredLength,
1512 OUT PPHYSICAL_ADDRESS LogicalAddress,
1513 IN BOOLEAN CacheEnabled,
1514 PVOID Reserved);
1515
1516VPAPI
1517VOID
1518NTAPI
1519VideoPortReleaseCommonBuffer(
1520 IN PVOID HwDeviceExtension,
1521 IN PVP_DMA_ADAPTER VpDmaAdapter,
1522 IN ULONG Length,
1523 IN PHYSICAL_ADDRESS LogicalAddress,
1524 IN PVOID VirtualAddress,
1525 IN BOOLEAN CacheEnabled);
1526
1527VPAPI
1528PVOID
1529NTAPI
1530VideoPortLockBuffer(
1531 IN PVOID HwDeviceExtension,
1532 IN PVOID BaseAddress,
1533 IN ULONG Length,
1534 IN VP_LOCK_OPERATION Operation);
1535
1536VPAPI
1537VOID
1538NTAPI
1539VideoPortUnLockBuffer(
1540 IN PVOID HwDeviceExtension,
1541 IN PVOID Mdl);
1542
1543VPAPI
1544VP_STATUS
1545NTAPI
1546VideoPortStartDma(
1547 IN PVOID HwDeviceExtension,
1548 IN PVP_DMA_ADAPTER VpDmaAdapter,
1549 IN PVOID Mdl,
1550 IN ULONG Offset,
1551 IN OUT PULONG pLength,
1552 IN PEXECUTE_DMA ExecuteDmaRoutine,
1553 IN PVOID Context,
1554 IN BOOLEAN WriteToDevice);
1555
1556VPAPI
1557VP_STATUS
1558NTAPI
1559VideoPortCompleteDma(
1560 IN PVOID HwDeviceExtension,
1561 IN PVP_DMA_ADAPTER VpDmaAdapter,
1562 IN PVP_SCATTER_GATHER_LIST VpScatterGather,
1563 IN BOOLEAN WriteToDevice);
1564
1565VPAPI
1566VP_STATUS
1567NTAPI
1568VideoPortCreateEvent(
1569 IN PVOID HwDeviceExtension,
1570 IN ULONG EventFlag,
1571 IN PVOID Unused,
1572 OUT PEVENT *ppEvent);
1573
1574VPAPI
1575VP_STATUS
1576NTAPI
1577VideoPortDeleteEvent(
1578 IN PVOID HwDeviceExtension,
1579 IN PEVENT pEvent);
1580
1581VPAPI
1582LONG
1583NTAPI
1584VideoPortSetEvent(
1585 IN PVOID HwDeviceExtension,
1586 IN PEVENT pEvent);
1587
1588VPAPI
1589VOID
1590NTAPI
1591VideoPortClearEvent(
1592 IN PVOID HwDeviceExtension,
1593 IN PEVENT pEvent);
1594
1595VPAPI
1596LONG
1597NTAPI
1598VideoPortReadStateEvent(
1599 IN PVOID HwDeviceExtension,
1600 IN PEVENT pEvent);
1601
1602VPAPI
1603VP_STATUS
1604NTAPI
1605VideoPortWaitForSingleObject(
1606 IN PVOID HwDeviceExtension,
1607 IN PVOID Object,
1608 IN PLARGE_INTEGER Timeout OPTIONAL);
1609
1610VPAPI
1611PVOID
1612NTAPI
1613VideoPortAllocatePool(
1614 IN PVOID HwDeviceExtension,
1615 IN VP_POOL_TYPE PoolType,
1616 IN SIZE_T NumberOfBytes,
1617 IN ULONG Tag);
1618
1619VPAPI
1620VOID
1621NTAPI
1622VideoPortFreePool(
1623 IN PVOID HwDeviceExtension,
1624 IN PVOID Ptr);
1625
1626VPAPI
1627VP_STATUS
1628NTAPI
1629VideoPortCreateSpinLock(
1630 IN PVOID HwDeviceExtension,
1631 OUT PSPIN_LOCK *SpinLock);
1632
1633VPAPI
1634VP_STATUS
1635NTAPI
1636VideoPortDeleteSpinLock(
1637 IN PVOID HwDeviceExtension,
1638 IN PSPIN_LOCK SpinLock);
1639
1640VPAPI
1641VOID
1642NTAPI
1643VideoPortAcquireSpinLock(
1644 IN PVOID HwDeviceExtension,
1645 IN PSPIN_LOCK SpinLock,
1646 OUT PUCHAR OldIrql);
1647
1648VPAPI
1649VOID
1650NTAPI
1651VideoPortAcquireSpinLockAtDpcLevel(
1652 IN PVOID HwDeviceExtension,
1653 IN PSPIN_LOCK SpinLock);
1654
1655VPAPI
1656VOID
1657NTAPI
1658VideoPortReleaseSpinLock(
1659 IN PVOID HwDeviceExtension,
1660 IN PSPIN_LOCK SpinLock,
1661 IN UCHAR NewIrql);
1662
1663VPAPI
1664VOID
1665NTAPI
1666VideoPortReleaseSpinLockFromDpcLevel(
1667 IN PVOID HwDeviceExtension,
1668 IN PSPIN_LOCK SpinLock);
1669
1670VPAPI
1671VOID
1672NTAPI
1673VideoPortQuerySystemTime(
1674 OUT PLARGE_INTEGER CurrentTime);
1675
1676VPAPI
1677BOOLEAN
1678NTAPI
1679VideoPortCheckForDeviceExistence(
1680 IN PVOID HwDeviceExtension,
1681 IN USHORT VendorId,
1682 IN USHORT DeviceId,
1683 IN UCHAR RevisionId,
1684 IN USHORT SubVendorId,
1685 IN USHORT SubSystemId,
1686 IN ULONG Flags);
1687
1688VPAPI
1689ULONG
1690NTAPI
1691VideoPortGetAssociatedDeviceID(
1692 IN PVOID DeviceObject);
1693
1694VPAPI
1695VP_STATUS
1696NTAPI
1697VideoPortFlushRegistry(
1698 PVOID HwDeviceExtension);
1699
1700VPAPI
1701VP_STATUS
1702NTAPI
1703VideoPortGetVersion(
1704 IN PVOID HwDeviceExtension,
1705 IN OUT PVPOSVERSIONINFO pVpOsVersionInfo);
1706
1707VPAPI
1708BOOLEAN
1709NTAPI
1710VideoPortIsNoVesa(VOID);
1711
1712VPAPI
1713VP_STATUS
1714NTAPI
1715VideoPortRegisterBugcheckCallback(
1716 IN PVOID HwDeviceExtension,
1717 IN ULONG BugcheckCode,
1718 IN PVIDEO_BUGCHECK_CALLBACK Callback,
1719 IN ULONG BugcheckDataSize);
1720
1721VPAPI
1722PVIDEO_DEBUG_REPORT
1723NTAPI
1724VideoPortDbgReportCreate(
1725 IN PVOID HwDeviceExtension,
1726 IN ULONG ulCode,
1727 IN ULONG_PTR ulpArg1,
1728 IN ULONG_PTR ulpArg2,
1729 IN ULONG_PTR ulpArg3,
1730 IN ULONG_PTR ulpArg4);
1731
1732VPAPI
1733BOOLEAN
1734NTAPI
1735VideoPortDbgReportSecondaryData(
1736 IN OUT PVIDEO_DEBUG_REPORT pReport,
1737 IN PVOID pvData,
1738 IN ULONG ulDataSize);
1739
1740VPAPI
1741VOID
1742NTAPI
1743VideoPortDbgReportComplete(
1744 IN OUT PVIDEO_DEBUG_REPORT pReport);
1745
1746#ifdef __cplusplus
1747}
1748#endif
Note: See TracBrowser for help on using the repository browser.