1 | /* $Id: VBoxMPVidPn.h 63943 2016-09-22 11:41:09Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VBox WDDM Miniport driver
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2011-2016 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 | void VBoxDumpSourceTargetArrays(VBOXWDDM_SOURCE *paSources, VBOXWDDM_TARGET *paTargets, uint32_t cScreens);
|
---|
51 |
|
---|
52 | /* !!!NOTE: The callback is responsible for releasing the path */
|
---|
53 | typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMPATHS(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
|
---|
54 | const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo, PVOID pContext);
|
---|
55 | typedef FNVBOXVIDPNENUMPATHS *PFNVBOXVIDPNENUMPATHS;
|
---|
56 |
|
---|
57 | /* !!!NOTE: The callback is responsible for releasing the source mode info */
|
---|
58 | typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMSOURCEMODES(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface,
|
---|
59 | const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, PVOID pContext);
|
---|
60 | typedef FNVBOXVIDPNENUMSOURCEMODES *PFNVBOXVIDPNENUMSOURCEMODES;
|
---|
61 |
|
---|
62 | /* !!!NOTE: The callback is responsible for releasing the target mode info */
|
---|
63 | typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMTARGETMODES(D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface,
|
---|
64 | const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, PVOID pContext);
|
---|
65 | typedef FNVBOXVIDPNENUMTARGETMODES *PFNVBOXVIDPNENUMTARGETMODES;
|
---|
66 |
|
---|
67 | /* !!!NOTE: The callback is responsible for releasing the source mode info */
|
---|
68 | typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMMONITORSOURCEMODES(D3DKMDT_HMONITORSOURCEMODESET hMonitorSMS, CONST DXGK_MONITORSOURCEMODESET_INTERFACE *pMonitorSMSIf,
|
---|
69 | CONST D3DKMDT_MONITOR_SOURCE_MODE *pMonitorSMI, PVOID pContext);
|
---|
70 | typedef FNVBOXVIDPNENUMMONITORSOURCEMODES *PFNVBOXVIDPNENUMMONITORSOURCEMODES;
|
---|
71 |
|
---|
72 | typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMTARGETSFORSOURCE(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
|
---|
73 | CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId, SIZE_T cTgtPaths, PVOID pContext);
|
---|
74 | typedef FNVBOXVIDPNENUMTARGETSFORSOURCE *PFNVBOXVIDPNENUMTARGETSFORSOURCE;
|
---|
75 |
|
---|
76 | NTSTATUS VBoxVidPnCommitSourceModeForSrcId(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
|
---|
77 | PVBOXWDDM_ALLOCATION pAllocation,
|
---|
78 | D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, VBOXWDDM_SOURCE *paSources, VBOXWDDM_TARGET *paTargets, BOOLEAN bPathPowerTransition);
|
---|
79 |
|
---|
80 | NTSTATUS VBoxVidPnCommitAll(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
|
---|
81 | PVBOXWDDM_ALLOCATION pAllocation,
|
---|
82 | VBOXWDDM_SOURCE *paSources, VBOXWDDM_TARGET *paTargets);
|
---|
83 |
|
---|
84 | NTSTATUS vboxVidPnEnumPaths(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
|
---|
85 | PFNVBOXVIDPNENUMPATHS pfnCallback, PVOID pContext);
|
---|
86 |
|
---|
87 | NTSTATUS vboxVidPnEnumSourceModes(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface,
|
---|
88 | PFNVBOXVIDPNENUMSOURCEMODES pfnCallback, PVOID pContext);
|
---|
89 |
|
---|
90 | NTSTATUS vboxVidPnEnumTargetModes(D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface,
|
---|
91 | PFNVBOXVIDPNENUMTARGETMODES pfnCallback, PVOID pContext);
|
---|
92 |
|
---|
93 | NTSTATUS vboxVidPnEnumMonitorSourceModes(D3DKMDT_HMONITORSOURCEMODESET hMonitorSMS, CONST DXGK_MONITORSOURCEMODESET_INTERFACE *pMonitorSMSIf,
|
---|
94 | PFNVBOXVIDPNENUMMONITORSOURCEMODES pfnCallback, PVOID pContext);
|
---|
95 |
|
---|
96 | NTSTATUS vboxVidPnEnumTargetsForSource(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
|
---|
97 | CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId,
|
---|
98 | PFNVBOXVIDPNENUMTARGETSFORSOURCE pfnCallback, PVOID pContext);
|
---|
99 |
|
---|
100 | void VBoxVidPnDumpTargetMode(const char *pPrefix, const D3DKMDT_VIDPN_TARGET_MODE* CONST pVidPnTargetModeInfo, const char *pSuffix);
|
---|
101 | void VBoxVidPnDumpMonitorMode(const char *pPrefix, const D3DKMDT_MONITOR_SOURCE_MODE *pVidPnModeInfo, const char *pSuffix);
|
---|
102 | NTSTATUS VBoxVidPnDumpMonitorModeSet(const char *pPrefix, PVBOXMP_DEVEXT pDevExt, uint32_t u32Target, const char *pSuffix);
|
---|
103 | void VBoxVidPnDumpSourceMode(const char *pPrefix, const D3DKMDT_VIDPN_SOURCE_MODE* pVidPnSourceModeInfo, const char *pSuffix);
|
---|
104 | void VBoxVidPnDumpCofuncModalityInfo(const char *pPrefix, D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE enmEnumPivotType, const DXGK_ENUM_PIVOT *pPivot, const char *pSuffix);
|
---|
105 |
|
---|
106 | void vboxVidPnDumpVidPn(const char * pPrefix, PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, const char * pSuffix);
|
---|
107 | void vboxVidPnDumpCofuncModalityArg(const char *pPrefix, D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE enmPivot, const DXGK_ENUM_PIVOT *pPivot, const char *pSuffix);
|
---|
108 | DECLCALLBACK(BOOLEAN) vboxVidPnDumpSourceModeSetEnum(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface,
|
---|
109 | const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, PVOID pContext);
|
---|
110 | DECLCALLBACK(BOOLEAN) vboxVidPnDumpTargetModeSetEnum(D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface,
|
---|
111 | const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, PVOID pContext);
|
---|
112 |
|
---|
113 |
|
---|
114 | typedef struct VBOXVIDPN_SOURCEMODE_ITER
|
---|
115 | {
|
---|
116 | D3DKMDT_HVIDPNSOURCEMODESET hVidPnModeSet;
|
---|
117 | const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnModeSetInterface;
|
---|
118 | const D3DKMDT_VIDPN_SOURCE_MODE *pCurVidPnModeInfo;
|
---|
119 | NTSTATUS Status;
|
---|
120 | } VBOXVIDPN_SOURCEMODE_ITER;
|
---|
121 |
|
---|
122 | DECLINLINE(void) VBoxVidPnSourceModeIterInit(VBOXVIDPN_SOURCEMODE_ITER *pIter, D3DKMDT_HVIDPNSOURCEMODESET hVidPnModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnModeSetInterface)
|
---|
123 | {
|
---|
124 | pIter->hVidPnModeSet = hVidPnModeSet;
|
---|
125 | pIter->pVidPnModeSetInterface = pVidPnModeSetInterface;
|
---|
126 | pIter->pCurVidPnModeInfo = NULL;
|
---|
127 | pIter->Status = STATUS_SUCCESS;
|
---|
128 | }
|
---|
129 |
|
---|
130 | DECLINLINE(void) VBoxVidPnSourceModeIterTerm(VBOXVIDPN_SOURCEMODE_ITER *pIter)
|
---|
131 | {
|
---|
132 | if (pIter->pCurVidPnModeInfo)
|
---|
133 | {
|
---|
134 | pIter->pVidPnModeSetInterface->pfnReleaseModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo);
|
---|
135 | pIter->pCurVidPnModeInfo = NULL;
|
---|
136 | }
|
---|
137 | }
|
---|
138 |
|
---|
139 | DECLINLINE(const D3DKMDT_VIDPN_SOURCE_MODE *) VBoxVidPnSourceModeIterNext(VBOXVIDPN_SOURCEMODE_ITER *pIter)
|
---|
140 | {
|
---|
141 | NTSTATUS Status;
|
---|
142 | const D3DKMDT_VIDPN_SOURCE_MODE *pCurVidPnModeInfo;
|
---|
143 |
|
---|
144 | if (!pIter->pCurVidPnModeInfo)
|
---|
145 | Status = pIter->pVidPnModeSetInterface->pfnAcquireFirstModeInfo(pIter->hVidPnModeSet, &pCurVidPnModeInfo);
|
---|
146 | else
|
---|
147 | Status = pIter->pVidPnModeSetInterface->pfnAcquireNextModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo, &pCurVidPnModeInfo);
|
---|
148 |
|
---|
149 | if (Status == STATUS_SUCCESS)
|
---|
150 | {
|
---|
151 | Assert(pCurVidPnModeInfo);
|
---|
152 |
|
---|
153 | if (pIter->pCurVidPnModeInfo)
|
---|
154 | pIter->pVidPnModeSetInterface->pfnReleaseModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo);
|
---|
155 |
|
---|
156 | pIter->pCurVidPnModeInfo = pCurVidPnModeInfo;
|
---|
157 | return pCurVidPnModeInfo;
|
---|
158 | }
|
---|
159 |
|
---|
160 | if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET
|
---|
161 | || Status == STATUS_GRAPHICS_DATASET_IS_EMPTY)
|
---|
162 | return NULL;
|
---|
163 |
|
---|
164 | WARN(("getting Source info failed %#x", Status));
|
---|
165 |
|
---|
166 | pIter->Status = Status;
|
---|
167 | return NULL;
|
---|
168 | }
|
---|
169 |
|
---|
170 | DECLINLINE(NTSTATUS) VBoxVidPnSourceModeIterStatus(VBOXVIDPN_SOURCEMODE_ITER *pIter)
|
---|
171 | {
|
---|
172 | return pIter->Status;
|
---|
173 | }
|
---|
174 |
|
---|
175 | typedef struct VBOXVIDPN_TARGETMODE_ITER
|
---|
176 | {
|
---|
177 | D3DKMDT_HVIDPNTARGETMODESET hVidPnModeSet;
|
---|
178 | const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnModeSetInterface;
|
---|
179 | const D3DKMDT_VIDPN_TARGET_MODE *pCurVidPnModeInfo;
|
---|
180 | NTSTATUS Status;
|
---|
181 | } VBOXVIDPN_TARGETMODE_ITER;
|
---|
182 |
|
---|
183 | DECLINLINE(void) VBoxVidPnTargetModeIterInit(VBOXVIDPN_TARGETMODE_ITER *pIter,D3DKMDT_HVIDPNTARGETMODESET hVidPnModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnModeSetInterface)
|
---|
184 | {
|
---|
185 | pIter->hVidPnModeSet = hVidPnModeSet;
|
---|
186 | pIter->pVidPnModeSetInterface = pVidPnModeSetInterface;
|
---|
187 | pIter->pCurVidPnModeInfo = NULL;
|
---|
188 | pIter->Status = STATUS_SUCCESS;
|
---|
189 | }
|
---|
190 |
|
---|
191 | DECLINLINE(void) VBoxVidPnTargetModeIterTerm(VBOXVIDPN_TARGETMODE_ITER *pIter)
|
---|
192 | {
|
---|
193 | if (pIter->pCurVidPnModeInfo)
|
---|
194 | {
|
---|
195 | pIter->pVidPnModeSetInterface->pfnReleaseModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo);
|
---|
196 | pIter->pCurVidPnModeInfo = NULL;
|
---|
197 | }
|
---|
198 | }
|
---|
199 |
|
---|
200 | DECLINLINE(const D3DKMDT_VIDPN_TARGET_MODE *) VBoxVidPnTargetModeIterNext(VBOXVIDPN_TARGETMODE_ITER *pIter)
|
---|
201 | {
|
---|
202 | NTSTATUS Status;
|
---|
203 | const D3DKMDT_VIDPN_TARGET_MODE *pCurVidPnModeInfo;
|
---|
204 |
|
---|
205 | if (!pIter->pCurVidPnModeInfo)
|
---|
206 | Status = pIter->pVidPnModeSetInterface->pfnAcquireFirstModeInfo(pIter->hVidPnModeSet, &pCurVidPnModeInfo);
|
---|
207 | else
|
---|
208 | Status = pIter->pVidPnModeSetInterface->pfnAcquireNextModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo, &pCurVidPnModeInfo);
|
---|
209 |
|
---|
210 | if (Status == STATUS_SUCCESS)
|
---|
211 | {
|
---|
212 | Assert(pCurVidPnModeInfo);
|
---|
213 |
|
---|
214 | if (pIter->pCurVidPnModeInfo)
|
---|
215 | pIter->pVidPnModeSetInterface->pfnReleaseModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo);
|
---|
216 |
|
---|
217 | pIter->pCurVidPnModeInfo = pCurVidPnModeInfo;
|
---|
218 | return pCurVidPnModeInfo;
|
---|
219 | }
|
---|
220 |
|
---|
221 | if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET
|
---|
222 | || Status == STATUS_GRAPHICS_DATASET_IS_EMPTY)
|
---|
223 | return NULL;
|
---|
224 |
|
---|
225 | WARN(("getting Target info failed %#x", Status));
|
---|
226 |
|
---|
227 | pIter->Status = Status;
|
---|
228 | return NULL;
|
---|
229 | }
|
---|
230 |
|
---|
231 | DECLINLINE(NTSTATUS) VBoxVidPnTargetModeIterStatus(VBOXVIDPN_TARGETMODE_ITER *pIter)
|
---|
232 | {
|
---|
233 | return pIter->Status;
|
---|
234 | }
|
---|
235 |
|
---|
236 |
|
---|
237 | typedef struct VBOXVIDPN_MONITORMODE_ITER
|
---|
238 | {
|
---|
239 | D3DKMDT_HMONITORSOURCEMODESET hVidPnModeSet;
|
---|
240 | const DXGK_MONITORSOURCEMODESET_INTERFACE *pVidPnModeSetInterface;
|
---|
241 | const D3DKMDT_MONITOR_SOURCE_MODE *pCurVidPnModeInfo;
|
---|
242 | NTSTATUS Status;
|
---|
243 | } VBOXVIDPN_MONITORMODE_ITER;
|
---|
244 |
|
---|
245 |
|
---|
246 | DECLINLINE(void) VBoxVidPnMonitorModeIterInit(VBOXVIDPN_MONITORMODE_ITER *pIter, D3DKMDT_HMONITORSOURCEMODESET hVidPnModeSet, const DXGK_MONITORSOURCEMODESET_INTERFACE *pVidPnModeSetInterface)
|
---|
247 | {
|
---|
248 | pIter->hVidPnModeSet = hVidPnModeSet;
|
---|
249 | pIter->pVidPnModeSetInterface = pVidPnModeSetInterface;
|
---|
250 | pIter->pCurVidPnModeInfo = NULL;
|
---|
251 | pIter->Status = STATUS_SUCCESS;
|
---|
252 | }
|
---|
253 |
|
---|
254 | DECLINLINE(void) VBoxVidPnMonitorModeIterTerm(VBOXVIDPN_MONITORMODE_ITER *pIter)
|
---|
255 | {
|
---|
256 | if (pIter->pCurVidPnModeInfo)
|
---|
257 | {
|
---|
258 | pIter->pVidPnModeSetInterface->pfnReleaseModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo);
|
---|
259 | pIter->pCurVidPnModeInfo = NULL;
|
---|
260 | }
|
---|
261 | }
|
---|
262 |
|
---|
263 | DECLINLINE(const D3DKMDT_MONITOR_SOURCE_MODE *) VBoxVidPnMonitorModeIterNext(VBOXVIDPN_MONITORMODE_ITER *pIter)
|
---|
264 | {
|
---|
265 | NTSTATUS Status;
|
---|
266 | const D3DKMDT_MONITOR_SOURCE_MODE *pCurVidPnModeInfo;
|
---|
267 |
|
---|
268 | if (!pIter->pCurVidPnModeInfo)
|
---|
269 | Status = pIter->pVidPnModeSetInterface->pfnAcquireFirstModeInfo(pIter->hVidPnModeSet, &pCurVidPnModeInfo);
|
---|
270 | else
|
---|
271 | Status = pIter->pVidPnModeSetInterface->pfnAcquireNextModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo, &pCurVidPnModeInfo);
|
---|
272 |
|
---|
273 | if (Status == STATUS_SUCCESS)
|
---|
274 | {
|
---|
275 | Assert(pCurVidPnModeInfo);
|
---|
276 |
|
---|
277 | if (pIter->pCurVidPnModeInfo)
|
---|
278 | pIter->pVidPnModeSetInterface->pfnReleaseModeInfo(pIter->hVidPnModeSet, pIter->pCurVidPnModeInfo);
|
---|
279 |
|
---|
280 | pIter->pCurVidPnModeInfo = pCurVidPnModeInfo;
|
---|
281 | return pCurVidPnModeInfo;
|
---|
282 | }
|
---|
283 |
|
---|
284 | if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET
|
---|
285 | || Status == STATUS_GRAPHICS_DATASET_IS_EMPTY)
|
---|
286 | return NULL;
|
---|
287 |
|
---|
288 | WARN(("getting Monitor info failed %#x", Status));
|
---|
289 |
|
---|
290 | pIter->Status = Status;
|
---|
291 | return NULL;
|
---|
292 | }
|
---|
293 |
|
---|
294 | DECLINLINE(NTSTATUS) VBoxVidPnMonitorModeIterStatus(VBOXVIDPN_MONITORMODE_ITER *pIter)
|
---|
295 | {
|
---|
296 | return pIter->Status;
|
---|
297 | }
|
---|
298 |
|
---|
299 |
|
---|
300 |
|
---|
301 | typedef struct VBOXVIDPN_PATH_ITER
|
---|
302 | {
|
---|
303 | D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology;
|
---|
304 | const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface;
|
---|
305 | const D3DKMDT_VIDPN_PRESENT_PATH *pCurVidPnPathInfo;
|
---|
306 | NTSTATUS Status;
|
---|
307 | } VBOXVIDPN_PATH_ITER;
|
---|
308 |
|
---|
309 |
|
---|
310 | DECLINLINE(void) VBoxVidPnPathIterInit(VBOXVIDPN_PATH_ITER *pIter, D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface)
|
---|
311 | {
|
---|
312 | pIter->hVidPnTopology = hVidPnTopology;
|
---|
313 | pIter->pVidPnTopologyInterface = pVidPnTopologyInterface;
|
---|
314 | pIter->pCurVidPnPathInfo = NULL;
|
---|
315 | pIter->Status = STATUS_SUCCESS;
|
---|
316 | }
|
---|
317 |
|
---|
318 | DECLINLINE(void) VBoxVidPnPathIterTerm(VBOXVIDPN_PATH_ITER *pIter)
|
---|
319 | {
|
---|
320 | if (pIter->pCurVidPnPathInfo)
|
---|
321 | {
|
---|
322 | pIter->pVidPnTopologyInterface->pfnReleasePathInfo(pIter->hVidPnTopology, pIter->pCurVidPnPathInfo);
|
---|
323 | pIter->pCurVidPnPathInfo = NULL;
|
---|
324 | }
|
---|
325 | }
|
---|
326 |
|
---|
327 | DECLINLINE(const D3DKMDT_VIDPN_PRESENT_PATH *) VBoxVidPnPathIterNext(VBOXVIDPN_PATH_ITER *pIter)
|
---|
328 | {
|
---|
329 | NTSTATUS Status;
|
---|
330 | const D3DKMDT_VIDPN_PRESENT_PATH *pCurVidPnPathInfo;
|
---|
331 |
|
---|
332 | if (!pIter->pCurVidPnPathInfo)
|
---|
333 | Status = pIter->pVidPnTopologyInterface->pfnAcquireFirstPathInfo(pIter->hVidPnTopology, &pCurVidPnPathInfo);
|
---|
334 | else
|
---|
335 | Status = pIter->pVidPnTopologyInterface->pfnAcquireNextPathInfo(pIter->hVidPnTopology, pIter->pCurVidPnPathInfo, &pCurVidPnPathInfo);
|
---|
336 |
|
---|
337 | if (Status == STATUS_SUCCESS)
|
---|
338 | {
|
---|
339 | Assert(pCurVidPnPathInfo);
|
---|
340 |
|
---|
341 | if (pIter->pCurVidPnPathInfo)
|
---|
342 | pIter->pVidPnTopologyInterface->pfnReleasePathInfo(pIter->hVidPnTopology, pIter->pCurVidPnPathInfo);
|
---|
343 |
|
---|
344 | pIter->pCurVidPnPathInfo = pCurVidPnPathInfo;
|
---|
345 | return pCurVidPnPathInfo;
|
---|
346 | }
|
---|
347 |
|
---|
348 | if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET
|
---|
349 | || Status == STATUS_GRAPHICS_DATASET_IS_EMPTY)
|
---|
350 | return NULL;
|
---|
351 |
|
---|
352 | WARN(("getting Path info failed %#x", Status));
|
---|
353 |
|
---|
354 | pIter->Status = Status;
|
---|
355 | return NULL;
|
---|
356 | }
|
---|
357 |
|
---|
358 | DECLINLINE(NTSTATUS) VBoxVidPnPathIterStatus(VBOXVIDPN_PATH_ITER *pIter)
|
---|
359 | {
|
---|
360 | return pIter->Status;
|
---|
361 | }
|
---|
362 |
|
---|
363 | NTSTATUS VBoxVidPnRecommendMonitorModes(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_TARGET_ID VideoPresentTargetId,
|
---|
364 | D3DKMDT_HMONITORSOURCEMODESET hVidPnModeSet, const DXGK_MONITORSOURCEMODESET_INTERFACE *pVidPnModeSetInterface);
|
---|
365 |
|
---|
366 | NTSTATUS VBoxVidPnRecommendFunctional(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, const VBOXWDDM_RECOMMENDVIDPN *pData);
|
---|
367 |
|
---|
368 | NTSTATUS VBoxVidPnCofuncModality(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE enmPivot, const DXGK_ENUM_PIVOT *pPivot);
|
---|
369 |
|
---|
370 | NTSTATUS VBoxVidPnIsSupported(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, BOOLEAN *pfSupported);
|
---|
371 |
|
---|
372 | NTSTATUS VBoxVidPnUpdateModes(PVBOXMP_DEVEXT pDevExt, uint32_t u32TargetId, const RTRECTSIZE *pSize);
|
---|
373 |
|
---|
374 | #endif /* #ifndef ___VBoxMPVidPn_h___ */
|
---|