1 | /* $Id: VBoxMPVidPn.h 52631 2014-09-05 21:11:11Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VBox WDDM Miniport driver
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2011 Oracle Corporation
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef ___VBoxMPVidPn_h___
|
---|
20 | #define ___VBoxMPVidPn_h___
|
---|
21 |
|
---|
22 | #define VBOXVDPN_C_DISPLAY_HBLANK_SIZE 200
|
---|
23 | #define VBOXVDPN_C_DISPLAY_VBLANK_SIZE 180
|
---|
24 |
|
---|
25 | void VBoxVidPnAllocDataInit(struct VBOXWDDM_ALLOC_DATA *pData, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId);
|
---|
26 |
|
---|
27 | void VBoxVidPnSourceInit(PVBOXWDDM_SOURCE pSource, const D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, uint8_t u8SyncState);
|
---|
28 | void VBoxVidPnTargetInit(PVBOXWDDM_TARGET pTarget, const D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId, uint8_t u8SyncState);
|
---|
29 | void VBoxVidPnSourceCopy(VBOXWDDM_SOURCE *pDst, const VBOXWDDM_SOURCE *pSrc);
|
---|
30 | void VBoxVidPnTargetCopy(VBOXWDDM_TARGET *pDst, const VBOXWDDM_TARGET *pSrc);
|
---|
31 |
|
---|
32 | void VBoxVidPnSourcesInit(PVBOXWDDM_SOURCE pSources, uint32_t cScreens, uint8_t u8SyncState);
|
---|
33 | void VBoxVidPnTargetsInit(PVBOXWDDM_TARGET pTargets, uint32_t cScreens, uint8_t u8SyncState);
|
---|
34 | void VBoxVidPnSourcesCopy(VBOXWDDM_SOURCE *pDst, const VBOXWDDM_SOURCE *pSrc, uint32_t cScreens);
|
---|
35 | void VBoxVidPnTargetsCopy(VBOXWDDM_TARGET *pDst, const VBOXWDDM_TARGET *pSrc, uint32_t cScreens);
|
---|
36 |
|
---|
37 | typedef struct VBOXWDDM_TARGET_ITER
|
---|
38 | {
|
---|
39 | PVBOXWDDM_SOURCE pSource;
|
---|
40 | PVBOXWDDM_TARGET paTargets;
|
---|
41 | uint32_t cTargets;
|
---|
42 | uint32_t i;
|
---|
43 | uint32_t c;
|
---|
44 | } VBOXWDDM_TARGET_ITER;
|
---|
45 |
|
---|
46 | void VBoxVidPnStCleanup(PVBOXWDDM_SOURCE paSources, PVBOXWDDM_TARGET paTargets, uint32_t cScreens);
|
---|
47 | void VBoxVidPnStTIterInit(PVBOXWDDM_SOURCE pSource, PVBOXWDDM_TARGET paTargets, uint32_t cTargets, VBOXWDDM_TARGET_ITER *pIter);
|
---|
48 | PVBOXWDDM_TARGET VBoxVidPnStTIterNext(VBOXWDDM_TARGET_ITER *pIter);
|
---|
49 |
|
---|
50 | /* !!!NOTE: The callback is responsible for releasing the path */
|
---|
51 | typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMPATHS(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
|
---|
52 | const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo, PVOID pContext);
|
---|
53 | typedef FNVBOXVIDPNENUMPATHS *PFNVBOXVIDPNENUMPATHS;
|
---|
54 |
|
---|
55 | /* !!!NOTE: The callback is responsible for releasing the source mode info */
|
---|
56 | typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMSOURCEMODES(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface,
|
---|
57 | const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, PVOID pContext);
|
---|
58 | typedef FNVBOXVIDPNENUMSOURCEMODES *PFNVBOXVIDPNENUMSOURCEMODES;
|
---|
59 |
|
---|
60 | /* !!!NOTE: The callback is responsible for releasing the target mode info */
|
---|
61 | typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMTARGETMODES(D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface,
|
---|
62 | const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, PVOID pContext);
|
---|
63 | typedef FNVBOXVIDPNENUMTARGETMODES *PFNVBOXVIDPNENUMTARGETMODES;
|
---|
64 |
|
---|
65 | /* !!!NOTE: The callback is responsible for releasing the source mode info */
|
---|
66 | typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMMONITORSOURCEMODES(D3DKMDT_HMONITORSOURCEMODESET hMonitorSMS, CONST DXGK_MONITORSOURCEMODESET_INTERFACE *pMonitorSMSIf,
|
---|
67 | CONST D3DKMDT_MONITOR_SOURCE_MODE *pMonitorSMI, PVOID pContext);
|
---|
68 | typedef FNVBOXVIDPNENUMMONITORSOURCEMODES *PFNVBOXVIDPNENUMMONITORSOURCEMODES;
|
---|
69 |
|
---|
70 | typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMTARGETSFORSOURCE(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
|
---|
71 | CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId, SIZE_T cTgtPaths, PVOID pContext);
|
---|
72 | typedef FNVBOXVIDPNENUMTARGETSFORSOURCE *PFNVBOXVIDPNENUMTARGETSFORSOURCE;
|
---|
73 |
|
---|
74 | NTSTATUS VBoxVidPnCommitSourceModeForSrcId(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
|
---|
75 | PVBOXWDDM_ALLOCATION pAllocation,
|
---|
76 | D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, VBOXWDDM_SOURCE *paSources, VBOXWDDM_TARGET *paTargets);
|
---|
77 |
|
---|
78 | NTSTATUS VBoxVidPnCommitAll(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
|
---|
79 | PVBOXWDDM_ALLOCATION pAllocation,
|
---|
80 | VBOXWDDM_SOURCE *paSources, VBOXWDDM_TARGET *paTargets);
|
---|
81 |
|
---|
82 | NTSTATUS vboxVidPnEnumPaths(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
|
---|
83 | PFNVBOXVIDPNENUMPATHS pfnCallback, PVOID pContext);
|
---|
84 |
|
---|
85 | NTSTATUS vboxVidPnEnumSourceModes(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface,
|
---|
86 | PFNVBOXVIDPNENUMSOURCEMODES pfnCallback, PVOID pContext);
|
---|
87 |
|
---|
88 | NTSTATUS vboxVidPnEnumTargetModes(D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface,
|
---|
89 | PFNVBOXVIDPNENUMTARGETMODES pfnCallback, PVOID pContext);
|
---|
90 |
|
---|
91 | NTSTATUS vboxVidPnEnumMonitorSourceModes(D3DKMDT_HMONITORSOURCEMODESET hMonitorSMS, CONST DXGK_MONITORSOURCEMODESET_INTERFACE *pMonitorSMSIf,
|
---|
92 | PFNVBOXVIDPNENUMMONITORSOURCEMODES pfnCallback, PVOID pContext);
|
---|
93 |
|
---|
94 | NTSTATUS vboxVidPnEnumTargetsForSource(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
|
---|
95 | CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId,
|
---|
96 | PFNVBOXVIDPNENUMTARGETSFORSOURCE pfnCallback, PVOID pContext);
|
---|
97 |
|
---|
98 | void VBoxVidPnDumpTargetMode(const char *pPrefix, const D3DKMDT_VIDPN_TARGET_MODE* CONST pVidPnTargetModeInfo, const char *pSuffix);
|
---|
99 | void VBoxVidPnDumpMonitorMode(const char *pPrefix, const D3DKMDT_MONITOR_SOURCE_MODE *pVidPnModeInfo, const char *pSuffix);
|
---|
100 | NTSTATUS VBoxVidPnDumpMonitorModeSet(const char *pPrefix, PVBOXMP_DEVEXT pDevExt, uint32_t u32Target, const char *pSuffix);
|
---|
101 | void VBoxVidPnDumpSourceMode(const char *pPrefix, const D3DKMDT_VIDPN_SOURCE_MODE* pVidPnSourceModeInfo, const char *pSuffix);
|
---|
102 | void VBoxVidPnDumpCofuncModalityInfo(const char *pPrefix, D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE enmEnumPivotType, const DXGK_ENUM_PIVOT *pPivot, const char *pSuffix);
|
---|
103 |
|
---|
104 | void vboxVidPnDumpVidPn(const char * pPrefix, PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, const char * pSuffix);
|
---|
105 | void vboxVidPnDumpCofuncModalityArg(const char *pPrefix, CONST DXGKARG_ENUMVIDPNCOFUNCMODALITY* CONST pEnumCofuncModalityArg, const char *pSuffix);
|
---|
106 | DECLCALLBACK(BOOLEAN) vboxVidPnDumpSourceModeSetEnum(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface,
|
---|
107 | const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, PVOID pContext);
|
---|
108 | DECLCALLBACK(BOOLEAN) vboxVidPnDumpTargetModeSetEnum(D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface,
|
---|
109 | const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, PVOID pContext);
|
---|
110 |
|
---|
111 |
|
---|
112 | typedef struct VBOXVIDPN_SOURCEMODE_ITER
|
---|
113 | {
|
---|
114 | D3DKMDT_HVIDPNSOURCEMODESET hVidPnModeSet;
|
---|
115 | const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnModeSetInterface;
|
---|
116 | const D3DKMDT_VIDPN_SOURCE_MODE *pCurVidPnModeInfo;
|
---|
117 | NTSTATUS Status;
|
---|
118 | } VBOXVIDPN_SOURCEMODE_ITER;
|
---|
119 |
|
---|
120 | DECLINLINE(void) VBoxVidPnSourceModeIterInit(VBOXVIDPN_SOURCEMODE_ITER *pIter, D3DKMDT_HVIDPNSOURCEMODESET hVidPnModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnModeSetInterface)
|
---|
121 | {
|
---|
122 | pIter->hVidPnModeSet = hVidPnModeSet;
|
---|
123 | pIter->pVidPnModeSetInterface = pVidPnModeSetInterface;
|
---|
124 | pIter->pCurVidPnModeInfo = NULL;
|
---|
125 | pIter->Status = STATUS_SUCCESS;
|
---|
126 | }
|
---|
127 |
|
---|
128 | DECLINLINE(void) VBoxVidPnSourceModeIterTerm(VBOXVIDPN_SOURCEMODE_ITER *pIter)
|
---|
129 | {
|
---|
130 | if (pIter->pCurVidPnModeInfo)
|
---|
131 | {
|
---|
132 | pIter->pVidPnModeSetInterface->pfnReleaseModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo);
|
---|
133 | pIter->pCurVidPnModeInfo = NULL;
|
---|
134 | }
|
---|
135 | }
|
---|
136 |
|
---|
137 | DECLINLINE(const D3DKMDT_VIDPN_SOURCE_MODE *) VBoxVidPnSourceModeIterNext(VBOXVIDPN_SOURCEMODE_ITER *pIter)
|
---|
138 | {
|
---|
139 | NTSTATUS Status;
|
---|
140 | const D3DKMDT_VIDPN_SOURCE_MODE *pCurVidPnModeInfo;
|
---|
141 |
|
---|
142 | if (!pIter->pCurVidPnModeInfo)
|
---|
143 | Status = pIter->pVidPnModeSetInterface->pfnAcquireFirstModeInfo(pIter->hVidPnModeSet, &pCurVidPnModeInfo);
|
---|
144 | else
|
---|
145 | Status = pIter->pVidPnModeSetInterface->pfnAcquireNextModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo, &pCurVidPnModeInfo);
|
---|
146 |
|
---|
147 | if (Status == STATUS_SUCCESS)
|
---|
148 | {
|
---|
149 | Assert(pCurVidPnModeInfo);
|
---|
150 |
|
---|
151 | if (pIter->pCurVidPnModeInfo)
|
---|
152 | pIter->pVidPnModeSetInterface->pfnReleaseModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo);
|
---|
153 |
|
---|
154 | pIter->pCurVidPnModeInfo = pCurVidPnModeInfo;
|
---|
155 | return pCurVidPnModeInfo;
|
---|
156 | }
|
---|
157 |
|
---|
158 | if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET
|
---|
159 | || Status == STATUS_GRAPHICS_DATASET_IS_EMPTY)
|
---|
160 | return NULL;
|
---|
161 |
|
---|
162 | WARN(("getting Source info failed %#x", Status));
|
---|
163 |
|
---|
164 | pIter->Status = Status;
|
---|
165 | return NULL;
|
---|
166 | }
|
---|
167 |
|
---|
168 | DECLINLINE(NTSTATUS) VBoxVidPnSourceModeIterStatus(VBOXVIDPN_SOURCEMODE_ITER *pIter)
|
---|
169 | {
|
---|
170 | return pIter->Status;
|
---|
171 | }
|
---|
172 |
|
---|
173 | typedef struct VBOXVIDPN_TARGETMODE_ITER
|
---|
174 | {
|
---|
175 | D3DKMDT_HVIDPNTARGETMODESET hVidPnModeSet;
|
---|
176 | const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnModeSetInterface;
|
---|
177 | const D3DKMDT_VIDPN_TARGET_MODE *pCurVidPnModeInfo;
|
---|
178 | NTSTATUS Status;
|
---|
179 | } VBOXVIDPN_TARGETMODE_ITER;
|
---|
180 |
|
---|
181 | DECLINLINE(void) VBoxVidPnTargetModeIterInit(VBOXVIDPN_TARGETMODE_ITER *pIter,D3DKMDT_HVIDPNTARGETMODESET hVidPnModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnModeSetInterface)
|
---|
182 | {
|
---|
183 | pIter->hVidPnModeSet = hVidPnModeSet;
|
---|
184 | pIter->pVidPnModeSetInterface = pVidPnModeSetInterface;
|
---|
185 | pIter->pCurVidPnModeInfo = NULL;
|
---|
186 | pIter->Status = STATUS_SUCCESS;
|
---|
187 | }
|
---|
188 |
|
---|
189 | DECLINLINE(void) VBoxVidPnTargetModeIterTerm(VBOXVIDPN_TARGETMODE_ITER *pIter)
|
---|
190 | {
|
---|
191 | if (pIter->pCurVidPnModeInfo)
|
---|
192 | {
|
---|
193 | pIter->pVidPnModeSetInterface->pfnReleaseModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo);
|
---|
194 | pIter->pCurVidPnModeInfo = NULL;
|
---|
195 | }
|
---|
196 | }
|
---|
197 |
|
---|
198 | DECLINLINE(const D3DKMDT_VIDPN_TARGET_MODE *) VBoxVidPnTargetModeIterNext(VBOXVIDPN_TARGETMODE_ITER *pIter)
|
---|
199 | {
|
---|
200 | NTSTATUS Status;
|
---|
201 | const D3DKMDT_VIDPN_TARGET_MODE *pCurVidPnModeInfo;
|
---|
202 |
|
---|
203 | if (!pIter->pCurVidPnModeInfo)
|
---|
204 | Status = pIter->pVidPnModeSetInterface->pfnAcquireFirstModeInfo(pIter->hVidPnModeSet, &pCurVidPnModeInfo);
|
---|
205 | else
|
---|
206 | Status = pIter->pVidPnModeSetInterface->pfnAcquireNextModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo, &pCurVidPnModeInfo);
|
---|
207 |
|
---|
208 | if (Status == STATUS_SUCCESS)
|
---|
209 | {
|
---|
210 | Assert(pCurVidPnModeInfo);
|
---|
211 |
|
---|
212 | if (pIter->pCurVidPnModeInfo)
|
---|
213 | pIter->pVidPnModeSetInterface->pfnReleaseModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo);
|
---|
214 |
|
---|
215 | pIter->pCurVidPnModeInfo = pCurVidPnModeInfo;
|
---|
216 | return pCurVidPnModeInfo;
|
---|
217 | }
|
---|
218 |
|
---|
219 | if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET
|
---|
220 | || Status == STATUS_GRAPHICS_DATASET_IS_EMPTY)
|
---|
221 | return NULL;
|
---|
222 |
|
---|
223 | WARN(("getting Target info failed %#x", Status));
|
---|
224 |
|
---|
225 | pIter->Status = Status;
|
---|
226 | return NULL;
|
---|
227 | }
|
---|
228 |
|
---|
229 | DECLINLINE(NTSTATUS) VBoxVidPnTargetModeIterStatus(VBOXVIDPN_TARGETMODE_ITER *pIter)
|
---|
230 | {
|
---|
231 | return pIter->Status;
|
---|
232 | }
|
---|
233 |
|
---|
234 |
|
---|
235 | typedef struct VBOXVIDPN_MONITORMODE_ITER
|
---|
236 | {
|
---|
237 | D3DKMDT_HMONITORSOURCEMODESET hVidPnModeSet;
|
---|
238 | const DXGK_MONITORSOURCEMODESET_INTERFACE *pVidPnModeSetInterface;
|
---|
239 | const D3DKMDT_MONITOR_SOURCE_MODE *pCurVidPnModeInfo;
|
---|
240 | NTSTATUS Status;
|
---|
241 | } VBOXVIDPN_MONITORMODE_ITER;
|
---|
242 |
|
---|
243 |
|
---|
244 | DECLINLINE(void) VBoxVidPnMonitorModeIterInit(VBOXVIDPN_MONITORMODE_ITER *pIter, D3DKMDT_HMONITORSOURCEMODESET hVidPnModeSet, const DXGK_MONITORSOURCEMODESET_INTERFACE *pVidPnModeSetInterface)
|
---|
245 | {
|
---|
246 | pIter->hVidPnModeSet = hVidPnModeSet;
|
---|
247 | pIter->pVidPnModeSetInterface = pVidPnModeSetInterface;
|
---|
248 | pIter->pCurVidPnModeInfo = NULL;
|
---|
249 | pIter->Status = STATUS_SUCCESS;
|
---|
250 | }
|
---|
251 |
|
---|
252 | DECLINLINE(void) VBoxVidPnMonitorModeIterTerm(VBOXVIDPN_MONITORMODE_ITER *pIter)
|
---|
253 | {
|
---|
254 | if (pIter->pCurVidPnModeInfo)
|
---|
255 | {
|
---|
256 | pIter->pVidPnModeSetInterface->pfnReleaseModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo);
|
---|
257 | pIter->pCurVidPnModeInfo = NULL;
|
---|
258 | }
|
---|
259 | }
|
---|
260 |
|
---|
261 | DECLINLINE(const D3DKMDT_MONITOR_SOURCE_MODE *) VBoxVidPnMonitorModeIterNext(VBOXVIDPN_MONITORMODE_ITER *pIter)
|
---|
262 | {
|
---|
263 | NTSTATUS Status;
|
---|
264 | const D3DKMDT_MONITOR_SOURCE_MODE *pCurVidPnModeInfo;
|
---|
265 |
|
---|
266 | if (!pIter->pCurVidPnModeInfo)
|
---|
267 | Status = pIter->pVidPnModeSetInterface->pfnAcquireFirstModeInfo(pIter->hVidPnModeSet, &pCurVidPnModeInfo);
|
---|
268 | else
|
---|
269 | Status = pIter->pVidPnModeSetInterface->pfnAcquireNextModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo, &pCurVidPnModeInfo);
|
---|
270 |
|
---|
271 | if (Status == STATUS_SUCCESS)
|
---|
272 | {
|
---|
273 | Assert(pCurVidPnModeInfo);
|
---|
274 |
|
---|
275 | if (pIter->pCurVidPnModeInfo)
|
---|
276 | pIter->pVidPnModeSetInterface->pfnReleaseModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo);
|
---|
277 |
|
---|
278 | pIter->pCurVidPnModeInfo = pCurVidPnModeInfo;
|
---|
279 | return pCurVidPnModeInfo;
|
---|
280 | }
|
---|
281 |
|
---|
282 | if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET
|
---|
283 | || Status == STATUS_GRAPHICS_DATASET_IS_EMPTY)
|
---|
284 | return NULL;
|
---|
285 |
|
---|
286 | WARN(("getting Monitor info failed %#x", Status));
|
---|
287 |
|
---|
288 | pIter->Status = Status;
|
---|
289 | return NULL;
|
---|
290 | }
|
---|
291 |
|
---|
292 | DECLINLINE(NTSTATUS) VBoxVidPnMonitorModeIterStatus(VBOXVIDPN_MONITORMODE_ITER *pIter)
|
---|
293 | {
|
---|
294 | return pIter->Status;
|
---|
295 | }
|
---|
296 |
|
---|
297 |
|
---|
298 |
|
---|
299 | typedef struct VBOXVIDPN_PATH_ITER
|
---|
300 | {
|
---|
301 | D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology;
|
---|
302 | const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface;
|
---|
303 | const D3DKMDT_VIDPN_PRESENT_PATH *pCurVidPnPathInfo;
|
---|
304 | NTSTATUS Status;
|
---|
305 | } VBOXVIDPN_PATH_ITER;
|
---|
306 |
|
---|
307 |
|
---|
308 | DECLINLINE(void) VBoxVidPnPathIterInit(VBOXVIDPN_PATH_ITER *pIter, D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface)
|
---|
309 | {
|
---|
310 | pIter->hVidPnTopology = hVidPnTopology;
|
---|
311 | pIter->pVidPnTopologyInterface = pVidPnTopologyInterface;
|
---|
312 | pIter->pCurVidPnPathInfo = NULL;
|
---|
313 | pIter->Status = STATUS_SUCCESS;
|
---|
314 | }
|
---|
315 |
|
---|
316 | DECLINLINE(void) VBoxVidPnPathIterTerm(VBOXVIDPN_PATH_ITER *pIter)
|
---|
317 | {
|
---|
318 | if (pIter->pCurVidPnPathInfo)
|
---|
319 | {
|
---|
320 | pIter->pVidPnTopologyInterface->pfnReleasePathInfo(pIter->hVidPnTopology, pIter->pCurVidPnPathInfo);
|
---|
321 | pIter->pCurVidPnPathInfo = NULL;
|
---|
322 | }
|
---|
323 | }
|
---|
324 |
|
---|
325 | DECLINLINE(const D3DKMDT_VIDPN_PRESENT_PATH *) VBoxVidPnPathIterNext(VBOXVIDPN_PATH_ITER *pIter)
|
---|
326 | {
|
---|
327 | NTSTATUS Status;
|
---|
328 | const D3DKMDT_VIDPN_PRESENT_PATH *pCurVidPnPathInfo;
|
---|
329 |
|
---|
330 | if (!pIter->pCurVidPnPathInfo)
|
---|
331 | Status = pIter->pVidPnTopologyInterface->pfnAcquireFirstPathInfo(pIter->hVidPnTopology, &pCurVidPnPathInfo);
|
---|
332 | else
|
---|
333 | Status = pIter->pVidPnTopologyInterface->pfnAcquireNextPathInfo(pIter->hVidPnTopology, pIter->pCurVidPnPathInfo, &pCurVidPnPathInfo);
|
---|
334 |
|
---|
335 | if (Status == STATUS_SUCCESS)
|
---|
336 | {
|
---|
337 | Assert(pCurVidPnPathInfo);
|
---|
338 |
|
---|
339 | if (pIter->pCurVidPnPathInfo)
|
---|
340 | pIter->pVidPnTopologyInterface->pfnReleasePathInfo(pIter->hVidPnTopology, pIter->pCurVidPnPathInfo);
|
---|
341 |
|
---|
342 | pIter->pCurVidPnPathInfo = pCurVidPnPathInfo;
|
---|
343 | return pCurVidPnPathInfo;
|
---|
344 | }
|
---|
345 |
|
---|
346 | if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET
|
---|
347 | || Status == STATUS_GRAPHICS_DATASET_IS_EMPTY)
|
---|
348 | return NULL;
|
---|
349 |
|
---|
350 | WARN(("getting Path info failed %#x", Status));
|
---|
351 |
|
---|
352 | pIter->Status = Status;
|
---|
353 | return NULL;
|
---|
354 | }
|
---|
355 |
|
---|
356 | DECLINLINE(NTSTATUS) VBoxVidPnPathIterStatus(VBOXVIDPN_PATH_ITER *pIter)
|
---|
357 | {
|
---|
358 | return pIter->Status;
|
---|
359 | }
|
---|
360 |
|
---|
361 | NTSTATUS VBoxVidPnRecommendMonitorModes(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_TARGET_ID VideoPresentTargetId,
|
---|
362 | D3DKMDT_HMONITORSOURCEMODESET hVidPnModeSet, const DXGK_MONITORSOURCEMODESET_INTERFACE *pVidPnModeSetInterface);
|
---|
363 |
|
---|
364 | NTSTATUS VBoxVidPnRecommendFunctional(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, const VBOXWDDM_RECOMMENDVIDPN *pData);
|
---|
365 |
|
---|
366 | NTSTATUS VBoxVidPnCofuncModality(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE enmPivot, const DXGK_ENUM_PIVOT *pPivot);
|
---|
367 |
|
---|
368 | NTSTATUS VBoxVidPnIsSupported(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, BOOLEAN *pfSupported);
|
---|
369 |
|
---|
370 | NTSTATUS VBoxVidPnUpdateModes(PVBOXMP_DEVEXT pDevExt, uint32_t u32TargetId, const RTRECTSIZE *pSize);
|
---|
371 |
|
---|
372 | #endif /* #ifndef ___VBoxMPVidPn_h___ */
|
---|