1 | /** @file
|
---|
2 | * VirtualBox Video miniport driver
|
---|
3 | *
|
---|
4 | * Copyright (C) 2006 InnoTek Systemberatung GmbH
|
---|
5 | *
|
---|
6 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
7 | * available from http://www.virtualbox.org. This file is free software;
|
---|
8 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
9 | * General Public License as published by the Free Software Foundation,
|
---|
10 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
11 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
12 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
13 | *
|
---|
14 | * If you received this file as part of a commercial VirtualBox
|
---|
15 | * distribution, then only the terms of your commercial VirtualBox
|
---|
16 | * license agreement apply instead of the previous paragraph.
|
---|
17 | *
|
---|
18 | */
|
---|
19 |
|
---|
20 | #ifndef VBOXVIDEO_H
|
---|
21 | #define VBOXVIDEO_H
|
---|
22 |
|
---|
23 | #include <VBox/cdefs.h>
|
---|
24 | #include <VBox/types.h>
|
---|
25 | #include <iprt/assert.h>
|
---|
26 |
|
---|
27 | __BEGIN_DECLS
|
---|
28 | #include "dderror.h"
|
---|
29 | #include "devioctl.h"
|
---|
30 | #include "miniport.h"
|
---|
31 | #include "ntddvdeo.h"
|
---|
32 | #include "video.h"
|
---|
33 | __END_DECLS
|
---|
34 |
|
---|
35 |
|
---|
36 | #define VBE_DISPI_IOPORT_INDEX 0x01CE
|
---|
37 | #define VBE_DISPI_IOPORT_DATA 0x01CF
|
---|
38 | #define VBE_DISPI_INDEX_ID 0x0
|
---|
39 | #define VBE_DISPI_INDEX_XRES 0x1
|
---|
40 | #define VBE_DISPI_INDEX_YRES 0x2
|
---|
41 | #define VBE_DISPI_INDEX_BPP 0x3
|
---|
42 | #define VBE_DISPI_INDEX_ENABLE 0x4
|
---|
43 | #define VBE_DISPI_INDEX_VIRT_WIDTH 0x6
|
---|
44 | #define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7
|
---|
45 | #define VBE_DISPI_ID2 0xB0C2
|
---|
46 | #define VBE_DISPI_DISABLED 0x00
|
---|
47 | #define VBE_DISPI_ENABLED 0x01
|
---|
48 | #define VBE_DISPI_LFB_ENABLED 0x40
|
---|
49 | #define VBE_DISPI_LFB_PHYSICAL_ADDRESS 0xE0000000
|
---|
50 | #define VBE_DISPI_TOTAL_VIDEO_MEMORY_MB 4
|
---|
51 | #define VBE_DISPI_TOTAL_VIDEO_MEMORY_KB (VBE_DISPI_TOTAL_VIDEO_MEMORY_MB * 1024)
|
---|
52 | #define VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES (VBE_DISPI_TOTAL_VIDEO_MEMORY_KB * 1024)
|
---|
53 |
|
---|
54 | typedef struct
|
---|
55 | {
|
---|
56 | // Saved information about video modes
|
---|
57 | ULONG CurrentMode;
|
---|
58 |
|
---|
59 | /* Pointer to preallocated generic request structure for VMMDevReq_VideoAccelFlush.
|
---|
60 | * Allocated when VBVA status is changed. Deallocated on HwReset.
|
---|
61 | */
|
---|
62 | void *pvReqFlush;
|
---|
63 | } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
|
---|
64 |
|
---|
65 | extern "C"
|
---|
66 | {
|
---|
67 |
|
---|
68 | __BEGIN_DECLS
|
---|
69 | ULONG DriverEntry(IN PVOID Context1, IN PVOID Context2);
|
---|
70 | __END_DECLS
|
---|
71 |
|
---|
72 | VP_STATUS VBoxVideoFindAdapter(
|
---|
73 | IN PVOID HwDeviceExtension,
|
---|
74 | IN PVOID HwContext,
|
---|
75 | IN PWSTR ArgumentString,
|
---|
76 | IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo,
|
---|
77 | OUT PUCHAR Again);
|
---|
78 |
|
---|
79 | BOOLEAN VBoxVideoInitialize(PVOID HwDeviceExtension);
|
---|
80 |
|
---|
81 | BOOLEAN VBoxVideoStartIO(
|
---|
82 | PVOID HwDeviceExtension,
|
---|
83 | PVIDEO_REQUEST_PACKET RequestPacket);
|
---|
84 |
|
---|
85 | BOOLEAN VBoxVideoResetHW(
|
---|
86 | PVOID HwDeviceExtension,
|
---|
87 | ULONG Columns,
|
---|
88 | ULONG Rows);
|
---|
89 |
|
---|
90 | VP_STATUS VBoxVideoGetPowerState(
|
---|
91 | PVOID HwDeviceExtension,
|
---|
92 | ULONG HwId,
|
---|
93 | PVIDEO_POWER_MANAGEMENT VideoPowerControl);
|
---|
94 |
|
---|
95 | VP_STATUS VBoxVideoSetPowerState(
|
---|
96 | PVOID HwDeviceExtension,
|
---|
97 | ULONG HwId,
|
---|
98 | PVIDEO_POWER_MANAGEMENT VideoPowerControl);
|
---|
99 |
|
---|
100 | BOOLEAN FASTCALL VBoxVideoSetCurrentMode(
|
---|
101 | PDEVICE_EXTENSION DeviceExtension,
|
---|
102 | PVIDEO_MODE RequestedMode,
|
---|
103 | PSTATUS_BLOCK StatusBlock);
|
---|
104 |
|
---|
105 | BOOLEAN FASTCALL VBoxVideoResetDevice(
|
---|
106 | PDEVICE_EXTENSION DeviceExtension,
|
---|
107 | PSTATUS_BLOCK StatusBlock);
|
---|
108 |
|
---|
109 | BOOLEAN FASTCALL VBoxVideoMapVideoMemory(
|
---|
110 | PDEVICE_EXTENSION DeviceExtension,
|
---|
111 | PVIDEO_MEMORY RequestedAddress,
|
---|
112 | PVIDEO_MEMORY_INFORMATION MapInformation,
|
---|
113 | PSTATUS_BLOCK StatusBlock);
|
---|
114 |
|
---|
115 | BOOLEAN FASTCALL VBoxVideoUnmapVideoMemory(
|
---|
116 | PDEVICE_EXTENSION DeviceExtension,
|
---|
117 | PVIDEO_MEMORY VideoMemory,
|
---|
118 | PSTATUS_BLOCK StatusBlock);
|
---|
119 |
|
---|
120 | BOOLEAN FASTCALL VBoxVideoQueryNumAvailModes(
|
---|
121 | PDEVICE_EXTENSION DeviceExtension,
|
---|
122 | PVIDEO_NUM_MODES Modes,
|
---|
123 | PSTATUS_BLOCK StatusBlock);
|
---|
124 |
|
---|
125 | BOOLEAN FASTCALL VBoxVideoQueryAvailModes(
|
---|
126 | PDEVICE_EXTENSION DeviceExtension,
|
---|
127 | PVIDEO_MODE_INFORMATION ReturnedModes,
|
---|
128 | PSTATUS_BLOCK StatusBlock);
|
---|
129 |
|
---|
130 | BOOLEAN FASTCALL VBoxVideoQueryCurrentMode(
|
---|
131 | PDEVICE_EXTENSION DeviceExtension,
|
---|
132 | PVIDEO_MODE_INFORMATION VideoModeInfo,
|
---|
133 | PSTATUS_BLOCK StatusBlock);
|
---|
134 |
|
---|
135 | BOOLEAN FASTCALL VBoxVideoSetColorRegisters(
|
---|
136 | PDEVICE_EXTENSION DeviceExtension,
|
---|
137 | PVIDEO_CLUT ColorLookUpTable,
|
---|
138 | PSTATUS_BLOCK StatusBlock);
|
---|
139 |
|
---|
140 | VP_STATUS VBoxVideoGetChildDescriptor(
|
---|
141 | PVOID HwDeviceExtension,
|
---|
142 | PVIDEO_CHILD_ENUM_INFO ChildEnumInfo,
|
---|
143 | PVIDEO_CHILD_TYPE VideoChildType,
|
---|
144 | PUCHAR pChildDescriptor,
|
---|
145 | PULONG pUId,
|
---|
146 | PULONG pUnused);
|
---|
147 |
|
---|
148 | } /* extern "C" */
|
---|
149 |
|
---|
150 | #endif /* VBOXVIDEO_H */
|
---|