Changeset 26053 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm
- Timestamp:
- Jan 26, 2010 6:45:22 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.cpp
r26052 r26053 266 266 else 267 267 { 268 drprintf(("VBoxVideoWddm: pfnAcquireFirstModeInfo failed Status(0x%x)\n" ));268 drprintf(("VBoxVideoWddm: pfnAcquireFirstModeInfo failed Status(0x%x)\n", Status)); 269 269 } 270 270 … … 351 351 else 352 352 { 353 drprintf((__FUNCTION__": pfnAcquireFirstModeInfo failed Status(0x%x)\n" ));353 drprintf((__FUNCTION__": pfnAcquireFirstModeInfo failed Status(0x%x)\n", Status)); 354 354 } 355 355 … … 358 358 } 359 359 360 DECLCALLBACK(BOOLEAN) vboxVidPnAdjustSourcesTargetsCallback(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, 360 DECLCALLBACK(BOOLEAN) vboxVidPnCofuncModalitySourceModeEnum(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 361 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 362 const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, PVOID pContext) 363 { 364 NTSTATUS Status = STATUS_SUCCESS; 365 PVBOXVIDPNCMCONTEXT pCbContext = (PVBOXVIDPNCMCONTEXT)pContext; 366 pCbContext->Status = STATUS_SUCCESS; 367 368 pVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo); 369 370 pCbContext->Status = Status; 371 return Status == STATUS_SUCCESS; 372 373 } 374 375 DECLCALLBACK(BOOLEAN) vboxVidPnCofuncModalityTargetModeEnum(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 376 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface, 377 const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, PVOID pContext) 378 { 379 NTSTATUS Status = STATUS_SUCCESS; 380 PVBOXVIDPNCMCONTEXT pCbContext = (PVBOXVIDPNCMCONTEXT)pContext; 381 pCbContext->Status = STATUS_SUCCESS; 382 383 pVidPnTargetModeSetInterface->pfnReleaseModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo); 384 385 pCbContext->Status = Status; 386 return Status == STATUS_SUCCESS; 387 } 388 389 DECLCALLBACK(BOOLEAN) vboxVidPnCofuncModalityPathEnum(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 361 390 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 362 391 const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo, PVOID pContext) 363 392 { 393 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet; 394 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface; 395 PVBOXVIDPNCMCONTEXT pCbContext = (PVBOXVIDPNCMCONTEXT)pContext; 396 pCbContext->Status = STATUS_SUCCESS; 397 NTSTATUS Status = pVidPnInterface->pfnAcquireSourceModeSet(hDesiredVidPn, 398 pNewVidPnPresentPathInfo->VidPnSourceId, 399 &hNewVidPnSourceModeSet, 400 &pVidPnSourceModeSetInterface); 401 Assert(Status == STATUS_SUCCESS); 402 if (Status == STATUS_SUCCESS) 403 { 404 CONST D3DKMDT_VIDPN_SOURCE_MODE* pPinnedVidPnSourceModeInfo; 405 Status = pVidPnSourceModeSetInterface->pfnAcquirePinnedModeInfo(hNewVidPnSourceModeSet, &pPinnedVidPnSourceModeInfo); 406 Assert(Status == STATUS_SUCCESS); 407 if (Status == STATUS_SUCCESS) 408 { 409 if (pPinnedVidPnSourceModeInfo) 410 { 411 /* nothing to be done here, just release */ 412 pVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pPinnedVidPnSourceModeInfo); 413 } 414 else 415 { 416 /* no pinned mode set, do adjustment */ 417 Status = vboxVidPnEnumSourceModes(pDevExt, hDesiredVidPn, pVidPnInterface, 418 hNewVidPnSourceModeSet, pVidPnSourceModeSetInterface, 419 vboxVidPnCofuncModalitySourceModeEnum, pCbContext); 420 Assert(Status == STATUS_SUCCESS); 421 if (Status == STATUS_SUCCESS) 422 { 423 Status = pCbContext->Status; 424 Assert(Status == STATUS_SUCCESS); 425 if (Status != STATUS_SUCCESS) 426 drprintf((__FUNCTION__": vboxVidPnCofuncModalitySourceModeEnum failed Status(0x%x)\n", Status)); 427 } 428 else 429 drprintf((__FUNCTION__": vboxVidPnEnumSourceModes failed Status(0x%x)\n", Status)); 430 } 431 } 432 else 433 drprintf((__FUNCTION__": pfnAcquirePinnedModeInfo failed Status(0x%x)\n", Status)); 434 435 pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hNewVidPnSourceModeSet); 436 } 437 else 438 drprintf((__FUNCTION__": pfnAcquireSourceModeSet failed Status(0x%x)\n", Status)); 439 440 if (Status == STATUS_SUCCESS) 441 { 442 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet; 443 const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface; 444 Status = pVidPnInterface->pfnAcquireTargetModeSet(hDesiredVidPn, 445 pNewVidPnPresentPathInfo->VidPnTargetId, 446 &hNewVidPnTargetModeSet, 447 &pVidPnTargetModeSetInterface); 448 Assert(Status == STATUS_SUCCESS); 449 if (Status == STATUS_SUCCESS) 450 { 451 CONST D3DKMDT_VIDPN_TARGET_MODE* pPinnedVidPnTargetModeInfo; 452 Status = pVidPnTargetModeSetInterface->pfnAcquirePinnedModeInfo(hNewVidPnTargetModeSet, &pPinnedVidPnTargetModeInfo); 453 Assert(Status == STATUS_SUCCESS); 454 if (Status == STATUS_SUCCESS) 455 { 456 if (pPinnedVidPnTargetModeInfo) 457 { 458 /* nothing to be done here, just release */ 459 pVidPnTargetModeSetInterface->pfnReleaseModeInfo(hNewVidPnTargetModeSet, pPinnedVidPnTargetModeInfo); 460 } 461 else 462 { 463 /* no pinned mode set, do adjustment */ 464 Status = vboxVidPnEnumTargetModes(pDevExt, hDesiredVidPn, pVidPnInterface, 465 hNewVidPnTargetModeSet, pVidPnTargetModeSetInterface, 466 vboxVidPnCofuncModalityTargetModeEnum, pCbContext); 467 Assert(Status == STATUS_SUCCESS); 468 if (Status == STATUS_SUCCESS) 469 { 470 Status = pCbContext->Status; 471 Assert(Status == STATUS_SUCCESS); 472 if (Status != STATUS_SUCCESS) 473 drprintf((__FUNCTION__": vboxVidPnCofuncModalityTargetModeEnum failed Status(0x%x)\n", Status)); 474 } 475 else 476 drprintf((__FUNCTION__": vboxVidPnEnumTargetModes failed Status(0x%x)\n", Status)); 477 } 478 } 479 else 480 drprintf((__FUNCTION__": pfnAcquirePinnedModeInfo failed Status(0x%x)\n", Status)); 481 482 pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hNewVidPnTargetModeSet); 483 } 484 else 485 drprintf((__FUNCTION__": pfnAcquireTargetModeSet failed Status(0x%x)\n", Status)); 486 } 364 487 365 488 pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo); 366 return TRUE; 367 } 368 369 NTSTATUS vboxVidPnEnumPaths(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, 489 490 pCbContext->Status = Status; 491 return Status == STATUS_SUCCESS; 492 } 493 494 NTSTATUS vboxVidPnEnumSourceModes(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 495 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 496 PFNVBOXVIDPNENUMSOURCEMODES pfnCallback, PVOID pContext) 497 { 498 const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo; 499 NTSTATUS Status = pVidPnSourceModeSetInterface->pfnAcquireFirstModeInfo(hNewVidPnSourceModeSet, &pNewVidPnSourceModeInfo); 500 if (Status == STATUS_SUCCESS) 501 { 502 while (pNewVidPnSourceModeInfo) 503 { 504 const D3DKMDT_VIDPN_SOURCE_MODE *pNextVidPnSourceModeInfo; 505 Status = pVidPnSourceModeSetInterface->pfnAcquireNextModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo, &pNextVidPnSourceModeInfo); 506 if (!pfnCallback(pDevExt, hDesiredVidPn, pVidPnInterface, 507 hNewVidPnSourceModeSet, pVidPnSourceModeSetInterface, 508 pNewVidPnSourceModeInfo, pContext)) 509 { 510 Assert(Status == STATUS_SUCCESS); 511 if (Status == STATUS_SUCCESS) 512 pVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNextVidPnSourceModeInfo); 513 else 514 { 515 drprintf((__FUNCTION__": pfnAcquireNextModeInfo Failed Status(0x%x), ignored since callback returned false\n", Status)); 516 Status = STATUS_SUCCESS; 517 } 518 519 break; 520 } 521 else if (Status == STATUS_SUCCESS) 522 pNewVidPnSourceModeInfo = pNextVidPnSourceModeInfo; 523 else 524 { 525 AssertBreakpoint(); 526 drprintf((__FUNCTION__": pfnAcquireNextModeInfo Failed Status(0x%x)\n", Status)); 527 pNewVidPnSourceModeInfo = NULL; 528 break; 529 } 530 } 531 } 532 else 533 { 534 drprintf((__FUNCTION__": pfnAcquireFirstModeInfo failed Status(0x%x)\n", Status)); 535 } 536 537 return Status; 538 } 539 540 NTSTATUS vboxVidPnEnumTargetModes(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 541 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface, 542 PFNVBOXVIDPNENUMTARGETMODES pfnCallback, PVOID pContext) 543 { 544 const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo; 545 NTSTATUS Status = pVidPnTargetModeSetInterface->pfnAcquireFirstModeInfo(hNewVidPnTargetModeSet, &pNewVidPnTargetModeInfo); 546 if (Status == STATUS_SUCCESS) 547 { 548 while (pNewVidPnTargetModeInfo) 549 { 550 const D3DKMDT_VIDPN_TARGET_MODE *pNextVidPnTargetModeInfo; 551 Status = pVidPnTargetModeSetInterface->pfnAcquireNextModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo, &pNextVidPnTargetModeInfo); 552 if (!pfnCallback(pDevExt, hDesiredVidPn, pVidPnInterface, 553 hNewVidPnTargetModeSet, pVidPnTargetModeSetInterface, 554 pNewVidPnTargetModeInfo, pContext)) 555 { 556 Assert(Status == STATUS_SUCCESS); 557 if (Status == STATUS_SUCCESS) 558 pVidPnTargetModeSetInterface->pfnReleaseModeInfo(hNewVidPnTargetModeSet, pNextVidPnTargetModeInfo); 559 else 560 { 561 drprintf((__FUNCTION__": pfnAcquireNextModeInfo Failed Status(0x%x), ignored since callback returned false\n", Status)); 562 Status = STATUS_SUCCESS; 563 } 564 565 break; 566 } 567 else if (Status == STATUS_SUCCESS) 568 pNewVidPnTargetModeInfo = pNextVidPnTargetModeInfo; 569 else 570 { 571 AssertBreakpoint(); 572 drprintf((__FUNCTION__": pfnAcquireNextModeInfo Failed Status(0x%x)\n", Status)); 573 pNewVidPnTargetModeInfo = NULL; 574 break; 575 } 576 } 577 } 578 else 579 { 580 drprintf((__FUNCTION__": pfnAcquireFirstModeInfo failed Status(0x%x)\n", Status)); 581 } 582 583 return Status; 584 } 585 586 587 NTSTATUS vboxVidPnEnumPaths(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, 370 588 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 371 589 PFNVBOXVIDPNENUMPATHS pfnCallback, PVOID pContext) … … 380 598 Status = pVidPnTopologyInterface->pfnAcquireNextPathInfo(hVidPnTopology, pNewVidPnPresentPathInfo, &pNextVidPnPresentPathInfo); 381 599 382 if (!pfnCallback(pDevExt, hDesiredVidPn, hVidPnTopology, pVidPnTopologyInterface, pNewVidPnPresentPathInfo, pContext))600 if (!pfnCallback(pDevExt, hDesiredVidPn, pVidPnInterface, hVidPnTopology, pVidPnTopologyInterface, pNewVidPnPresentPathInfo, pContext)) 383 601 { 384 602 Assert(Status == STATUS_SUCCESS); 385 603 if (Status == STATUS_SUCCESS) 386 {387 604 pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNextVidPnPresentPathInfo); 388 }389 605 else 390 606 { 391 607 drprintf((__FUNCTION__": pfnAcquireNextPathInfo Failed Status(0x%x), ignored since callback returned false\n", Status)); 608 Status = STATUS_SUCCESS; 392 609 } 393 610 … … 395 612 } 396 613 else if (Status == STATUS_SUCCESS) 397 {398 614 pNewVidPnPresentPathInfo = pNextVidPnPresentPathInfo; 399 }400 615 else 401 616 { -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r26052 r26053 891 891 if (Status == STATUS_SUCCESS) 892 892 { 893 Status = vboxVidPnEnumPaths(pContext, pEnumCofuncModalityArg->hConstrainingVidPn, 893 VBOXVIDPNCMCONTEXT CbContext = {0}; 894 CbContext.pEnumCofuncModalityArg = pEnumCofuncModalityArg; 895 Status = vboxVidPnEnumPaths(pContext, pEnumCofuncModalityArg->hConstrainingVidPn, pVidPnInterface, 894 896 hVidPnTopology, pVidPnTopologyInterface, 895 vboxVidPn AdjustSourcesTargetsCallback, (PVOID)pEnumCofuncModalityArg);897 vboxVidPnCofuncModalityPathEnum, &CbContext); 896 898 Assert(Status == STATUS_SUCCESS); 897 if (Status != STATUS_SUCCESS) 898 drprintf((__FUNCTION__ ": vboxVidPnEnumPaths failed Status(0x%x)\n")); 899 if (Status == STATUS_SUCCESS) 900 { 901 Status = CbContext.Status; 902 Assert(Status == STATUS_SUCCESS); 903 if (Status != STATUS_SUCCESS) 904 drprintf((__FUNCTION__ ": vboxVidPnAdjustSourcesTargetsCallback failed Status(0x%x)\n", Status)); 905 } 906 else 907 drprintf((__FUNCTION__ ": vboxVidPnEnumPaths failed Status(0x%x)\n", Status)); 899 908 } 900 909 else 901 drprintf((__FUNCTION__ ": pfnGetTopology failed Status(0x%x)\n" ));910 drprintf((__FUNCTION__ ": pfnGetTopology failed Status(0x%x)\n", Status)); 902 911 } 903 912 else 904 drprintf((__FUNCTION__ ": DxgkCbQueryVidPnInterface failed Status(0x%x)\n" ));913 drprintf((__FUNCTION__ ": DxgkCbQueryVidPnInterface failed Status(0x%x)\n", Status)); 905 914 906 915 dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter));
Note:
See TracChangeset
for help on using the changeset viewer.