Changeset 33530 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Oct 27, 2010 7:59:36 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r33308 r33530 309 309 310 310 VBOXVIDEOCM_MGR CmMgr; 311 /* hgsmi allocation manager */ 312 VBOXVIDEOCM_ALLOC_MGR AllocMgr; 311 313 VBOXVDMADDI_CMD_QUEUE DdiCmdQueue; 312 314 LIST_ENTRY SwapchainList3D; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r33308 r33530 927 927 } 928 928 929 ulAvailable = offset; 930 ulSize = ulAvailable/2; 931 offset = ulAvailable - ulSize; 932 933 NTSTATUS Status = vboxVideoAMgrCreate(PrimaryExtension, &PrimaryExtension->AllocMgr, offset, ulSize); 934 Assert(Status == STATUS_SUCCESS); 935 if (Status != STATUS_SUCCESS) 936 { 937 offset = ulAvailable; 938 } 939 929 940 #ifdef VBOXWDDM_RENDER_FROM_SHADOW 930 941 if (RT_SUCCESS(rc)) … … 1018 1029 } 1019 1030 } 1031 1032 vboxVideoAMgrDestroy(PrimaryExtension, &PrimaryExtension->AllocMgr); 1020 1033 1021 1034 rc = vboxVdmaDisable(PrimaryExtension, &PrimaryExtension->u.primary.Vdma); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoCm.cpp
r32496 r33530 289 289 NTSTATUS vboxVideoCmSessionCreate(PVBOXVIDEOCM_MGR pMgr, PVBOXVIDEOCM_SESSION *ppSession, PKEVENT pUmEvent, PVBOXVIDEOCM_CTX pContext) 290 290 { 291 NTSTATUS Status = STATUS_UNSUCCESSFUL; 291 292 PVBOXVIDEOCM_SESSION pSession = (PVBOXVIDEOCM_SESSION)vboxWddmMemAllocZero(sizeof (VBOXVIDEOCM_SESSION)); 292 293 Assert(pSession); … … 303 304 *ppSession = pSession; 304 305 return STATUS_SUCCESS; 305 } 306 return STATUS_NO_MEMORY; 306 // vboxWddmMemFree(pSession); 307 } 308 else 309 { 310 Status = STATUS_NO_MEMORY; 311 } 312 return Status; 307 313 } 308 314 … … 496 502 ExReleaseFastMutex(&pContext->pSession->Mutex); 497 503 } 504 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoCm.h
r32496 r33530 25 25 struct VBOXVIDEOCM_SESSION *pSession; 26 26 uint64_t u64UmData; 27 VBOXWDDM_HTABLE AllocTable; 27 28 } VBOXVIDEOCM_CTX, *PVBOXVIDEOCM_CTX; 28 29 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoIf.h
r33116 r33530 346 346 VBOXSWAPCHAININFO SwapchainInfo; 347 347 } VBOXDISPIFESCAPE_SWAPCHAININFO, *PVBOXDISPIFESCAPE_SWAPCHAININFO; 348 349 typedef struct VBOXVIDEOCM_UM_ALLOC 350 { 351 VBOXDISP_KMHANDLE hAlloc; 352 uint32_t cbData; 353 uint8_t *pvData; 354 HANDLE hSynch; 355 VBOXUHGSMI_SYNCHOBJECT_TYPE enmSynchType; 356 } VBOXVIDEOCM_UM_ALLOC, *PVBOXVIDEOCM_UM_ALLOC; 357 358 typedef struct VBOXDISPIFESCAPE_UHGSMI_ALLOCATE 359 { 360 VBOXDISPIFESCAPE EscapeHdr; 361 VBOXVIDEOCM_UM_ALLOC Alloc; 362 } VBOXDISPIFESCAPE_UHGSMI_ALLOCATE, *PVBOXDISPIFESCAPE_UHGSMI_ALLOCATE; 363 364 typedef struct VBOXDISPIFESCAPE_UHGSMI_DEALLOCATE 365 { 366 VBOXDISPIFESCAPE EscapeHdr; 367 VBOXDISP_KMHANDLE hAlloc; 368 } VBOXDISPIFESCAPE_UHGSMI_DEALLOCATE, *PVBOXDISPIFESCAPE_UHGSMI_DEALLOCATE; 369 370 typedef struct VBOXWDDM_UHGSMI_BUFFER_UI_INFO_ESCAPE 371 { 372 VBOXDISP_KMHANDLE hAlloc; 373 VBOXWDDM_UHGSMI_BUFFER_UI_SUBMIT_INFO Info; 374 } VBOXWDDM_UHGSMI_BUFFER_UI_INFO_ESCAPE, *PVBOXWDDM_UHGSMI_BUFFER_UI_INFO_ESCAPE; 375 376 typedef struct VBOXDISPIFESCAPE_UHGSMI_SUBMIT 377 { 378 VBOXDISPIFESCAPE EscapeHdr; 379 VBOXWDDM_UHGSMI_BUFFER_UI_INFO_ESCAPE aBuffers[1]; 380 } VBOXDISPIFESCAPE_UHGSMI_SUBMIT, *PVBOXDISPIFESCAPE_UHGSMI_SUBMIT; 348 381 349 382 /* query info func */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoMisc.cpp
r32930 r33530 796 796 } 797 797 } 798 799 /* mm */ 800 801 NTSTATUS vboxMmInit(PVBOXWDDM_MM pMm, UINT cPages) 802 { 803 UINT cbBuffer = VBOXWDDM_ROUNDBOUND(cPages, 8) >> 3; 804 cbBuffer = VBOXWDDM_ROUNDBOUND(cbBuffer, 4); 805 PULONG pBuf = (PULONG)vboxWddmMemAllocZero(cbBuffer); 806 if (!pBuf) 807 { 808 Assert(0); 809 return STATUS_NO_MEMORY; 810 } 811 RtlInitializeBitMap(&pMm->BitMap, pBuf, cPages); 812 pMm->cPages = cPages; 813 pMm->cAllocs = 0; 814 pMm->pBuffer = pBuf; 815 return STATUS_SUCCESS; 816 } 817 818 ULONG vboxMmAlloc(PVBOXWDDM_MM pMm, UINT cPages) 819 { 820 ULONG iPage = RtlFindClearBitsAndSet(&pMm->BitMap, cPages, 0); 821 if (iPage == 0xFFFFFFFF) 822 { 823 Assert(0); 824 return VBOXWDDM_MM_VOID; 825 } 826 827 ++pMm->cAllocs; 828 return iPage; 829 } 830 831 VOID vboxMmFree(PVBOXWDDM_MM pMm, UINT iPage, UINT cPages) 832 { 833 Assert(RtlAreBitsSet(&pMm->BitMap, iPage, cPages)); 834 RtlClearBits(&pMm->BitMap, iPage, cPages); 835 --pMm->cAllocs; 836 Assert(pMm->cAllocs < UINT32_MAX); 837 } 838 839 NTSTATUS vboxMmTerm(PVBOXWDDM_MM pMm) 840 { 841 Assert(!pMm->cAllocs); 842 vboxWddmMemFree(pMm->pBuffer); 843 pMm->pBuffer = NULL; 844 return STATUS_SUCCESS; 845 } 846 847 848 849 typedef struct VBOXVIDEOCM_ALLOC 850 { 851 VBOXWDDM_HANDLE hGlobalHandle; 852 uint32_t offData; 853 uint32_t cbData; 854 } VBOXVIDEOCM_ALLOC, *PVBOXVIDEOCM_ALLOC; 855 856 typedef struct VBOXVIDEOCM_ALLOC_REF 857 { 858 PVBOXVIDEOCM_ALLOC_CONTEXT pContext; 859 VBOXWDDM_HANDLE hSessionHandle; 860 PVBOXVIDEOCM_ALLOC pAlloc; 861 union 862 { 863 PKEVENT pSynchEvent; 864 PRKSEMAPHORE pSynchSemaphore; 865 }; 866 VBOXUHGSMI_SYNCHOBJECT_TYPE enmSynchType; 867 MDL Mdl; 868 } VBOXVIDEOCM_ALLOC_REF, *PVBOXVIDEOCM_ALLOC_REF; 869 870 871 NTSTATUS vboxVideoCmAllocAlloc(PVBOXVIDEOCM_ALLOC_MGR pMgr, PVBOXVIDEOCM_ALLOC pAlloc) 872 { 873 NTSTATUS Status = STATUS_UNSUCCESSFUL; 874 UINT cbSize = pAlloc->cbData; 875 UINT cPages = BYTES_TO_PAGES(cbSize); 876 ExAcquireFastMutex(&pMgr->Mutex); 877 UINT iPage = vboxMmAlloc(&pMgr->Mm, cPages); 878 if (iPage != VBOXWDDM_MM_VOID) 879 { 880 uint32_t offData = pMgr->offData + (iPage << PAGE_SHIFT); 881 Assert(offData + cbSize <= pMgr->offData + pMgr->cbData); 882 pAlloc->offData = offData; 883 pAlloc->hGlobalHandle = vboxWddmHTablePut(&pMgr->AllocTable, pAlloc); 884 ExReleaseFastMutex(&pMgr->Mutex); 885 if (VBOXWDDM_HANDLE_INVALID != pAlloc->hGlobalHandle) 886 return STATUS_SUCCESS; 887 888 Assert(0); 889 Status = STATUS_NO_MEMORY; 890 vboxMmFree(&pMgr->Mm, iPage, cPages); 891 } 892 else 893 { 894 Assert(0); 895 ExReleaseFastMutex(&pMgr->Mutex); 896 Status = STATUS_INSUFFICIENT_RESOURCES; 897 } 898 return Status; 899 } 900 901 VOID vboxVideoCmAllocDealloc(PVBOXVIDEOCM_ALLOC_MGR pMgr, PVBOXVIDEOCM_ALLOC pAlloc) 902 { 903 UINT cbSize = pAlloc->cbData; 904 UINT cPages = BYTES_TO_PAGES(cbSize); 905 UINT iPage = BYTES_TO_PAGES(pAlloc->offData - pMgr->offData); 906 ExAcquireFastMutex(&pMgr->Mutex); 907 vboxWddmHTableRemove(&pMgr->AllocTable, pAlloc->hGlobalHandle); 908 vboxMmFree(&pMgr->Mm, iPage, cPages); 909 ExReleaseFastMutex(&pMgr->Mutex); 910 } 911 912 913 NTSTATUS vboxVideoAMgrAllocCreate(PVBOXVIDEOCM_ALLOC_MGR pMgr, UINT cbSize, PVBOXVIDEOCM_ALLOC *ppAlloc) 914 { 915 NTSTATUS Status = STATUS_SUCCESS; 916 PVBOXVIDEOCM_ALLOC pAlloc = (PVBOXVIDEOCM_ALLOC)vboxWddmMemAllocZero(sizeof (*pAlloc)); 917 if (pAlloc) 918 { 919 pAlloc->cbData = cbSize; 920 Status = vboxVideoCmAllocAlloc(pMgr, pAlloc); 921 if (Status == STATUS_SUCCESS) 922 { 923 *ppAlloc = pAlloc; 924 return STATUS_SUCCESS; 925 } 926 927 Assert(0); 928 vboxWddmMemFree(pAlloc); 929 } 930 else 931 { 932 Assert(0); 933 Status = STATUS_NO_MEMORY; 934 } 935 936 return Status; 937 } 938 939 VOID vboxVideoAMgrAllocDestroy(PVBOXVIDEOCM_ALLOC_MGR pMgr, PVBOXVIDEOCM_ALLOC pAlloc) 940 { 941 vboxVideoCmAllocDealloc(pMgr, pAlloc); 942 vboxWddmMemFree(pAlloc); 943 } 944 945 NTSTATUS vboxVideoAMgrCtxAllocMap(PVBOXVIDEOCM_ALLOC_CONTEXT pContext, PVBOXVIDEOCM_ALLOC pAlloc, PVBOXVIDEOCM_UM_ALLOC pUmAlloc) 946 { 947 PVBOXVIDEOCM_ALLOC_MGR pMgr = pContext->pMgr; 948 NTSTATUS Status = STATUS_SUCCESS; 949 950 union 951 { 952 PKEVENT pSynchEvent; 953 PRKSEMAPHORE pSynchSemaphore; 954 }; 955 956 switch (pUmAlloc->enmSynchType) 957 { 958 case VBOXUHGSMI_SYNCHOBJECT_TYPE_EVENT: 959 Status = ObReferenceObjectByHandle(pUmAlloc->hSynch, EVENT_MODIFY_STATE, *ExEventObjectType, UserMode, 960 (PVOID*)&pSynchEvent, 961 NULL); 962 Assert(Status == STATUS_SUCCESS); 963 break; 964 case VBOXUHGSMI_SYNCHOBJECT_TYPE_SEMAPHORE: 965 Status = ObReferenceObjectByHandle(pUmAlloc->hSynch, EVENT_MODIFY_STATE, *ExSemaphoreObjectType, UserMode, 966 (PVOID*)&pSynchSemaphore, 967 NULL); 968 Assert(Status == STATUS_SUCCESS); 969 break; 970 case VBOXUHGSMI_SYNCHOBJECT_TYPE_NONE: 971 pSynchEvent = NULL; 972 Status = STATUS_SUCCESS; 973 break; 974 default: 975 drprintf((__FUNCTION__ ": ERROR: invalid synch info type(%d)\n", pUmAlloc->enmSynchType)); 976 AssertBreakpoint(); 977 Status = STATUS_INVALID_PARAMETER; 978 break; 979 } 980 981 if (Status == STATUS_SUCCESS) 982 { 983 PVOID BaseVa = pMgr->pvData + pAlloc->offData - pMgr->offData; 984 SIZE_T cbLength = pAlloc->cbData; 985 986 PVBOXVIDEOCM_ALLOC_REF pAllocRef = (PVBOXVIDEOCM_ALLOC_REF)vboxWddmMemAllocZero(sizeof (*pAllocRef) + sizeof (PFN_NUMBER) * ADDRESS_AND_SIZE_TO_SPAN_PAGES(BaseVa, cbLength)); 987 if (pAllocRef) 988 { 989 MmInitializeMdl(&pAllocRef->Mdl, BaseVa, cbLength); 990 __try 991 { 992 MmProbeAndLockPages(&pAllocRef->Mdl, KernelMode, IoWriteAccess); 993 } 994 __except(EXCEPTION_EXECUTE_HANDLER) 995 { 996 Assert(0); 997 Status = STATUS_UNSUCCESSFUL; 998 } 999 1000 if (Status == STATUS_SUCCESS) 1001 { 1002 PVOID pvUm = MmMapLockedPagesSpecifyCache(&pAllocRef->Mdl, UserMode, MmNonCached, 1003 NULL, /* PVOID BaseAddress */ 1004 FALSE, /* ULONG BugCheckOnFailure */ 1005 NormalPagePriority); 1006 if (pvUm) 1007 { 1008 pAllocRef->pContext = pContext; 1009 pAllocRef->pAlloc = pAlloc; 1010 pAllocRef->enmSynchType = pUmAlloc->enmSynchType; 1011 pAllocRef->pSynchEvent = pSynchEvent; 1012 ExAcquireFastMutex(&pContext->Mutex); 1013 pAllocRef->hSessionHandle = vboxWddmHTablePut(&pContext->AllocTable, pAllocRef); 1014 ExReleaseFastMutex(&pContext->Mutex); 1015 if (VBOXWDDM_HANDLE_INVALID != pAllocRef->hSessionHandle) 1016 { 1017 pUmAlloc->hAlloc = pAllocRef->hSessionHandle; 1018 pUmAlloc->cbData = pAlloc->cbData; 1019 pUmAlloc->pvData = (uint8_t*)pvUm; 1020 return STATUS_SUCCESS; 1021 } 1022 } 1023 else 1024 { 1025 Assert(0); 1026 Status = STATUS_INSUFFICIENT_RESOURCES; 1027 } 1028 1029 MmUnlockPages(&pAllocRef->Mdl); 1030 } 1031 1032 vboxWddmMemFree(pAllocRef); 1033 } 1034 else 1035 { 1036 Assert(0); 1037 Status = STATUS_NO_MEMORY; 1038 } 1039 1040 if (pSynchEvent) 1041 { 1042 ObDereferenceObject(pSynchEvent); 1043 } 1044 } 1045 else 1046 { 1047 Assert(0); 1048 } 1049 1050 1051 return Status; 1052 } 1053 1054 NTSTATUS vboxVideoAMgrCtxAllocUnmap(PVBOXVIDEOCM_ALLOC_CONTEXT pContext, VBOXDISP_KMHANDLE hSesionHandle, PVBOXVIDEOCM_ALLOC *ppAlloc) 1055 { 1056 NTSTATUS Status = STATUS_SUCCESS; 1057 ExAcquireFastMutex(&pContext->Mutex); 1058 PVBOXVIDEOCM_ALLOC_REF pAllocRef = (PVBOXVIDEOCM_ALLOC_REF)vboxWddmHTableRemove(&pContext->AllocTable, hSesionHandle); 1059 ExReleaseFastMutex(&pContext->Mutex); 1060 if (pAllocRef) 1061 { 1062 MmUnlockPages(&pAllocRef->Mdl); 1063 *ppAlloc = pAllocRef->pAlloc; 1064 if (pAllocRef->pSynchEvent) 1065 { 1066 ObDereferenceObject(pAllocRef->pSynchEvent); 1067 } 1068 vboxWddmMemFree(pAllocRef); 1069 } 1070 else 1071 { 1072 Assert(0); 1073 Status = STATUS_INVALID_PARAMETER; 1074 } 1075 1076 return Status; 1077 } 1078 1079 static PVBOXVIDEOCM_ALLOC_REF vboxVideoAMgrCtxAllocRefAcquire(PVBOXVIDEOCM_ALLOC_CONTEXT pContext, VBOXDISP_KMHANDLE hSesionHandle) 1080 { 1081 ExAcquireFastMutex(&pContext->Mutex); 1082 PVBOXVIDEOCM_ALLOC_REF pAllocRef = (PVBOXVIDEOCM_ALLOC_REF)vboxWddmHTableGet(&pContext->AllocTable, hSesionHandle); 1083 ExReleaseFastMutex(&pContext->Mutex); 1084 return pAllocRef; 1085 } 1086 1087 static VOID vboxVideoCmCtxAllocRefRelease(PVBOXVIDEOCM_ALLOC_REF pRef) 1088 { 1089 1090 } 1091 1092 1093 1094 NTSTATUS vboxVideoAMgrCtxAllocCreate(PVBOXVIDEOCM_ALLOC_CONTEXT pContext, PVBOXVIDEOCM_UM_ALLOC pUmAlloc) 1095 { 1096 PVBOXVIDEOCM_ALLOC pAlloc; 1097 PVBOXVIDEOCM_ALLOC_MGR pMgr = pContext->pMgr; 1098 NTSTATUS Status = vboxVideoAMgrAllocCreate(pMgr, pUmAlloc->cbData, &pAlloc); 1099 if (Status == STATUS_SUCCESS) 1100 { 1101 Status = vboxVideoAMgrCtxAllocMap(pContext, pAlloc, pUmAlloc); 1102 if (Status == STATUS_SUCCESS) 1103 return STATUS_SUCCESS; 1104 else 1105 { 1106 Assert(0); 1107 } 1108 vboxVideoAMgrAllocDestroy(pMgr, pAlloc); 1109 } 1110 else 1111 { 1112 Assert(0); 1113 } 1114 return Status; 1115 } 1116 1117 NTSTATUS vboxVideoAMgrCtxAllocDestroy(PVBOXVIDEOCM_ALLOC_CONTEXT pContext, VBOXDISP_KMHANDLE hSesionHandle) 1118 { 1119 PVBOXVIDEOCM_ALLOC pAlloc; 1120 PVBOXVIDEOCM_ALLOC_MGR pMgr = pContext->pMgr; 1121 NTSTATUS Status = vboxVideoAMgrCtxAllocUnmap(pContext, hSesionHandle, &pAlloc); 1122 if (Status == STATUS_SUCCESS) 1123 { 1124 vboxVideoAMgrAllocDestroy(pMgr, pAlloc); 1125 } 1126 else 1127 { 1128 Assert(0); 1129 } 1130 return Status; 1131 } 1132 1133 static DECLCALLBACK(VOID) vboxVideoAMgrAllocSubmitCompletion(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD pCmd, PVOID pvContext) 1134 { 1135 PVBOXVDMACBUF_DR pDr = (PVBOXVDMACBUF_DR)pvContext; 1136 PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD); 1137 VBOXVDMACMD_CHROMIUM_CMD *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_CHROMIUM_CMD); 1138 UINT cBufs = pBody->cBuffers; 1139 for (UINT i = 0; i < cBufs; ++i) 1140 { 1141 VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[i]; 1142 PVBOXVIDEOCM_ALLOC_REF pRef = (PVBOXVIDEOCM_ALLOC_REF)pBufCmd->u64GuesData; 1143 if (!pBufCmd->u32GuesData) 1144 { 1145 /* signal completion */ 1146 switch (pRef->enmSynchType) 1147 { 1148 case VBOXUHGSMI_SYNCHOBJECT_TYPE_EVENT: 1149 KeSetEvent(pRef->pSynchEvent, 3, FALSE); 1150 break; 1151 case VBOXUHGSMI_SYNCHOBJECT_TYPE_SEMAPHORE: 1152 KeReleaseSemaphore(pRef->pSynchSemaphore, 1153 3, 1154 1, 1155 FALSE); 1156 break; 1157 case VBOXUHGSMI_SYNCHOBJECT_TYPE_NONE: 1158 break; 1159 default: 1160 Assert(0); 1161 } 1162 } 1163 1164 vboxVideoCmCtxAllocRefRelease(pRef); 1165 } 1166 1167 vboxVdmaCBufDrFree(&pDevExt->u.primary.Vdma, pDr); 1168 } 1169 1170 NTSTATUS vboxVideoAMgrCtxAllocSubmit(PDEVICE_EXTENSION pDevExt, PVBOXVIDEOCM_ALLOC_CONTEXT pContext, UINT cBuffers, VBOXWDDM_UHGSMI_BUFFER_UI_INFO_ESCAPE *paBuffers) 1171 { 1172 NTSTATUS Status = STATUS_SUCCESS; 1173 UINT cbCmd = VBOXVDMACMD_SIZE_FROMBODYSIZE(RT_OFFSETOF(VBOXVDMACMD_CHROMIUM_CMD, aBuffers[cBuffers])); 1174 1175 PVBOXVDMACBUF_DR pDr = vboxVdmaCBufDrCreate (&pDevExt->u.primary.Vdma, cbCmd); 1176 if (pDr) 1177 { 1178 // vboxVdmaCBufDrCreate zero initializes the pDr 1179 pDr->fFlags = VBOXVDMACBUF_FLAG_BUF_FOLLOWS_DR; 1180 pDr->cbBuf = cbCmd; 1181 pDr->rc = VERR_NOT_IMPLEMENTED; 1182 1183 PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD); 1184 pHdr->enmType = VBOXVDMACMD_TYPE_CHROMIUM_CMD; 1185 pHdr->u32CmdSpecific = 0; 1186 VBOXVDMACMD_CHROMIUM_CMD *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_CHROMIUM_CMD); 1187 pBody->cBuffers = cBuffers; 1188 for (UINT i = 0; i < cBuffers; ++i) 1189 { 1190 VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[i]; 1191 VBOXWDDM_UHGSMI_BUFFER_UI_INFO_ESCAPE *pBufInfo = &paBuffers[i]; 1192 PVBOXVIDEOCM_ALLOC_REF pRef = vboxVideoAMgrCtxAllocRefAcquire(pContext, pBufInfo->hAlloc); 1193 if (pRef) 1194 { 1195 pBufCmd->offBuffer = pRef->pAlloc->offData + pBufInfo->Info.offData; 1196 pBufCmd->cbBuffer = pBufInfo->Info.cbData; 1197 pBufCmd->u32GuesData = pBufInfo->Info.fSubFlags.bDoNotSignalCompletion; 1198 pBufCmd->u64GuesData = (uint64_t)pRef; 1199 } 1200 else 1201 { 1202 Assert(0); 1203 Status = STATUS_INVALID_PARAMETER; 1204 break; 1205 } 1206 } 1207 1208 if (Status == STATUS_SUCCESS) 1209 { 1210 PVBOXVDMADDI_CMD pDdiCmd = VBOXVDMADDI_CMD_FROM_BUF_DR(pDr); 1211 vboxVdmaDdiCmdInit(pDdiCmd, 0, NULL, vboxVideoAMgrAllocSubmitCompletion, pDr); 1212 vboxVdmaDdiCmdSubmittedNotDx(pDdiCmd); 1213 int rc = vboxVdmaCBufDrSubmit(pDevExt, &pDevExt->u.primary.Vdma, pDr); 1214 Assert(rc == VINF_SUCCESS); 1215 if (RT_SUCCESS(rc)) 1216 { 1217 return STATUS_SUCCESS; 1218 } 1219 } 1220 1221 vboxVdmaCBufDrFree(&pDevExt->u.primary.Vdma, pDr); 1222 } 1223 else 1224 { 1225 Assert(0); 1226 /* @todo: try flushing.. */ 1227 drprintf((__FUNCTION__": vboxVdmaCBufDrCreate returned NULL\n")); 1228 Status = STATUS_INSUFFICIENT_RESOURCES; 1229 } 1230 1231 return Status; 1232 } 1233 1234 NTSTATUS vboxVideoAMgrCreate(PDEVICE_EXTENSION pDevExt, PVBOXVIDEOCM_ALLOC_MGR pMgr, uint32_t offData, uint32_t cbData) 1235 { 1236 Assert(!(offData & (PAGE_SIZE -1))); 1237 Assert(!(cbData & (PAGE_SIZE -1))); 1238 offData = VBOXWDDM_ROUNDBOUND(offData, PAGE_SIZE); 1239 cbData &= (~(PAGE_SIZE -1)); 1240 Assert(cbData); 1241 if (!cbData) 1242 return STATUS_INVALID_PARAMETER; 1243 1244 ExInitializeFastMutex(&pMgr->Mutex); 1245 NTSTATUS Status = vboxWddmHTableCreate(&pMgr->AllocTable, 64); 1246 Assert(Status == STATUS_SUCCESS); 1247 if (Status == STATUS_SUCCESS) 1248 { 1249 Status = vboxMmInit(&pMgr->Mm, BYTES_TO_PAGES(cbData)); 1250 Assert(Status == STATUS_SUCCESS); 1251 if (Status == STATUS_SUCCESS) 1252 { 1253 PHYSICAL_ADDRESS PhysicalAddress = {0}; 1254 PhysicalAddress.QuadPart = VBE_DISPI_LFB_PHYSICAL_ADDRESS + offData; 1255 pMgr->pvData = (uint8_t*)MmMapIoSpace(PhysicalAddress, cbData, MmNonCached); 1256 Assert(pMgr->pvData); 1257 if (pMgr->pvData) 1258 { 1259 pMgr->offData = offData; 1260 pMgr->cbData = cbData; 1261 return STATUS_SUCCESS; 1262 } 1263 else 1264 { 1265 Status = STATUS_UNSUCCESSFUL; 1266 } 1267 vboxMmTerm(&pMgr->Mm); 1268 } 1269 vboxWddmHTableDestroy(&pMgr->AllocTable); 1270 } 1271 1272 return Status; 1273 } 1274 1275 NTSTATUS vboxVideoAMgrDestroy(PDEVICE_EXTENSION pDevExt, PVBOXVIDEOCM_ALLOC_MGR pMgr) 1276 { 1277 MmUnmapIoSpace(pMgr->pvData, pMgr->cbData); 1278 vboxMmTerm(&pMgr->Mm); 1279 vboxWddmHTableDestroy(&pMgr->AllocTable); 1280 return STATUS_SUCCESS; 1281 } 1282 1283 NTSTATUS vboxVideoAMgrCtxCreate(PVBOXVIDEOCM_ALLOC_MGR pMgr, PVBOXVIDEOCM_ALLOC_CONTEXT pCtx) 1284 { 1285 NTSTATUS Status = STATUS_NOT_SUPPORTED; 1286 if (pMgr->pvData) 1287 { 1288 ExInitializeFastMutex(&pCtx->Mutex); 1289 Status = vboxWddmHTableCreate(&pCtx->AllocTable, 32); 1290 Assert(Status == STATUS_SUCCESS); 1291 if (Status == STATUS_SUCCESS) 1292 { 1293 pCtx->pMgr = pMgr; 1294 return STATUS_SUCCESS; 1295 } 1296 } 1297 return Status; 1298 } 1299 1300 NTSTATUS vboxVideoAMgrCtxDestroy(PVBOXVIDEOCM_ALLOC_CONTEXT pCtx) 1301 { 1302 if (!pCtx->pMgr) 1303 return STATUS_SUCCESS; 1304 1305 VBOXWDDM_HTABLE_ITERATOR Iter; 1306 NTSTATUS Status = STATUS_SUCCESS; 1307 1308 vboxWddmHTableIterInit(&pCtx->AllocTable, &Iter); 1309 do 1310 { 1311 PVBOXVIDEOCM_ALLOC_REF pRef = (PVBOXVIDEOCM_ALLOC_REF)vboxWddmHTableIterNext(&Iter, NULL); 1312 if (!pRef) 1313 break; 1314 1315 Status = vboxVideoAMgrCtxAllocDestroy(pCtx, pRef->hSessionHandle); 1316 Assert(Status == STATUS_SUCCESS); 1317 if (Status != STATUS_SUCCESS) 1318 break; 1319 // vboxWddmHTableIterRemoveCur(&Iter); 1320 } while (1); 1321 1322 if (Status == STATUS_SUCCESS) 1323 { 1324 vboxWddmHTableDestroy(&pCtx->AllocTable); 1325 } 1326 1327 return Status; 1328 } 1329 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoMisc.h
r32930 r33530 97 97 VOID vboxWddmVGuidFree(PDEVICE_EXTENSION pDevExt); 98 98 99 #define VBOXWDDM_MM_VOID 0xffffffffUL 100 101 typedef struct VBOXWDDM_MM 102 { 103 RTL_BITMAP BitMap; 104 UINT cPages; 105 UINT cAllocs; 106 PULONG pBuffer; 107 } VBOXWDDM_MM, *PVBOXWDDM_MM; 108 109 NTSTATUS vboxMmInit(PVBOXWDDM_MM pMm, UINT cPages); 110 ULONG vboxMmAlloc(PVBOXWDDM_MM pMm, UINT cPages); 111 VOID vboxMmFree(PVBOXWDDM_MM pMm, UINT iPage, UINT cPages); 112 NTSTATUS vboxMmTerm(PVBOXWDDM_MM pMm); 113 114 typedef struct VBOXVIDEOCM_ALLOC_MGR 115 { 116 /* synch lock */ 117 FAST_MUTEX Mutex; 118 VBOXWDDM_HTABLE AllocTable; 119 VBOXWDDM_MM Mm; 120 // PHYSICAL_ADDRESS PhData; 121 uint8_t *pvData; 122 uint32_t offData; 123 uint32_t cbData; 124 } VBOXVIDEOCM_ALLOC_MGR, *PVBOXVIDEOCM_ALLOC_MGR; 125 126 typedef struct VBOXVIDEOCM_ALLOC_CONTEXT 127 { 128 PVBOXVIDEOCM_ALLOC_MGR pMgr; 129 /* synch lock */ 130 FAST_MUTEX Mutex; 131 VBOXWDDM_HTABLE AllocTable; 132 } VBOXVIDEOCM_ALLOC_CONTEXT, *PVBOXVIDEOCM_ALLOC_CONTEXT; 133 134 NTSTATUS vboxVideoAMgrCreate(PDEVICE_EXTENSION pDevExt, PVBOXVIDEOCM_ALLOC_MGR pMgr, uint32_t offData, uint32_t cbData); 135 NTSTATUS vboxVideoAMgrDestroy(PDEVICE_EXTENSION pDevExt, PVBOXVIDEOCM_ALLOC_MGR pMgr); 136 137 NTSTATUS vboxVideoAMgrCtxCreate(PVBOXVIDEOCM_ALLOC_MGR pMgr, PVBOXVIDEOCM_ALLOC_CONTEXT pCtx); 138 NTSTATUS vboxVideoAMgrCtxDestroy(PVBOXVIDEOCM_ALLOC_CONTEXT pCtx); 139 140 NTSTATUS vboxVideoAMgrCtxAllocCreate(PVBOXVIDEOCM_ALLOC_CONTEXT pContext, PVBOXVIDEOCM_UM_ALLOC pUmAlloc); 141 NTSTATUS vboxVideoAMgrCtxAllocDestroy(PVBOXVIDEOCM_ALLOC_CONTEXT pContext, VBOXDISP_KMHANDLE hSesionHandle); 142 143 NTSTATUS vboxVideoAMgrCtxAllocSubmit(PDEVICE_EXTENSION pDevExt, PVBOXVIDEOCM_ALLOC_CONTEXT pContext, UINT cBuffers, VBOXWDDM_UHGSMI_BUFFER_UI_INFO_ESCAPE *paBuffers); 144 99 145 #endif /* #ifndef ___VBoxVideoMisc_h__ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
r33226 r33530 1073 1073 1074 1074 #ifdef VBOX_WITH_VDMA 1075 KeInitializeSpinLock(&pInfo->HeapLock); 1075 1076 Assert((offBuffer & 0xfff) == 0); 1076 1077 Assert((cbBuffer & 0xfff) == 0); … … 1199 1200 void vboxVdmaCBufDrFree (PVBOXVDMAINFO pInfo, PVBOXVDMACBUF_DR pDr) 1200 1201 { 1202 KIRQL OldIrql; 1203 KeAcquireSpinLock(&pInfo->HeapLock, &OldIrql); 1201 1204 VBoxSHGSMICommandFree (&pInfo->CmdHeap, pDr); 1205 KeReleaseSpinLock(&pInfo->HeapLock, OldIrql); 1202 1206 } 1203 1207 … … 1205 1209 { 1206 1210 uint32_t cbDr = VBOXVDMACBUF_DR_SIZE(cbTrailingData); 1211 KIRQL OldIrql; 1212 KeAcquireSpinLock(&pInfo->HeapLock, &OldIrql); 1207 1213 PVBOXVDMACBUF_DR pDr = (PVBOXVDMACBUF_DR)VBoxSHGSMICommandAlloc (&pInfo->CmdHeap, cbDr, HGSMI_CH_VBVA, VBVA_VDMA_CMD); 1214 KeReleaseSpinLock(&pInfo->HeapLock, OldIrql); 1208 1215 Assert(pDr); 1209 1216 if (pDr) … … 1345 1352 notify.InterruptType = DXGK_INTERRUPT_DMA_COMPLETED; 1346 1353 notify.DmaCompleted.SubmissionFenceId = pCmd->u32FenceId; 1347 if (pCmd->pContext)1348 {1349 notify.DmaCompleted.NodeOrdinal = pCmd->pContext->NodeOrdinal;1350 pCmd->pContext->uLastCompletedCmdFenceId = pCmd->u32FenceId;1351 }1352 else1354 // if (pCmd->pContext) 1355 // { 1356 // notify.DmaCompleted.NodeOrdinal = pCmd->pContext->NodeOrdinal; 1357 // pCmd->pContext->uLastCompletedCmdFenceId = pCmd->u32FenceId; 1358 // } 1359 // else 1353 1360 { 1354 1361 pDevExt->u.primary.Vdma.uLastCompletedPagingBufferCmdFenceId = pCmd->u32FenceId; … … 1362 1369 notify.InterruptType = DXGK_INTERRUPT_DMA_PREEMPTED; 1363 1370 notify.DmaPreempted.PreemptionFenceId = pCmd->u32FenceId; 1364 if (pCmd->pContext)1365 {1366 notify.DmaPreempted.LastCompletedFenceId = pCmd->pContext->uLastCompletedCmdFenceId;1367 notify.DmaPreempted.NodeOrdinal = pCmd->pContext->NodeOrdinal;1368 }1369 else1371 // if (pCmd->pContext) 1372 // { 1373 // notify.DmaPreempted.LastCompletedFenceId = pCmd->pContext->uLastCompletedCmdFenceId; 1374 // notify.DmaPreempted.NodeOrdinal = pCmd->pContext->NodeOrdinal; 1375 // } 1376 // else 1370 1377 { 1371 1378 notify.DmaPreempted.LastCompletedFenceId = pDevExt->u.primary.Vdma.uLastCompletedPagingBufferCmdFenceId; … … 1412 1419 BOOLEAN vboxVdmaDdiCmdCompletedIrq(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD_QUEUE pQueue, PVBOXVDMADDI_CMD pCmd, DXGK_INTERRUPT_TYPE enmComplType) 1413 1420 { 1421 if (VBOXVDMADDI_STATE_NOT_DX_CMD == pCmd->enmState) 1422 { 1423 InsertTailList(&pQueue->DpcCmdQueue, &pCmd->QueueEntry); 1424 return FALSE; 1425 } 1426 1414 1427 BOOLEAN bQueued = pCmd->enmState > VBOXVDMADDI_STATE_NOT_QUEUED; 1415 1428 BOOLEAN bComplete = FALSE; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h
r33216 r33530 22 22 { 23 23 VBOXVDMADDI_STATE_UNCKNOWN = 0, 24 VBOXVDMADDI_STATE_NOT_DX_CMD, 24 25 VBOXVDMADDI_STATE_NOT_QUEUED, 25 26 VBOXVDMADDI_STATE_PENDING, … … 68 69 pCmd->pfnComplete = pfnComplete; 69 70 pCmd->pvComplete = pvComplete; 71 } 72 73 DECLINLINE(VOID) vboxVdmaDdiCmdSubmittedNotDx(PVBOXVDMADDI_CMD pCmd) 74 { 75 Assert(pCmd->enmState == VBOXVDMADDI_STATE_NOT_QUEUED); 76 pCmd->enmState = VBOXVDMADDI_STATE_NOT_DX_CMD; 70 77 } 71 78 … … 254 261 { 255 262 #ifdef VBOX_WITH_VDMA 263 KSPIN_LOCK HeapLock; 256 264 HGSMIHEAP CmdHeap; 257 265 #endif 258 266 UINT uLastCompletedPagingBufferCmdFenceId; 259 267 BOOL fEnabled; 260 #if 0261 VBOXVDMASUBMIT Submitter;262 #endif263 268 /* dma-related commands list processed on the guest w/o host part involvement (guest-guest commands) */ 264 269 VBOXVDMAGG DmaGg; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r33365 r33530 888 888 bNeedDpc = TRUE; 889 889 } 890 891 bNeedDpc |= !vboxVdmaDdiCmdIsCompletedListEmptyIsr(&pDevExt->DdiCmdQueue); 890 892 891 893 if (pDevExt->bNotifyDxDpc) … … 2534 2536 dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 2535 2537 2536 AssertBreakpoint();2538 // AssertBreakpoint(); 2537 2539 /* @todo: fixme: implement */ 2538 2540 … … 3210 3212 switch (pEscapeHdr->escapeCode) 3211 3213 { 3214 case VBOXESC_UHGSMI_SUBMIT: 3215 { 3216 PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pEscape->hContext; 3217 PVBOXDISPIFESCAPE_UHGSMI_SUBMIT pSubmit = (PVBOXDISPIFESCAPE_UHGSMI_SUBMIT)pEscapeHdr; 3218 Assert(pEscape->PrivateDriverDataSize >= sizeof (VBOXDISPIFESCAPE_UHGSMI_SUBMIT) 3219 && pEscape->PrivateDriverDataSize == RT_OFFSETOF(VBOXDISPIFESCAPE_UHGSMI_SUBMIT, aBuffers[pEscapeHdr->u32CmdSpecific])); 3220 if (pEscape->PrivateDriverDataSize >= sizeof (VBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD) 3221 && pEscape->PrivateDriverDataSize == RT_OFFSETOF(VBOXDISPIFESCAPE_UHGSMI_SUBMIT, aBuffers[pEscapeHdr->u32CmdSpecific])) 3222 { 3223 Status = vboxVideoAMgrCtxAllocSubmit(pDevExt, &pContext->AllocContext, pEscapeHdr->u32CmdSpecific, pSubmit->aBuffers); 3224 Assert(Status == STATUS_SUCCESS); 3225 } 3226 else 3227 Status = STATUS_BUFFER_TOO_SMALL; 3228 3229 break; 3230 } 3231 case VBOXESC_UHGSMI_ALLOCATE: 3232 { 3233 PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pEscape->hContext; 3234 PVBOXDISPIFESCAPE_UHGSMI_ALLOCATE pAlocate = (PVBOXDISPIFESCAPE_UHGSMI_ALLOCATE)pEscapeHdr; 3235 Assert(pEscape->PrivateDriverDataSize == sizeof (VBOXDISPIFESCAPE_UHGSMI_ALLOCATE)); 3236 if (pEscape->PrivateDriverDataSize == sizeof (VBOXDISPIFESCAPE_UHGSMI_ALLOCATE)) 3237 { 3238 Status = vboxVideoAMgrCtxAllocCreate(&pContext->AllocContext, &pAlocate->Alloc); 3239 Assert(Status == STATUS_SUCCESS); 3240 } 3241 else 3242 Status = STATUS_BUFFER_TOO_SMALL; 3243 3244 break; 3245 } 3246 case VBOXESC_UHGSMI_DEALLOCATE: 3247 { 3248 PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pEscape->hContext; 3249 PVBOXDISPIFESCAPE_UHGSMI_DEALLOCATE pDealocate = (PVBOXDISPIFESCAPE_UHGSMI_DEALLOCATE)pEscapeHdr; 3250 Assert(pEscape->PrivateDriverDataSize == sizeof (VBOXDISPIFESCAPE_UHGSMI_DEALLOCATE)); 3251 if (pEscape->PrivateDriverDataSize == sizeof (VBOXDISPIFESCAPE_UHGSMI_DEALLOCATE)) 3252 { 3253 Status = vboxVideoAMgrCtxAllocDestroy(&pContext->AllocContext, pDealocate->hAlloc); 3254 Assert(Status == STATUS_SUCCESS); 3255 } 3256 else 3257 Status = STATUS_BUFFER_TOO_SMALL; 3258 3259 break; 3260 } 3212 3261 case VBOXESC_GETVBOXVIDEOCMCMD: 3213 3262 { … … 3380 3429 } 3381 3430 3431 typedef struct VBOXWDDM_QUERYCURFENCE_CB 3432 { 3433 PDEVICE_EXTENSION pDevExt; 3434 ULONG MessageNumber; 3435 ULONG uLastCompletedCmdFenceId; 3436 } VBOXWDDM_QUERYCURFENCE_CB, *PVBOXWDDM_QUERYCURFENCE_CB; 3437 3438 static BOOLEAN vboxWddmQueryCurrentFenceCb(PVOID Context) 3439 { 3440 PVBOXWDDM_QUERYCURFENCE_CB pdc = (PVBOXWDDM_QUERYCURFENCE_CB)Context; 3441 BOOL bRc = DxgkDdiInterruptRoutine(pdc->pDevExt, pdc->MessageNumber); 3442 pdc->uLastCompletedCmdFenceId = pdc->pDevExt->u.primary.Vdma.uLastCompletedPagingBufferCmdFenceId; 3443 return bRc; 3444 } 3445 3382 3446 NTSTATUS 3383 3447 APIENTRY … … 3388 3452 dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 3389 3453 3390 AssertBreakpoint(); 3391 /* @todo: fixme: implement */ 3454 vboxVDbgBreakF(); 3455 3456 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 3457 VBOXWDDM_QUERYCURFENCE_CB context = {0}; 3458 context.pDevExt = pDevExt; 3459 BOOLEAN bRet; 3460 NTSTATUS Status = pDevExt->u.primary.DxgkInterface.DxgkCbSynchronizeExecution( 3461 pDevExt->u.primary.DxgkInterface.DeviceHandle, 3462 vboxWddmQueryCurrentFenceCb, 3463 &context, 3464 0, /* IN ULONG MessageNumber */ 3465 &bRet); 3466 Assert(Status == STATUS_SUCCESS); 3467 if (Status == STATUS_SUCCESS) 3468 { 3469 pCurrentFence->CurrentFence = context.uLastCompletedCmdFenceId; 3470 } 3392 3471 3393 3472 dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); … … 4987 5066 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D: 4988 5067 { 4989 ExInitializeFastMutex(&pContext->SwapchainMutex); 4990 Status = vboxWddmHTableCreate(&pContext->Swapchains, 4); 5068 Status = vboxVideoAMgrCtxCreate(&pDevExt->AllocMgr, &pContext->AllocContext); 4991 5069 Assert(Status == STATUS_SUCCESS); 4992 5070 if (Status == STATUS_SUCCESS) 4993 5071 { 4994 pContext->enmType = VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D;4995 Status = vbox VideoCmCtxAdd(&pDevice->pAdapter->CmMgr, &pContext->CmContext, (HANDLE)pInfo->hUmEvent, pInfo->u64UmInfo);5072 ExInitializeFastMutex(&pContext->SwapchainMutex); 5073 Status = vboxWddmHTableCreate(&pContext->Swapchains, 4); 4996 5074 Assert(Status == STATUS_SUCCESS); 4997 5075 if (Status == STATUS_SUCCESS) 4998 5076 { 4999 // Assert(KeGetCurrentIrql() < DISPATCH_LEVEL); 5000 // ExAcquireFastMutex(&pDevExt->ContextMutex); 5001 ASMAtomicIncU32(&pDevExt->cContexts3D); 5002 // ExReleaseFastMutex(&pDevExt->ContextMutex); 5003 } 5004 else 5005 { 5077 pContext->enmType = VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D; 5078 Status = vboxVideoCmCtxAdd(&pDevice->pAdapter->CmMgr, &pContext->CmContext, (HANDLE)pInfo->hUmEvent, pInfo->u64UmInfo); 5079 Assert(Status == STATUS_SUCCESS); 5080 if (Status == STATUS_SUCCESS) 5081 { 5082 // Assert(KeGetCurrentIrql() < DISPATCH_LEVEL); 5083 // ExAcquireFastMutex(&pDevExt->ContextMutex); 5084 ASMAtomicIncU32(&pDevExt->cContexts3D); 5085 // ExReleaseFastMutex(&pDevExt->ContextMutex); 5086 break; 5087 } 5006 5088 vboxWddmHTableDestroy(&pContext->Swapchains); 5007 5089 } … … 5009 5091 break; 5010 5092 } 5011 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_2D:5012 5093 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_3D: 5013 5094 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL: 5095 { 5096 Status = vboxVideoAMgrCtxCreate(&pDevExt->AllocMgr, &pContext->AllocContext); 5097 Assert(Status == STATUS_SUCCESS); 5098 if (Status != STATUS_SUCCESS) 5099 break; 5100 /* do not break to go to the _2D branch and do the rest stuff */ 5101 } 5102 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_2D: 5014 5103 { 5015 5104 pContext->enmType = pInfo->enmType; … … 5069 5158 } 5070 5159 5071 NTSTATUS Status = vboxVideo CmCtxRemove(&pContext->pDevice->pAdapter->CmMgr, &pContext->CmContext);5160 NTSTATUS Status = vboxVideoAMgrCtxDestroy(&pContext->AllocContext); 5072 5161 Assert(Status == STATUS_SUCCESS); 5073 5162 if (Status == STATUS_SUCCESS) 5074 5163 { 5075 vboxWddmSwapchainCtxDestroyAll(pDevExt, pContext); 5076 vboxWddmMemFree(pContext); 5164 Status = vboxVideoCmCtxRemove(&pContext->pDevice->pAdapter->CmMgr, &pContext->CmContext); 5165 Assert(Status == STATUS_SUCCESS); 5166 if (Status == STATUS_SUCCESS) 5167 { 5168 vboxWddmSwapchainCtxDestroyAll(pDevExt, pContext); 5169 vboxWddmMemFree(pContext); 5170 } 5077 5171 } 5078 5172 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h
r33116 r33530 154 154 UINT NodeOrdinal; 155 155 UINT EngineAffinity; 156 UINT uLastCompletedCmdFenceId;156 // UINT uLastCompletedCmdFenceId; 157 157 FAST_MUTEX SwapchainMutex; 158 158 VBOXWDDM_HTABLE Swapchains; 159 159 VBOXVIDEOCM_CTX CmContext; 160 VBOXVIDEOCM_ALLOC_CONTEXT AllocContext; 160 161 } VBOXWDDM_CONTEXT, *PVBOXWDDM_CONTEXT; 161 162
Note:
See TracChangeset
for help on using the changeset viewer.