VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h@ 11527

Last change on this file since 11527 was 8433, checked in by vboxsync, 17 years ago

Save current video mode parameters to be able to know them when a new mode is being set (Windows guest).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.2 KB
Line 
1/** @file
2 * VirtualBox Video miniport driver
3 *
4 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 (GPL) as published by the Free Software
10 * Foundation, in version 2 as it comes in the "COPYING" file of the
11 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
12 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
13 *
14 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
15 * Clara, CA 95054 USA or visit http://www.sun.com if you need
16 * additional information or have any questions.
17 */
18
19#ifndef VBOXVIDEO_H
20#define VBOXVIDEO_H
21
22#include <VBox/cdefs.h>
23#include <VBox/types.h>
24#include <iprt/assert.h>
25
26__BEGIN_DECLS
27#include "dderror.h"
28#include "devioctl.h"
29#include "miniport.h"
30#include "ntddvdeo.h"
31#include "video.h"
32__END_DECLS
33
34
35#define VBE_DISPI_IOPORT_INDEX 0x01CE
36#define VBE_DISPI_IOPORT_DATA 0x01CF
37#define VBE_DISPI_INDEX_ID 0x0
38#define VBE_DISPI_INDEX_XRES 0x1
39#define VBE_DISPI_INDEX_YRES 0x2
40#define VBE_DISPI_INDEX_BPP 0x3
41#define VBE_DISPI_INDEX_ENABLE 0x4
42#define VBE_DISPI_INDEX_VIRT_WIDTH 0x6
43#define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7
44#define VBE_DISPI_INDEX_VBOX_VIDEO 0xa
45#define VBE_DISPI_ID2 0xB0C2
46/* The VBOX interface id. Indicates support for VBE_DISPI_INDEX_VBOX_VIDEO. */
47#define VBE_DISPI_ID_VBOX_VIDEO 0xBE00
48#define VBE_DISPI_DISABLED 0x00
49#define VBE_DISPI_ENABLED 0x01
50#define VBE_DISPI_LFB_ENABLED 0x40
51#define VBE_DISPI_LFB_PHYSICAL_ADDRESS 0xE0000000
52#define VBE_DISPI_TOTAL_VIDEO_MEMORY_MB 4
53#define VBE_DISPI_TOTAL_VIDEO_MEMORY_KB (VBE_DISPI_TOTAL_VIDEO_MEMORY_MB * 1024)
54#define VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES (VBE_DISPI_TOTAL_VIDEO_MEMORY_KB * 1024)
55
56typedef struct _DEVICE_EXTENSION
57{
58 struct _DEVICE_EXTENSION *pNext; /* Next extension in the DualView extension list.
59 * The primary extension is the first one.
60 */
61
62 struct _DEVICE_EXTENSION *pPrimary; /* Pointer to the primary device extension. */
63
64 ULONG iDevice; /* Device index: 0 for primary, otherwise a secondary device. */
65
66
67 ULONG CurrentMode; /* Saved information about video modes */
68 ULONG CurrentModeWidth;
69 ULONG CurrentModeHeight;
70 ULONG CurrentModeBPP;
71
72 ULONG ulFrameBufferOffset; /* The framebuffer position in the VRAM. */
73 ULONG ulFrameBufferSize; /* The size of the current framebuffer. */
74
75 union {
76 /* Information that is only relevant to the primary device or is the same for all devices. */
77 struct {
78
79 void *pvReqFlush; /* Pointer to preallocated generic request structure for
80 * VMMDevReq_VideoAccelFlush. Allocated when VBVA status
81 * is changed. Deallocated on HwReset.
82 */
83
84
85 ULONG ulVbvaEnabled; /* Indicates that VBVA mode is enabled. */
86
87 BOOLEAN bVBoxVideoSupported; /* TRUE if VBoxVideo extensions, including DualView, are supported by the host. */
88
89 int cDisplays; /* Number of displays. */
90
91 ULONG cbVRAM; /* The VRAM size. */
92
93 ULONG cbMiniportHeap; /* The size of reserved VRAM for miniport driver heap.
94 * It is at offset:
95 * cbAdapterMemorySize - VBOX_VIDEO_ADAPTER_INFORMATION_SIZE - cbMiniportHeap
96 */
97 PVOID pvMiniportHeap; /* The pointer to the miniport heap VRAM.
98 * This is mapped by miniport separately.
99 */
100
101 PVOID pvAdapterInformation; /* The pointer to the last 4K of VRAM.
102 * This is mapped by miniport separately.
103 */
104
105 ULONG ulMaxFrameBufferSize; /* The size of the VRAM allocated for the a single framebuffer. */
106
107 ULONG ulDisplayInformationSize; /* The size of the Display information, which is at offset:
108 * ulFrameBufferOffset + ulMaxFrameBufferSize.
109 */
110
111 } primary;
112
113 /* Secondary device information. */
114 struct {
115 BOOLEAN bEnabled; /* Device enabled flag */
116 } secondary;
117 } u;
118} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
119
120extern "C"
121{
122
123__BEGIN_DECLS
124ULONG DriverEntry(IN PVOID Context1, IN PVOID Context2);
125__END_DECLS
126
127VP_STATUS VBoxVideoFindAdapter(
128 IN PVOID HwDeviceExtension,
129 IN PVOID HwContext,
130 IN PWSTR ArgumentString,
131 IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo,
132 OUT PUCHAR Again);
133
134BOOLEAN VBoxVideoInitialize(PVOID HwDeviceExtension);
135
136BOOLEAN VBoxVideoStartIO(
137 PVOID HwDeviceExtension,
138 PVIDEO_REQUEST_PACKET RequestPacket);
139
140BOOLEAN VBoxVideoResetHW(
141 PVOID HwDeviceExtension,
142 ULONG Columns,
143 ULONG Rows);
144
145VP_STATUS VBoxVideoGetPowerState(
146 PVOID HwDeviceExtension,
147 ULONG HwId,
148 PVIDEO_POWER_MANAGEMENT VideoPowerControl);
149
150VP_STATUS VBoxVideoSetPowerState(
151 PVOID HwDeviceExtension,
152 ULONG HwId,
153 PVIDEO_POWER_MANAGEMENT VideoPowerControl);
154
155BOOLEAN FASTCALL VBoxVideoSetCurrentMode(
156 PDEVICE_EXTENSION DeviceExtension,
157 PVIDEO_MODE RequestedMode,
158 PSTATUS_BLOCK StatusBlock);
159
160BOOLEAN FASTCALL VBoxVideoResetDevice(
161 PDEVICE_EXTENSION DeviceExtension,
162 PSTATUS_BLOCK StatusBlock);
163
164BOOLEAN FASTCALL VBoxVideoMapVideoMemory(
165 PDEVICE_EXTENSION DeviceExtension,
166 PVIDEO_MEMORY RequestedAddress,
167 PVIDEO_MEMORY_INFORMATION MapInformation,
168 PSTATUS_BLOCK StatusBlock);
169
170BOOLEAN FASTCALL VBoxVideoUnmapVideoMemory(
171 PDEVICE_EXTENSION DeviceExtension,
172 PVIDEO_MEMORY VideoMemory,
173 PSTATUS_BLOCK StatusBlock);
174
175BOOLEAN FASTCALL VBoxVideoQueryNumAvailModes(
176 PDEVICE_EXTENSION DeviceExtension,
177 PVIDEO_NUM_MODES Modes,
178 PSTATUS_BLOCK StatusBlock);
179
180BOOLEAN FASTCALL VBoxVideoQueryAvailModes(
181 PDEVICE_EXTENSION DeviceExtension,
182 PVIDEO_MODE_INFORMATION ReturnedModes,
183 PSTATUS_BLOCK StatusBlock);
184
185BOOLEAN FASTCALL VBoxVideoQueryCurrentMode(
186 PDEVICE_EXTENSION DeviceExtension,
187 PVIDEO_MODE_INFORMATION VideoModeInfo,
188 PSTATUS_BLOCK StatusBlock);
189
190BOOLEAN FASTCALL VBoxVideoSetColorRegisters(
191 PDEVICE_EXTENSION DeviceExtension,
192 PVIDEO_CLUT ColorLookUpTable,
193 PSTATUS_BLOCK StatusBlock);
194
195VP_STATUS VBoxVideoGetChildDescriptor(
196 PVOID HwDeviceExtension,
197 PVIDEO_CHILD_ENUM_INFO ChildEnumInfo,
198 PVIDEO_CHILD_TYPE VideoChildType,
199 PUCHAR pChildDescriptor,
200 PULONG pUId,
201 PULONG pUnused);
202
203} /* extern "C" */
204
205#endif /* VBOXVIDEO_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette