Changeset 77225 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Feb 8, 2019 4:06:59 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/VBoxMPGaWddm.cpp
r76884 r77225 711 711 case STATUS_SUCCESS: 712 712 { 713 if (u32TargetLength) 714 { 715 pPresent->pDmaBuffer = (uint8_t *)pPresent->pDmaBuffer + u32TargetLength; 716 pPresent->pDmaBufferPrivateData = (uint8_t *)pPresent->pDmaBufferPrivateData + cbPrivateData; 717 } 713 pPresent->pDmaBuffer = (uint8_t *)pPresent->pDmaBuffer + u32TargetLength; 714 pPresent->pDmaBufferPrivateData = (uint8_t *)pPresent->pDmaBufferPrivateData + cbPrivateData; 718 715 } break; 719 716 default: break; … … 828 825 case STATUS_SUCCESS: 829 826 { 830 if (u32TargetLength) 831 { 832 pPresent->pDmaBuffer = (uint8_t *)pPresent->pDmaBuffer + u32TargetLength; 833 pPresent->pDmaBufferPrivateData = (uint8_t *)pPresent->pDmaBufferPrivateData + cbPrivateData; 834 } 827 pPresent->pDmaBuffer = (uint8_t *)pPresent->pDmaBuffer + u32TargetLength; 828 pPresent->pDmaBufferPrivateData = (uint8_t *)pPresent->pDmaBufferPrivateData + cbPrivateData; 835 829 } break; 836 830 default: break; … … 839 833 else if (pPresent->Flags.ColorFill) 840 834 { 841 GALOG(("ColorFill\n"));835 LogRelMax(16, ("ColorFill is not implemented\n")); 842 836 AssertFailed(); 837 838 /* Generate empty DMA buffer. 839 * Store the command buffer descriptor to pDmaBufferPrivateData. 840 */ 841 GARENDERDATA *pRenderData = NULL; 842 uint32_t u32TargetLength = 0; 843 uint32_t cbPrivateData = 0; 844 845 if (pPresent->DmaBufferPrivateDataSize >= sizeof(GARENDERDATA)) 846 { 847 /* Fill RenderData description in any case, it will be ignored if the above code failed. */ 848 pRenderData = (GARENDERDATA *)pPresent->pDmaBufferPrivateData; 849 pRenderData->u32DataType = GARENDERDATA_TYPE_PRESENT; 850 pRenderData->cbData = u32TargetLength; 851 pRenderData->pFenceObject = NULL; /* Not a user request, so no user accessible fence object. */ 852 pRenderData->pvDmaBuffer = pPresent->pDmaBuffer; 853 cbPrivateData = sizeof(GARENDERDATA); 854 } 855 else 856 { 857 Status = STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER; 858 } 859 860 switch (Status) 861 { 862 case STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER: 863 if (pRenderData == NULL) 864 { 865 /* Not enough space in pDmaBufferPrivateData. */ 866 break; 867 } 868 RT_FALL_THRU(); 869 case STATUS_SUCCESS: 870 { 871 pPresent->pDmaBuffer = (uint8_t *)pPresent->pDmaBuffer + u32TargetLength; 872 pPresent->pDmaBufferPrivateData = (uint8_t *)pPresent->pDmaBufferPrivateData + cbPrivateData; 873 } break; 874 default: break; 875 } 843 876 } 844 877 else … … 1166 1199 case STATUS_SUCCESS: 1167 1200 { 1168 if (u32TargetLength) 1169 { 1170 pBuildPagingBuffer->pDmaBuffer = (uint8_t *)pBuildPagingBuffer->pDmaBuffer + u32TargetLength; 1171 pBuildPagingBuffer->pDmaBufferPrivateData = (uint8_t *)pBuildPagingBuffer->pDmaBufferPrivateData + cbPrivateData; 1172 } 1201 pBuildPagingBuffer->pDmaBuffer = (uint8_t *)pBuildPagingBuffer->pDmaBuffer + u32TargetLength; 1202 pBuildPagingBuffer->pDmaBufferPrivateData = (uint8_t *)pBuildPagingBuffer->pDmaBufferPrivateData + cbPrivateData; 1173 1203 } break; 1174 1204 default: break; … … 1242 1272 uint32_t cbDmaBufferSubmission = pSubmitCommand->DmaBufferSubmissionEndOffset - pSubmitCommand->DmaBufferSubmissionStartOffset; 1243 1273 uint32_t cDataBlocks = cbPrivateData / sizeof(GARENDERDATA); 1244 AssertReturn(cDataBlocks, STATUS_INVALID_PARAMETER); 1245 1246 GARENDERDATA *pRenderData = (GARENDERDATA *)pvPrivateData; 1274 1275 if (cDataBlocks == 0) 1276 { 1277 /* Sometimes a zero sized paging buffer is submitted. 1278 * Seen this on W10.17763 right after DXGK_OPERATION_DISCARD_CONTENT. 1279 * Can not ignore such block, since a new SubmissionFenceId is passed. 1280 * Try to handle it by emitting the fence command only. 1281 */ 1282 Assert(cbPrivateData == 0); 1283 Assert(pSubmitCommand->Flags.Paging); 1284 LogRelMax(16, ("WDDM: empty buffer: cbPrivateData %d, flags 0x%x\n", cbPrivateData, pSubmitCommand->Flags.Value)); 1285 } 1286 1287 GARENDERDATA const *pRenderData = (GARENDERDATA *)pvPrivateData; 1247 1288 while (cDataBlocks--) 1248 1289 { … … 1293 1334 if (pvDmaBuffer) 1294 1335 { 1295 /* Copy DmaBuffer to Fifo. */1296 1336 Assert(pSubmitCommand->DmaBufferSegmentId == 0); 1297 1337 1298 1338 uint32_t const cbSubmit = pRenderData->cbData; 1299 1300 void *pvCmd = SvgaFifoReserve(pGaDevExt->hw.pSvga, cbSubmit); 1301 AssertPtrReturn(pvCmd, STATUS_INSUFFICIENT_RESOURCES); 1302 1303 /* pvDmaBuffer is the actual address of the current data block. 1304 * Therefore do not use pSubmitCommand->DmaBufferSubmissionStartOffset here. 1305 */ 1306 memcpy(pvCmd, pvDmaBuffer, cbSubmit); 1307 SvgaFifoCommit(pGaDevExt->hw.pSvga, cbSubmit); 1339 if (cbSubmit) 1340 { 1341 /* Copy DmaBuffer to Fifo. */ 1342 void *pvCmd = SvgaFifoReserve(pGaDevExt->hw.pSvga, cbSubmit); 1343 AssertPtrReturn(pvCmd, STATUS_INSUFFICIENT_RESOURCES); 1344 1345 /* pvDmaBuffer is the actual address of the current data block. 1346 * Therefore do not use pSubmitCommand->DmaBufferSubmissionStartOffset here. 1347 */ 1348 memcpy(pvCmd, pvDmaBuffer, cbSubmit); 1349 SvgaFifoCommit(pGaDevExt->hw.pSvga, cbSubmit); 1350 } 1351 else 1352 { 1353 /* 'Paging' buffers can be empty, implementation is incomplete. See GaDxgkDdiBuildPagingBuffer. */ 1354 if (pSubmitCommand->Flags.Paging == 0) 1355 { 1356 LogRelMax(16, ("WDDM: Zero sized command buffer. Flags 0x%x, type %d\n", pSubmitCommand->Flags.Value, pRenderData->u32DataType)); 1357 AssertFailed(); 1358 } 1359 } 1308 1360 } 1309 1361 1310 1362 ++pRenderData; 1311 1363 } 1364 1365 ASMAtomicWriteU32(&pGaDevExt->u32LastSubmittedFenceId, pSubmitCommand->SubmissionFenceId); 1312 1366 1313 1367 /* Submit the fence. */ 1314 1368 SvgaFence(pGaDevExt->hw.pSvga, pSubmitCommand->SubmissionFenceId); 1315 1316 ASMAtomicWriteU32(&pGaDevExt->u32LastSubmittedFenceId, pSubmitCommand->SubmissionFenceId);1317 1369 1318 1370 GALOG(("done %d\n", pSubmitCommand->SubmissionFenceId));
Note:
See TracChangeset
for help on using the changeset viewer.