Changeset 82331 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Dec 2, 2019 11:50:22 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 135155
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r82323 r82331 157 157 #define DEVHDA_LOCK_BOTH_RETURN(a_pDevIns, a_pThis, a_SD, a_rcBusy) \ 158 158 do { \ 159 int rcLock = TMTimerLock((a_pThis)->pTimer[a_SD], (a_rcBusy)); \ 160 if (rcLock == VINF_SUCCESS) \ 161 { \ 162 rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSect, (a_rcBusy)); \ 163 if (rcLock == VINF_SUCCESS) \ 164 break; \ 165 TMTimerUnlock((a_pThis)->pTimer[a_SD]); \ 166 } \ 167 AssertRC(rcLock); \ 168 return rcLock; \ 159 VBOXSTRICTRC rcLock = PDMDevHlpTimerLockClock2(pDevIns, (a_pThis)->ahTimers[a_SD], &(a_pThis)->CritSect, (a_rcBusy)); \ 160 if (RT_LIKELY(rcLock == VINF_SUCCESS)) \ 161 { /* likely */ } \ 162 else \ 163 return VBOXSTRICTRC_TODO(rcLock); \ 169 164 } while (0) 170 165 … … 173 168 */ 174 169 #define DEVHDA_UNLOCK_BOTH(a_pDevIns, a_pThis, a_SD) \ 175 do { \ 176 PDMDevHlpCritSectLeave((a_pDevIns), &(a_pThis)->CritSect); \ 177 TMTimerUnlock((a_pThis)->pTimer[a_SD]); \ 178 } while (0) 170 PDMDevHlpTimerUnlockClock2(pDevIns, (a_pThis)->ahTimers[a_SD], &(a_pThis)->CritSect) 179 171 180 172 … … 1400 1392 # endif 1401 1393 /* (Re-)initialize the stream with current values. */ 1402 rc2 = hdaR3StreamInit(p Stream, pStream->u8SD);1394 rc2 = hdaR3StreamInit(pDevIns, pStream, pStream->u8SD); 1403 1395 if ( RT_SUCCESS(rc2) 1404 1396 /* Any vital stream change occurred so that we need to (re-)add the stream to our setup? … … 1435 1427 AssertRC(rc2); 1436 1428 1437 rc2 = hdaR3TimerSet(pThis, pStream, TMTimerGet(pThis->pTimer[pStream->u8SD]) + pStream->State.cTransferTicks, 1429 rc2 = hdaR3TimerSet(pDevIns, pThis, pStream, 1430 PDMDevHlpTimerGet(pDevIns, pThis->ahTimers[pStream->u8SD]) 1431 + pStream->State.cTransferTicks, 1438 1432 false /* fForce */); 1439 1433 AssertRC(rc2); … … 1527 1521 HDA_PROCESS_INTERRUPT(pDevIns, pThis); 1528 1522 1529 const uint64_t tsNow = TMTimerGet(pThis->pTimer[uSD]);1523 const uint64_t tsNow = PDMDevHlpTimerGet(pDevIns, pThis->ahTimers[uSD]); 1530 1524 Assert(tsNow >= pStream->State.tsTransferLast); 1531 1525 … … 1545 1539 1546 1540 if (cTicksElapsed <= cTicksToNext) 1547 {1548 1541 cTicksToNext = cTicksToNext - cTicksElapsed; 1549 }1550 1542 else /* Catch up. */ 1551 1543 { … … 1555 1547 LogRelMax2(64, ("HDA: Stream #%RU8 interrupt lagging behind (expected %uus, got %uus), trying to catch up ...\n", 1556 1548 pStream->u8SD, 1557 (TMTimerGetFreq(pThis->pTimer[pStream->u8SD]) / pThis->uTimerHz) / 1000,(tsNow - pStream->State.tsTransferLast) / 1000)); 1549 (PDMDevHlpTimerGetFreq(pDevIns, pThis->ahTimers[pStream->u8SD]) / pThis->uTimerHz) / 1000, 1550 (tsNow - pStream->State.tsTransferLast) / 1000)); 1558 1551 1559 1552 cTicksToNext = 0; … … 1575 1568 /* Re-arm the timer. */ 1576 1569 LogFunc(("Timer set SD%RU8\n", pStream->u8SD)); 1577 hdaR3TimerSet(p This, pStream, tsNow + cTicksToNext, false /* fForce */);1570 hdaR3TimerSet(pDevIns, pThis, pStream, tsNow + cTicksToNext, false /* fForce */); 1578 1571 } 1579 1572 } … … 2845 2838 2846 2839 /** 2847 * Main routine for the stream's timer. 2848 * 2849 * @param pDevIns Device instance. 2850 * @param pTimer Timer this callback was called for. 2851 * @param pvUser Pointer to associated HDASTREAM. 2840 * @callback_method_impl{FNTMTIMERDEV, Main routine for the stream's timer.} 2852 2841 */ 2853 2842 static DECLCALLBACK(void) hdaR3Timer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 2854 2843 { 2855 PHDASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PHDASTATE); 2856 PHDASTREAM pStream = (PHDASTREAM)pvUser; 2844 PHDASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PHDASTATE); 2845 PHDASTREAM pStream = (PHDASTREAM)pvUser; 2846 TMTIMERHANDLE hTimer = RT_SAFE_SUBSCRIPT8(pThis->ahTimers, pStream->u8SD); 2857 2847 RT_NOREF(pTimer); 2858 2848 2859 2849 AssertPtr(pStream); 2860 2850 Assert(PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect)); 2861 Assert( TMTimerIsLockOwner(pStream->pTimer));2862 2863 hdaR3StreamUpdate(p Stream, true /* fInTimer */);2851 Assert(PDMDevHlpTimerIsLockOwner(pDevIns, hTimer)); 2852 2853 hdaR3StreamUpdate(pDevIns, pStream, true /* fInTimer */); 2864 2854 2865 2855 /* Flag indicating whether to kick the timer again for a new data processing round. */ … … 2870 2860 if (fSinkActive) 2871 2861 { 2872 const bool fTimerScheduled = hdaR3StreamTransferIsScheduled(p Stream);2862 const bool fTimerScheduled = hdaR3StreamTransferIsScheduled(pDevIns, pStream); 2873 2863 Log3Func(("fSinksActive=%RTbool, fTimerScheduled=%RTbool\n", fSinkActive, fTimerScheduled)); 2874 2864 if (!fTimerScheduled) 2875 hdaR3TimerSet(p This, pStream,2876 TMTimerGet(pThis->pTimer[pStream->u8SD])2877 + TMTimerGetFreq(pThis->pTimer[pStream->u8SD]) / pStream->pHDAState->uTimerHz,2865 hdaR3TimerSet(pDevIns, pThis, pStream, 2866 PDMDevHlpTimerGet(pDevIns, hTimer) 2867 + PDMDevHlpTimerGetFreq(pDevIns, hTimer) / pStream->pHDAState->uTimerHz, 2878 2868 true /* fForce */); 2879 2869 } … … 3595 3585 * Does required post processing when loading a saved state. 3596 3586 * 3587 * @param pDevIns The device instance. 3597 3588 * @param pThis Pointer to HDA state. 3598 3589 */ 3599 static int hdaR3LoadExecPost(P HDASTATE pThis)3590 static int hdaR3LoadExecPost(PPDMDEVINS pDevIns, PHDASTATE pThis) 3600 3591 { 3601 3592 int rc = VINF_SUCCESS; … … 3637 3628 hdaR3StreamRegisterDMAHandlers(pThis, pStream); 3638 3629 #endif 3639 if (hdaR3StreamTransferIsScheduled(p Stream))3640 hdaR3TimerSet(p This, pStream, hdaR3StreamTransferGetNext(pStream), true /* fForce */);3630 if (hdaR3StreamTransferIsScheduled(pDevIns, pStream)) 3631 hdaR3TimerSet(pDevIns, pThis, pStream, hdaR3StreamTransferGetNext(pStream), true /* fForce */); 3641 3632 3642 3633 /* Also keep track of the currently active streams. */ … … 3749 3740 /* Output */ 3750 3741 PHDASTREAM pStream = &pThis->aStreams[4]; 3751 rc = hdaR3StreamInit(p Stream, 4 /* Stream descriptor, hardcoded */);3742 rc = hdaR3StreamInit(pDevIns, pStream, 4 /* Stream descriptor, hardcoded */); 3752 3743 AssertRCReturn(rc, rc); 3753 3744 rc = pHlp->pfnSSMGetStructEx(pSSM, &pStream->State.BDLE, sizeof(pStream->State.BDLE), … … 3758 3749 /* Microphone-In */ 3759 3750 pStream = &pThis->aStreams[2]; 3760 rc = hdaR3StreamInit(p Stream, 2 /* Stream descriptor, hardcoded */);3751 rc = hdaR3StreamInit(pDevIns, pStream, 2 /* Stream descriptor, hardcoded */); 3761 3752 AssertRCReturn(rc, rc); 3762 3753 rc = pHlp->pfnSSMGetStructEx(pSSM, &pStream->State.BDLE, sizeof(pStream->State.BDLE), … … 3767 3758 /* Line-In */ 3768 3759 pStream = &pThis->aStreams[0]; 3769 rc = hdaR3StreamInit(p Stream, 0 /* Stream descriptor, hardcoded */);3760 rc = hdaR3StreamInit(pDevIns, pStream, 0 /* Stream descriptor, hardcoded */); 3770 3761 AssertRCReturn(rc, rc); 3771 3762 rc = pHlp->pfnSSMGetStructEx(pSSM, &pStream->State.BDLE, sizeof(pStream->State.BDLE), … … 3805 3796 } 3806 3797 3807 rc = hdaR3StreamInit(p Stream, idStream);3798 rc = hdaR3StreamInit(pDevIns, pStream, idStream); 3808 3799 if (RT_FAILURE(rc)) 3809 3800 { … … 3908 3899 rc = hdaR3LoadExecLegacy(pDevIns, pThis, pSSM, uVersion); 3909 3900 if (RT_SUCCESS(rc)) 3910 rc = hdaR3LoadExecPost(p This);3901 rc = hdaR3LoadExecPost(pDevIns, pThis); 3911 3902 return rc; 3912 3903 } … … 3982 3973 } 3983 3974 3984 rc = hdaR3StreamInit(p Stream, idStream);3975 rc = hdaR3StreamInit(pDevIns, pStream, idStream); 3985 3976 if (RT_FAILURE(rc)) 3986 3977 { … … 4073 4064 } /* for cStreams */ 4074 4065 4075 rc = hdaR3LoadExecPost(p This);4066 rc = hdaR3LoadExecPost(pDevIns, pThis); 4076 4067 AssertRC(rc); 4077 4068 … … 4961 4952 4962 4953 /* 4963 * Create all hardware streams. 4954 * Create the per stream timers and the asso. 4955 * 4956 * We must the critical section for the timers as the device has a 4957 * noop section associated with it. 4958 * 4959 * Note: Use TMCLOCK_VIRTUAL_SYNC here, as the guest's HDA driver relies 4960 * on exact (virtual) DMA timing and uses DMA Position Buffers 4961 * instead of the LPIB registers. 4964 4962 */ 4965 4963 static const char * const s_apszNames[] = … … 4969 4967 }; 4970 4968 AssertCompile(RT_ELEMENTS(s_apszNames) == HDA_MAX_STREAMS); 4969 for (size_t i = 0; i < HDA_MAX_STREAMS; i++) 4970 { 4971 rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, hdaR3Timer, &pThis->aStreams[i], 4972 TMTIMER_FLAGS_NO_CRIT_SECT, s_apszNames[i], &pThis->ahTimers[i]); 4973 AssertRCReturn(rc, rc); 4974 4975 rc = PDMDevHlpTimerSetCritSect(pDevIns, pThis->ahTimers[i], &pThis->CritSect); 4976 AssertRCReturn(rc, rc); 4977 } 4978 4979 /* 4980 * Create all hardware streams. 4981 */ 4971 4982 for (uint8_t i = 0; i < HDA_MAX_STREAMS; ++i) 4972 4983 { 4973 /* Create the emulation timer (per stream).4974 *4975 * Note: Use TMCLOCK_VIRTUAL_SYNC here, as the guest's HDA driver4976 * relies on exact (virtual) DMA timing and uses DMA Position Buffers4977 * instead of the LPIB registers.4978 */4979 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, hdaR3Timer, &pThis->aStreams[i],4980 TMTIMER_FLAGS_NO_CRIT_SECT, s_apszNames[i], &pThis->pTimer[i]);4981 AssertRCReturn(rc, rc);4982 4983 /* Use our own critcal section for the device timer.4984 * That way we can control more fine-grained when to lock what. */4985 rc = TMR3TimerSetCritSect(pThis->pTimer[i], &pThis->CritSect);4986 AssertRCReturn(rc, rc);4987 4988 4984 rc = hdaR3StreamCreate(&pThis->aStreams[i], pThis, i /* u8SD */); 4989 4985 AssertRCReturn(rc, rc); -
trunk/src/VBox/Devices/Audio/DevHDA.h
r82319 r82331 138 138 /** Number of active (running) SDn streams. */ 139 139 uint8_t cStreamsActive; 140 /** The stream timers for pumping data thru the attached LUN drivers. */ 141 PTMTIMERR3 pTimer[HDA_MAX_STREAMS]; 140 /** The stream timers for pumping data thru the attached LUN drivers. 141 * Duplicated in HDASTREAM::hTimer. */ 142 TMTIMERHANDLE ahTimers[HDA_MAX_STREAMS]; 142 143 /** Pointer to HDA codec to use. */ 143 144 R3PTRTYPE(PHDACODEC) pCodec; -
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 -
trunk/src/VBox/Devices/Audio/DevHDACommon.h
r80692 r82331 653 653 */ 654 654 #ifdef IN_RING3 655 bool hdaR3TimerSet(P HDASTATE pThis, PHDASTREAM pStream, uint64_t u64Expire, bool fForce);656 #endif /* IN_RING3 */655 bool hdaR3TimerSet(PPDMDEVINS pDevIns, PHDASTATE pThis, PHDASTREAM pStream, uint64_t u64Expire, bool fForce); 656 #endif 657 657 /** @} */ 658 658 -
trunk/src/VBox/Devices/Audio/HDAStream.cpp
r82324 r82331 54 54 pStream->pMixSink = NULL; 55 55 pStream->pHDAState = pThis; 56 pStream->pTimer = pThis->pTimer[u8SD]; 57 AssertPtr(pStream->pTimer); 56 pStream->hTimer = pThis->ahTimers[u8SD]; 58 57 59 58 pStream->State.fInReset = false; … … 189 188 * @returns IPRT status code. VINF_NO_CHANGE if the stream does not need (re-)initialization because the stream's (hardware) 190 189 * parameters did not change. 191 * @param pStream HDA stream to initialize. 192 * @param uSD SD (stream descriptor) number to assign the HDA stream to. 193 */ 194 int hdaR3StreamInit(PHDASTREAM pStream, uint8_t uSD) 190 * @param pDevIns The device instance. 191 * @param pStream HDA stream to initialize. 192 * @param uSD SD (stream descriptor) number to assign the HDA stream to. 193 */ 194 int hdaR3StreamInit(PPDMDEVINS pDevIns, PHDASTREAM pStream, uint8_t uSD) 195 195 { 196 196 AssertPtrReturn(pStream, VERR_INVALID_POINTER); … … 464 464 pStream->State.cbTransferChunk = pStream->State.cbTransferSize; 465 465 466 const uint64_t cTicksPerHz = TMTimerGetFreq(pStream->pTimer) / pStream->State.uTimerHz;466 const uint64_t cTicksPerHz = PDMDevHlpTimerGetFreq(pDevIns, pStream->hTimer) / pStream->State.uTimerHz; 467 467 468 468 /* Calculate the timer ticks per byte for this stream. */ … … 715 715 /** 716 716 * Returns whether a next transfer for a given stream is scheduled or not. 717 * 717 718 * This takes pending stream interrupts into account as well as the next scheduled 718 719 * transfer timestamp. 719 720 * 720 721 * @returns True if a next transfer is scheduled, false if not. 722 * @param pDevIns The device instance. 721 723 * @param pStream HDA stream to retrieve schedule status for. 722 724 */ 723 bool hdaR3StreamTransferIsScheduled(P HDASTREAM pStream)725 bool hdaR3StreamTransferIsScheduled(PPDMDEVINS pDevIns, PHDASTREAM pStream) 724 726 { 725 727 if (pStream) … … 735 737 } 736 738 737 const uint64_t tsNow = TMTimerGet(pStream->pTimer);739 const uint64_t tsNow = PDMDevHlpTimerGet(pDevIns, pStream->hTimer); 738 740 if (pStream->State.tsTransferNext > tsNow) 739 741 { … … 908 910 * 909 911 * @returns IPRT status code. 912 * @param pDevIns The device instance. 910 913 * @param pStream HDA stream to update. 911 914 * @param cbToProcessMax How much data (in bytes) to process as maximum. 912 915 */ 913 int hdaR3StreamTransfer(P HDASTREAM pStream, uint32_t cbToProcessMax)916 int hdaR3StreamTransfer(PPDMDEVINS pDevIns, PHDASTREAM pStream, uint32_t cbToProcessMax) 914 917 { 915 918 AssertPtrReturn(pStream, VERR_INVALID_POINTER); … … 945 948 } 946 949 947 const uint64_t tsNow = TMTimerGet(pStream->pTimer);950 const uint64_t tsNow = PDMDevHlpTimerGet(pDevIns, pStream->hTimer); 948 951 949 952 if (!pStream->State.tsTransferLast) … … 1376 1379 1377 1380 LogFunc(("Timer set SD%RU8\n", pStream->u8SD)); 1378 hdaR3TimerSet(p Stream->pHDAState, pStream, tsTransferNext, false /* fForce */);1381 hdaR3TimerSet(pDevIns, pStream->pHDAState, pStream, tsTransferNext, false /* fForce */); 1379 1382 1380 1383 pStream->State.tsTransferNext = tsTransferNext; … … 1413 1416 * (with fInTimer set to @c false). 1414 1417 * 1415 * @param pStream HDA stream to update. 1416 * @param fInTimer Whether to this function was called from the timer 1417 * context or an asynchronous I/O stream thread (if supported). 1418 */ 1419 void hdaR3StreamUpdate(PHDASTREAM pStream, bool fInTimer) 1418 * @param pDevIns The device instance. 1419 * @param pStream HDA stream to update. 1420 * @param fInTimer Whether to this function was called from the timer 1421 * context or an asynchronous I/O stream thread (if supported). 1422 */ 1423 void hdaR3StreamUpdate(PPDMDEVINS pDevIns, PHDASTREAM pStream, bool fInTimer) 1420 1424 { 1421 1425 if (!pStream) … … 1446 1450 { 1447 1451 /* Do the DMA transfer. */ 1448 rc2 = hdaR3StreamTransfer(p Stream, cbStreamFree);1452 rc2 = hdaR3StreamTransfer(pDevIns, pStream, cbStreamFree); 1449 1453 AssertRC(rc2); 1450 1454 } … … 1567 1571 if (cbStreamUsed) 1568 1572 { 1569 rc2 = hdaR3StreamTransfer(p Stream, cbStreamUsed);1573 rc2 = hdaR3StreamTransfer(pDevIns, pStream, cbStreamUsed); 1570 1574 AssertRC(rc2); 1571 1575 } … … 1823 1827 PHDASTREAMTHREADCTX pCtx = (PHDASTREAMTHREADCTX)pvUser; 1824 1828 AssertPtr(pCtx); 1825 1826 1829 PHDASTREAM pStream = pCtx->pStream; 1830 1827 1831 AssertPtr(pStream); 1828 1829 PHDASTREAMSTATEAIO pAIO = &pCtx->pStream->State.AIO; 1832 PHDASTREAMSTATEAIO pAIO = &pStream->State.AIO; 1833 1834 PPDMDEVINS pDevIns = pCtx->pThis->pDevInsR3; 1830 1835 1831 1836 ASMAtomicXchgBool(&pAIO->fStarted, true); … … 1853 1858 } 1854 1859 1855 hdaR3StreamUpdate(p Stream, false /* fInTimer */);1860 hdaR3StreamUpdate(pDevIns, pStream, false /* fInTimer */); 1856 1861 1857 1862 int rc3 = RTCritSectLeave(&pAIO->CritSect); -
trunk/src/VBox/Devices/Audio/HDAStream.h
r76565 r82331 188 188 189 189 /** 190 * Structure for keeping aHDA stream (SDI / SDO).190 * An HDA stream (SDI / SDO). 191 191 * 192 * Note:This HDA stream has nothing to do with a regular audio stream handled193 * by the audio connector or the audio mixer. This HDA stream is a serial data in/out194 * stream (SDI/SDO) defined in hardware and can contain multiple audio streams195 * in one single SDI/SDO (interleaving streams).192 * @note This HDA stream has nothing to do with a regular audio stream handled 193 * by the audio connector or the audio mixer. This HDA stream is a serial 194 * data in/out stream (SDI/SDO) defined in hardware and can contain 195 * multiple audio streams in one single SDI/SDO (interleaving streams). 196 196 * 197 197 * How a specific SDI/SDO is mapped to our internal audio streams relies on the 198 198 * stream channel mappings. 199 199 * 200 * Contains only register values which do *not* change until a 201 * stream resetoccurs.200 * Contains only register values which do *not* change until a stream reset 201 * occurs. 202 202 */ 203 203 typedef struct HDASTREAM … … 235 235 /** Pointer to HDA sink this stream is attached to. */ 236 236 R3PTRTYPE(PHDAMIXERSINK) pMixSink; 237 /** Stream's timer (copy of HDASTATE::ahTimers[u8SD]). */ 238 TMTIMERHANDLE hTimer; 237 239 /** The stream'S critical section to serialize access. */ 238 240 RTCRITSECT CritSect; 239 /** Pointer to the stream's timer. */240 PTMTIMERR3 pTimer;241 241 /** Internal state of this stream. */ 242 242 HDASTREAMSTATE State; 243 243 /** Debug information. */ 244 244 HDASTREAMDBGINFO Dbg; 245 } HDASTREAM, *PHDASTREAM; 245 } HDASTREAM; 246 /** Pointer to an HDA stream (SDI / SDO). */ 247 typedef HDASTREAM *PHDASTREAM; 246 248 247 249 #ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO … … 263 265 int hdaR3StreamCreate(PHDASTREAM pStream, PHDASTATE pThis, uint8_t u8SD); 264 266 void hdaR3StreamDestroy(PHDASTREAM pStream); 265 int hdaR3StreamInit(P HDASTREAM pStream, uint8_t uSD);267 int hdaR3StreamInit(PPDMDEVINS pDevIns, PHDASTREAM pStream, uint8_t uSD); 266 268 void hdaR3StreamReset(PHDASTATE pThis, PHDASTREAM pStream, uint8_t uSD); 267 269 int hdaR3StreamEnable(PHDASTREAM pStream, bool fEnable); … … 270 272 uint32_t hdaR3StreamGetFree(PHDASTREAM pStream); 271 273 uint32_t hdaR3StreamGetUsed(PHDASTREAM pStream); 272 bool hdaR3StreamTransferIsScheduled(P HDASTREAM pStream);274 bool hdaR3StreamTransferIsScheduled(PPDMDEVINS pDevIns, PHDASTREAM pStream); 273 275 uint64_t hdaR3StreamTransferGetNext(PHDASTREAM pStream); 274 int hdaR3StreamTransfer(P HDASTREAM pStream, uint32_t cbToProcessMax);276 int hdaR3StreamTransfer(PPDMDEVINS pDevIns, PHDASTREAM pStream, uint32_t cbToProcessMax); 275 277 void hdaR3StreamLock(PHDASTREAM pStream); 276 278 void hdaR3StreamUnlock(PHDASTREAM pStream); 277 279 int hdaR3StreamRead(PHDASTREAM pStream, uint32_t cbToRead, uint32_t *pcbRead); 278 280 int hdaR3StreamWrite(PHDASTREAM pStream, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten); 279 void hdaR3StreamUpdate(P HDASTREAM pStream, bool fAsync);281 void hdaR3StreamUpdate(PPDMDEVINS pDevIns, PHDASTREAM pStream, bool fAsync); 280 282 # ifdef HDA_USE_DMA_ACCESS_HANDLER 281 283 bool hdaR3StreamRegisterDMAHandlers(PHDASTREAM pStream);
Note:
See TracChangeset
for help on using the changeset viewer.