Changeset 26138 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Feb 1, 2010 11:56:14 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 57140
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r26053 r26138 114 114 typedef PEVENT VBOXVCMNEVENT, *PVBOXVCMNEVENT; 115 115 #else 116 #include <VBox/VBoxVideo.h> 117 116 118 typedef KSPIN_LOCK VBOXVCMNSPIN_LOCK, *PVBOXVCMNSPIN_LOCK; 117 119 typedef KIRQL VBOXVCMNIRQL, *PVBOXVCMNIRQL; 118 120 119 121 typedef KEVENT VBOXVCMNEVENT, *PVBOXVCMNEVENT; 122 123 typedef enum 124 { 125 VBOXWDDM_CMD_UNEFINED = 0, 126 VBOXWDDM_CMD_DMA_TRANSFER 127 } VBOXWDDM_CMD_TYPE; 128 129 typedef struct VBOXWDDM_SOURCE 130 { 131 HGSMIHEAP hgsmiDisplayHeap; 132 // VBVABUFFER *pVBVA; /* Pointer to the pjScreen + layout->offVBVABuffer. NULL if VBVA is not enabled. */ 133 } VBOXWDDM_SOURCE, *PVBOXWDDM_SOURCE; 134 135 typedef enum 136 { 137 VBOXWDDM_ALLOC_UNEFINED = 0, 138 VBOXWDDM_ALLOC_STD_SHAREDPRIMARYSURFACE, 139 VBOXWDDM_ALLOC_STD_SHADOWSURFACE, 140 VBOXWDDM_ALLOC_STD_STAGINGSURFACE, 141 /* this one is win 7-specific and hence unused for now */ 142 VBOXWDDM_ALLOC_STD_GDISURFACE 143 /* custom allocation types requested from user-mode d3d module will go here */ 144 } VBOXWDDM_ALLOC_TYPE; 145 146 typedef struct VBOXWDDM_ALLOCINFO 147 { 148 VBOXWDDM_ALLOC_TYPE enmType; 149 char Body[1]; 150 } VBOXWDDM_ALLOCINFO, *PVBOXWDDM_ALLOCINFO; 151 152 #define VBOXWDDM_ALLOCINFO_HEADSIZE() (RT_OFFSETOF(VBOXWDDM_ALLOCINFO, Body)) 153 #define VBOXWDDM_ALLOCINFO_SIZE_FROMBODYSIZE(_s) (VBOXWDDM_ALLOCINFO_HEADSIZE() + (_s)) 154 #define VBOXWDDM_ALLOCINFO_SIZE(_tCmd) (VBOXWDDM_ALLOCINFO_SIZE_FROMBODYSIZE(sizeof(_tCmd))) 155 #define VBOXWDDM_ALLOCINFO_BODY(_p, _t) ((_t*)(_p)->Body) 156 #define VBOXWDDM_ALLOCINFO_HEAD(_pb) ((VBOXWDDM_ALLOCINFO*)((uint8_t *)(_pb) - RT_OFFSETOF(VBOXWDDM_ALLOCINFO, Body))) 157 158 typedef struct VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE 159 { 160 D3DKMDT_SHAREDPRIMARYSURFACEDATA SurfData; 161 } VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE, *PVBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE; 162 163 typedef struct VBOXWDDM_ALLOCINFO_SHADOWSURFACE 164 { 165 D3DKMDT_SHADOWSURFACEDATA SurfData; 166 } VBOXWDDM_ALLOCINFO_SHADOWSURFACE, *PVBOXWDDM_ALLOCINFO_SHADOWSURFACE; 167 168 typedef struct VBOXWDDM_ALLOCINFO_STAGINGSURFACE 169 { 170 D3DKMDT_STAGINGSURFACEDATA SurfData; 171 } VBOXWDDM_ALLOCINFO_STAGINGSURFACE, *PVBOXWDDM_ALLOCINFO_STAGINGSURFACE; 172 173 /* allocation */ 174 typedef struct VBOXWDDM_ALLOCATION 175 { 176 VBOXWDDM_ALLOC_TYPE enmType; 177 char Body[1]; 178 } VBOXWDDM_ALLOCATION, *PVBOXWDDM_ALLOCATION; 179 180 #define VBOXWDDM_ALLOCATION_HEADSIZE() (RT_OFFSETOF(VBOXWDDM_ALLOCATION, Body)) 181 #define VBOXWDDM_ALLOCATION_SIZE_FROMBODYSIZE(_s) (VBOXWDDM_ALLOCATION_HEADSIZE() + (_s)) 182 #define VBOXWDDM_ALLOCATION_SIZE(_tCmd) (VBOXWDDM_ALLOCATION_SIZE_FROMBODYSIZE(sizeof(_tCmd))) 183 #define VBOXWDDM_ALLOCATION_BODY(_p, _t) ((_t*)(_p)->Body) 184 #define VBOXWDDM_ALLOCATION_HEAD(_pb) ((VBOXWDDM_ALLOCATION*)((uint8_t *)(_pb) - RT_OFFSETOF(VBOXWDDM_ALLOCATION, Body))) 185 186 typedef struct VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE 187 { 188 VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE AllocInfo; 189 } VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE, *PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE; 190 191 typedef struct VBOXWDDM_ALLOCATION_SHADOWSURFACE 192 { 193 VBOXWDDM_ALLOCINFO_SHADOWSURFACE AllocInfo; 194 } VBOXWDDM_ALLOCATION_SHADOWSURFACE, *PVBOXWDDM_ALLOCATION_SHADOWSURFACE; 195 196 typedef struct VBOXWDDM_ALLOCATION_STAGINGSURFACE 197 { 198 VBOXWDDM_ALLOCINFO_STAGINGSURFACE AllocInfo; 199 } VBOXWDDM_ALLOCATION_STAGINGSURFACE, *PVBOXWDDM_ALLOCATION_STAGINGSURFACE; 200 201 202 typedef struct VBOXWDDM_DEVICE 203 { 204 HANDLE hDevice; /* the handle that the driver should use when it calls back into the Microsoft DirectX graphics kernel subsystem */ 205 struct _DEVICE_EXTENSION * pAdapter; /* Adapder info */ 206 DXGK_CREATEDEVICEFLAGS fCreationFlags; /* device creation flags passed to DxgkDdiCreateDevice, not sure we need it */ 207 DXGK_DEVICEINFO DeviceInfo; 208 } VBOXWDDM_DEVICE, *PVBOXWDDM_DEVICE; 209 120 210 #endif 121 211 … … 217 307 HGSMIAREA areaDisplay; /* Entire VRAM chunk for this display device. */ 218 308 #endif /* VBOX_WITH_HGSMI */ 309 310 #ifdef VBOXWDDM 311 ULONG cSources; 312 /* currently we define the array for the max possible size since we do not know 313 * the monitor count at the DxgkDdiAddDevice, 314 * i.e. we obtain the monitor count in DxgkDdiStartDevice due to implementation of the currently re-used XPDM functionality 315 * 316 * @todo: use the dynamic array size calculated at DxgkDdiAddDevice 317 * */ 318 VBOXWDDM_SOURCE aSources[VBOX_VIDEO_MAX_SCREENS]; 319 #endif 219 320 } DEVICE_EXTENSION, *PDEVICE_EXTENSION; 220 321 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r26077 r26138 38 38 { 39 39 ExFreePool(pvMem); 40 } 41 42 UINT vboxWddmCalcBitsPerPixel(D3DDDIFORMAT format) 43 { 44 switch (format) 45 { 46 case D3DDDIFMT_R8G8B8: 47 return 24; 48 case D3DDDIFMT_A8R8G8B8: 49 case D3DDDIFMT_X8R8G8B8: 50 return 32; 51 case D3DDDIFMT_R5G6B5: 52 case D3DDDIFMT_X1R5G5B5: 53 case D3DDDIFMT_A1R5G5B5: 54 case D3DDDIFMT_A4R4G4B4: 55 return 16; 56 case D3DDDIFMT_R3G3B2: 57 case D3DDDIFMT_A8: 58 return 8; 59 case D3DDDIFMT_A8R3G3B2: 60 case D3DDDIFMT_X4R4G4B4: 61 return 16; 62 case D3DDDIFMT_A2B10G10R10: 63 case D3DDDIFMT_A8B8G8R8: 64 case D3DDDIFMT_X8B8G8R8: 65 case D3DDDIFMT_G16R16: 66 case D3DDDIFMT_A2R10G10B10: 67 return 32; 68 case D3DDDIFMT_A16B16G16R16: 69 return 64; 70 default: 71 AssertBreakpoint(); 72 return 0; 73 } 74 } 75 76 UINT vboxWddmCalcPitch(UINT w, UINT bitsPerPixel) 77 { 78 UINT Pitch = bitsPerPixel * w; 79 /* pitch is now in bits, translate in bytes */ 80 if(Pitch & 7) 81 Pitch = (Pitch >> 3) + 1; 82 else 83 Pitch = (Pitch >> 3); 84 85 return Pitch; 40 86 } 41 87 … … 125 171 NTSTATUS Status = STATUS_UNSUCCESSFUL; 126 172 127 PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)vboxWddmMemAllocZero(sizeof (DEVICE_EXTENSION));173 PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)vboxWddmMemAllocZero(sizeof (DEVICE_EXTENSION)); 128 174 if (pContext) 129 175 { … … 166 212 167 213 /* Save DeviceHandle and function pointers supplied by the DXGKRNL_INTERFACE structure passed to DxgkInterface. */ 168 memcpy(&pContext->u.primary.DxgkInterface, DxgkInterface, sizeof (DXGKRNL_INTERFACE));214 memcpy(&pContext->u.primary.DxgkInterface, DxgkInterface, sizeof (DXGKRNL_INTERFACE)); 169 215 170 216 /* Allocate a DXGK_DEVICE_INFO structure, and call DxgkCbGetDeviceInformation to fill in the members of that structure, which include the registry path, the PDO, and a list of translated resources for the display adapter represented by MiniportDeviceContext. Save selected members (ones that the display miniport driver will need later) … … 478 524 pQsOut->pSegmentDescriptor->CpuTranslatedAddress.QuadPart = VBE_DISPI_LFB_PHYSICAL_ADDRESS; 479 525 /* make sure the size is page aligned */ 526 /* @todo: need to setup VBVA buffers and adjust the mem size here */ 480 527 pQsOut->pSegmentDescriptor->Size = (pContext->u.primary.cbVRAM - VBVA_ADAPTER_INFORMATION_SIZE - pContext->u.primary.cbMiniportHeap) & (~0xfffUL); 481 528 pQsOut->pSegmentDescriptor->NbOfBanks = 0; … … 492 539 case DXGKQAITYPE_UMDRIVERPRIVATE: 493 540 drprintf((__FUNCTION__ ": we do not support DXGKQAITYPE_UMDRIVERPRIVATE\n")); 541 AssertBreakpoint(); 494 542 Status = STATUS_NOT_SUPPORTED; 495 543 break; 496 544 default: 497 545 drprintf((__FUNCTION__ ": unsupported Type (%d)\n", pQueryAdapterInfo->Type)); 546 AssertBreakpoint(); 498 547 Status = STATUS_NOT_SUPPORTED; 499 548 break; … … 507 556 DXGKARG_CREATEDEVICE* pCreateDevice) 508 557 { 509 return STATUS_NOT_IMPLEMENTED; 558 /* DxgkDdiCreateDevice should be made pageable. */ 559 PAGED_CODE(); 560 561 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 562 NTSTATUS Status = STATUS_SUCCESS; 563 PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter; 564 565 PVBOXWDDM_DEVICE pDevice = (PVBOXWDDM_DEVICE)vboxWddmMemAllocZero(sizeof (VBOXWDDM_DEVICE)); 566 pDevice->hDevice = pCreateDevice->hDevice; 567 pDevice->pAdapter = pContext; 568 pDevice->fCreationFlags = pCreateDevice->Flags; 569 570 pDevice->DeviceInfo.AllocationListSize = 1024; 571 pDevice->DeviceInfo.DmaBufferSegmentSet = 0; 572 pDevice->DeviceInfo.DmaBufferPrivateDataSize = 0; 573 pDevice->DeviceInfo.AllocationListSize = 4; 574 pDevice->DeviceInfo.PatchLocationListSize = 4; 575 pDevice->DeviceInfo.Flags.Value = 0; 576 pDevice->DeviceInfo.Flags.GuaranteedDmaBufferContract = 1; 577 578 pCreateDevice->pInfo = &pDevice->DeviceInfo; 579 pCreateDevice->hDevice = pDevice; 580 581 dfprintf(("<== "__FUNCTION__ ", context(0x%x), Status(0x%x)\n", hAdapter, Status)); 582 583 return Status; 584 } 585 NTSTATUS vboxWddmDestroyAllocation(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ALLOCATION pAllocation) 586 { 587 PAGED_CODE(); 588 589 vboxWddmMemFree(pAllocation); 590 return STATUS_SUCCESS; 591 } 592 593 NTSTATUS vboxWddmCreateAllocation(PDEVICE_EXTENSION pDevExt, DXGK_ALLOCATIONINFO* pAllocationInfo) 594 { 595 PAGED_CODE(); 596 597 NTSTATUS Status = STATUS_SUCCESS; 598 599 Assert(pAllocationInfo->PrivateDriverDataSize >= VBOXWDDM_ALLOCINFO_HEADSIZE()); 600 if (pAllocationInfo->PrivateDriverDataSize >= VBOXWDDM_ALLOCINFO_HEADSIZE()) 601 { 602 PVBOXWDDM_ALLOCINFO pAllocInfo = (PVBOXWDDM_ALLOCINFO)pAllocationInfo->pPrivateDriverData; 603 switch (pAllocInfo->enmType) 604 { 605 case VBOXWDDM_ALLOC_STD_SHAREDPRIMARYSURFACE: 606 { 607 Assert(pAllocationInfo->PrivateDriverDataSize >= VBOXWDDM_ALLOCINFO_SIZE(VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE)); 608 if (pAllocationInfo->PrivateDriverDataSize >= VBOXWDDM_ALLOCINFO_SIZE(VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE)) 609 { 610 PVBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE pInfo = VBOXWDDM_ALLOCINFO_BODY(pAllocInfo, VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE); 611 UINT bpp = vboxWddmCalcBitsPerPixel(pInfo->SurfData.Format); 612 Assert(bpp); 613 if (bpp != 0) 614 { 615 PVBOXWDDM_ALLOCATION pAllocation = (PVBOXWDDM_ALLOCATION)vboxWddmMemAllocZero(VBOXWDDM_ALLOCATION_SIZE(VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE)); 616 Assert(pAllocation); 617 if (pAllocation) 618 { 619 UINT Pitch = vboxWddmCalcPitch(pInfo->SurfData.Width, bpp); 620 pAllocation->enmType = VBOXWDDM_ALLOC_STD_SHAREDPRIMARYSURFACE; 621 PVBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE pAlloc = VBOXWDDM_ALLOCATION_BODY(pAllocInfo, VBOXWDDM_ALLOCATION_SHAREDPRIMARYSURFACE); 622 memcpy(&pAlloc->AllocInfo, pInfo, sizeof (pAlloc->AllocInfo)); 623 624 pAllocationInfo->pPrivateDriverData = NULL; 625 pAllocationInfo->PrivateDriverDataSize = 0; 626 pAllocationInfo->Alignment = 0; 627 pAllocationInfo->Size = Pitch * pInfo->SurfData.Height; 628 pAllocationInfo->PitchAlignedSize = 0; 629 pAllocationInfo->HintedBank.Value = 0; 630 pAllocationInfo->PreferredSegment.Value = 0; 631 pAllocationInfo->SupportedReadSegmentSet = 1; 632 pAllocationInfo->SupportedWriteSegmentSet = 1; 633 pAllocationInfo->EvictionSegmentSet = 0; 634 pAllocationInfo->MaximumRenamingListLength = 0; 635 pAllocationInfo->hAllocation = pAlloc; 636 pAllocationInfo->Flags.Value = 0; 637 pAllocationInfo->Flags.CpuVisible = 1; 638 pAllocationInfo->pAllocationUsageHint = NULL; 639 pAllocationInfo->AllocationPriority = D3DDDI_ALLOCATIONPRIORITY_NORMAL; 640 } 641 else 642 { 643 drprintf((__FUNCTION__ ": ERROR: failed to create allocation description\n")); 644 Status = STATUS_NO_MEMORY; 645 } 646 } 647 else 648 { 649 drprintf((__FUNCTION__ ": Invalid format (%d)\n", pInfo->SurfData.Format)); 650 Status = STATUS_INVALID_PARAMETER; 651 } 652 } 653 else 654 { 655 drprintf((__FUNCTION__ ": ERROR: PrivateDriverDataSize(%d) less than VBOXWDDM_ALLOC_STD_SHAREDPRIMARYSURFACE cmd size(%d)\n", pAllocationInfo->PrivateDriverDataSize, VBOXWDDM_ALLOCINFO_SIZE(VBOXWDDM_ALLOCINFO_SHADOWSURFACE))); 656 Status = STATUS_INVALID_PARAMETER; 657 } 658 break; 659 } 660 case VBOXWDDM_ALLOC_STD_SHADOWSURFACE: 661 { 662 Assert(pAllocationInfo->PrivateDriverDataSize >= VBOXWDDM_ALLOCINFO_SIZE(VBOXWDDM_ALLOCINFO_SHADOWSURFACE)); 663 if (pAllocationInfo->PrivateDriverDataSize >= VBOXWDDM_ALLOCINFO_SIZE(VBOXWDDM_ALLOCINFO_SHADOWSURFACE)) 664 { 665 PVBOXWDDM_ALLOCATION pAllocation = (PVBOXWDDM_ALLOCATION)vboxWddmMemAllocZero(VBOXWDDM_ALLOCATION_SIZE(VBOXWDDM_ALLOCATION_SHADOWSURFACE)); 666 Assert(pAllocation); 667 if (pAllocation) 668 { 669 pAllocation->enmType = VBOXWDDM_ALLOC_STD_SHADOWSURFACE; 670 PVBOXWDDM_ALLOCATION_SHADOWSURFACE pAlloc = VBOXWDDM_ALLOCATION_BODY(pAllocInfo, VBOXWDDM_ALLOCATION_SHADOWSURFACE); 671 PVBOXWDDM_ALLOCINFO_SHADOWSURFACE pInfo = VBOXWDDM_ALLOCINFO_BODY(pAllocInfo, VBOXWDDM_ALLOCINFO_SHADOWSURFACE); 672 memcpy(&pAlloc->AllocInfo, pInfo, sizeof (pAlloc->AllocInfo)); 673 674 pAllocationInfo->pPrivateDriverData = NULL; 675 pAllocationInfo->PrivateDriverDataSize = 0; 676 pAllocationInfo->Alignment = 0; 677 pAllocationInfo->Size = pInfo->SurfData.Pitch * pInfo->SurfData.Height; 678 pAllocationInfo->PitchAlignedSize = 0; 679 pAllocationInfo->HintedBank.Value = 0; 680 pAllocationInfo->PreferredSegment.Value = 0; 681 pAllocationInfo->SupportedReadSegmentSet = 1; 682 pAllocationInfo->SupportedWriteSegmentSet = 1; 683 pAllocationInfo->EvictionSegmentSet = 0; 684 pAllocationInfo->MaximumRenamingListLength = 0; 685 pAllocationInfo->hAllocation = pAlloc; 686 pAllocationInfo->Flags.Value = 0; 687 pAllocationInfo->Flags.CpuVisible = 1; 688 pAllocationInfo->pAllocationUsageHint = NULL; 689 pAllocationInfo->AllocationPriority = D3DDDI_ALLOCATIONPRIORITY_NORMAL; 690 } 691 else 692 { 693 drprintf((__FUNCTION__ ": ERROR: failed to create allocation description\n")); 694 Status = STATUS_NO_MEMORY; 695 } 696 } 697 else 698 { 699 drprintf((__FUNCTION__ ": ERROR: PrivateDriverDataSize(%d) less than VBOXWDDM_ALLOC_STD_SHADOWSURFACE cmd size(%d)\n", pAllocationInfo->PrivateDriverDataSize, VBOXWDDM_ALLOCINFO_SIZE(VBOXWDDM_ALLOCINFO_SHADOWSURFACE))); 700 Status = STATUS_INVALID_PARAMETER; 701 } 702 break; 703 } 704 case VBOXWDDM_ALLOC_STD_STAGINGSURFACE: 705 { 706 /* @todo: impl */ 707 AssertBreakpoint(); 708 break; 709 } 710 default: 711 drprintf((__FUNCTION__ ": ERROR: invalid alloc info type(%d)\n", pAllocInfo->enmType)); 712 Status = STATUS_INVALID_PARAMETER; 713 break; 714 } 715 } 716 else 717 { 718 drprintf((__FUNCTION__ ": ERROR: PrivateDriverDataSize(%d) less than header size(%d)\n", pAllocationInfo->PrivateDriverDataSize, VBOXWDDM_ALLOCINFO_HEADSIZE())); 719 Status = STATUS_INVALID_PARAMETER; 720 } 721 722 return Status; 510 723 } 511 724 … … 514 727 DXGKARG_CREATEALLOCATION* pCreateAllocation) 515 728 { 516 return STATUS_NOT_IMPLEMENTED; 729 /* DxgkDdiCreateAllocation should be made pageable. */ 730 PAGED_CODE(); 731 732 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 733 734 NTSTATUS Status = STATUS_SUCCESS; 735 736 for (UINT i = 0; i < pCreateAllocation->NumAllocations; ++i) 737 { 738 Status = vboxWddmCreateAllocation((PDEVICE_EXTENSION)hAdapter, &pCreateAllocation->pAllocationInfo[i]); 739 Assert(Status == STATUS_SUCCESS); 740 if (Status != STATUS_SUCCESS) 741 { 742 drprintf((__FUNCTION__ ": ERROR: vboxWddmCreateAllocation error (0x%x)\n", Status)); 743 /* note: i-th allocation is expected to be cleared in a fail handling code above */ 744 for (UINT j = 0; j < i; ++j) 745 { 746 vboxWddmDestroyAllocation((PDEVICE_EXTENSION)hAdapter, (PVBOXWDDM_ALLOCATION)pCreateAllocation->pAllocationInfo[j].hAllocation); 747 } 748 } 749 } 750 751 dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter)); 752 753 return Status; 517 754 } 518 755 … … 523 760 CONST DXGKARG_DESTROYALLOCATION* pDestroyAllocation) 524 761 { 525 return STATUS_NOT_IMPLEMENTED; 762 /* DxgkDdiDestroyAllocation should be made pageable. */ 763 PAGED_CODE(); 764 765 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 766 NTSTATUS Status = STATUS_SUCCESS; 767 768 for (UINT i = 0; i < pDestroyAllocation->NumAllocations; ++i) 769 { 770 vboxWddmDestroyAllocation((PDEVICE_EXTENSION)hAdapter, (PVBOXWDDM_ALLOCATION)pDestroyAllocation->pAllocationList[i]); 771 } 772 773 dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter)); 774 775 return Status; 526 776 } 527 777 … … 542 792 DXGKARG_GETSTANDARDALLOCATIONDRIVERDATA* pGetStandardAllocationDriverData) 543 793 { 544 return STATUS_NOT_IMPLEMENTED; 794 /* DxgkDdiGetStandardAllocationDriverData should be made pageable. */ 795 PAGED_CODE(); 796 797 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); 798 799 NTSTATUS Status = STATUS_SUCCESS; 800 PVBOXWDDM_ALLOCINFO pAllocInfo = NULL; 801 802 switch (pGetStandardAllocationDriverData->StandardAllocationType) 803 { 804 case D3DKMDT_STANDARDALLOCATION_SHAREDPRIMARYSURFACE: 805 { 806 dfprintf((__FUNCTION__ ": D3DKMDT_STANDARDALLOCATION_SHAREDPRIMARYSURFACE\n")); 807 if(pGetStandardAllocationDriverData->pAllocationPrivateDriverData) 808 { 809 pAllocInfo = (PVBOXWDDM_ALLOCINFO)pGetStandardAllocationDriverData->pAllocationPrivateDriverData; 810 pAllocInfo->enmType = VBOXWDDM_ALLOC_STD_SHAREDPRIMARYSURFACE; 811 PVBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE pInfo = VBOXWDDM_ALLOCINFO_BODY(pAllocInfo, VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE); 812 memcpy(&pInfo->SurfData, pGetStandardAllocationDriverData->pCreateSharedPrimarySurfaceData, sizeof (pInfo->SurfData)); 813 } 814 pGetStandardAllocationDriverData->AllocationPrivateDriverDataSize = VBOXWDDM_ALLOCINFO_SIZE(VBOXWDDM_ALLOCINFO_SHAREDPRIMARYSURFACE); 815 816 pGetStandardAllocationDriverData->ResourcePrivateDriverDataSize = 0; 817 break; 818 } 819 case D3DKMDT_STANDARDALLOCATION_SHADOWSURFACE: 820 { 821 dfprintf((__FUNCTION__ ": D3DKMDT_STANDARDALLOCATION_SHADOWSURFACE\n")); 822 UINT bpp = vboxWddmCalcBitsPerPixel(pGetStandardAllocationDriverData->pCreateShadowSurfaceData->Format); 823 Assert(bpp); 824 if (bpp != 0) 825 { 826 UINT Pitch = vboxWddmCalcPitch(pGetStandardAllocationDriverData->pCreateShadowSurfaceData->Width, bpp); 827 pGetStandardAllocationDriverData->pCreateShadowSurfaceData->Pitch = Pitch; 828 829 /* @todo: need [d/q]word align?? */ 830 831 if (pGetStandardAllocationDriverData->pAllocationPrivateDriverData) 832 { 833 pAllocInfo = (PVBOXWDDM_ALLOCINFO)pGetStandardAllocationDriverData->pAllocationPrivateDriverData; 834 pAllocInfo->enmType = VBOXWDDM_ALLOC_STD_SHADOWSURFACE; 835 PVBOXWDDM_ALLOCINFO_SHADOWSURFACE pInfo = VBOXWDDM_ALLOCINFO_BODY(pAllocInfo, VBOXWDDM_ALLOCINFO_SHADOWSURFACE); 836 memcpy(&pInfo->SurfData, pGetStandardAllocationDriverData->pCreateShadowSurfaceData, sizeof (pInfo->SurfData)); 837 } 838 pGetStandardAllocationDriverData->AllocationPrivateDriverDataSize = VBOXWDDM_ALLOCINFO_SIZE(VBOXWDDM_ALLOCINFO_SHADOWSURFACE); 839 840 pGetStandardAllocationDriverData->ResourcePrivateDriverDataSize = 0; 841 } 842 else 843 { 844 drprintf((__FUNCTION__ ": Invalid format (%d)\n", pGetStandardAllocationDriverData->pCreateShadowSurfaceData->Format)); 845 Status = STATUS_INVALID_PARAMETER; 846 } 847 break; 848 } 849 case D3DKMDT_STANDARDALLOCATION_STAGINGSURFACE: 850 { 851 dfprintf((__FUNCTION__ ": D3DKMDT_STANDARDALLOCATION_STAGINGSURFACE\n")); 852 if(pGetStandardAllocationDriverData->pAllocationPrivateDriverData) 853 { 854 pAllocInfo = (PVBOXWDDM_ALLOCINFO)pGetStandardAllocationDriverData->pAllocationPrivateDriverData; 855 pAllocInfo->enmType = VBOXWDDM_ALLOC_STD_STAGINGSURFACE; 856 PVBOXWDDM_ALLOCINFO_STAGINGSURFACE pInfo = VBOXWDDM_ALLOCINFO_BODY(pAllocInfo, VBOXWDDM_ALLOCINFO_STAGINGSURFACE); 857 memcpy(&pInfo->SurfData, pGetStandardAllocationDriverData->pCreateStagingSurfaceData, sizeof (pInfo->SurfData)); 858 } 859 pGetStandardAllocationDriverData->AllocationPrivateDriverDataSize = VBOXWDDM_ALLOCINFO_SIZE(VBOXWDDM_ALLOCINFO_STAGINGSURFACE); 860 861 pGetStandardAllocationDriverData->ResourcePrivateDriverDataSize = 0; 862 break; 863 } 864 //#if (DXGKDDI_INTERFACE_VERSION >= DXGKDDI_INTERFACE_VERSION_WIN7) 865 // case D3DKMDT_STANDARDALLOCATION_GDISURFACE: 866 // break; 867 //#endif 868 default: 869 drprintf((__FUNCTION__ ": Invalid allocation type (%d)\n", pGetStandardAllocationDriverData->StandardAllocationType)); 870 Status = STATUS_INVALID_PARAMETER; 871 break; 872 } 873 874 dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter)); 875 876 return Status; 545 877 } 546 878 … … 800 1132 pNewVidPnPresentPathInfo->ContentTransformation.Scaling = D3DKMDT_VPPS_IDENTITY; 801 1133 memset(&pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport, 802 0, sizeof (pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport));1134 0, sizeof (pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport)); 803 1135 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Identity = 1; 804 1136 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Centered = 1; … … 821 1153 pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType = D3DKMDT_VPPMT_NOPROTECTION; 822 1154 pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits = 0; 823 memset(&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, 0, sizeof (pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport));1155 memset(&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, 0, sizeof (pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport)); 824 1156 pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport.NoProtection = 1; 825 1157 pNewVidPnPresentPathInfo->GammaRamp.Type = D3DDDI_GAMMARAMP_DEFAULT; … … 1113 1445 CONST HANDLE hDevice) 1114 1446 { 1115 return STATUS_NOT_IMPLEMENTED; 1447 /* DxgkDdiDestroyDevice should be made pageable. */ 1448 PAGED_CODE(); 1449 1450 dfprintf(("==> "__FUNCTION__ ", hDevice(0x%x)\n", hDevice)); 1451 1452 vboxWddmMemFree(hDevice); 1453 1454 dfprintf(("<== "__FUNCTION__ ", \n")); 1455 1456 return STATUS_UNSUCCESSFUL; 1116 1457 } 1117 1458
Note:
See TracChangeset
for help on using the changeset viewer.