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