Changeset 32877 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Oct 1, 2010 10:51:28 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/Makefile.kmk
r32823 r32877 90 90 endif 91 91 endif 92 ifdef VBOXVDMA_WITH_VDMA 93 VBoxVideoWddm_DEFS += VBOXVDMA_WITH_VDMA 94 endif 92 95 ifdef DEBUG_misha 93 96 VBoxVideoWddm_DEFS += LOG_ENABLED -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r32876 r32877 959 959 ULONG ulSize; 960 960 ULONG offset; 961 #ifdef VBOX VDMA961 #ifdef VBOX_WITH_VDMA 962 962 ulSize = ulAvailable / 2; 963 963 if (ulSize > VBOXWDDM_C_VDMA_BUFFER_SIZE) … … 973 973 #endif 974 974 rc = vboxVdmaCreate (PrimaryExtension, &PrimaryExtension->u.primary.Vdma 975 #ifdef VBOX VDMA975 #ifdef VBOX_WITH_VDMA 976 976 , offset, ulSize 977 977 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoIf.h
r32580 r32877 24 24 #include <VBox/VBoxVideo.h> 25 25 #include "../../../include/VBoxDisplay.h" 26 #include "VBoxUhgsmi.h" 26 27 27 28 #include <iprt/assert.h> … … 29 30 30 31 /* One would increase this whenever definitions in this file are changed */ 31 #define VBOXVIDEOIF_VERSION 532 #define VBOXVIDEOIF_VERSION 6 32 33 33 34 /* create allocation func */ … … 42 43 /* custom allocation types requested from user-mode d3d module will go here */ 43 44 , VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC 45 , VBOXWDDM_ALLOC_TYPE_UMD_HGSMI_BUFFER 44 46 } VBOXWDDM_ALLOC_TYPE; 45 47 … … 69 71 { 70 72 VBOXWDDM_ALLOC_TYPE enmType; 71 D3DDDI_RESOURCEFLAGS fFlags; 72 HANDLE hSharedHandle; 73 VBOXWDDM_SURFACE_DESC SurfDesc; 73 union 74 { 75 struct 76 { 77 D3DDDI_RESOURCEFLAGS fFlags; 78 HANDLE hSharedHandle; 79 VBOXWDDM_SURFACE_DESC SurfDesc; 80 }; 81 82 struct 83 { 84 uint32_t cbBuffer; 85 HANDLE hSynch; 86 VBOXUHGSMI_SYNCHOBJECT_TYPE enmSynchType; 87 }; 88 }; 74 89 } VBOXWDDM_ALLOCINFO, *PVBOXWDDM_ALLOCINFO; 75 90 … … 100 115 // VBOXWDDM_ALLOCINFO aAllocInfos[1]; 101 116 } VBOXWDDM_RCINFO, *PVBOXWDDM_RCINFO; 117 118 typedef struct VBOXWDDM_DMA_PRIVATEDATA_FLAFS 119 { 120 union 121 { 122 struct 123 { 124 UINT bCmdInDmaBuffer : 1; 125 UINT bReserved : 31; 126 }; 127 uint32_t Value; 128 }; 129 } VBOXWDDM_DMA_PRIVATEDATA_FLAFS, *PVBOXWDDM_DMA_PRIVATEDATA_FLAFS; 130 131 typedef struct VBOXWDDM_DMA_PRIVATEDATA_BASEHDR 132 { 133 VBOXVDMACMD_TYPE enmCmd; 134 union 135 { 136 VBOXWDDM_DMA_PRIVATEDATA_FLAFS fFlags; 137 uint32_t u32CmdReserved; 138 }; 139 } VBOXWDDM_DMA_PRIVATEDATA_BASEHDR, *PVBOXWDDM_DMA_PRIVATEDATA_BASEHDR; 140 141 typedef struct VBOXWDDM_UHGSMI_BUFFER_UI_SUBMIT_INFO 142 { 143 VBOXUHGSMI_BUFFER_SUBMIT_FLAGS fSubFlags; 144 uint32_t offData; 145 uint32_t cbData; 146 } VBOXWDDM_UHGSMI_BUFFER_UI_SUBMIT_INFO, *PVBOXWDDM_UHGSMI_BUFFER_UI_SUBMIT_INFO; 147 148 typedef struct VBOXWDDM_DMA_PRIVATEDATA_UM_CHROMIUM_CMD 149 { 150 VBOXWDDM_DMA_PRIVATEDATA_BASEHDR Base; 151 VBOXWDDM_UHGSMI_BUFFER_UI_SUBMIT_INFO aBufInfos[1]; 152 } VBOXWDDM_DMA_PRIVATEDATA_UM_CHROMIUM_CMD, *PVBOXWDDM_DMA_PRIVATEDATA_UM_CHROMIUM_CMD; 102 153 103 154 #define VBOXVHWA_F_ENABLED 0x00000001 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
r32823 r32877 717 717 PVBOXWDDM_CONTEXT pContext = pDmaCmd->DdiCmd.pContext; 718 718 NTSTATUS Status = STATUS_SUCCESS; 719 DXGK_INTERRUPT_TYPE enmComplType = DXGK_INTERRUPT_DMA_COMPLETED; 719 720 switch (pDmaCmd->enmCmd) 720 721 { … … 869 870 } 870 871 871 Status = vboxVdmaDdiCmdCompleted(pDevExt, &pDevExt->DdiCmdQueue, &pDmaCmd->DdiCmd );872 Status = vboxVdmaDdiCmdCompleted(pDevExt, &pDevExt->DdiCmdQueue, &pDmaCmd->DdiCmd, enmComplType); 872 873 Assert(Status == STATUS_SUCCESS); 873 874 … … 974 975 /* end */ 975 976 976 #ifdef VBOX VDMA977 #ifdef VBOX_WITH_VDMA 977 978 /* 978 979 * This is currently used by VDMA. It is invisible for Vdma API clients since … … 1063 1064 /* create a DMACommand buffer */ 1064 1065 int vboxVdmaCreate(PDEVICE_EXTENSION pDevExt, VBOXVDMAINFO *pInfo 1065 #ifdef VBOX VDMA1066 #ifdef VBOX_WITH_VDMA 1066 1067 , ULONG offBuffer, ULONG cbBuffer 1067 1068 #endif … … 1071 1072 pInfo->fEnabled = FALSE; 1072 1073 1073 #ifdef VBOX VDMA1074 #ifdef VBOX_WITH_VDMA 1074 1075 Assert((offBuffer & 0xfff) == 0); 1075 1076 Assert((cbBuffer & 0xfff) == 0); … … 1110 1111 rc = VERR_GENERAL_FAILURE; 1111 1112 } 1112 #ifdef VBOX VDMA1113 #ifdef VBOX_WITH_VDMA 1113 1114 else 1114 1115 drprintf((__FUNCTION__": HGSMIHeapSetup failed rc = 0x%x\n", rc)); … … 1132 1133 /* ensure nothing else is submitted */ 1133 1134 pInfo->fEnabled = FALSE; 1134 #ifdef VBOX VDMA1135 #ifdef VBOX_WITH_VDMA 1135 1136 int rc = vboxVdmaInformHost (pDevExt, pInfo, VBOXVDMA_CTL_TYPE_DISABLE); 1136 1137 AssertRC(rc); … … 1148 1149 if (pInfo->fEnabled) 1149 1150 return VINF_ALREADY_INITIALIZED; 1150 #ifdef VBOX VDMA1151 #ifdef VBOX_WITH_VDMA 1151 1152 int rc = vboxVdmaInformHost (pDevExt, pInfo, VBOXVDMA_CTL_TYPE_ENABLE); 1152 1153 Assert(RT_SUCCESS(rc)); … … 1160 1161 } 1161 1162 1162 #ifdef VBOX VDMA1163 #ifdef VBOX_WITH_VDMA 1163 1164 int vboxVdmaFlush (PDEVICE_EXTENSION pDevExt, PVBOXVDMAINFO pInfo) 1164 1165 { … … 1186 1187 if (pInfo->fEnabled) 1187 1188 rc = vboxVdmaDisable (pDevExt, pInfo); 1188 #ifdef VBOX VDMA1189 #ifdef VBOX_WITH_VDMA 1189 1190 VBoxUnmapAdapterMemory (pDevExt, (void**)&pInfo->CmdHeap.area.pu8Base, pInfo->CmdHeap.area.cbArea); 1190 1191 #endif … … 1195 1196 } 1196 1197 1197 #ifdef VBOX VDMA1198 #ifdef VBOX_WITH_VDMA 1198 1199 void vboxVdmaCBufDrFree (PVBOXVDMAINFO pInfo, PVBOXVDMACBUF_DR pDr) 1199 1200 { … … 1227 1228 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)pvContext; 1228 1229 PVBOXVDMAINFO pVdma = &pDevExt->u.primary.Vdma; 1229 DXGKARGCB_NOTIFY_INTERRUPT_DATA notify;1230 1230 PVBOXVDMACBUF_DR pDr = (PVBOXVDMACBUF_DR)pvCmd; 1231 1231 1232 memset(¬ify, 0, sizeof(DXGKARGCB_NOTIFY_INTERRUPT_DATA)); 1233 1234 PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pDr->u64GuestContext; 1232 DXGK_INTERRUPT_TYPE enmComplType; 1235 1233 1236 1234 if (RT_SUCCESS(pDr->rc)) 1237 1235 { 1238 notify.InterruptType = DXGK_INTERRUPT_DMA_COMPLETED; 1239 notify.DmaCompleted.SubmissionFenceId = pDr->u32FenceId; 1240 if (pContext) 1241 { 1242 notify.DmaCompleted.NodeOrdinal = pContext->NodeOrdinal; 1243 notify.DmaCompleted.EngineOrdinal = 0; 1244 pContext->uLastCompletedCmdFenceId = pDr->u32FenceId; 1245 } 1246 else 1247 pVdma->uLastCompletedPagingBufferCmdFenceId = pDr->u32FenceId; 1248 pDevExt->bSetNotifyDxDpc = TRUE; 1236 enmComplType = DXGK_INTERRUPT_DMA_COMPLETED; 1249 1237 } 1250 1238 else if (pDr->rc == VERR_INTERRUPTED) 1251 1239 { 1252 notify.InterruptType = DXGK_INTERRUPT_DMA_PREEMPTED; 1253 notify.DmaPreempted.PreemptionFenceId = pDr->u32FenceId; 1254 if (pContext) 1255 { 1256 notify.DmaPreempted.LastCompletedFenceId = pContext->uLastCompletedCmdFenceId; 1257 notify.DmaPreempted.NodeOrdinal = pContext->NodeOrdinal; 1258 notify.DmaPreempted.EngineOrdinal = 0; 1259 } 1260 else 1261 notify.DmaPreempted.LastCompletedFenceId = pVdma->uLastCompletedPagingBufferCmdFenceId; 1262 1263 pDevExt->bSetNotifyDxDpc = TRUE; 1240 Assert(0); 1241 enmComplType = DXGK_INTERRUPT_DMA_PREEMPTED; 1264 1242 } 1265 1243 else 1266 1244 { 1267 AssertBreakpoint(); 1268 notify.InterruptType = DXGK_INTERRUPT_DMA_FAULTED; 1269 notify.DmaFaulted.FaultedFenceId = pDr->u32FenceId; 1270 notify.DmaFaulted.Status = STATUS_UNSUCCESSFUL; /* @todo: better status ? */ 1271 if (pContext) 1272 { 1273 notify.DmaFaulted.NodeOrdinal = pContext->NodeOrdinal; 1274 notify.DmaFaulted.EngineOrdinal = 0; 1275 } 1276 pDevExt->bSetNotifyDxDpc = TRUE; 1277 } 1278 1279 pDevExt->u.primary.DxgkInterface.DxgkCbNotifyInterrupt(pDevExt->u.primary.DxgkInterface.DeviceHandle, ¬ify); 1280 1281 /* inform SHGSMI we want to be called at DPC later */ 1282 *ppfnCompletion = vboxVdmaCBufDrCompletion; 1283 *ppvCompletion = pvContext; 1245 Assert(0); 1246 enmComplType = DXGK_INTERRUPT_DMA_FAULTED; 1247 } 1248 1249 vboxVdmaDdiCmdCompletedIrq(pDevExt, &pDevExt->DdiCmdQueue, VBOXVDMADDI_CMD_FROM_BUF_DR(pDr), enmComplType); 1250 1251 /* inform SHGSMI we DO NOT want to be called at DPC later */ 1252 *ppfnCompletion = NULL; 1253 // *ppvCompletion = pvContext; 1284 1254 } 1285 1255 … … 1330 1300 } 1331 1301 1332 static VOID vboxVdmaDdiCmdNotifyCompletedIrq(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD_QUEUE pQueue, PVBOXVDMADDI_CMD pCmd )1302 static VOID vboxVdmaDdiCmdNotifyCompletedIrq(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD_QUEUE pQueue, PVBOXVDMADDI_CMD pCmd, DXGK_INTERRUPT_TYPE enmComplType) 1333 1303 { 1334 1304 DXGKARGCB_NOTIFY_INTERRUPT_DATA notify; 1335 1305 memset(¬ify, 0, sizeof(DXGKARGCB_NOTIFY_INTERRUPT_DATA)); 1336 notify.InterruptType = DXGK_INTERRUPT_DMA_COMPLETED; 1337 notify.DmaCompleted.SubmissionFenceId = pCmd->u32FenceId; 1338 notify.DmaCompleted.NodeOrdinal = pCmd->pContext->NodeOrdinal; 1339 notify.DmaCompleted.EngineOrdinal = 0; 1340 pCmd->pContext->uLastCompletedCmdFenceId = pCmd->u32FenceId; 1306 switch (enmComplType) 1307 { 1308 case DXGK_INTERRUPT_DMA_COMPLETED: 1309 notify.InterruptType = DXGK_INTERRUPT_DMA_COMPLETED; 1310 notify.DmaCompleted.SubmissionFenceId = pCmd->u32FenceId; 1311 if (pCmd->pContext) 1312 { 1313 notify.DmaCompleted.NodeOrdinal = pCmd->pContext->NodeOrdinal; 1314 pCmd->pContext->uLastCompletedCmdFenceId = pCmd->u32FenceId; 1315 } 1316 else 1317 { 1318 pDevExt->u.primary.Vdma.uLastCompletedPagingBufferCmdFenceId = pCmd->u32FenceId; 1319 } 1320 1321 InsertTailList(&pQueue->DpcCmdQueue, &pCmd->QueueEntry); 1322 1323 break; 1324 case DXGK_INTERRUPT_DMA_PREEMPTED: 1325 Assert(0); 1326 notify.InterruptType = DXGK_INTERRUPT_DMA_PREEMPTED; 1327 notify.DmaPreempted.PreemptionFenceId = pCmd->u32FenceId; 1328 if (pCmd->pContext) 1329 { 1330 notify.DmaPreempted.LastCompletedFenceId = pCmd->pContext->uLastCompletedCmdFenceId; 1331 notify.DmaPreempted.NodeOrdinal = pCmd->pContext->NodeOrdinal; 1332 } 1333 else 1334 { 1335 notify.DmaPreempted.LastCompletedFenceId = pDevExt->u.primary.Vdma.uLastCompletedPagingBufferCmdFenceId; 1336 } 1337 break; 1338 1339 case DXGK_INTERRUPT_DMA_FAULTED: 1340 Assert(0); 1341 notify.InterruptType = DXGK_INTERRUPT_DMA_FAULTED; 1342 notify.DmaFaulted.FaultedFenceId = pCmd->u32FenceId; 1343 notify.DmaFaulted.Status = STATUS_UNSUCCESSFUL; /* @todo: better status ? */ 1344 if (pCmd->pContext) 1345 { 1346 notify.DmaFaulted.NodeOrdinal = pCmd->pContext->NodeOrdinal; 1347 } 1348 break; 1349 default: 1350 Assert(0); 1351 break; 1352 } 1341 1353 1342 1354 pDevExt->u.primary.DxgkInterface.DxgkCbNotifyInterrupt(pDevExt->u.primary.DxgkInterface.DeviceHandle, ¬ify); 1343 1344 InsertTailList(&pQueue->DpcCmdQueue, &pCmd->QueueEntry);1345 1355 } 1346 1356 … … 1364 1374 } 1365 1375 1366 BOOLEAN vboxVdmaDdiCmdCompletedIrq(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD_QUEUE pQueue, PVBOXVDMADDI_CMD pCmd )1376 BOOLEAN vboxVdmaDdiCmdCompletedIrq(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD_QUEUE pQueue, PVBOXVDMADDI_CMD pCmd, DXGK_INTERRUPT_TYPE enmComplType) 1367 1377 { 1368 1378 BOOLEAN bQueued = pCmd->enmState > VBOXVDMADDI_STATE_NOT_QUEUED; … … 1390 1400 if (bComplete) 1391 1401 { 1392 vboxVdmaDdiCmdNotifyCompletedIrq(pDevExt, pQueue, pCmd );1402 vboxVdmaDdiCmdNotifyCompletedIrq(pDevExt, pQueue, pCmd, enmComplType); 1393 1403 1394 1404 while (!IsListEmpty(&pQueue->CmdQueue)) … … 1398 1408 { 1399 1409 vboxVdmaDdiCmdDequeueIrq(pQueue, pCmd); 1400 vboxVdmaDdiCmdNotifyCompletedIrq(pDevExt, pQueue, pCmd );1410 vboxVdmaDdiCmdNotifyCompletedIrq(pDevExt, pQueue, pCmd, pCmd->enmComplType); 1401 1411 } 1402 1412 else … … 1407 1417 { 1408 1418 pCmd->enmState = VBOXVDMADDI_STATE_COMPLETED; 1419 pCmd->enmComplType = enmComplType; 1409 1420 } 1410 1421 … … 1426 1437 PVBOXVDMADDI_CMD_QUEUE pQueue; 1427 1438 PVBOXVDMADDI_CMD pCmd; 1439 DXGK_INTERRUPT_TYPE enmComplType; 1428 1440 } VBOXVDMADDI_CMD_COMPLETED_CB, *PVBOXVDMADDI_CMD_COMPLETED_CB; 1429 1441 … … 1431 1443 { 1432 1444 PVBOXVDMADDI_CMD_COMPLETED_CB pdc = (PVBOXVDMADDI_CMD_COMPLETED_CB)Context; 1433 BOOLEAN bNeedDps = vboxVdmaDdiCmdCompletedIrq(pdc->pDevExt, pdc->pQueue, pdc->pCmd );1445 BOOLEAN bNeedDps = vboxVdmaDdiCmdCompletedIrq(pdc->pDevExt, pdc->pQueue, pdc->pCmd, pdc->enmComplType); 1434 1446 pdc->pDevExt->bNotifyDxDpc |= bNeedDps; 1435 1447 … … 1437 1449 } 1438 1450 1439 NTSTATUS vboxVdmaDdiCmdCompleted(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD_QUEUE pQueue, PVBOXVDMADDI_CMD pCmd )1451 NTSTATUS vboxVdmaDdiCmdCompleted(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD_QUEUE pQueue, PVBOXVDMADDI_CMD pCmd, DXGK_INTERRUPT_TYPE enmComplType) 1440 1452 { 1441 1453 VBOXVDMADDI_CMD_COMPLETED_CB context; … … 1443 1455 context.pQueue = pQueue; 1444 1456 context.pCmd = pCmd; 1457 context.enmComplType = enmComplType; 1445 1458 BOOLEAN bNeedDps; 1446 1459 NTSTATUS Status = pDevExt->u.primary.DxgkInterface.DxgkCbSynchronizeExecution( … … 1535 1548 } 1536 1549 1537 NTSTATUS vboxVdmaDdiCmdFenceComplete(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_CONTEXT pContext, uint32_t u32FenceId )1550 NTSTATUS vboxVdmaDdiCmdFenceComplete(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_CONTEXT pContext, uint32_t u32FenceId, DXGK_INTERRUPT_TYPE enmComplType) 1538 1551 { 1539 1552 if (vboxVdmaDdiCmdCanComplete(&pDevExt->DdiCmdQueue)) … … 1545 1558 { 1546 1559 vboxVdmaDdiCmdInit(pCmd, u32FenceId, pContext, vboxVdmaDdiCmdCompletionCbFree, NULL); 1547 NTSTATUS Status = vboxVdmaDdiCmdCompleted(pDevExt, &pDevExt->DdiCmdQueue, pCmd );1560 NTSTATUS Status = vboxVdmaDdiCmdCompleted(pDevExt, &pDevExt->DdiCmdQueue, pCmd, enmComplType); 1548 1561 Assert(Status == STATUS_SUCCESS); 1549 1562 if (Status == STATUS_SUCCESS) -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h
r32823 r32877 37 37 VBOXVDMADDI_STATE enmState; 38 38 uint32_t u32FenceId; 39 DXGK_INTERRUPT_TYPE enmComplType; 39 40 PVBOXWDDM_CONTEXT pContext; 40 41 PFNVBOXVDMADDICMDCOMPLETE_DPC pfnComplete; … … 50 51 51 52 VOID vboxVdmaDdiQueueInit(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD_QUEUE pQueue); 52 BOOLEAN vboxVdmaDdiCmdCompletedIrq(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD_QUEUE pQueue, PVBOXVDMADDI_CMD pCmd );53 BOOLEAN vboxVdmaDdiCmdCompletedIrq(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD_QUEUE pQueue, PVBOXVDMADDI_CMD pCmd, DXGK_INTERRUPT_TYPE enmComplType); 53 54 VOID vboxVdmaDdiCmdSubmittedIrq(PVBOXVDMADDI_CMD_QUEUE pQueue, PVBOXVDMADDI_CMD pCmd); 54 55 55 NTSTATUS vboxVdmaDdiCmdCompleted(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD_QUEUE pQueue, PVBOXVDMADDI_CMD pCmd );56 NTSTATUS vboxVdmaDdiCmdCompleted(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD_QUEUE pQueue, PVBOXVDMADDI_CMD pCmd, DXGK_INTERRUPT_TYPE enmComplType); 56 57 NTSTATUS vboxVdmaDdiCmdSubmitted(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD_QUEUE pQueue, PVBOXVDMADDI_CMD pCmd); 57 58 … … 69 70 } 70 71 71 NTSTATUS vboxVdmaDdiCmdFenceComplete(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_CONTEXT pContext, uint32_t u32FenceId );72 NTSTATUS vboxVdmaDdiCmdFenceComplete(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_CONTEXT pContext, uint32_t u32FenceId, DXGK_INTERRUPT_TYPE enmComplType); 72 73 73 74 DECLCALLBACK(VOID) vboxVdmaDdiCmdCompletionCbFree(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD pCmd, PVOID pvContext); … … 247 248 typedef struct VBOXVDMAINFO 248 249 { 249 #ifdef VBOX VDMA250 #ifdef VBOX_WITH_VDMA 250 251 HGSMIHEAP CmdHeap; 251 252 #endif … … 260 261 261 262 int vboxVdmaCreate (struct _DEVICE_EXTENSION* pDevExt, VBOXVDMAINFO *pInfo 262 #ifdef VBOX VDMA263 #ifdef VBOX_WITH_VDMA 263 264 , ULONG offBuffer, ULONG cbBuffer 264 265 #endif … … 271 272 int vboxVdmaDestroy (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo); 272 273 273 #ifdef VBOX VDMA274 #ifdef VBOX_WITH_VDMA 274 275 int vboxVdmaFlush (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo); 275 276 int vboxVdmaCBufDrSubmit (struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo, PVBOXVDMACBUF_DR pDr); … … 280 281 #define VBOXVDMACBUF_DR_SIZE(_cbData) (VBOXVDMACBUF_DR_DATA_OFFSET() + (_cbData)) 281 282 #define VBOXVDMACBUF_DR_DATA(_pDr) ( ((uint8_t*)(_pDr)) + VBOXVDMACBUF_DR_DATA_OFFSET() ) 283 284 AssertCompile(sizeof (VBOXVDMADDI_CMD) <= RT_SIZEOFMEMB(VBOXVDMACBUF_DR, aGuestData)); 285 #define VBOXVDMADDI_CMD_FROM_BUF_DR(_pDr) ((PVBOXVDMADDI_CMD)(_pDr)->aGuestData) 286 #define VBOXVDMACBUF_DR_FROM_DDI_CMD(_pCmd) ((PVBOXVDMACBUF_DR)(((uint_8*)(_pCmd)) - RT_OFFSETOF(VBOXVDMACBUF_DR, aGuestData))) 287 282 288 #endif 283 289 NTSTATUS vboxVdmaGgCmdSubmit(PVBOXVDMAGG pVdma, PVBOXVDMAPIPE_CMD_DR pCmd); … … 287 293 #define VBOXVDMAPIPE_CMD_DR_FROM_DDI_CMD(_pCmd) ((PVBOXVDMAPIPE_CMD_DR)(((uint8_t*)(_pCmd)) - RT_OFFSETOF(VBOXVDMAPIPE_CMD_DR, DdiCmd))) 288 294 DECLCALLBACK(VOID) vboxVdmaGgDdiCmdDestroy(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD pCmd, PVOID pvContext); 289 290 295 #endif /* #ifndef ___VBoxVideoVdma_h___ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r32876 r32877 47 47 GhData.Flags.Value = 0; 48 48 return (PVBOXWDDM_ALLOCATION)pDevExt->u.primary.DxgkInterface.DxgkCbGetHandleData(&GhData); 49 } 50 51 DECLINLINE(PVBOXWDDM_ALLOCATION) vboxWddmGetAllocationFromAllocList(PDEVICE_EXTENSION pDevExt, DXGK_ALLOCATIONLIST *pAllocList) 52 { 53 return vboxWddmGetAllocationFromOpenData(pDevExt, (PVBOXWDDM_OPENALLOCATION)pAllocList->hDeviceSpecificAllocation); 54 } 55 56 static void vboxWddmPopulateDmaAllocInfo(PVBOXWDDM_DMA_ALLOCINFO pInfo, PVBOXWDDM_ALLOCATION pAlloc, DXGK_ALLOCATIONLIST *pDmaAlloc) 57 { 58 pInfo->pAlloc = pAlloc; 59 if (pDmaAlloc->SegmentId) 60 { 61 pInfo->offAlloc = (VBOXVIDEOOFFSET)pDmaAlloc->PhysicalAddress.QuadPart; 62 pInfo->segmentIdAlloc = pDmaAlloc->SegmentId; 63 } 64 else 65 pInfo->segmentIdAlloc = 0; 66 pInfo->srcId = pAlloc->SurfDesc.VidPnSourceId; 49 67 } 50 68 … … 246 264 HGSMIHEAP* vboxWddmHgsmiGetHeapFromCmdOffset(PDEVICE_EXTENSION pDevExt, HGSMIOFFSET offCmd) 247 265 { 248 #ifdef VBOX VDMA266 #ifdef VBOX_WITH_VDMA 249 267 if(HGSMIAreaContainsOffset(&pDevExt->u.primary.Vdma.CmdHeap.area, offCmd)) 250 268 return &pDevExt->u.primary.Vdma.CmdHeap; … … 259 277 VBOXWDDM_HGSMICMD_TYPE_UNDEFINED = 0, 260 278 VBOXWDDM_HGSMICMD_TYPE_CTL = 1, 261 #ifdef VBOX VDMA279 #ifdef VBOX_WITH_VDMA 262 280 VBOXWDDM_HGSMICMD_TYPE_DMACMD = 2 263 281 #endif … … 266 284 VBOXWDDM_HGSMICMD_TYPE vboxWddmHgsmiGetCmdTypeFromOffset(PDEVICE_EXTENSION pDevExt, HGSMIOFFSET offCmd) 267 285 { 268 #ifdef VBOX VDMA286 #ifdef VBOX_WITH_VDMA 269 287 if(HGSMIAreaContainsOffset(&pDevExt->u.primary.Vdma.CmdHeap.area, offCmd)) 270 288 return VBOXWDDM_HGSMICMD_TYPE_DMACMD; … … 764 782 { 765 783 VBOXSHGSMILIST CtlList; 766 #ifdef VBOX VDMA784 #ifdef VBOX_WITH_VDMA 767 785 VBOXSHGSMILIST DmaCmdList; 768 786 #endif 769 787 vboxSHGSMIListInit(&CtlList); 770 #ifdef VBOX VDMA788 #ifdef VBOX_WITH_VDMA 771 789 vboxSHGSMIListInit(&DmaCmdList); 772 790 #endif … … 793 811 switch (enmType) 794 812 { 795 #ifdef VBOX VDMA813 #ifdef VBOX_WITH_VDMA 796 814 case VBOXWDDM_HGSMICMD_TYPE_DMACMD: 797 815 pList = &DmaCmdList; … … 816 834 switch (chInfo) 817 835 { 818 #ifdef VBOX VDMA836 #ifdef VBOX_WITH_VDMA 819 837 case VBVA_VDMA_CMD: 820 838 case VBVA_VDMA_CTL: … … 855 873 bNeedDpc = TRUE; 856 874 } 857 #ifdef VBOX VDMA875 #ifdef VBOX_WITH_VDMA 858 876 if (!vboxSHGSMIListIsEmpty(&DmaCmdList)) 859 877 { … … 904 922 { 905 923 VBOXSHGSMILIST CtlList; 906 #ifdef VBOX VDMA924 #ifdef VBOX_WITH_VDMA 907 925 VBOXSHGSMILIST DmaCmdList; 908 926 #endif … … 925 943 926 944 vboxSHGSMIListDetach2List(&pdc->pDevExt->CtlList, &pdc->data.CtlList); 927 #ifdef VBOX VDMA945 #ifdef VBOX_WITH_VDMA 928 946 vboxSHGSMIListDetach2List(&pdc->pDevExt->DmaCmdList, &pdc->data.DmaCmdList); 929 947 #endif … … 967 985 AssertRC(rc); 968 986 } 969 #ifdef VBOX VDMA987 #ifdef VBOX_WITH_VDMA 970 988 if (!vboxSHGSMIListIsEmpty(&context.data.DmaCmdList)) 971 989 { … … 1964 1982 case VBOXVDMACMD_TYPE_DMA_NOP: 1965 1983 break; 1984 case VBOXVDMACMD_TYPE_CHROMIUM_CMD: 1985 { 1986 uint8_t * pPrivateBuf = (uint8_t*)pPrivateDataBase; 1987 for (UINT i = pPatch->PatchLocationListSubmissionStart; i < pPatch->PatchLocationListSubmissionLength; ++i) 1988 { 1989 const D3DDDI_PATCHLOCATIONLIST* pPatchList = &pPatch->pPatchLocationList[i]; 1990 Assert(pPatchList->AllocationIndex < pPatch->AllocationListSize); 1991 const DXGK_ALLOCATIONLIST *pAllocationList = &pPatch->pAllocationList[pPatchList->AllocationIndex]; 1992 Assert(pAllocationList->SegmentId); 1993 if (pAllocationList->SegmentId) 1994 { 1995 DXGK_ALLOCATIONLIST *pAllocation2Patch = (DXGK_ALLOCATIONLIST*)pPrivateBuf + pPatchList->PatchOffset; 1996 pAllocation2Patch->SegmentId = pAllocationList->SegmentId; 1997 pAllocation2Patch->PhysicalAddress = pAllocationList->PhysicalAddress; 1998 } 1999 } 2000 break; 2001 } 1966 2002 default: 1967 2003 { … … 2051 2087 Assert(cNew < UINT32_MAX/2); 2052 2088 } 2053 vboxVdmaDdiCmdCompleted(pDevExt, &pDevExt->DdiCmdQueue, &pCmd->DdiCmd );2089 vboxVdmaDdiCmdCompleted(pDevExt, &pDevExt->DdiCmdQueue, &pCmd->DdiCmd, DXGK_INTERRUPT_DMA_FAULTED); 2054 2090 } 2055 2091 } … … 2079 2115 else 2080 2116 { 2081 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext, u32FenceId );2117 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext, u32FenceId, DXGK_INTERRUPT_DMA_FAULTED); 2082 2118 } 2083 2119 … … 2085 2121 } 2086 2122 2123 #ifdef VBOX_WITH_VDMA 2124 DECLCALLBACK(VOID) vboxWddmDmaCompleteChromiumCmd(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD pCmd, PVOID pvContext) 2125 { 2126 PVBOXVDMACBUF_DR pDr = (pDr)pvContext; 2127 PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD); 2128 UINT cBufs = pHdr->u32CmdSpecific; 2129 VBOXVDMACMD_CHROMIUM_CMD *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_CHROMIUM_CMD); 2130 for (UINT i = 0; i < cBufs; ++i) 2131 { 2132 VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[i]; 2133 if (!pBufCmd->u32GuesData) 2134 { 2135 /* signal completion */ 2136 PVBOXWDDM_ALLOCATION pAlloc = (PVBOXWDDM_ALLOCATION)pBufCmd->u64GuesData; 2137 switch (pAlloc->enmSynchType) 2138 { 2139 case VBOXUHGSMI_SYNCHOBJECT_TYPE_EVENT: 2140 KeSetEvent(pAlloc->pSynchEvent, 3, FALSE); 2141 break; 2142 case VBOXUHGSMI_SYNCHOBJECT_TYPE_SEMAPHORE: 2143 KeReleaseSemaphore(pAlloc->pSynchSemaphore, 2144 3, 2145 1, 2146 FALSE); 2147 break; 2148 default: 2149 Assert(0); 2150 } 2151 } 2152 } 2153 2154 vboxVdmaCBufDrFree(&pDevExt->u.primary.Vdma, pDr); 2155 } 2156 2157 #endif 2087 2158 NTSTATUS 2088 2159 APIENTRY … … 2140 2211 /* get DPC data at IRQL */ 2141 2212 2142 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext, pSubmitCommand->SubmissionFenceId );2213 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext, pSubmitCommand->SubmissionFenceId, DXGK_INTERRUPT_DMA_COMPLETED); 2143 2214 break; 2144 2215 } … … 2251 2322 if (bComplete) 2252 2323 { 2253 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext, pSubmitCommand->SubmissionFenceId );2324 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext, pSubmitCommand->SubmissionFenceId, DXGK_INTERRUPT_DMA_COMPLETED); 2254 2325 } 2255 2326 break; 2327 } 2328 case VBOXVDMACMD_TYPE_CHROMIUM_CMD: 2329 { 2330 #ifdef VBOX_WITH_VDMA 2331 VBOXWDDM_DMA_PRIVATEDATA_CHROMIUM_CMD *pChromiumCmd = (VBOXWDDM_DMA_PRIVATEDATA_CHROMIUM_CMD*)pPrivateDataBase; 2332 UINT cbCmd = VBOXVDMACMD_SIZE_FROMBODYSIZE(RT_OFFSETOF(VBOXVDMACMD_CHROMIUM_CMD, aBuffers[pChromiumCmd->Base.u32CmdReserved])); 2333 2334 PVBOXVDMACBUF_DR pDr = vboxVdmaCBufDrCreate (&pDevExt->u.primary.Vdma, cbCmd); 2335 if (!pDr) 2336 { 2337 /* @todo: try flushing.. */ 2338 drprintf((__FUNCTION__": vboxVdmaCBufDrCreate returned NULL\n")); 2339 return STATUS_INSUFFICIENT_RESOURCES; 2340 } 2341 // vboxVdmaCBufDrCreate zero initializes the pDr 2342 pDr->fFlags = VBOXVDMACBUF_FLAG_BUF_FOLLOWS_DR; 2343 pDr->cbBuf = cbCmd; 2344 pDr->u32FenceId = pSubmitCommand->SubmissionFenceId; 2345 pDr->rc = VERR_NOT_IMPLEMENTED; 2346 pDr->u64GuestContext = (uint64_t)pContext; 2347 2348 PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD); 2349 pHdr->enmType = VBOXVDMACMD_TYPE_CHROMIUM_CMD; 2350 pHdr->u32CmdSpecific = pChromiumCmd->Base.u32CmdReserved; 2351 VBOXVDMACMD_CHROMIUM_CMD *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_CHROMIUM_CMD); 2352 for (UINT i = 0; i < pChromiumCmd->Base.u32CmdReserved; ++i) 2353 { 2354 VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[i]; 2355 VBOXWDDM_UHGSMI_BUFFER_SUBMIT_INFO *pBufInfo = &pChromiumCmd->aBufInfos[i]; 2356 2357 pBufCmd->offBuffer = pBufInfo->Alloc.offAlloc; 2358 pBufCmd->cbBuffer = pBufInfo->cbData; 2359 pBufCmd->u32GuesData = pBufInfo->bDoNotSignalCompletion; 2360 pBufCmd->u64GuesData = (uint64_t)pBufInfo->Alloc.pAlloc; 2361 } 2362 2363 PVBOXVDMADDI_CMD pDdiCmd = VBOXVDMADDI_CMD_FROM_BUF_DR(pDr); 2364 vboxVdmaDdiCmdInit(pDdiCmd, pSubmitCommand->SubmissionFenceId, pContext, vboxWddmDmaCompleteChromiumCmd, pDr); 2365 NTSTATUS Status = vboxVdmaDdiCmdSubmitted(pDevExt, &pDevExt->DdiCmdQueue, &pCmd->DdiCmd); 2366 Assert(Status == STATUS_SUCCESS); 2367 if (Status == STATUS_SUCCESS) 2368 { 2369 int rc = vboxVdmaCBufDrSubmit(pDevExt, &pDevExt->u.primary.Vdma, pDr); 2370 Assert(rc == VINF_SUCCESS); 2371 } 2372 else 2373 { 2374 vboxVdmaCBufDrFree(&pDevExt->u.primary.Vdma, pDr); 2375 } 2376 #else 2377 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext, pSubmitCommand->SubmissionFenceId, DXGK_INTERRUPT_DMA_COMPLETED); 2378 Assert(Status == STATUS_SUCCESS); 2379 #endif 2256 2380 } 2257 2381 case VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP: … … 2275 2399 else 2276 2400 { 2277 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext, pSubmitCommand->SubmissionFenceId );2401 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext, pSubmitCommand->SubmissionFenceId, DXGK_INTERRUPT_DMA_FAULTED); 2278 2402 Assert(Status == STATUS_SUCCESS); 2279 2403 } … … 2303 2427 else 2304 2428 { 2305 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext, pSubmitCommand->SubmissionFenceId );2429 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext, pSubmitCommand->SubmissionFenceId, DXGK_INTERRUPT_DMA_FAULTED); 2306 2430 Assert(Status == STATUS_SUCCESS); 2307 2431 } … … 2311 2435 case VBOXVDMACMD_TYPE_DMA_NOP: 2312 2436 { 2313 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext, pSubmitCommand->SubmissionFenceId );2437 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext, pSubmitCommand->SubmissionFenceId, DXGK_INTERRUPT_DMA_COMPLETED); 2314 2438 Assert(Status == STATUS_SUCCESS); 2315 2439 break; … … 2318 2442 { 2319 2443 AssertBreakpoint(); 2320 #ifdef VBOX VDMA2444 #ifdef VBOX_WITH_VDMA 2321 2445 VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR *pPrivateData = (VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR*)pPrivateDataBase; 2322 2446 PVBOXVDMACBUF_DR pDr = vboxVdmaCBufDrCreate (&pDevExt->u.primary.Vdma, 0); … … 3384 3508 } 3385 3509 } 3386 #ifdef VBOX VDMA3510 #ifdef VBOX_WITH_VDMA 3387 3511 else 3388 3512 { … … 3835 3959 return STATUS_INVALID_PARAMETER; 3836 3960 } 3837 3961 if (pRender->CommandLength < sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR)) 3962 { 3963 Assert(0); 3964 drprintf((__FUNCTION__": Present->DmaBufferPrivateDataSize(%d) < sizeof VBOXWDDM_DMA_PRIVATEDATA_BASEHDR (%d)\n", 3965 pRender->DmaBufferPrivateDataSize , sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR))); 3966 /* @todo: can this actually happen? what status to return? */ 3967 return STATUS_INVALID_PARAMETER; 3968 } 3969 3970 PVBOXWDDM_DMA_PRIVATEDATA_BASEHDR pInputHdr = (PVBOXWDDM_DMA_PRIVATEDATA_BASEHDR)pRender->pCommand; 3838 3971 NTSTATUS Status = STATUS_SUCCESS; 3839 PVBOXWDDM_DMA_PRIVATEDATA_BASEHDR pPrivateData = (PVBOXWDDM_DMA_PRIVATEDATA_BASEHDR)pRender->pDmaBufferPrivateData; 3840 pPrivateData->enmCmd = VBOXVDMACMD_TYPE_DMA_NOP; 3841 3842 pRender->pDmaBufferPrivateData = (uint8_t*)pRender->pDmaBufferPrivateData + sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR); 3843 pRender->pDmaBuffer = ((uint8_t*)pRender->pDmaBuffer) + pRender->CommandLength; 3844 Assert(pRender->DmaSize >= pRender->CommandLength); 3845 Assert(pRender->PatchLocationListOutSize >= pRender->PatchLocationListInSize); 3846 UINT cbPLL = pRender->PatchLocationListInSize * sizeof (pRender->pPatchLocationListOut[0]); 3847 memcpy(pRender->pPatchLocationListOut, pRender->pPatchLocationListIn, cbPLL); 3848 pRender->pPatchLocationListOut += pRender->PatchLocationListInSize; 3972 switch (pInputHdr->enmCmd) 3973 { 3974 case VBOXVDMACMD_TYPE_CHROMIUM_CMD: 3975 { 3976 if (pRender->CommandLength != RT_OFFSETOF(VBOXWDDM_DMA_PRIVATEDATA_UM_CHROMIUM_CMD, aBufInfos[pInputHdr->u32CmdReserved])) 3977 { 3978 Assert(0); 3979 return STATUS_INVALID_PARAMETER; 3980 } 3981 PVBOXWDDM_DMA_PRIVATEDATA_UM_CHROMIUM_CMD pUmCmd = (PVBOXWDDM_DMA_PRIVATEDATA_UM_CHROMIUM_CMD)pInputHdr; 3982 PVBOXWDDM_DMA_PRIVATEDATA_CHROMIUM_CMD pChromiumCmd = (PVBOXWDDM_DMA_PRIVATEDATA_CHROMIUM_CMD)pRender->pDmaBufferPrivateData; 3983 const uint32_t cbDma = RT_OFFSETOF(VBOXWDDM_DMA_PRIVATEDATA_CHROMIUM_CMD, aBufInfos[pInputHdr->u32CmdReserved]); 3984 if (pRender->DmaBufferPrivateDataSize < cbDma) 3985 { 3986 Assert(0); 3987 return STATUS_INVALID_PARAMETER; 3988 } 3989 if (pRender->DmaSize < cbDma) 3990 { 3991 Assert(0); 3992 return STATUS_INVALID_PARAMETER; 3993 } 3994 3995 if (pRender->PatchLocationListOutSize < pInputHdr->u32CmdReserved) 3996 { 3997 Assert(0); 3998 return STATUS_INVALID_PARAMETER; 3999 } 4000 4001 PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)hContext; 4002 PVBOXWDDM_DEVICE pDevice = pContext->pDevice; 4003 PDEVICE_EXTENSION pDevExt = pDevice->pAdapter; 4004 4005 pChromiumCmd->Base.enmCmd = VBOXVDMACMD_TYPE_CHROMIUM_CMD; 4006 pChromiumCmd->Base.u32CmdReserved = pInputHdr->u32CmdReserved; 4007 pRender->pDmaBufferPrivateData = (uint8_t*)pRender->pDmaBufferPrivateData + cbDma; 4008 pRender->pDmaBuffer = ((uint8_t*)pRender->pDmaBuffer) + cbDma; 4009 D3DDDI_PATCHLOCATIONLIST* pPLL = pRender->pPatchLocationListOut; 4010 memset(pPLL, 0, sizeof (*pPLL) * pChromiumCmd->Base.u32CmdReserved); 4011 pRender->pPatchLocationListOut += pInputHdr->u32CmdReserved; 4012 PVBOXWDDM_UHGSMI_BUFFER_SUBMIT_INFO pSubmInfo = pChromiumCmd->aBufInfos; 4013 PVBOXWDDM_UHGSMI_BUFFER_UI_SUBMIT_INFO pSubmUmInfo = pUmCmd->aBufInfos; 4014 DXGK_ALLOCATIONLIST *pAllocationList = pRender->pAllocationList; 4015 for (UINT i = 0; i < pChromiumCmd->Base.u32CmdReserved; ++i) 4016 { 4017 PVBOXWDDM_ALLOCATION pAlloc = vboxWddmGetAllocationFromAllocList(pDevExt, pAllocationList); 4018 vboxWddmPopulateDmaAllocInfo(&pSubmInfo->Alloc, pAlloc, pAllocationList); 4019 4020 pSubmInfo->cbData = pSubmUmInfo->cbData; 4021 pSubmInfo->bDoNotSignalCompletion = pSubmUmInfo->fSubFlags.bDoNotSignalCompletion; 4022 4023 pPLL->AllocationIndex = i; 4024 pPLL->PatchOffset = RT_OFFSETOF(VBOXWDDM_DMA_PRIVATEDATA_CHROMIUM_CMD, aBufInfos[i].Alloc); 4025 pPLL->AllocationOffset = pSubmUmInfo->offData; 4026 4027 ++pPLL; 4028 ++pSubmInfo; 4029 ++pSubmUmInfo; 4030 ++pAllocationList; 4031 } 4032 4033 break; 4034 } 4035 case VBOXVDMACMD_TYPE_DMA_NOP: 4036 { 4037 PVBOXWDDM_DMA_PRIVATEDATA_BASEHDR pPrivateData = (PVBOXWDDM_DMA_PRIVATEDATA_BASEHDR)pRender->pDmaBufferPrivateData; 4038 pPrivateData->enmCmd = VBOXVDMACMD_TYPE_DMA_NOP; 4039 4040 pRender->pDmaBufferPrivateData = (uint8_t*)pRender->pDmaBufferPrivateData + sizeof (VBOXWDDM_DMA_PRIVATEDATA_BASEHDR); 4041 pRender->pDmaBuffer = ((uint8_t*)pRender->pDmaBuffer) + pRender->CommandLength; 4042 Assert(pRender->DmaSize >= pRender->CommandLength); 4043 Assert(pRender->PatchLocationListOutSize >= pRender->PatchLocationListInSize); 4044 UINT cbPLL = pRender->PatchLocationListInSize * sizeof (pRender->pPatchLocationListOut[0]); 4045 memcpy(pRender->pPatchLocationListOut, pRender->pPatchLocationListIn, cbPLL); 4046 pRender->pPatchLocationListOut += pRender->PatchLocationListInSize; 4047 break; 4048 } 4049 default: 4050 return STATUS_INVALID_PARAMETER; 4051 } 3849 4052 3850 4053 drprintf(("<== "__FUNCTION__ ", hContext(0x%x)\n", hContext)); … … 3856 4059 #define VBOXVDMACMD_DMA_PRESENT_BLT_SIZE(_c) (VBOXVDMACMD_BODY_FIELD_OFFSET(UINT, VBOXVDMACMD_DMA_PRESENT_BLT, aDstSubRects[_c])) 3857 4060 3858 DECLINLINE(PVBOXWDDM_ALLOCATION) vboxWddmGetAllocationFromAllocList(PDEVICE_EXTENSION pDevExt, DXGK_ALLOCATIONLIST *pAllocList) 3859 { 3860 return vboxWddmGetAllocationFromOpenData(pDevExt, (PVBOXWDDM_OPENALLOCATION)pAllocList->hDeviceSpecificAllocation); 3861 } 3862 3863 #ifdef VBOXVDMA 4061 #ifdef VBOX_WITH_VDMA 3864 4062 DECLINLINE(VOID) vboxWddmRectlFromRect(const RECT *pRect, PVBOXVDMA_RECTL pRectl) 3865 4063 { … … 3916 4114 #endif 3917 4115 3918 static void vboxWddmPopulateDmaAllocInfo(PVBOXWDDM_DMA_ALLOCINFO pInfo, PVBOXWDDM_ALLOCATION pAlloc, DXGK_ALLOCATIONLIST *pDmaAlloc)3919 {3920 pInfo->pAlloc = pAlloc;3921 if (pDmaAlloc->SegmentId)3922 {3923 pInfo->offAlloc = (VBOXVIDEOOFFSET)pDmaAlloc->PhysicalAddress.QuadPart;3924 pInfo->segmentIdAlloc = pDmaAlloc->SegmentId;3925 }3926 else3927 pInfo->segmentIdAlloc = 0;3928 pInfo->srcId = pAlloc->SurfDesc.VidPnSourceId;3929 }3930 4116 /** 3931 4117 * DxgkDdiPresent … … 4109 4295 4110 4296 break; 4111 #ifdef VBOX VDMA4297 #ifdef VBOX_WITH_VDMA 4112 4298 cbCmd = pPresent->DmaSize; 4113 4299 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h
r32823 r32877 24 24 #define VBOXWDDM_C_POINTER_MAX_HEIGHT 64 25 25 26 #ifdef VBOX VDMA26 #ifdef VBOX_WITH_VDMA 27 27 #define VBOXWDDM_C_VDMA_BUFFER_SIZE (64*_1K) 28 28 #endif 29 29 30 30 #ifndef VBOXWDDM_RENDER_FROM_SHADOW 31 # ifndef VBOX VDMA32 # error "VBOX VDMA must be defined!!!"31 # ifndef VBOX_WITH_VDMA 32 # error "VBOX_WITH_VDMA must be defined!!!" 33 33 # endif 34 34 #endif … … 76 76 DXGK_ALLOCATIONUSAGEHINT UsageHint; 77 77 uint32_t iIndex; 78 VBOXUHGSMI_SYNCHOBJECT_TYPE enmSynchType; 79 union 80 { 81 PKEVENT pSynchEvent; 82 PRKSEMAPHORE pSynchSemaphore; 83 }; 78 84 } VBOXWDDM_ALLOCATION, *PVBOXWDDM_ALLOCATION; 79 85 … … 164 170 #define VBOXWDDMENTRY_2_SWAPCHAIN(_pE) ((PVBOXWDDM_SWAPCHAIN)((uint8_t*)(_pE) - RT_OFFSETOF(VBOXWDDM_SWAPCHAIN, DevExtListEntry))) 165 171 166 typedef struct VBOXWDDM_DMA_PRIVATEDATA_FLAFS167 {168 union169 {170 struct171 {172 UINT bCmdInDmaBuffer : 1;173 UINT bReserved : 31;174 };175 uint32_t Value;176 };177 } VBOXWDDM_DMA_PRIVATEDATA_FLAFS, *PVBOXWDDM_DMA_PRIVATEDATA_FLAFS;178 179 typedef struct VBOXWDDM_DMA_PRIVATEDATA_BASEHDR180 {181 VBOXVDMACMD_TYPE enmCmd;182 union183 {184 VBOXWDDM_DMA_PRIVATEDATA_FLAFS fFlags;185 uint32_t u32CmdReserved;186 };187 }VBOXWDDM_DMA_PRIVATEDATA_BASEHDR, *PVBOXWDDM_DMA_PRIVATEDATA_BASEHDR;188 189 172 typedef struct VBOXWDDM_DMA_PRIVATEDATA_PRESENTHDR 190 173 { … … 219 202 VBOXVDMA_CLRFILL ClrFill; 220 203 } VBOXWDDM_DMA_PRIVATEDATA_CLRFILL, *PVBOXWDDM_DMA_PRIVATEDATA_CLRFILL; 204 205 typedef struct VBOXWDDM_UHGSMI_BUFFER_SUBMIT_INFO 206 { 207 VBOXWDDM_DMA_ALLOCINFO Alloc; 208 uint32_t cbData; 209 uint32_t bDoNotSignalCompletion; 210 } VBOXWDDM_UHGSMI_BUFFER_SUBMIT_INFO, *PVBOXWDDM_UHGSMI_BUFFER_SUBMIT_INFO; 211 212 typedef struct VBOXWDDM_DMA_PRIVATEDATA_CHROMIUM_CMD 213 { 214 VBOXWDDM_DMA_PRIVATEDATA_BASEHDR Base; 215 VBOXWDDM_UHGSMI_BUFFER_SUBMIT_INFO aBufInfos[1]; 216 } VBOXWDDM_DMA_PRIVATEDATA_CHROMIUM_CMD, *PVBOXWDDM_DMA_PRIVATEDATA_CHROMIUM_CMD; 221 217 222 218 typedef struct VBOXWDDM_OPENALLOCATION
Note:
See TracChangeset
for help on using the changeset viewer.