Changeset 34018 in vbox
- Timestamp:
- Nov 12, 2010 1:31:55 AM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r33997 r34018 599 599 } 600 600 601 #ifdef VBOX_WITH_WDDM 602 601 603 static bool vboxVideoModesMatch(VIDEO_MODE_INFORMATION *pMode1, VIDEO_MODE_INFORMATION *pMode2) 602 604 { … … 606 608 } 607 609 608 static DECLINLINE(void) vboxVideoCh ackModeAdd(VIDEO_MODE_INFORMATION *pModes, int *pcNumModes)610 static DECLINLINE(void) vboxVideoCheckModeAdd(VIDEO_MODE_INFORMATION *pModes, int *pcNumModes) 609 611 { 610 612 const int cNumModes = *pcNumModes; … … 617 619 } 618 620 619 #ifdef VBOX_WITH_WDDM 620 # define VBOXVIDEOMODE_ADDED(_aModes, _pcModes) vboxVideoChackModeAdd(_aModes, _pcModes) 621 # define VBOXVIDEOMODE_ADDED(_aModes, _pcModes) vboxVideoCheckModeAdd(_aModes, _pcModes) 621 622 #else 622 623 # define VBOXVIDEOMODE_ADDED(_aModes, _pcModes) do { (*(_pcModes))++; } while (0) … … 2318 2319 } 2319 2320 2320 NTSTATUS vboxWddmGetModesForResolution( PDEVICE_EXTENSION DeviceExtension, PVBOXWDDM_VIDEOMODES_INFO pModeInfos,2321 D3DKMDT_2DREGION *pResolution, VIDEO_MODE_INFORMATION * pModes, uint32_t cModes, uint32_t *pcModes, int32_t *piPreferrableMode)2321 NTSTATUS vboxWddmGetModesForResolution(VIDEO_MODE_INFORMATION *pAllModes, uint32_t cAllModes, int iSearchPreferredMode, 2322 const D3DKMDT_2DREGION *pResolution, VIDEO_MODE_INFORMATION * pModes, uint32_t cModes, uint32_t *pcModes, int32_t *piPreferrableMode) 2322 2323 { 2323 2324 NTSTATUS Status = STATUS_SUCCESS; 2324 2325 uint32_t cFound = 0; 2325 2326 int iFoundPreferrableMode = -1; 2326 for (uint32_t i = 0; i < pModeInfos->cModes; ++i)2327 { 2328 VIDEO_MODE_INFORMATION *pCur = &p ModeInfos->aModes[i];2327 for (uint32_t i = 0; i < cAllModes; ++i) 2328 { 2329 VIDEO_MODE_INFORMATION *pCur = &pAllModes[i]; 2329 2330 if (pResolution->cx == pCur->VisScreenWidth 2330 2331 && pResolution->cy == pCur->VisScreenHeight) … … 2335 2336 Status = STATUS_BUFFER_TOO_SMALL; 2336 2337 2337 if (i == pModeInfos->iPreferredMode)2338 if (i == iSearchPreferredMode) 2338 2339 iFoundPreferrableMode = cFound; 2339 2340 … … 2351 2352 } 2352 2353 2354 int vboxWddmVideoModeFind(const VIDEO_MODE_INFORMATION *pModes, int cModes, const VIDEO_MODE_INFORMATION *pM) 2355 { 2356 for (int i = 0; i < cModes; ++i) 2357 { 2358 const VIDEO_MODE_INFORMATION *pMode = &pModes[i]; 2359 if (pMode->VisScreenHeight == pM->VisScreenHeight && pMode->VisScreenWidth == pM->VisScreenWidth && pMode->BitsPerPlane == pM->BitsPerPlane) 2360 return i; 2361 } 2362 return -1; 2363 } 2364 2365 int vboxWddmVideoResolutionFind(const D3DKMDT_2DREGION *pResolutions, int cResolutions, const D3DKMDT_2DREGION *pRes) 2366 { 2367 for (int i = 0; i < cResolutions; ++i) 2368 { 2369 const D3DKMDT_2DREGION *pResolution = &pResolutions[i]; 2370 if (pResolution->cx == pRes->cx && pResolution->cy == pRes->cy) 2371 return i; 2372 } 2373 return -1; 2374 } 2375 2376 bool vboxWddmVideoResolutionsMatch(const D3DKMDT_2DREGION *pResolutions1, const D3DKMDT_2DREGION *pResolutions2, int cResolutions) 2377 { 2378 for (int i = 0; i < cResolutions; ++i) 2379 { 2380 const D3DKMDT_2DREGION * pRes1 = &pResolutions1[i]; 2381 int j = 0; 2382 for (;j < cResolutions; ++j) 2383 { 2384 const D3DKMDT_2DREGION * pRes2 = &pResolutions2[j]; 2385 if (pRes1->cx == pRes2->cx && pRes1->cy == pRes2->cy) 2386 break; 2387 } 2388 2389 if (j == cResolutions) 2390 { 2391 return false; 2392 } 2393 } 2394 return true; 2395 } 2396 2397 bool vboxWddmVideoModesMatch(const VIDEO_MODE_INFORMATION *pModes1, const VIDEO_MODE_INFORMATION *pModes2, int cModes) 2398 { 2399 for (int i = 0; i < cModes; ++i) 2400 { 2401 const VIDEO_MODE_INFORMATION *pM1 = &pModes1[i]; 2402 int j = 0; 2403 for (;j < cModes; ++j) 2404 { 2405 const VIDEO_MODE_INFORMATION *pM2 = &pModes2[j]; 2406 2407 if (pM1->VisScreenHeight == pM2->VisScreenHeight 2408 && pM1->VisScreenWidth == pM2->VisScreenWidth 2409 && pM1->BitsPerPlane == pM2->BitsPerPlane) 2410 break; 2411 } 2412 2413 if (j == cModes) 2414 { 2415 return false; 2416 } 2417 } 2418 return true; 2419 } 2420 2421 D3DDDIFORMAT vboxWddmCalcPixelFormat(const VIDEO_MODE_INFORMATION *pInfo) 2422 { 2423 switch (pInfo->BitsPerPlane) 2424 { 2425 case 32: 2426 if(!(pInfo->AttributeFlags & VIDEO_MODE_PALETTE_DRIVEN) && !(pInfo->AttributeFlags & VIDEO_MODE_MANAGED_PALETTE)) 2427 { 2428 if (pInfo->RedMask == 0xFF0000 && pInfo->GreenMask == 0xFF00 && pInfo->BlueMask == 0xFF) 2429 return D3DDDIFMT_A8R8G8B8; 2430 drprintf((__FUNCTION__": unsupported format: bpp(%d), rmask(%d), gmask(%d), bmask(%d)\n", pInfo->BitsPerPlane, pInfo->RedMask, pInfo->GreenMask, pInfo->BlueMask)); 2431 AssertBreakpoint(); 2432 } 2433 else 2434 { 2435 drprintf((__FUNCTION__": unsupported AttributeFlags(0x%x)\n", pInfo->AttributeFlags)); 2436 AssertBreakpoint(); 2437 } 2438 break; 2439 case 24: 2440 if(!(pInfo->AttributeFlags & VIDEO_MODE_PALETTE_DRIVEN) && !(pInfo->AttributeFlags & VIDEO_MODE_MANAGED_PALETTE)) 2441 { 2442 if (pInfo->RedMask == 0xFF0000 && pInfo->GreenMask == 0xFF00 && pInfo->BlueMask == 0xFF) 2443 return D3DDDIFMT_R8G8B8; 2444 drprintf((__FUNCTION__": unsupported format: bpp(%d), rmask(%d), gmask(%d), bmask(%d)\n", pInfo->BitsPerPlane, pInfo->RedMask, pInfo->GreenMask, pInfo->BlueMask)); 2445 AssertBreakpoint(); 2446 } 2447 else 2448 { 2449 drprintf((__FUNCTION__": unsupported AttributeFlags(0x%x)\n", pInfo->AttributeFlags)); 2450 AssertBreakpoint(); 2451 } 2452 break; 2453 case 16: 2454 if(!(pInfo->AttributeFlags & VIDEO_MODE_PALETTE_DRIVEN) && !(pInfo->AttributeFlags & VIDEO_MODE_MANAGED_PALETTE)) 2455 { 2456 if (pInfo->RedMask == 0xF800 && pInfo->GreenMask == 0x7E0 && pInfo->BlueMask == 0x1F) 2457 return D3DDDIFMT_R5G6B5; 2458 drprintf((__FUNCTION__": unsupported format: bpp(%d), rmask(%d), gmask(%d), bmask(%d)\n", pInfo->BitsPerPlane, pInfo->RedMask, pInfo->GreenMask, pInfo->BlueMask)); 2459 AssertBreakpoint(); 2460 } 2461 else 2462 { 2463 drprintf((__FUNCTION__": unsupported AttributeFlags(0x%x)\n", pInfo->AttributeFlags)); 2464 AssertBreakpoint(); 2465 } 2466 break; 2467 case 8: 2468 if((pInfo->AttributeFlags & VIDEO_MODE_PALETTE_DRIVEN) && (pInfo->AttributeFlags & VIDEO_MODE_MANAGED_PALETTE)) 2469 { 2470 return D3DDDIFMT_P8; 2471 } 2472 else 2473 { 2474 drprintf((__FUNCTION__": unsupported AttributeFlags(0x%x)\n", pInfo->AttributeFlags)); 2475 AssertBreakpoint(); 2476 } 2477 break; 2478 default: 2479 drprintf((__FUNCTION__": unsupported bpp(%d)\n", pInfo->BitsPerPlane)); 2480 AssertBreakpoint(); 2481 break; 2482 } 2483 2484 return D3DDDIFMT_UNKNOWN; 2485 } 2486 2487 bool vboxWddmFillMode(VIDEO_MODE_INFORMATION *pInfo, D3DDDIFORMAT enmFormat, ULONG w, ULONG h) 2488 { 2489 pInfo->VisScreenWidth = w; 2490 pInfo->VisScreenHeight = h; 2491 pInfo->VideoMemoryBitmapWidth = w; 2492 pInfo->VideoMemoryBitmapHeight = h; 2493 2494 switch (enmFormat) 2495 { 2496 case D3DDDIFMT_A8R8G8B8: 2497 pInfo->AttributeFlags = VIDEO_MODE_GRAPHICS | VIDEO_MODE_COLOR | VIDEO_MODE_NO_OFF_SCREEN; 2498 pInfo->BitsPerPlane = 32; 2499 pInfo->RedMask = 0xFF0000; 2500 pInfo->GreenMask = 0xFF00; 2501 pInfo->BlueMask = 0xFF; 2502 return true; 2503 case D3DDDIFMT_R8G8B8: 2504 pInfo->AttributeFlags = VIDEO_MODE_GRAPHICS | VIDEO_MODE_COLOR | VIDEO_MODE_NO_OFF_SCREEN; 2505 pInfo->BitsPerPlane = 24; 2506 pInfo->RedMask = 0xFF0000; 2507 pInfo->GreenMask = 0xFF00; 2508 pInfo->BlueMask = 0xFF; 2509 return true; 2510 case D3DDDIFMT_R5G6B5: 2511 pInfo->AttributeFlags = VIDEO_MODE_GRAPHICS | VIDEO_MODE_COLOR | VIDEO_MODE_NO_OFF_SCREEN; 2512 pInfo->BitsPerPlane = 16; 2513 pInfo->RedMask = 0xF800; 2514 pInfo->GreenMask = 0x7E0; 2515 pInfo->BlueMask = 0x1F; 2516 return true; 2517 case D3DDDIFMT_P8: 2518 pInfo->AttributeFlags = VIDEO_MODE_GRAPHICS | VIDEO_MODE_COLOR | VIDEO_MODE_NO_OFF_SCREEN | VIDEO_MODE_PALETTE_DRIVEN | VIDEO_MODE_MANAGED_PALETTE; 2519 pInfo->BitsPerPlane = 8; 2520 pInfo->RedMask = 0; 2521 pInfo->GreenMask = 0; 2522 pInfo->BlueMask = 0; 2523 return true; 2524 default: 2525 drprintf((__FUNCTION__": unsupported enmFormat(%d)\n", enmFormat)); 2526 AssertBreakpoint(); 2527 break; 2528 } 2529 2530 return false; 2531 } 2353 2532 2354 2533 static VBOXWDDM_VIDEOMODES_INFO g_aVBoxVideoModeInfos[VBOX_VIDEO_MAX_SCREENS] = {0}; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r33997 r34018 409 409 410 410 /* @return STATUS_BUFFER_TOO_SMALL - if buffer is too small, STATUS_SUCCESS - on success */ 411 NTSTATUS vboxWddmGetModesForResolution(PDEVICE_EXTENSION DeviceExtension, PVBOXWDDM_VIDEOMODES_INFO pModeInfos, 412 D3DKMDT_2DREGION *pResolution, VIDEO_MODE_INFORMATION * pModes, uint32_t cModes, uint32_t *pcModes, int32_t *piPreferrableMode); 413 414 D3DDDIFORMAT vboxWddmCalcPixelFormat(VIDEO_MODE_INFORMATION *pInfo); 411 NTSTATUS vboxWddmGetModesForResolution(VIDEO_MODE_INFORMATION *pAllModes, uint32_t cAllModes, int iSearchPreferredMode, 412 const D3DKMDT_2DREGION *pResolution, VIDEO_MODE_INFORMATION * pModes, uint32_t cModes, uint32_t *pcModes, int32_t *piPreferrableMode); 413 414 int vboxWddmVideoModeFind(const VIDEO_MODE_INFORMATION *pModes, int cModes, const VIDEO_MODE_INFORMATION *pM); 415 int vboxWddmVideoResolutionFind(const D3DKMDT_2DREGION *pResolutions, int cResolutions, const D3DKMDT_2DREGION *pRes); 416 bool vboxWddmVideoResolutionsMatch(const D3DKMDT_2DREGION *pResolutions1, const D3DKMDT_2DREGION *pResolutions2, int cResolutions); 417 bool vboxWddmVideoModesMatch(const VIDEO_MODE_INFORMATION *pModes1, const VIDEO_MODE_INFORMATION *pModes2, int cModes); 418 419 D3DDDIFORMAT vboxWddmCalcPixelFormat(const VIDEO_MODE_INFORMATION *pInfo); 420 bool vboxWddmFillMode(VIDEO_MODE_INFORMATION *pInfo, D3DDDIFORMAT enmFormat, ULONG w, ULONG h); 415 421 416 422 DECLINLINE(ULONG) vboxWddmVramCpuVisibleSize(PDEVICE_EXTENSION pDevExt) -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.cpp
r33983 r34018 23 23 if (Status == STATUS_SUCCESS) 24 24 { 25 BOOLEAN bFoundPrimary = FALSE;25 BOOLEAN bFoundPrimary = TRUE; 26 26 27 27 while (1) … … 30 30 { 31 31 dprintf(("unsupported source(%d)->target(%d) pare\n", pNewVidPnPresentPathInfo->VidPnSourceId, pNewVidPnPresentPathInfo->VidPnTargetId)); 32 AssertBreakpoint();32 // AssertBreakpoint(); 33 33 bSupported = FALSE; 34 34 break; … … 213 213 } 214 214 215 bSupported &= bFoundPrimary;215 // bSupported &= bFoundPrimary; 216 216 217 217 if (pNewVidPnPresentPathInfo) … … 1121 1121 } 1122 1122 1123 DECLCALLBACK(BOOLEAN) vboxVidPnCofuncModalityPathEnum(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 1124 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 1123 typedef struct VBOXVIDPNPOPRESOLUTIONENUM 1124 { 1125 NTSTATUS Status; 1126 D3DKMDT_2DREGION *pResolutions; 1127 int cResolutions; 1128 int cResultResolutions; 1129 }VBOXVIDPNPOPRESOLUTIONENUM, *PVBOXVIDPNPOPRESOLUTIONENUM; 1130 1131 static DECLCALLBACK(BOOLEAN) vboxVidPnPopulateResolutionsFromSourceModeSetEnum(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 1132 const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, PVOID pContext) 1133 { 1134 NTSTATUS Status = STATUS_SUCCESS; 1135 PVBOXVIDPNPOPRESOLUTIONENUM pInfo = (PVBOXVIDPNPOPRESOLUTIONENUM)pContext; 1136 Assert(pInfo->cResolutions >= pInfo->cResultResolutions); 1137 Assert(pInfo->Status == STATUS_SUCCESS); 1138 if (vboxWddmVideoResolutionFind(pInfo->pResolutions, pInfo->cResultResolutions, &pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize) < 0) 1139 { 1140 if (pInfo->cResultResolutions < pInfo->cResolutions) 1141 { 1142 pInfo->pResolutions[pInfo->cResultResolutions] = pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize; 1143 ++pInfo->cResultResolutions; 1144 } 1145 else 1146 { 1147 Status = STATUS_BUFFER_OVERFLOW; 1148 } 1149 } 1150 1151 pInfo->Status = Status; 1152 1153 return Status == STATUS_SUCCESS; 1154 } 1155 1156 static DECLCALLBACK(BOOLEAN) vboxVidPnPopulateResolutionsFromTargetModeSetEnum(D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface, 1157 const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, PVOID pContext) 1158 { 1159 NTSTATUS Status = STATUS_SUCCESS; 1160 PVBOXVIDPNPOPRESOLUTIONENUM pInfo = (PVBOXVIDPNPOPRESOLUTIONENUM)pContext; 1161 Assert(pInfo->cResolutions >= pInfo->cResultResolutions); 1162 Assert(pInfo->Status == STATUS_SUCCESS); 1163 if (vboxWddmVideoResolutionFind(pInfo->pResolutions, pInfo->cResultResolutions, &pNewVidPnTargetModeInfo->VideoSignalInfo.ActiveSize) < 0) 1164 { 1165 if (pInfo->cResultResolutions < pInfo->cResolutions) 1166 { 1167 pInfo->pResolutions[pInfo->cResultResolutions] = pNewVidPnTargetModeInfo->VideoSignalInfo.ActiveSize; 1168 ++pInfo->cResultResolutions; 1169 } 1170 else 1171 { 1172 Status = STATUS_BUFFER_OVERFLOW; 1173 } 1174 } 1175 1176 pInfo->Status = Status; 1177 1178 return Status == STATUS_SUCCESS; 1179 } 1180 1181 typedef struct VBOXVIDPNPOPMODEENUM 1182 { 1183 NTSTATUS Status; 1184 VIDEO_MODE_INFORMATION *pModes; 1185 int cModes; 1186 int cResultModes; 1187 }VBOXVIDPNPOPMODEENUM, *PVBOXVIDPNPOPMODEENUM; 1188 1189 static DECLCALLBACK(BOOLEAN) vboxVidPnPopulateModesFromSourceModeSetEnum(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 1190 const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, PVOID pContext) 1191 { 1192 NTSTATUS Status = STATUS_SUCCESS; 1193 PVBOXVIDPNPOPMODEENUM pInfo = (PVBOXVIDPNPOPMODEENUM)pContext; 1194 VIDEO_MODE_INFORMATION Mode; 1195 Assert(pInfo->cModes >= pInfo->cResultModes); 1196 Assert(pInfo->Status == STATUS_SUCCESS); 1197 if (vboxWddmFillMode(&Mode, pNewVidPnSourceModeInfo->Format.Graphics.PixelFormat, 1198 pNewVidPnSourceModeInfo->Format.Graphics.VisibleRegionSize.cx, 1199 pNewVidPnSourceModeInfo->Format.Graphics.VisibleRegionSize.cy)) 1200 { 1201 if (vboxWddmVideoModeFind(pInfo->pModes, pInfo->cModes, &Mode) < 0) 1202 { 1203 if (pInfo->cResultModes < pInfo->cModes) 1204 { 1205 pInfo->pModes[pInfo->cResultModes] = Mode; 1206 ++pInfo->cResultModes; 1207 } 1208 else 1209 { 1210 Status = STATUS_BUFFER_OVERFLOW; 1211 } 1212 } 1213 } 1214 else 1215 { 1216 Assert(0); 1217 Status = STATUS_INVALID_PARAMETER; 1218 } 1219 1220 pInfo->Status = Status; 1221 1222 return Status == STATUS_SUCCESS; 1223 } 1224 1225 typedef struct VBOXVIDPNPOPMODETARGETENUM 1226 { 1227 VBOXVIDPNPOPMODEENUM Base; 1228 VIDEO_MODE_INFORMATION *pSuperset; 1229 int cSuperset; 1230 }VBOXVIDPNPOPMODETARGETENUM, *PVBOXVIDPNPOPMODETARGETENUM; 1231 1232 static DECLCALLBACK(BOOLEAN) vboxVidPnPopulateModesFromTargetModeSetEnum(D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface, 1233 const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, PVOID pContext) 1234 { 1235 NTSTATUS Status = STATUS_SUCCESS; 1236 PVBOXVIDPNPOPMODETARGETENUM pInfo = (PVBOXVIDPNPOPMODETARGETENUM)pContext; 1237 Assert(pInfo->Base.cModes >= pInfo->Base.cResultModes); 1238 Assert(pInfo->Base.Status == STATUS_SUCCESS); 1239 uint32_t cResult; 1240 Status = vboxWddmGetModesForResolution(pInfo->pSuperset, pInfo->cSuperset, -1, &pNewVidPnTargetModeInfo->VideoSignalInfo.ActiveSize, 1241 pInfo->Base.pModes + pInfo->Base.cResultModes, pInfo->Base.cModes - pInfo->Base.cResultModes, &cResult, NULL); 1242 Assert(Status == STATUS_SUCCESS); 1243 if (Status == STATUS_SUCCESS) 1244 { 1245 pInfo->Base.cResultModes += cResult; 1246 } 1247 1248 pInfo->Base.Status = Status; 1249 1250 return Status == STATUS_SUCCESS; 1251 } 1252 1253 DECLCALLBACK(BOOLEAN) vboxVidPnCofuncModalityPathEnum(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 1125 1254 const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo, PVOID pContext) 1126 1255 { 1127 1256 PVBOXVIDPNCOFUNCMODALITY pCbContext = (PVBOXVIDPNCOFUNCMODALITY)pContext; 1257 PDEVICE_EXTENSION pDevExt = pCbContext->pDevExt; 1258 D3DKMDT_HVIDPN hDesiredVidPn = pCbContext->pEnumCofuncModalityArg->hConstrainingVidPn; 1259 const DXGK_VIDPN_INTERFACE* pVidPnInterface = pCbContext->pVidPnInterface; 1128 1260 NTSTATUS Status = STATUS_SUCCESS; 1129 1261 pCbContext->Status = STATUS_SUCCESS; 1130 1262 PVBOXWDDM_VIDEOMODES_INFO pInfo = &pCbContext->pInfos[pNewVidPnPresentPathInfo->VidPnTargetId]; 1131 VIDEO_MODE_INFORMATION *pModes = pInfo->aModes; 1132 uint32_t cModes = pInfo->cModes; 1133 /* we do not want the mode to be pinned */ 1134 int iPreferredMode = -1; /* pInfo->iPreferredMode; */ 1135 uint32_t cResolutions = pInfo->cResolutions; 1136 D3DKMDT_2DREGION * pResolutions = pInfo->aResolutions; 1137 1138 1139 /* adjust scaling */ 1140 if (pCbContext->pEnumCofuncModalityArg->EnumPivotType != D3DKMDT_EPT_SCALING) 1141 { 1142 if (pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_IDENTITY 1143 && pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_CENTERED 1144 && pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_STRETCHED 1145 && pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_UNPINNED 1146 && pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_NOTSPECIFIED) 1147 { 1148 AssertBreakpoint(); 1149 /* todo: create a new path (if not done already) and assign a proper info */ 1150 } 1151 } 1152 1153 /* adjust rotation */ 1154 if (pCbContext->pEnumCofuncModalityArg->EnumPivotType != D3DKMDT_EPT_ROTATION) 1155 { 1156 if (pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_IDENTITY 1157 && pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_ROTATE90 1158 && pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_ROTATE180 1159 && pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_ROTATE270 1160 && pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_UNPINNED) 1161 { 1162 AssertBreakpoint(); 1163 /* todo: create a new path (if not done already) and assign a proper info */ 1164 } 1165 } 1263 bool bConversionSupported = 1264 ( 1265 pNewVidPnPresentPathInfo->ContentTransformation.Scaling == D3DKMDT_VPPS_UNINITIALIZED 1266 || pNewVidPnPresentPathInfo->ContentTransformation.Scaling == D3DKMDT_VPPS_IDENTITY 1267 || pNewVidPnPresentPathInfo->ContentTransformation.Scaling == D3DKMDT_VPPS_UNPINNED 1268 || pNewVidPnPresentPathInfo->ContentTransformation.Scaling == D3DKMDT_VPPS_NOTSPECIFIED 1269 ) 1270 && ( 1271 pNewVidPnPresentPathInfo->ContentTransformation.Rotation == D3DKMDT_VPPR_UNINITIALIZED 1272 || pNewVidPnPresentPathInfo->ContentTransformation.Rotation == D3DKMDT_VPPR_IDENTITY 1273 || pNewVidPnPresentPathInfo->ContentTransformation.Rotation == D3DKMDT_VPPR_UNPINNED 1274 || pNewVidPnPresentPathInfo->ContentTransformation.Rotation == D3DKMDT_VPPR_NOTSPECIFIED 1275 ); 1276 1166 1277 1167 1278 D3DKMDT_HVIDPNSOURCEMODESET hCurVidPnSourceModeSet; 1168 1279 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pCurVidPnSourceModeSetInterface; 1169 VIDEO_MODE_INFORMATION *pPreferredMode = iPreferredMode >= 0 ? &pModes[iPreferredMode] : NULL;1170 1280 1171 1281 Status = pVidPnInterface->pfnAcquireSourceModeSet(hDesiredVidPn, … … 1207 1317 drprintf((__FUNCTION__": pfnAcquirePinnedModeInfo failed Status(0x%x)\n", Status)); 1208 1318 1209 switch (pCbContext->pEnumCofuncModalityArg->EnumPivotType) 1210 { 1211 case D3DKMDT_EPT_VIDPNSOURCE: 1212 if (!pPinnedVidPnTargetModeInfo) 1319 bool bSrcPinned = pPinnedVidPnSourceModeInfo 1320 || (pCbContext->pEnumCofuncModalityArg->EnumPivotType == D3DKMDT_EPT_VIDPNSOURCE 1321 && (pCbContext->pEnumCofuncModalityArg->EnumPivot.VidPnSourceId == pNewVidPnPresentPathInfo->VidPnSourceId 1322 || pCbContext->pEnumCofuncModalityArg->EnumPivot.VidPnSourceId == D3DDDI_ID_ALL)); 1323 bool bTgtPinned = pPinnedVidPnTargetModeInfo 1324 || (pCbContext->pEnumCofuncModalityArg->EnumPivotType == D3DKMDT_EPT_VIDPNTARGET 1325 && (pCbContext->pEnumCofuncModalityArg->EnumPivot.VidPnTargetId == pNewVidPnPresentPathInfo->VidPnTargetId 1326 || pCbContext->pEnumCofuncModalityArg->EnumPivot.VidPnTargetId == D3DDDI_ID_ALL)); 1327 if (bSrcPinned) 1328 { 1329 if (!bTgtPinned) 1330 { 1331 /* adjust target mode set relative to source mode set */ 1332 /* 1. get list of resolutions for source and for target 1333 * 2. if they do not match create and populate a new set */ 1334 SIZE_T cTgtModes; 1335 SIZE_T cSrcModes; 1336 Status = pCurVidPnTargetModeSetInterface->pfnGetNumModes(hCurVidPnTargetModeSet, &cTgtModes); 1337 Assert(Status == STATUS_SUCCESS); 1338 if (Status == STATUS_SUCCESS) 1213 1339 { 1214 if (pPinnedVidPnSourceModeInfo) 1340 Status = pCurVidPnSourceModeSetInterface->pfnGetNumModes(hCurVidPnSourceModeSet, &cSrcModes); 1341 Assert(Status == STATUS_SUCCESS); 1342 if (Status == STATUS_SUCCESS) 1215 1343 { 1216 SIZE_T cModes; 1217 Status = pCurVidPnTargetModeSetInterface->pfnGetNumModes(hCurVidPnTargetModeSet, &cModes); 1218 Assert(Status == STATUS_SUCCESS); 1344 D3DKMDT_2DREGION *pSrcResolutions = cSrcModes ? (D3DKMDT_2DREGION*)vboxWddmMemAlloc(cSrcModes * sizeof (pSrcResolutions[0])) : NULL; 1345 Assert(pSrcResolutions || !cSrcModes); 1346 if (pSrcResolutions || !cSrcModes) 1347 { 1348 VBOXVIDPNPOPRESOLUTIONENUM Info = {0}; 1349 if (cSrcModes) 1350 { 1351 Info.pResolutions = pSrcResolutions; 1352 Info.cResolutions = cSrcModes; 1353 Status = vboxVidPnEnumSourceModes(hCurVidPnSourceModeSet, pCurVidPnSourceModeSetInterface, 1354 vboxVidPnPopulateResolutionsFromSourceModeSetEnum, &Info); 1355 Assert(Status == STATUS_SUCCESS); 1356 } 1357 if (Status == STATUS_SUCCESS) 1358 { 1359 Assert(Info.Status == STATUS_SUCCESS); 1360 if (Info.Status == STATUS_SUCCESS) 1361 { 1362 D3DKMDT_2DREGION *pTgtResolutions = cTgtModes ? (D3DKMDT_2DREGION*)vboxWddmMemAlloc(cTgtModes * sizeof (pTgtResolutions[0])) : NULL; 1363 Assert(pTgtResolutions || !cTgtModes); 1364 if (pTgtResolutions || !cTgtModes) 1365 { 1366 int cSrcResolutions = Info.cResultResolutions; 1367 memset(&Info, 0, sizeof (Info)); 1368 if (cTgtModes) 1369 { 1370 Info.pResolutions = pTgtResolutions; 1371 Info.cResolutions = cTgtModes; 1372 Status = vboxVidPnEnumTargetModes(hCurVidPnTargetModeSet, pCurVidPnTargetModeSetInterface, 1373 vboxVidPnPopulateResolutionsFromTargetModeSetEnum, &Info); 1374 Assert(Status == STATUS_SUCCESS); 1375 } 1376 if (Status == STATUS_SUCCESS) 1377 { 1378 Assert(Info.Status == STATUS_SUCCESS); 1379 if (Info.Status == STATUS_SUCCESS) 1380 { 1381 bool bNeedSet; 1382 Assert(cTgtModes == Info.cResultResolutions); 1383 if (cSrcResolutions == Info.cResultResolutions) 1384 { 1385 /* need to check all modes */ 1386 bNeedSet = !vboxWddmVideoResolutionsMatch(pSrcResolutions, pTgtResolutions, cSrcResolutions); 1387 } 1388 else 1389 { 1390 bNeedSet = true; 1391 } 1392 1393 if (bNeedSet) 1394 { 1395 Status = vboxVidPnCreatePopulateTargetModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1396 pNewVidPnPresentPathInfo->VidPnTargetId, 1397 pSrcResolutions, 1398 cSrcResolutions, 1399 NULL, 1400 0, 1401 NULL); 1402 Assert(Status == STATUS_SUCCESS); 1403 } 1404 } 1405 else 1406 { 1407 Status = Info.Status; 1408 } 1409 } 1410 1411 if (pTgtResolutions) 1412 vboxWddmMemFree(pTgtResolutions); 1413 } 1414 else 1415 { 1416 Status = STATUS_NO_MEMORY; 1417 } 1418 } 1419 else 1420 { 1421 Status = Info.Status; 1422 } 1423 } 1424 if (pSrcResolutions) 1425 vboxWddmMemFree(pSrcResolutions); 1426 } 1427 else 1428 { 1429 Status = STATUS_NO_MEMORY; 1430 } 1431 } 1432 } 1433 } 1434 } 1435 else if (bTgtPinned) 1436 { 1437 /* adjust source mode set relative to target mode set */ 1438 /* 1. get list of modes for target resolutions 1439 * 2. get list of modes for sources 1440 * 3. if modes do not match create and populate new set */ 1441 SIZE_T cTgtModes; 1442 SIZE_T cSrcModes; 1443 Status = pCurVidPnTargetModeSetInterface->pfnGetNumModes(hCurVidPnTargetModeSet, &cTgtModes); 1444 Assert(Status == STATUS_SUCCESS); 1445 if (Status == STATUS_SUCCESS) 1446 { 1447 Status = pCurVidPnSourceModeSetInterface->pfnGetNumModes(hCurVidPnSourceModeSet, &cSrcModes); 1448 Assert(Status == STATUS_SUCCESS); 1449 if (Status == STATUS_SUCCESS) 1450 { 1451 VIDEO_MODE_INFORMATION *pSrcModes = cSrcModes ? (VIDEO_MODE_INFORMATION*)vboxWddmMemAlloc(cSrcModes * sizeof (pSrcModes[0])) : NULL; 1452 Assert(pSrcModes || !cSrcModes); 1453 if (pSrcModes || !cSrcModes) 1454 { 1455 VBOXVIDPNPOPMODETARGETENUM Info = {0}; 1456 if (cSrcModes) 1457 { 1458 Info.Base.pModes = pSrcModes; 1459 Info.Base.cModes = cSrcModes; 1460 Status = vboxVidPnEnumSourceModes(hCurVidPnSourceModeSet, pCurVidPnSourceModeSetInterface, 1461 vboxVidPnPopulateModesFromSourceModeSetEnum, &Info.Base); 1462 Assert(Status == STATUS_SUCCESS); 1463 } 1219 1464 if (Status == STATUS_SUCCESS) 1220 1465 { 1221 D3DKMDT_2DREGION Resolution; 1222 Resolution.cx = pPinnedVidPnSourceModeInfo->Format.Graphics.VisibleRegionSize.cx; 1223 Resolution.cy = pPinnedVidPnSourceModeInfo->Format.Graphics.VisibleRegionSize.cy; 1224 BOOLEAN bCreateTrg = FALSE; 1225 if (cModes == 1) 1466 Assert(Info.Base.Status == STATUS_SUCCESS); 1467 if (Info.Base.Status == STATUS_SUCCESS) 1226 1468 { 1227 const D3DKMDT_VIDPN_TARGET_MODE *pVidPnTargetModeInfo; 1228 Status = pCurVidPnTargetModeSetInterface->pfnAcquireFirstModeInfo(hCurVidPnTargetModeSet, &pVidPnTargetModeInfo); 1229 Assert(Status == STATUS_SUCCESS); 1469 VIDEO_MODE_INFORMATION *pTgtModes = cTgtModes ? (VIDEO_MODE_INFORMATION*)vboxWddmMemAlloc(pInfo->cModes * sizeof (pTgtModes[0])) : NULL; 1470 Assert(pTgtModes || !cTgtModes); 1471 if (pTgtModes || !cTgtModes) 1472 { 1473 int cSrcResultModes = Info.Base.cModes; 1474 Assert(cSrcResultModes == cSrcModes); 1475 memset(&Info, 0, sizeof (Info)); 1476 if (cTgtModes) 1477 { 1478 Info.Base.pModes = pTgtModes; 1479 Info.Base.cModes = pInfo->cModes; 1480 Info.pSuperset = pInfo->aModes; 1481 Info.cSuperset = pInfo->cModes; 1482 Status = vboxVidPnEnumTargetModes(hCurVidPnTargetModeSet, pCurVidPnTargetModeSetInterface, 1483 vboxVidPnPopulateModesFromTargetModeSetEnum, &Info); 1484 Assert(Status == STATUS_SUCCESS); 1485 } 1486 if (Status == STATUS_SUCCESS) 1487 { 1488 Assert(Info.Base.Status == STATUS_SUCCESS); 1489 if (Info.Base.Status == STATUS_SUCCESS) 1490 { 1491 bool bNeedSet; 1492 Assert((int)cTgtModes <= Info.Base.cResultModes); 1493 if (cSrcResultModes == Info.Base.cResultModes) 1494 { 1495 /* need to check all modes */ 1496 bNeedSet = !vboxWddmVideoModesMatch(pSrcModes, pTgtModes, cSrcResultModes); 1497 } 1498 else 1499 { 1500 bNeedSet = true; 1501 } 1502 1503 if (bNeedSet) 1504 { 1505 Status = Status = vboxVidPnCreatePopulateSourceModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1506 pNewVidPnPresentPathInfo->VidPnSourceId, 1507 pTgtModes, Info.Base.cResultModes, -1, NULL); 1508 Assert(Status == STATUS_SUCCESS); 1509 } 1510 } 1511 else 1512 { 1513 Status = Info.Base.Status; 1514 } 1515 } 1516 1517 if (pTgtModes) 1518 vboxWddmMemFree(pTgtModes); 1519 } 1520 else 1521 { 1522 Status = STATUS_NO_MEMORY; 1523 } 1524 } 1525 else 1526 { 1527 Status = Info.Base.Status; 1528 } 1529 } 1530 if (pSrcModes) 1531 vboxWddmMemFree(pSrcModes); 1532 } 1533 else 1534 { 1535 Status = STATUS_NO_MEMORY; 1536 } 1537 } 1538 } 1539 } 1540 else 1541 { 1542 /* neither Source nor Target are pinned */ 1543 /* 1. get list of target resolutions 1544 * 2. if resolutions do not match with the complete list we have build - create and populate new 1545 * 3. get list of modes for sources 1546 * 4. if modes do not match with the complete list we have - create and populate a new set */ 1547 SIZE_T cTgtModes; 1548 SIZE_T cSrcModes; 1549 Status = pCurVidPnSourceModeSetInterface->pfnGetNumModes(hCurVidPnSourceModeSet, &cSrcModes); 1550 Assert(Status == STATUS_SUCCESS); 1551 if (Status == STATUS_SUCCESS) 1552 { 1553 bool bNeedSet = false; 1554 uint32_t cModes = bConversionSupported ? pInfo->cModes : 0; 1555 if (cSrcModes != cModes) 1556 { 1557 bNeedSet = true; 1558 } 1559 else 1560 { 1561 VIDEO_MODE_INFORMATION *pSrcModes = cSrcModes ? (VIDEO_MODE_INFORMATION*)vboxWddmMemAlloc(cSrcModes * sizeof (pSrcModes[0])) : NULL; 1562 Assert(pSrcModes || !cSrcModes); 1563 if (pSrcModes || !cSrcModes) 1564 { 1565 VBOXVIDPNPOPMODETARGETENUM Info = {0}; 1566 if (cSrcModes) 1567 { 1568 Info.Base.pModes = pSrcModes; 1569 Info.Base.cModes = cSrcModes; 1570 Status = vboxVidPnEnumSourceModes(hCurVidPnSourceModeSet, pCurVidPnSourceModeSetInterface, 1571 vboxVidPnPopulateModesFromSourceModeSetEnum, &Info.Base); 1572 Assert(Status == STATUS_SUCCESS); 1573 } 1574 if (Status == STATUS_SUCCESS) 1575 { 1576 Assert(Info.Base.Status == STATUS_SUCCESS); 1577 if (Info.Base.Status == STATUS_SUCCESS) 1578 { 1579 Assert(cSrcModes == Info.Base.cResultModes); 1580 if (cSrcModes == Info.Base.cResultModes) 1581 { 1582 /* need to check all modes */ 1583 bNeedSet = !vboxWddmVideoModesMatch(pSrcModes, pInfo->aModes, cModes); 1584 } 1585 else 1586 { 1587 bNeedSet = true; 1588 } 1589 } 1590 } 1591 if (pSrcModes) 1592 vboxWddmMemFree(pSrcModes); 1593 } 1594 else 1595 { 1596 Status = STATUS_NO_MEMORY; 1597 } 1598 } 1599 1600 if (Status == STATUS_SUCCESS && bNeedSet) 1601 { 1602 Status = Status = vboxVidPnCreatePopulateSourceModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1603 pNewVidPnPresentPathInfo->VidPnSourceId, 1604 pInfo->aModes, cModes, -1, NULL); 1605 Assert(Status == STATUS_SUCCESS); 1606 } 1607 1608 if (Status == STATUS_SUCCESS) 1609 { 1610 Status = pCurVidPnTargetModeSetInterface->pfnGetNumModes(hCurVidPnTargetModeSet, &cTgtModes); 1611 Assert(Status == STATUS_SUCCESS); 1612 if (Status == STATUS_SUCCESS) 1613 { 1614 bool bNeedSet = false; 1615 uint32_t cResolutions = bConversionSupported ? pInfo->cResolutions : 0; 1616 if (cTgtModes == cResolutions) 1617 { 1618 D3DKMDT_2DREGION *pTgtResolutions = cTgtModes ? (D3DKMDT_2DREGION*)vboxWddmMemAlloc(cTgtModes * sizeof (pTgtResolutions[0])) : NULL; 1619 Assert(pTgtResolutions || !cTgtModes); 1620 if (pTgtResolutions || !cTgtModes) 1621 { 1622 VBOXVIDPNPOPRESOLUTIONENUM Info = {0}; 1623 if (cTgtModes) 1624 { 1625 Info.pResolutions = pTgtResolutions; 1626 Info.cResolutions = cTgtModes; 1627 Status = vboxVidPnEnumTargetModes(hCurVidPnTargetModeSet, pCurVidPnTargetModeSetInterface, 1628 vboxVidPnPopulateResolutionsFromTargetModeSetEnum, &Info); 1629 Assert(Status == STATUS_SUCCESS); 1630 } 1230 1631 if (Status == STATUS_SUCCESS) 1231 1632 { 1232 D3DKMDT_VIDPN_TARGET_MODE dummyMode = {0}; 1233 Status = vboxVidPnPopulateTargetModeInfoFromLegacy(&dummyMode, &Resolution, FALSE); 1234 Assert(Status == STATUS_SUCCESS); 1235 if (Status == STATUS_SUCCESS) 1633 Assert(Info.Status == STATUS_SUCCESS); 1634 if (Info.Status == STATUS_SUCCESS) 1236 1635 { 1237 if (!vboxVidPnMatchVideoSignal(&dummyMode.VideoSignalInfo, &pVidPnTargetModeInfo->VideoSignalInfo)) 1238 bCreateTrg = TRUE; 1636 Assert(cTgtModes == Info.cResultResolutions); 1637 if (Info.cResultResolutions == cResolutions) 1638 { 1639 /* need to check all modes */ 1640 bNeedSet = !vboxWddmVideoResolutionsMatch(pInfo->aResolutions, pTgtResolutions, cResolutions); 1641 } 1239 1642 else 1240 1643 { 1241 /* do we need to check pVidPnTargetModeInfo->Preference; ? */1644 bNeedSet = true; 1242 1645 } 1243 1646 } 1244 1647 else 1245 1648 { 1246 drprintf((__FUNCTION__": trg vboxVidPnPopulateTargetModeInfoFromLegacy failed Status(0x%x), pretending success\n", Status)); 1247 Status = STATUS_SUCCESS; 1248 bCreateTrg = TRUE; 1649 Status = Info.Status; 1249 1650 } 1250 1651 } 1251 else 1252 drprintf((__FUNCTION__": trg pfnAcquireFirstModeInfo failed Status(0x%x)\n", Status)); 1652 1653 if (pTgtResolutions) 1654 vboxWddmMemFree(pTgtResolutions); 1253 1655 } 1254 1656 else 1255 bCreateTrg = TRUE;1256 1257 if (bCreateTrg)1258 1657 { 1259 Status = vboxVidPnCreatePopulateTargetModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1260 pNewVidPnPresentPathInfo->VidPnTargetId, 1261 &Resolution, 1262 1, 1263 pPreferredMode, 1264 0, 1265 NULL); 1266 Assert(Status == STATUS_SUCCESS); 1267 if (Status != STATUS_SUCCESS) 1268 drprintf((__FUNCTION__": vboxVidPnCreatePopulateTargetModeSetFromLegacy for pinned source failed Status(0x%x)\n", Status)); } 1658 Status = STATUS_NO_MEMORY; 1659 } 1269 1660 } 1270 1661 else 1271 drprintf((__FUNCTION__": trg pfnGetNumModes failed Status(0x%x)\n", Status)); 1272 } 1273 else 1274 { 1275 dprintf((__FUNCTION__": source pivot w/o pinned source mode\n")); 1276 // AssertBreakpoint(); 1662 { 1663 bNeedSet = true; 1664 } 1665 1666 if (Status == STATUS_SUCCESS && bNeedSet) 1667 { 1668 Status = vboxVidPnCreatePopulateTargetModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1669 pNewVidPnPresentPathInfo->VidPnTargetId, 1670 pInfo->aResolutions, 1671 cResolutions, 1672 NULL, 1673 0, 1674 NULL); 1675 Assert(Status == STATUS_SUCCESS); 1676 } 1277 1677 } 1278 1678 } 1279 break; 1280 case D3DKMDT_EPT_VIDPNTARGET: 1281 break; 1282 case D3DKMDT_EPT_SCALING: 1283 break; 1284 case D3DKMDT_EPT_ROTATION: 1285 break; 1286 case D3DKMDT_EPT_NOPIVOT: 1287 Assert(!!pPinnedVidPnSourceModeInfo == !!pPinnedVidPnTargetModeInfo); 1288 if (!pPinnedVidPnSourceModeInfo && !pPinnedVidPnTargetModeInfo) 1289 { 1290 /* just create and populate the new source mode set for now */ 1291 Status = vboxVidPnCreatePopulateSourceModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1292 pNewVidPnPresentPathInfo->VidPnSourceId, 1293 pModes, cModes, iPreferredMode, NULL); 1294 Assert(Status == STATUS_SUCCESS); 1295 if (Status == STATUS_SUCCESS) 1296 { 1297 /* just create and populate a new target mode info for now */ 1298 Status = vboxVidPnCreatePopulateTargetModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface, 1299 pNewVidPnPresentPathInfo->VidPnTargetId, 1300 pResolutions, 1301 cResolutions, 1302 pPreferredMode, 1303 0, 1304 NULL); 1305 Assert(Status == STATUS_SUCCESS); 1306 if (Status != STATUS_SUCCESS) 1307 drprintf((__FUNCTION__": vboxVidPnCreatePopulateTargetModeSetFromLegacy failed Status(0x%x)\n", Status)); 1308 } 1309 else 1310 drprintf((__FUNCTION__": vboxVidPnCreatePopulateSourceModeSetFromLegacy failed Status(0x%x)\n", Status)); 1311 } 1312 break; 1313 default: 1314 drprintf((__FUNCTION__": unknown EnumPivotType (%dx)\n", pCbContext->pEnumCofuncModalityArg->EnumPivotType)); 1315 break; 1679 } 1316 1680 } 1317 1681 … … 1391 1755 } 1392 1756 1393 NTSTATUS vboxVidPnEnumSourceModes(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 1394 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 1395 PFNVBOXVIDPNENUMSOURCEMODES pfnCallback, PVOID pContext) 1757 NTSTATUS vboxVidPnEnumSourceModes(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 1758 PFNVBOXVIDPNENUMSOURCEMODES pfnCallback, PVOID pContext) 1396 1759 { 1397 1760 const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo; … … 1404 1767 const D3DKMDT_VIDPN_SOURCE_MODE *pNextVidPnSourceModeInfo; 1405 1768 Status = pVidPnSourceModeSetInterface->pfnAcquireNextModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo, &pNextVidPnSourceModeInfo); 1406 if (!pfnCallback(pDevExt, hDesiredVidPn, pVidPnInterface, 1407 hNewVidPnSourceModeSet, pVidPnSourceModeSetInterface, 1769 if (!pfnCallback(hNewVidPnSourceModeSet, pVidPnSourceModeSetInterface, 1408 1770 pNewVidPnSourceModeInfo, pContext)) 1409 1771 { … … 1448 1810 } 1449 1811 1450 NTSTATUS vboxVidPnEnumTargetModes(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 1451 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface, 1812 NTSTATUS vboxVidPnEnumTargetModes(D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface, 1452 1813 PFNVBOXVIDPNENUMTARGETMODES pfnCallback, PVOID pContext) 1453 1814 { … … 1461 1822 const D3DKMDT_VIDPN_TARGET_MODE *pNextVidPnTargetModeInfo; 1462 1823 Status = pVidPnTargetModeSetInterface->pfnAcquireNextModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo, &pNextVidPnTargetModeInfo); 1463 if (!pfnCallback(pDevExt, hDesiredVidPn, pVidPnInterface, 1464 hNewVidPnTargetModeSet, pVidPnTargetModeSetInterface, 1824 if (!pfnCallback(hNewVidPnTargetModeSet, pVidPnTargetModeSetInterface, 1465 1825 pNewVidPnTargetModeInfo, pContext)) 1466 1826 { … … 1537 1897 } 1538 1898 1539 NTSTATUS vboxVidPnEnumPaths(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 1540 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 1899 NTSTATUS vboxVidPnEnumPaths(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 1541 1900 PFNVBOXVIDPNENUMPATHS pfnCallback, PVOID pContext) 1542 1901 { … … 1550 1909 Status = pVidPnTopologyInterface->pfnAcquireNextPathInfo(hVidPnTopology, pNewVidPnPresentPathInfo, &pNextVidPnPresentPathInfo); 1551 1910 1552 if (!pfnCallback( pDevExt, hDesiredVidPn, pVidPnInterface,hVidPnTopology, pVidPnTopologyInterface, pNewVidPnPresentPathInfo, pContext))1911 if (!pfnCallback(hVidPnTopology, pVidPnTopologyInterface, pNewVidPnPresentPathInfo, pContext)) 1553 1912 { 1554 1913 Assert(Status == STATUS_SUCCESS); … … 1725 2084 } 1726 2085 1727 DECLCALLBACK(BOOLEAN) vboxVidPnCommitPathEnum(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 1728 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 2086 DECLCALLBACK(BOOLEAN) vboxVidPnCommitPathEnum(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 1729 2087 const D3DKMDT_VIDPN_PRESENT_PATH *pVidPnPresentPathInfo, PVOID pContext) 1730 2088 { 1731 2089 NTSTATUS Status = STATUS_SUCCESS; 1732 2090 PVBOXVIDPNCOMMIT pCommitInfo = (PVBOXVIDPNCOMMIT)pContext; 2091 PDEVICE_EXTENSION pDevExt = pCommitInfo->pDevExt; 2092 const D3DKMDT_HVIDPN hDesiredVidPn = pCommitInfo->pCommitVidPnArg->hFunctionalVidPn; 2093 const DXGK_VIDPN_INTERFACE* pVidPnInterface = pCommitInfo->pVidPnInterface; 1733 2094 1734 2095 if (pCommitInfo->pCommitVidPnArg->AffectedVidPnSourceId == D3DDDI_ID_ALL … … 2139 2500 2140 2501 2141 static DECLCALLBACK(BOOLEAN) vboxVidPnDumpSourceModeSetEnum(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 2142 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 2502 static DECLCALLBACK(BOOLEAN) vboxVidPnDumpSourceModeSetEnum(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 2143 2503 const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, PVOID pContext) 2144 2504 { … … 2161 2521 { 2162 2522 2163 Status = vboxVidPnEnumSourceModes( pDevExt, hVidPn, pVidPnInterface,hCurVidPnSourceModeSet, pCurVidPnSourceModeSetInterface,2523 Status = vboxVidPnEnumSourceModes(hCurVidPnSourceModeSet, pCurVidPnSourceModeSetInterface, 2164 2524 vboxVidPnDumpSourceModeSetEnum, NULL); 2165 2525 Assert(Status == STATUS_SUCCESS); … … 2178 2538 } 2179 2539 2180 DECLCALLBACK(BOOLEAN) vboxVidPnDumpTargetModeSetEnum(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 2181 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface, 2540 DECLCALLBACK(BOOLEAN) vboxVidPnDumpTargetModeSetEnum(D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface, 2182 2541 const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, PVOID pContext) 2183 2542 { … … 2200 2559 { 2201 2560 2202 Status = vboxVidPnEnumTargetModes( pDevExt, hVidPn, pVidPnInterface,hCurVidPnTargetModeSet, pCurVidPnTargetModeSetInterface,2561 Status = vboxVidPnEnumTargetModes(hCurVidPnTargetModeSet, pCurVidPnTargetModeSetInterface, 2203 2562 vboxVidPnDumpTargetModeSetEnum, NULL); 2204 2563 Assert(Status == STATUS_SUCCESS); … … 2261 2620 } 2262 2621 2263 void vboxVidPnDumpPath(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 2264 const D3DKMDT_VIDPN_PRESENT_PATH *pVidPnPresentPathInfo) 2622 void vboxVidPnDumpPath(const D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, const D3DKMDT_VIDPN_PRESENT_PATH *pVidPnPresentPathInfo) 2265 2623 { 2266 2624 drprintf((" >>**** Start Dump VidPn Path ****>>\n")); … … 2285 2643 } 2286 2644 2287 static DECLCALLBACK(BOOLEAN) vboxVidPnDumpPathEnum(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 2288 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 2645 typedef struct VBOXVIDPNDUMPPATHENUM 2646 { 2647 D3DKMDT_HVIDPN hVidPn; 2648 const DXGK_VIDPN_INTERFACE* pVidPnInterface; 2649 } VBOXVIDPNDUMPPATHENUM, *PVBOXVIDPNDUMPPATHENUM; 2650 2651 static DECLCALLBACK(BOOLEAN) vboxVidPnDumpPathEnum(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 2289 2652 const D3DKMDT_VIDPN_PRESENT_PATH *pVidPnPresentPathInfo, PVOID pContext) 2290 2653 { 2291 vboxVidPnDumpPath(pDevExt, hVidPn, pVidPnInterface, pVidPnPresentPathInfo); 2654 PVBOXVIDPNDUMPPATHENUM pData = (PVBOXVIDPNDUMPPATHENUM)pContext; 2655 vboxVidPnDumpPath(pData->hVidPn, pData->pVidPnInterface, pVidPnPresentPathInfo); 2292 2656 2293 2657 pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pVidPnPresentPathInfo); … … 2299 2663 drprintf (("%s", pPrefix)); 2300 2664 2665 VBOXVIDPNDUMPPATHENUM CbData; 2666 CbData.hVidPn = hVidPn; 2667 CbData.pVidPnInterface = pVidPnInterface; 2301 2668 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology; 2302 2669 const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface; … … 2305 2672 if (Status == STATUS_SUCCESS) 2306 2673 { 2307 Status = vboxVidPnEnumPaths(pDevExt, hVidPn, pVidPnInterface, 2308 hVidPnTopology, pVidPnTopologyInterface, 2309 vboxVidPnDumpPathEnum, NULL); 2674 Status = vboxVidPnEnumPaths(hVidPnTopology, pVidPnTopologyInterface, 2675 vboxVidPnDumpPathEnum, &CbData); 2310 2676 Assert(Status == STATUS_SUCCESS); 2311 2677 } -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.h
r33983 r34018 41 41 { 42 42 NTSTATUS Status; 43 struct _DEVICE_EXTENSION* pDevExt; 44 const DXGK_VIDPN_INTERFACE* pVidPnInterface; 43 45 CONST DXGKARG_ENUMVIDPNCOFUNCMODALITY* pEnumCofuncModalityArg; 44 46 PVBOXWDDM_VIDEOMODES_INFO pInfos; … … 48 50 { 49 51 NTSTATUS Status; 52 struct _DEVICE_EXTENSION* pDevExt; 53 const DXGK_VIDPN_INTERFACE* pVidPnInterface; 50 54 CONST DXGKARG_COMMITVIDPN* pCommitVidPnArg; 51 55 } VBOXVIDPNCOMMIT, *PVBOXVIDPNCOMMIT; 52 56 53 57 /* !!!NOTE: The callback is responsible for releasing the path */ 54 typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMPATHS(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 55 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 58 typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMPATHS(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 56 59 const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo, PVOID pContext); 57 60 typedef FNVBOXVIDPNENUMPATHS *PFNVBOXVIDPNENUMPATHS; 58 61 59 62 /* !!!NOTE: The callback is responsible for releasing the source mode info */ 60 typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMSOURCEMODES(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 61 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 63 typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMSOURCEMODES(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 62 64 const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, PVOID pContext); 63 65 typedef FNVBOXVIDPNENUMSOURCEMODES *PFNVBOXVIDPNENUMSOURCEMODES; 64 66 65 67 /* !!!NOTE: The callback is responsible for releasing the target mode info */ 66 typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMTARGETMODES(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 67 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface, 68 typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMTARGETMODES(D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface, 68 69 const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, PVOID pContext); 69 70 typedef FNVBOXVIDPNENUMTARGETMODES *PFNVBOXVIDPNENUMTARGETMODES; … … 78 79 typedef FNVBOXVIDPNENUMTARGETSFORSOURCE *PFNVBOXVIDPNENUMTARGETSFORSOURCE; 79 80 80 DECLCALLBACK(BOOLEAN) vboxVidPnCofuncModalityPathEnum(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 81 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 81 DECLCALLBACK(BOOLEAN) vboxVidPnCofuncModalityPathEnum(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 82 82 const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo, PVOID pContext); 83 83 … … 90 90 const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, PVOID pContext); 91 91 92 DECLCALLBACK(BOOLEAN) vboxVidPnCommitPathEnum(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 93 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 92 DECLCALLBACK(BOOLEAN) vboxVidPnCommitPathEnum(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 94 93 const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo, PVOID pContext); 95 94 96 95 NTSTATUS vboxVidPnCommitSourceModeForSrcId(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, struct VBOXWDDM_ALLOCATION *pAllocation); 97 96 98 NTSTATUS vboxVidPnEnumPaths(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 99 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 97 NTSTATUS vboxVidPnEnumPaths(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 100 98 PFNVBOXVIDPNENUMPATHS pfnCallback, PVOID pContext); 101 99 102 NTSTATUS vboxVidPnEnumSourceModes(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 103 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 100 NTSTATUS vboxVidPnEnumSourceModes(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 104 101 PFNVBOXVIDPNENUMSOURCEMODES pfnCallback, PVOID pContext); 105 102 106 NTSTATUS vboxVidPnEnumTargetModes(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 107 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface, 103 NTSTATUS vboxVidPnEnumTargetModes(D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface, 108 104 PFNVBOXVIDPNENUMTARGETMODES pfnCallback, PVOID pContext); 109 105 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r33983 r34018 304 304 return VBOXWDDM_HGSMICMD_TYPE_CTL; 305 305 return VBOXWDDM_HGSMICMD_TYPE_UNDEFINED; 306 }307 308 309 D3DDDIFORMAT vboxWddmCalcPixelFormat(VIDEO_MODE_INFORMATION *pInfo)310 {311 switch (pInfo->BitsPerPlane)312 {313 case 32:314 if(!(pInfo->AttributeFlags & VIDEO_MODE_PALETTE_DRIVEN) && !(pInfo->AttributeFlags & VIDEO_MODE_MANAGED_PALETTE))315 {316 if (pInfo->RedMask == 0xFF0000 && pInfo->GreenMask == 0xFF00 && pInfo->BlueMask == 0xFF)317 return D3DDDIFMT_A8R8G8B8;318 drprintf((__FUNCTION__": unsupported format: bpp(%d), rmask(%d), gmask(%d), bmask(%d)\n", pInfo->BitsPerPlane, pInfo->RedMask, pInfo->GreenMask, pInfo->BlueMask));319 AssertBreakpoint();320 }321 else322 {323 drprintf((__FUNCTION__": unsupported AttributeFlags(0x%x)\n", pInfo->AttributeFlags));324 AssertBreakpoint();325 }326 break;327 case 24:328 if(!(pInfo->AttributeFlags & VIDEO_MODE_PALETTE_DRIVEN) && !(pInfo->AttributeFlags & VIDEO_MODE_MANAGED_PALETTE))329 {330 if (pInfo->RedMask == 0xFF0000 && pInfo->GreenMask == 0xFF00 && pInfo->BlueMask == 0xFF)331 return D3DDDIFMT_R8G8B8;332 drprintf((__FUNCTION__": unsupported format: bpp(%d), rmask(%d), gmask(%d), bmask(%d)\n", pInfo->BitsPerPlane, pInfo->RedMask, pInfo->GreenMask, pInfo->BlueMask));333 AssertBreakpoint();334 }335 else336 {337 drprintf((__FUNCTION__": unsupported AttributeFlags(0x%x)\n", pInfo->AttributeFlags));338 AssertBreakpoint();339 }340 break;341 case 16:342 if(!(pInfo->AttributeFlags & VIDEO_MODE_PALETTE_DRIVEN) && !(pInfo->AttributeFlags & VIDEO_MODE_MANAGED_PALETTE))343 {344 if (pInfo->RedMask == 0xF800 && pInfo->GreenMask == 0x7E0 && pInfo->BlueMask == 0x1F)345 return D3DDDIFMT_R5G6B5;346 drprintf((__FUNCTION__": unsupported format: bpp(%d), rmask(%d), gmask(%d), bmask(%d)\n", pInfo->BitsPerPlane, pInfo->RedMask, pInfo->GreenMask, pInfo->BlueMask));347 AssertBreakpoint();348 }349 else350 {351 drprintf((__FUNCTION__": unsupported AttributeFlags(0x%x)\n", pInfo->AttributeFlags));352 AssertBreakpoint();353 }354 break;355 case 8:356 if((pInfo->AttributeFlags & VIDEO_MODE_PALETTE_DRIVEN) && (pInfo->AttributeFlags & VIDEO_MODE_MANAGED_PALETTE))357 {358 return D3DDDIFMT_P8;359 }360 else361 {362 drprintf((__FUNCTION__": unsupported AttributeFlags(0x%x)\n", pInfo->AttributeFlags));363 AssertBreakpoint();364 }365 break;366 default:367 drprintf((__FUNCTION__": unsupported bpp(%d)\n", pInfo->BitsPerPlane));368 AssertBreakpoint();369 break;370 }371 372 return D3DDDIFMT_UNKNOWN;373 306 } 374 307 … … 3621 3554 if (Status == STATUS_SUCCESS) 3622 3555 { 3623 #ifdef DEBUG_misha3556 #ifdef VBOXWDDM_DEBUG_VIDPN 3624 3557 vboxVidPnDumpVidPn("\n>>>>IS SUPPORTED VidPN : >>>>\n", pContext, pIsSupportedVidPnArg->hDesiredVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n\n"); 3625 3558 #endif … … 3706 3639 pIsSupportedVidPnArg->IsVidPnSupported = bSupported; 3707 3640 3708 #ifdef DEBUG_misha3641 #ifdef VBOXWDDM_DEBUG_VIDPN 3709 3642 drprintf(("The Given VidPn is %ssupported", pIsSupportedVidPnArg->IsVidPnSupported ? "" : "!!NOT!! ")); 3710 3643 #endif … … 3740 3673 VIDEO_MODE_INFORMATION *pResModes = NULL; 3741 3674 uint32_t cResModes = 0; 3742 for (int i = commonFromDeviceExt(pDevExt)->cDisplays -1; i >= 0 ; --i)3675 for (int i = 0; i < commonFromDeviceExt(pDevExt)->cDisplays; ++i) 3743 3676 { 3744 3677 /* @todo: check that we actually need the current source->target */ … … 3759 3692 uint32_t cActualResModes; 3760 3693 3761 Status = vboxWddmGetModesForResolution(p DevExt, pInfo, &Resolution,3694 Status = vboxWddmGetModesForResolution(pInfo->aModes, pInfo->cModes, pInfo->iPreferredMode, &Resolution, 3762 3695 pResModes, cResModes, &cActualResModes, &iPreferableResMode); 3763 3696 Assert(Status == STATUS_SUCCESS || Status == STATUS_BUFFER_TOO_SMALL); … … 3777 3710 } 3778 3711 cResModes = cActualResModes; 3779 Status = vboxWddmGetModesForResolution(p DevExt, pInfo, &Resolution,3712 Status = vboxWddmGetModesForResolution(pInfo->aModes, pInfo->cModes, pInfo->iPreferredMode, &Resolution, 3780 3713 pResModes, cResModes, &cActualResModes, &iPreferableResMode); 3781 3714 Assert(Status == STATUS_SUCCESS); … … 3786 3719 break; 3787 3720 3788 Assert(iPreferableResMode > 0);3721 Assert(iPreferableResMode >= 0); 3789 3722 3790 3723 Status = vboxVidPnCreatePopulateVidPnFromLegacy(pDevExt, pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, pVidPnInterface, … … 3800 3733 } 3801 3734 3802 #ifdef DEBUG_misha 3735 if(pResModes) 3736 vboxWddmMemFree(pResModes); 3737 3738 #ifdef VBOXWDDM_DEBUG_VIDPN 3803 3739 vboxVidPnDumpVidPn("\n>>>>Recommended VidPN: >>>>\n", pDevExt, pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n\n"); 3804 3740 #endif … … 3829 3765 if (Status == STATUS_SUCCESS) 3830 3766 { 3831 #ifdef DEBUG_misha3767 #ifdef VBOXWDDM_DEBUG_VIDPN 3832 3768 vboxVidPnDumpCofuncModalityArg(">>>>MODALITY Args: ", pEnumCofuncModalityArg, "\n"); 3833 3769 vboxVidPnDumpVidPn(">>>>MODALITY VidPN (IN) : >>>>\n", pDevExt, pEnumCofuncModalityArg->hConstrainingVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n\n"); … … 3841 3777 { 3842 3778 VBOXVIDPNCOFUNCMODALITY CbContext = {0}; 3779 CbContext.pDevExt = pDevExt; 3780 CbContext.pVidPnInterface = pVidPnInterface; 3843 3781 CbContext.pEnumCofuncModalityArg = pEnumCofuncModalityArg; 3844 3782 CbContext.pInfos = vboxWddmGetAllVideoModesInfos(pDevExt); 3845 Status = vboxVidPnEnumPaths(pDevExt, pEnumCofuncModalityArg->hConstrainingVidPn, pVidPnInterface, 3846 hVidPnTopology, pVidPnTopologyInterface, 3783 Status = vboxVidPnEnumPaths(hVidPnTopology, pVidPnTopologyInterface, 3847 3784 vboxVidPnCofuncModalityPathEnum, &CbContext); 3848 3785 Assert(Status == STATUS_SUCCESS); … … 3860 3797 drprintf((__FUNCTION__ ": pfnGetTopology failed Status(0x%x)\n", Status)); 3861 3798 3862 #ifdef DEBUG_misha3799 #ifdef VBOXWDDM_DEBUG_VIDPN 3863 3800 vboxVidPnDumpVidPn("\n>>>>MODALITY VidPN (OUT) : >>>>\n", pDevExt, pEnumCofuncModalityArg->hConstrainingVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n\n"); 3864 3801 #endif … … 4052 3989 if (Status == STATUS_SUCCESS) 4053 3990 { 4054 #ifdef DEBUG_misha3991 #ifdef VBOXWDDM_DEBUG_VIDPN 4055 3992 vboxVidPnDumpVidPn("\n>>>>COMMIT VidPN: >>>>\n", pDevExt, pCommitVidPnArg->hFunctionalVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n\n"); 4056 3993 #endif … … 4080 4017 { 4081 4018 VBOXVIDPNCOMMIT CbContext = {0}; 4019 CbContext.pDevExt = pDevExt; 4020 CbContext.pVidPnInterface = pVidPnInterface; 4082 4021 CbContext.pCommitVidPnArg = pCommitVidPnArg; 4083 Status = vboxVidPnEnumPaths(pDevExt, pCommitVidPnArg->hFunctionalVidPn, pVidPnInterface, 4084 hVidPnTopology, pVidPnTopologyInterface, 4022 Status = vboxVidPnEnumPaths(hVidPnTopology, pVidPnTopologyInterface, 4085 4023 vboxVidPnCommitPathEnum, &CbContext); 4086 4024 Assert(Status == STATUS_SUCCESS); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h
r33868 r34018 14 14 15 15 #include "../VBoxVideo.h" 16 17 //#define VBOXWDDM_DEBUG_VIDPN 16 18 17 19 /* one page size */
Note:
See TracChangeset
for help on using the changeset viewer.