Changeset 33306 in vbox for trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
- Timestamp:
- Oct 21, 2010 12:52:37 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
r33216 r33306 524 524 void * pvDst; 525 525 int rc = VINF_SUCCESS; 526 uint32_t cbTransfer = pTransfer->cbTransferSize; 527 uint32_t cbTransfered = 0; 526 528 bool bSrcLocked = false; 527 529 bool bDstLocked = false; 528 if (pTransfer->fFlags & VBOXVDMACMD_DMA_BPB_TRANSFER_F_SRC_VRAMOFFSET) 529 { 530 pvSrc = pvRam + pTransfer->Src.offVramBuf; 531 } 532 else 533 { 534 RTGCPHYS phPage = pTransfer->Src.phBuf; 535 rc = PDMDevHlpPhysGCPhys2CCPtrReadOnly(pDevIns, phPage, 0, &pvSrc, &SrcLock); 536 AssertRC(rc); 530 do 531 { 532 uint32_t cbSubTransfer = cbTransfer; 533 if (pTransfer->fFlags & VBOXVDMACMD_DMA_BPB_TRANSFER_F_SRC_VRAMOFFSET) 534 { 535 pvSrc = pvRam + pTransfer->Src.offVramBuf + cbTransfered; 536 } 537 else 538 { 539 RTGCPHYS phPage = pTransfer->Src.phBuf; 540 phPage += cbTransfered; 541 rc = PDMDevHlpPhysGCPhys2CCPtrReadOnly(pDevIns, phPage, 0, &pvSrc, &SrcLock); 542 AssertRC(rc); 543 if (RT_SUCCESS(rc)) 544 { 545 bSrcLocked = true; 546 cbSubTransfer = RT_MIN(cbSubTransfer, 0x1000); 547 } 548 else 549 { 550 break; 551 } 552 } 553 554 if (pTransfer->fFlags & VBOXVDMACMD_DMA_BPB_TRANSFER_F_DST_VRAMOFFSET) 555 { 556 pvDst = pvRam + pTransfer->Dst.offVramBuf + cbTransfered; 557 } 558 else 559 { 560 RTGCPHYS phPage = pTransfer->Dst.phBuf; 561 phPage += cbTransfered; 562 rc = PDMDevHlpPhysGCPhys2CCPtr(pDevIns, phPage, 0, &pvDst, &DstLock); 563 AssertRC(rc); 564 if (RT_SUCCESS(rc)) 565 { 566 bDstLocked = true; 567 cbSubTransfer = RT_MIN(cbSubTransfer, 0x1000); 568 } 569 else 570 { 571 break; 572 } 573 } 574 537 575 if (RT_SUCCESS(rc)) 538 576 { 539 bSrcLocked = true; 540 } 541 } 542 543 if (pTransfer->fFlags & VBOXVDMACMD_DMA_BPB_TRANSFER_F_DST_VRAMOFFSET) 544 { 545 pvDst = pvRam + pTransfer->Dst.offVramBuf; 546 } 547 else 548 { 549 RTGCPHYS phPage = pTransfer->Dst.phBuf; 550 rc = PDMDevHlpPhysGCPhys2CCPtr(pDevIns, phPage, 0, &pvDst, &DstLock); 551 AssertRC(rc); 552 if (RT_SUCCESS(rc)) 553 { 554 bDstLocked = true; 555 } 556 } 557 558 if (RT_SUCCESS(rc)) 559 { 560 memcpy(pvDst, pvSrc, pTransfer->cbTransferSize); 561 } 562 563 if (bSrcLocked) 564 PDMDevHlpPhysReleasePageMappingLock(pDevIns, &SrcLock); 565 if (bDstLocked) 566 PDMDevHlpPhysReleasePageMappingLock(pDevIns, &DstLock); 577 memcpy(pvDst, pvSrc, cbSubTransfer); 578 cbTransfer -= cbSubTransfer; 579 cbTransfered += cbSubTransfer; 580 } 581 else 582 { 583 cbTransfer = 0; /* to break */ 584 } 585 586 if (bSrcLocked) 587 PDMDevHlpPhysReleasePageMappingLock(pDevIns, &SrcLock); 588 if (bDstLocked) 589 PDMDevHlpPhysReleasePageMappingLock(pDevIns, &DstLock); 590 } while (cbTransfer); 567 591 568 592 if (RT_SUCCESS(rc))
Note:
See TracChangeset
for help on using the changeset viewer.