Changeset 82331 in vbox for trunk/src/VBox/Devices/Audio/DevHDACommon.cpp
- Timestamp:
- Dec 2, 2019 11:50:22 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDACommon.cpp
r82323 r82331 2 2 /** @file 3 3 * DevHDACommon.cpp - Shared HDA device functions. 4 * 5 * @todo r=bird: Shared with whom exactly? 4 6 */ 5 7 … … 662 664 * 663 665 * @returns Whether the new expiration time was set or not. 664 * @param pThis HDA state. 665 * @param pStream HDA stream to set timer for. 666 * @param tsExpire New (virtual) expiration time to set. 667 * @param fForce Whether to force setting the expiration time or not. 666 * @param pDevIns The device instance. 667 * @param pThis HDA state. 668 * @param pStream HDA stream to set timer for. 669 * @param tsExpire New (virtual) expiration time to set. 670 * @param fForce Whether to force setting the expiration time or not. 668 671 * 669 672 * @remark This function takes all active HDA streams and their … … 676 679 * Forcing a new expiration time will override the above mechanism. 677 680 */ 678 bool hdaR3TimerSet(P HDASTATE pThis, PHDASTREAM pStream, uint64_t tsExpire, bool fForce)679 { 680 AssertPtr Return(pThis, false);681 AssertPtr Return(pStream, false);681 bool hdaR3TimerSet(PPDMDEVINS pDevIns, PHDASTATE pThis, PHDASTREAM pStream, uint64_t tsExpire, bool fForce) 682 { 683 AssertPtr(pThis); 684 AssertPtr(pStream); 682 685 683 686 uint64_t tsExpireMin = tsExpire; … … 685 688 if (!fForce) 686 689 { 687 if (hdaR3StreamTransferIsScheduled(pStream)) 688 tsExpireMin = RT_MIN(tsExpireMin, hdaR3StreamTransferGetNext(pStream)); 689 } 690 691 AssertPtr(pThis->pTimer[pStream->u8SD]); 692 693 const uint64_t tsNow = TMTimerGet(pThis->pTimer[pStream->u8SD]); 690 /** @todo r=bird: hdaR3StreamTransferIsScheduled() also does a 691 * PDMDevHlpTimerGet(), so, some callers does one, this does, and then we do 692 * right afterwards == very inefficient! */ 693 if (hdaR3StreamTransferIsScheduled(pDevIns, pStream)) 694 { 695 uint64_t const tsNext = hdaR3StreamTransferGetNext(pStream); 696 if (tsExpireMin > tsNext) 697 tsExpireMin = tsNext; 698 } 699 } 700 701 const uint64_t tsNow = PDMDevHlpTimerGet(pDevIns, pStream->hTimer); 694 702 695 703 /* … … 700 708 tsExpireMin = tsNow; 701 709 702 int rc = TMTimerSet(pThis->pTimer[pStream->u8SD], tsExpireMin);703 AssertRC (rc);704 705 return RT_SUCCESS(rc);710 int rc = PDMDevHlpTimerSet(pDevIns, pStream->hTimer, tsExpireMin); 711 AssertRCReturn(rc, false); 712 713 return true; 706 714 } 707 715
Note:
See TracChangeset
for help on using the changeset viewer.