Changeset 50913 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.cpp
- Timestamp:
- Mar 27, 2014 5:56:50 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.cpp
r50859 r50913 174 174 static int vboxCmdVbvaCtlSubmitAsync(PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, VBOXCMDVBVA_CTL * pCtl, FNVBOXSHGSMICMDCOMPLETION pfnCompletion, void *pvCompletion) 175 175 { 176 const VBOXSHGSMIHEADER* pHdr = VBoxSHGSMICommandPrepAsynch(&pHGSMICtx->heapCtx, pCtl, pfnCompletion, pvCompletion, 0);176 const VBOXSHGSMIHEADER* pHdr = VBoxSHGSMICommandPrepAsynch(&pHGSMICtx->heapCtx, pCtl, pfnCompletion, pvCompletion, VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ); 177 177 HGSMIOFFSET offCmd = VBoxSHGSMICommandOffset(&pHGSMICtx->heapCtx, pHdr); 178 178 if (offCmd == HGSMIOFFSET_VOID) … … 293 293 // LogFunc(("flags = 0x%08X\n", pCtx->pVBVA? pCtx->pVBVA->u32HostEvents: -1)); 294 294 295 if ( pCtx->pVBVA 296 && (pCtx->pVBVA->hostFlags.u32HostEvents & VBVA_F_MODE_ENABLED)) 295 Assert(pCtx->pVBVA); 296 /* we do not use u32HostEvents & VBVA_F_MODE_ENABLED, 297 * VBVA stays enabled once ENABLE call succeeds, until it is disabled with DISABLED call */ 298 // if ( pCtx->pVBVA 299 // && (pCtx->pVBVA->hostFlags.u32HostEvents & VBVA_F_MODE_ENABLED)) 297 300 { 298 301 uint32_t indexRecordNext; … … 366 369 } 367 370 371 DECLINLINE(bool) vboxVBVAExIsEntryInRangeOrEmpty(uint32_t u32First, uint32_t u32Entry, uint32_t u32Free) 372 { 373 return vboxVBVAExIsEntryInRange(u32First, u32Entry, u32Free) 374 || ( u32First == u32Entry 375 && u32Entry == u32Free); 376 } 368 377 #ifdef DEBUG 369 378 … … 371 380 { 372 381 VBVABUFFER *pVBVA = pCtx->pVBVA; 373 if (!vboxVBVAExIsEntryInRange (pCtx->indexRecordFirstUncompleted, pVBVA->indexRecordFirst, pVBVA->indexRecordFree))382 if (!vboxVBVAExIsEntryInRangeOrEmpty(pCtx->indexRecordFirstUncompleted, pVBVA->indexRecordFirst, pVBVA->indexRecordFree)) 374 383 { 375 384 WARN(("invalid record set")); 376 385 } 377 386 378 if (!vboxVBVAExIsEntryInRange (pCtx->off32DataUncompleted, pVBVA->off32Data, pVBVA->off32Free))387 if (!vboxVBVAExIsEntryInRangeOrEmpty(pCtx->off32DataUncompleted, pVBVA->off32Data, pVBVA->off32Free)) 379 388 { 380 389 WARN(("invalid data set")); … … 904 913 int rc = VINF_SUCCESS; 905 914 915 Assert(pCmd->u32FenceID); 916 906 917 pCmd->u8State = VBOXCMDVBVA_STATE_SUBMITTED; 907 918 pVbva->u32FenceSubmitted = pCmd->u32FenceID; 908 919 909 if (VBoxVBVAExGetSize(&pVbva->Vbva) >cbCmd)920 if (VBoxVBVAExGetSize(&pVbva->Vbva) < cbCmd) 910 921 { 911 922 WARN(("buffer does not fit the vbva buffer, we do not support splitting buffers")); … … 1073 1084 } 1074 1085 1075 1086 #if 0 1076 1087 static uint32_t vboxCVDdiSysMemElBuild(VBOXCMDVBVA_SYSMEMEL *pEl, PMDL pMdl, uint32_t iPfn, uint32_t cPages) 1077 1088 { … … 1103 1114 VBOXCMDVBVA_SYSMEMEL *pEl = pCmd->aSysMem; 1104 1115 1105 if (cbBuffer < sizeof (VBOXCMDVBVA_PAGING_TRANSFER)) 1106 { 1107 WARN(("cbBuffer < sizeof (VBOXCMDVBVA_PAGING_TRANSFER)")); 1108 goto done; 1109 } 1116 Assert(cbBuffer >= sizeof (VBOXCMDVBVA_PAGING_TRANSFER)); 1110 1117 1111 1118 cbBuffer -= RT_OFFSETOF(VBOXCMDVBVA_PAGING_TRANSFER, aSysMem); … … 1116 1123 } 1117 1124 1118 done:1119 1125 *pcPagesWritten = cInitPages - cPages; 1120 1126 return cbInitBuffer - cbBuffer; 1121 1127 } 1128 #endif 1129 1130 uint32_t VBoxCVDdiPTransferVRamSysBuildEls(VBOXCMDVBVA_PAGING_TRANSFER *pCmd, PMDL pMdl, uint32_t iPfn, uint32_t cPages, uint32_t cbBuffer, uint32_t *pcPagesWritten) 1131 { 1132 uint32_t cbInitBuffer = cbBuffer; 1133 uint32_t i = 0; 1134 VBOXCMDVBVAPAGEIDX *pPageNumbers = pCmd->aPageNumbers; 1135 1136 cbBuffer -= RT_OFFSETOF(VBOXCMDVBVA_PAGING_TRANSFER, aPageNumbers); 1137 1138 for (; i < cPages && cbBuffer >= sizeof (*pPageNumbers); ++i, cbBuffer -= sizeof (*pPageNumbers)) 1139 { 1140 pPageNumbers[i] = (VBOXCMDVBVAPAGEIDX)(MmGetMdlPfnArray(pMdl)[iPfn + i]); 1141 } 1142 1143 *pcPagesWritten = i; 1144 Assert(cbInitBuffer - cbBuffer == RT_OFFSETOF(VBOXCMDVBVA_PAGING_TRANSFER, aPageNumbers[i])); 1145 return cbInitBuffer - cbBuffer; 1146 } 1147 1122 1148 1123 1149 int vboxCmdVbvaConConnect(PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, … … 1144 1170 rc = pConnect->Hdr.i32Result; 1145 1171 if (RT_SUCCESS(rc)) 1172 { 1173 Assert(pConnect->Connect.Hdr.u32CmdClientId); 1146 1174 *pu32ClientID = pConnect->Connect.Hdr.u32CmdClientId; 1175 } 1147 1176 else 1148 1177 WARN(("VBOXCMDVBVA3DCTL_TYPE_CONNECT Disable failed %d", rc));
Note:
See TracChangeset
for help on using the changeset viewer.