[HEADERS]
[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 VideoPortIsNoVesa(
1143 VOID
1144 );
1145
1146 VPAPI
1147 BOOLEAN
1148 DDKAPI
1149 VideoPortQueueDpc(
1150 IN PVOID HwDeviceExtension,
1151 IN PMINIPORT_DPC_ROUTINE CallbackRoutine,
1152 IN PVOID Context);
1153
1154 VPAPI
1155 VOID
1156 DDKAPI
1157 VideoPortReadPortBufferUchar(
1158 IN PUCHAR Port,
1159 OUT PUCHAR Buffer,
1160 IN ULONG Count);
1161
1162 VPAPI
1163 VOID
1164 DDKAPI
1165 VideoPortReadPortBufferUlong(
1166 IN PULONG Port,
1167 OUT PULONG Buffer,
1168 IN ULONG Count);
1169
1170 VPAPI
1171 VOID
1172 DDKAPI
1173 VideoPortReadPortBufferUshort(
1174 IN PUSHORT Port,
1175 OUT PUSHORT Buffer,
1176 IN ULONG Count);
1177
1178 VPAPI
1179 UCHAR
1180 DDKAPI
1181 VideoPortReadPortUchar(
1182 IN PUCHAR Port);
1183
1184 VPAPI
1185 ULONG
1186 DDKAPI
1187 VideoPortReadPortUlong(
1188 IN PULONG Port);
1189
1190 VPAPI
1191 USHORT
1192 DDKAPI
1193 VideoPortReadPortUshort(
1194 IN PUSHORT Port);
1195
1196 VPAPI
1197 VOID
1198 DDKAPI
1199 VideoPortReadRegisterBufferUchar(
1200 IN PUCHAR Register,
1201 OUT PUCHAR Buffer,
1202 IN ULONG Count);
1203
1204 VPAPI
1205 VOID
1206 DDKAPI
1207 VideoPortReadRegisterBufferUlong(
1208 IN PULONG Register,
1209 OUT PULONG Buffer,
1210 IN ULONG Count);
1211
1212 VPAPI
1213 VOID
1214 DDKAPI
1215 VideoPortReadRegisterBufferUshort(
1216 IN PUSHORT Register,
1217 OUT PUSHORT Buffer,
1218 IN ULONG Count);
1219
1220 VPAPI
1221 UCHAR
1222 DDKAPI
1223 VideoPortReadRegisterUchar(
1224 IN PUCHAR Register);
1225
1226 VPAPI
1227 ULONG
1228 DDKAPI
1229 VideoPortReadRegisterUlong(
1230 IN PULONG Register);
1231
1232 VPAPI
1233 USHORT
1234 DDKAPI
1235 VideoPortReadRegisterUshort(
1236 IN PUSHORT Register);
1237
1238 VPAPI
1239 LONG
1240 DDKAPI
1241 VideoPortReadStateEvent(
1242 IN PVOID HwDeviceExtension,
1243 IN PEVENT pEvent);
1244
1245 VPAPI
1246 VOID
1247 DDKAPI
1248 VideoPortReleaseBuffer(
1249 IN PVOID HwDeviceExtension,
1250 IN PVOID Buffer);
1251
1252 VPAPI
1253 VOID
1254 DDKAPI
1255 VideoPortReleaseCommonBuffer(
1256 IN PVOID HwDeviceExtension,
1257 IN PVP_DMA_ADAPTER VpDmaAdapter,
1258 IN ULONG Length,
1259 IN PHYSICAL_ADDRESS LogicalAddress,
1260 IN PVOID VirtualAddress,
1261 IN BOOLEAN CacheEnabled);
1262
1263 VPAPI
1264 VOID
1265 DDKAPI
1266 VideoPortReleaseDeviceLock(
1267 IN PVOID HwDeviceExtension);
1268
1269 VPAPI
1270 VOID
1271 DDKAPI
1272 VideoPortReleaseSpinLock(
1273 IN PVOID HwDeviceExtension,
1274 IN PSPIN_LOCK SpinLock,
1275 IN UCHAR NewIrql);
1276
1277 VPAPI
1278 VOID
1279 DDKAPI
1280 VideoPortReleaseSpinLockFromDpcLevel(
1281 IN PVOID HwDeviceExtension,
1282 IN PSPIN_LOCK SpinLock);
1283
1284 VPAPI
1285 BOOLEAN
1286 DDKAPI
1287 VideoPortScanRom(
1288 PVOID HwDeviceExtension,
1289 PUCHAR RomBase,
1290 ULONG RomLength,
1291 PUCHAR String);
1292
1293 VPAPI
1294 ULONG
1295 DDKAPI
1296 VideoPortSetBusData(
1297 IN PVOID HwDeviceExtension,
1298 IN BUS_DATA_TYPE BusDataType,
1299 IN ULONG SlotNumber,
1300 IN PVOID Buffer,
1301 IN ULONG Offset,
1302 IN ULONG Length);
1303
1304 VPAPI
1305 VOID
1306 DDKAPI
1307 VideoPortSetBytesUsed(
1308 IN PVOID HwDeviceExtension,
1309 IN OUT PDMA pDma,
1310 IN ULONG BytesUsed);
1311
1312 VPAPI
1313 VOID
1314 DDKAPI
1315 VideoPortSetDmaContext(
1316 IN PVOID HwDeviceExtension,
1317 OUT PDMA pDma,
1318 IN PVOID InstanceContext);
1319
1320 VPAPI
1321 LONG
1322 DDKAPI
1323 VideoPortSetEvent(
1324 IN PVOID HwDeviceExtension,
1325 IN PEVENT pEvent);
1326
1327 VPAPI
1328 VP_STATUS
1329 DDKAPI
1330 VideoPortSetRegistryParameters(
1331 IN PVOID HwDeviceExtension,
1332 IN PWSTR ValueName,
1333 IN PVOID ValueData,
1334 IN ULONG ValueLength);
1335
1336 VPAPI
1337 VP_STATUS
1338 DDKAPI
1339 VideoPortSetTrappedEmulatorPorts(
1340 IN PVOID HwDeviceExtension,
1341 IN ULONG NumAccessRanges,
1342 IN PVIDEO_ACCESS_RANGE AccessRange);
1343
1344 VPAPI
1345 BOOLEAN
1346 DDKAPI
1347 VideoPortSignalDmaComplete(
1348 IN PVOID HwDeviceExtension,
1349 IN PDMA pDmaHandle);
1350
1351 VPAPI
1352 VOID
1353 DDKAPI
1354 VideoPortStallExecution(
1355 IN ULONG Microseconds);
1356
1357 VPAPI
1358 VP_STATUS
1359 DDKAPI
1360 VideoPortStartDma(
1361 IN PVOID HwDeviceExtension,
1362 IN PVP_DMA_ADAPTER VpDmaAdapter,
1363 IN PVOID Mdl,
1364 IN ULONG Offset,
1365 IN OUT PULONG pLength,
1366 IN PEXECUTE_DMA ExecuteDmaRoutine,
1367 IN PVOID Context,
1368 IN BOOLEAN WriteToDevice);
1369
1370 VPAPI
1371 VOID
1372 DDKAPI
1373 VideoPortStartTimer(
1374 IN PVOID HwDeviceExtension);
1375
1376 VPAPI
1377 VOID
1378 DDKAPI
1379 VideoPortStopTimer(
1380 IN PVOID HwDeviceExtension);
1381
1382 /* VideoPortSynchronizeExecution.Priority constants */
1383 typedef enum VIDEO_SYNCHRONIZE_PRIORITY {
1384 VpLowPriority = 0,
1385 VpMediumPriority,
1386 VpHighPriority
1387 } VIDEO_SYNCHRONIZE_PRIORITY, *PVIDEO_SYNCHRONIZE_PRIORITY;
1388
1389 VPAPI
1390 BOOLEAN
1391 DDKAPI
1392 VideoPortSynchronizeExecution(
1393 IN PVOID HwDeviceExtension,
1394 IN VIDEO_SYNCHRONIZE_PRIORITY Priority,
1395 IN PMINIPORT_SYNCHRONIZE_ROUTINE SynchronizeRoutine,
1396 IN PVOID Context);
1397
1398 VPAPI
1399 VOID
1400 DDKAPI
1401 VideoPortUnLockBuffer(
1402 IN PVOID HwDeviceExtension,
1403 IN PVOID Mdl);
1404
1405 VPAPI
1406 BOOLEAN
1407 DDKAPI
1408 VideoPortUnlockPages(
1409 IN PVOID hwDeviceExtension,
1410 IN OUT PDMA pDma);
1411
1412 VPAPI
1413 BOOLEAN
1414 DDKAPI
1415 VideoPortUnmapDmaMemory(
1416 IN PVOID HwDeviceExtension,
1417 IN PVOID VirtualAddress,
1418 IN HANDLE ProcessHandle,
1419 IN PDMA BoardMemoryHandle);
1420
1421 VPAPI
1422 VP_STATUS
1423 DDKAPI
1424 VideoPortUnmapMemory(
1425 IN PVOID HwDeviceExtension,
1426 IN OUT PVOID VirtualAddress,
1427 IN HANDLE ProcessHandle);
1428
1429 VPAPI
1430 VP_STATUS
1431 DDKAPI
1432 VideoPortVerifyAccessRanges(
1433 IN PVOID HwDeviceExtension,
1434 IN ULONG NumAccessRanges,
1435 IN PVIDEO_ACCESS_RANGE AccessRanges);
1436
1437 VPAPI
1438 VP_STATUS
1439 DDKAPI
1440 VideoPortWaitForSingleObject(
1441 IN PVOID HwDeviceExtension,
1442 IN PVOID Object,
1443 IN PLARGE_INTEGER Timeout OPTIONAL);
1444
1445 VPAPI
1446 VOID
1447 DDKAPI
1448 VideoPortWritePortBufferUchar(
1449 IN PUCHAR Port,
1450 IN PUCHAR Buffer,
1451 IN ULONG Count);
1452
1453 VPAPI
1454 VOID
1455 DDKAPI
1456 VideoPortWritePortBufferUlong(
1457 IN PULONG Port,
1458 IN PULONG Buffer,
1459 IN ULONG Count);
1460
1461 VPAPI
1462 VOID
1463 DDKAPI
1464 VideoPortWritePortBufferUshort(
1465 IN PUSHORT Port,
1466 IN PUSHORT Buffer,
1467 IN ULONG Count);
1468
1469 VPAPI
1470 VOID
1471 DDKAPI
1472 VideoPortWritePortUchar(
1473 IN PUCHAR Port,
1474 IN UCHAR Value);
1475
1476 VPAPI
1477 VOID
1478 DDKAPI
1479 VideoPortWritePortUlong(
1480 IN PULONG Port,
1481 IN ULONG Value);
1482
1483 VPAPI
1484 VOID
1485 DDKAPI
1486 VideoPortWritePortUshort(
1487 IN PUSHORT Port,
1488 IN USHORT Value);
1489
1490 VPAPI
1491 VOID
1492 DDKAPI
1493 VideoPortWriteRegisterBufferUchar(
1494 IN PUCHAR Register,
1495 IN PUCHAR Buffer,
1496 IN ULONG Count);
1497
1498 VPAPI
1499 VOID
1500 DDKAPI
1501 VideoPortWriteRegisterBufferUlong(
1502 IN PULONG Register,
1503 IN PULONG Buffer,
1504 IN ULONG Count);
1505
1506 VPAPI
1507 VOID
1508 DDKAPI
1509 VideoPortWriteRegisterBufferUshort(
1510 IN PUSHORT Register,
1511 IN PUSHORT Buffer,
1512 IN ULONG Count);
1513
1514 VPAPI
1515 VOID
1516 DDKAPI
1517 VideoPortWriteRegisterUchar(
1518 IN PUCHAR Register,
1519 IN UCHAR Value);
1520
1521 VPAPI
1522 VOID
1523 DDKAPI
1524 VideoPortWriteRegisterUlong(
1525 IN PULONG Register,
1526 IN ULONG Value);
1527
1528 VPAPI
1529 VOID
1530 DDKAPI
1531 VideoPortWriteRegisterUshort(
1532 IN PUSHORT Register,
1533 IN USHORT Value);
1534
1535 VPAPI
1536 VOID
1537 DDKAPI
1538 VideoPortZeroDeviceMemory(
1539 IN PVOID Destination,
1540 IN ULONG Length);
1541
1542 VPAPI
1543 VOID
1544 DDKAPI
1545 VideoPortZeroMemory(
1546 IN PVOID Destination,
1547 IN ULONG Length);
1548
1549 #if DBG
1550 #define VideoDebugPrint(x) VideoPortDebugPrint x
1551 #else
1552 #define VideoDebugPrint(x)
1553 #endif
1554
1555 #ifdef __cplusplus
1556 }
1557 #endif
1558
1559 #endif /* defined _WINDDI_ */
1560
1561 #endif /* __VIDEO_H__ */