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