Changeset 29798 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- May 25, 2010 5:26:57 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r29742 r29798 861 861 PVIDEO_POINTER_ATTRIBUTES pointerAttr, 862 862 uint32_t cbLength); 863 #ifndef VBOXWDDM 863 864 #ifdef VBOXWDDM 865 int VBoxFreeDisplaysHGSMI(PDEVICE_EXTENSION PrimaryExtension); 866 #else 864 867 DECLCALLBACK(void) hgsmiHostCmdComplete (HVBOXVIDEOHGSMI hHGSMI, struct _VBVAHOSTCMD * pCmd); 865 868 DECLCALLBACK(int) hgsmiHostCmdRequest (HVBOXVIDEOHGSMI hHGSMI, uint8_t u8Channel, struct _VBVAHOSTCMD ** ppCmd); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r29742 r29798 1045 1045 } 1046 1046 1047 #ifdef VBOXWDDM 1048 int VBoxFreeDisplaysHGSMI(PDEVICE_EXTENSION PrimaryExtension) 1049 { 1050 int rc; 1051 for (int i = PrimaryExtension->cSources-1; i >= 0; --i) 1052 { 1053 rc = vboxVbvaDisable(PrimaryExtension, &PrimaryExtension->aSources[i].Vbva); 1054 AssertRC(rc); 1055 if (RT_SUCCESS(rc)) 1056 { 1057 rc = vboxVbvaDestroy(PrimaryExtension, &PrimaryExtension->aSources[i].Vbva); 1058 AssertRC(rc); 1059 if (RT_SUCCESS(rc)) 1060 { 1061 rc = vboxVdmaDisable(PrimaryExtension, &PrimaryExtension->u.primary.Vdma); 1062 AssertRC(rc); 1063 if (RT_SUCCESS(rc)) 1064 { 1065 rc = vboxVdmaDestroy(PrimaryExtension, &PrimaryExtension->u.primary.Vdma); 1066 AssertRC(rc); 1067 if (RT_SUCCESS(rc)) 1068 { 1069 /*rc = */VBoxUnmapAdapterMemory(PrimaryExtension, &PrimaryExtension->u.primary.pvMiniportHeap, PrimaryExtension->u.primary.cbMiniportHeap); 1070 /* 1071 AssertRC(rc); 1072 if (RT_SUCCESS(rc)) 1073 */ 1074 { 1075 HGSMIHeapDestroy(&PrimaryExtension->u.primary.hgsmiAdapterHeap); 1076 1077 /* Map the adapter information. It will be needed for HGSMI IO. */ 1078 /*rc = */VBoxUnmapAdapterMemory(PrimaryExtension, &PrimaryExtension->u.primary.pvAdapterInformation, VBVA_ADAPTER_INFORMATION_SIZE); 1079 /* 1080 AssertRC(rc); 1081 if (RT_FAILURE(rc)) 1082 drprintf((__FUNCTION__"VBoxUnmapAdapterMemory PrimaryExtension->u.primary.pvAdapterInformation failed, rc(%d)\n", rc)); 1083 */ 1084 1085 } 1086 } 1087 } 1088 } 1089 } 1090 } 1091 1092 return rc; 1093 } 1094 #endif 1047 1095 1048 1096 /* -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVbva.cpp
r29432 r29798 39 39 VBVAENABLE *pEnable = &pEnableEx->Base; 40 40 pEnable->u32Flags = bEnable? VBVA_F_ENABLE: VBVA_F_DISABLE; 41 pEnable->u32Flags |= VBVA_F_EXTENDED ;41 pEnable->u32Flags |= VBVA_F_EXTENDED | VBVA_F_ABSOFFSET; 42 42 pEnable->u32Offset = (uint32_t)pVbva->offVBVA; 43 43 pEnable->i32Result = VERR_NOT_SUPPORTED; … … 119 119 } 120 120 121 int vboxVbvaDestroy(PDEVICE_EXTENSION pDevExt, VBOXVBVAINFO *pVbva) 122 { 123 int rc = VINF_SUCCESS; 124 /*rc = */VBoxUnmapAdapterMemory(pDevExt, (void**)&pVbva->pVBVA, pVbva->cbVBVA); 125 /* 126 AssertRC(rc); 127 if (RT_SUCCESS(rc)) 128 */ 129 memset(pVbva, 0, sizeof(VBOXVBVAINFO)); 130 /* 131 else 132 drprintf((__FUNCTION__": VBoxUnmapAdapterMemory failed, rc (%d)\n", rc)); 133 */ 134 return rc; 135 } 136 121 137 /* 122 138 * Private operations. -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVbva.h
r28800 r29798 25 25 int vboxVbvaEnable (struct _DEVICE_EXTENSION* pDevExt, VBOXVBVAINFO *pVbva); 26 26 int vboxVbvaDisable (struct _DEVICE_EXTENSION* pDevExt, VBOXVBVAINFO *pVbva); 27 int vboxVbvaDestroy(PDEVICE_EXTENSION pDevExt, VBOXVBVAINFO *pVbva); 27 28 int vboxVbvaCreate(struct _DEVICE_EXTENSION* pDevExt, VBOXVBVAINFO *pVbva, ULONG offBuffer, ULONG cbBuffer, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId); 28 29 int vboxVbvaReportCmdOffset (struct _DEVICE_EXTENSION* pDevExt, VBOXVBVAINFO *pVbva, uint32_t offCmd); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.cpp
r29745 r29798 403 403 } 404 404 } 405 406 void vboxVHWAFree(PDEVICE_EXTENSION pDevExt) 407 { 408 /* we do not allocate/map anything, just issue a Disable command 409 * to ensure all pending commands are flushed */ 410 for (uint32_t i = 0; i < pDevExt->cSources; ++i) 411 { 412 vboxVHWADisable(pDevExt, i); 413 } 414 } -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.h
r29742 r29798 52 52 int vboxVHWADisable(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId); 53 53 void vboxVHWAInit(PDEVICE_EXTENSION pDevExt); 54 void vboxVHWAFree(PDEVICE_EXTENSION pDevExt); 54 55 55 56 #endif /* #ifndef ___VBoxVideoVhwa_h___ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r29742 r29798 595 595 } 596 596 597 static void vboxWddmDevExtZeroinit(PDEVICE_EXTENSION pDevExt, CONST PDEVICE_OBJECT pPDO) 598 { 599 memset(pDevExt, 0, sizeof (DEVICE_EXTENSION)); 600 pDevExt->pPDO = pPDO; 601 #ifdef VBOXWDDM_RENDER_FROM_SHADOW 602 for (int i = 0; i < RT_ELEMENTS(pDevExt->aSources); ++i) 603 { 604 pDevExt->aSources[i].offVram = VBOXVIDEOOFFSET_VOID; 605 } 606 #endif 607 } 608 597 609 /* driver callbacks */ 598 610 NTSTATUS DxgkDdiAddDevice( … … 613 625 if (pContext) 614 626 { 615 pContext->pPDO = PhysicalDeviceObject;627 vboxWddmDevExtZeroinit(pContext, PhysicalDeviceObject); 616 628 *MiniportDeviceContext = pContext; 617 #ifdef VBOXWDDM_RENDER_FROM_SHADOW618 for (int i = 0; i < RT_ELEMENTS(pContext->aSources); ++i)619 {620 pContext->aSources[i].offVram = VBOXVIDEOOFFSET_VOID;621 }622 #endif623 629 } 624 630 else … … 694 700 { 695 701 drprintf(("VBoxVideoWddm: HGSMI failed to initialize, returning err\n")); 702 703 VbglTerminate(); 696 704 /* @todo: report a better status */ 697 705 Status = STATUS_UNSUCCESSFUL; … … 729 737 dfprintf(("==> "__FUNCTION__ ", context(0x%p)\n", MiniportDeviceContext)); 730 738 731 AssertBreakpoint(); 732 /* @todo: fixme: implement */ 733 734 dfprintf(("<== "__FUNCTION__ ", context(0x%p)\n", MiniportDeviceContext)); 735 736 return STATUS_SUCCESS; 739 vboxVDbgBreakF(); 740 741 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)MiniportDeviceContext; 742 NTSTATUS Status = STATUS_SUCCESS; 743 744 /* do everything we did on DxgkDdiStartDevice in the reverse order */ 745 #ifdef VBOX_WITH_VIDEOHWACCEL 746 vboxVHWAFree(pDevExt); 747 #endif 748 749 int rc = VBoxFreeDisplaysHGSMI(pDevExt); 750 AssertRC(rc); 751 if (RT_SUCCESS(rc)) 752 { 753 VbglTerminate(); 754 755 /* revert back to the state we were right after the DxgkDdiAddDevice */ 756 vboxWddmDevExtZeroinit(pDevExt, pDevExt->pPDO); 757 } 758 else 759 Status = STATUS_UNSUCCESSFUL; 760 761 return Status; 737 762 } 738 763
Note:
See TracChangeset
for help on using the changeset viewer.