Changeset 71711 in vbox
- Timestamp:
- Apr 6, 2018 3:47:49 PM (7 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r71710 r71711 541 541 542 542 543 #ifdef IN_RING3544 545 543 /** 546 544 * Retrieves the number of bytes of a FIFOW register. … … 563 561 } 564 562 563 #ifdef IN_RING3 565 564 /** 566 565 * Reschedules pending interrupts for all audio streams which have complete … … 596 595 # endif 597 596 } 598 599 597 #endif /* IN_RING3 */ 600 598 … … 1271 1269 static int hdaRegWriteSDCBL(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1272 1270 { 1273 #ifdef IN_RING3 1274 DEVHDA_LOCK(pThis); 1271 DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); 1275 1272 1276 1273 PHDASTREAM pStream = hdaGetStreamFromSD(pThis, HDA_SD_NUM_FROM_REG(pThis, CBL, iReg)); … … 1284 1281 HDA_SD_NUM_FROM_REG(pThis, CTL, iReg), u32Value)); 1285 1282 1286 int rc 2= hdaRegWriteU32(pThis, iReg, u32Value);1287 AssertRC (rc2);1283 int rc = hdaRegWriteU32(pThis, iReg, u32Value); 1284 AssertRCSuccess(rc); 1288 1285 1289 1286 DEVHDA_UNLOCK(pThis); 1290 return VINF_SUCCESS; /* Always return success to the MMIO handler. */ 1291 #else /* !IN_RING3 */ 1292 RT_NOREF_PV(pThis); RT_NOREF_PV(iReg); RT_NOREF_PV(u32Value); 1293 return VINF_IOM_R3_MMIO_WRITE; 1294 #endif /* IN_RING3 */ 1287 return rc; 1295 1288 } 1296 1289 … … 1599 1592 static int hdaRegWriteSDLVI(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1600 1593 { 1601 #ifdef IN_RING3 1602 DEVHDA_LOCK(pThis); 1594 DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); 1603 1595 1604 1596 if (HDA_REG_IND(pThis, iReg) == u32Value) /* Value already set? */ … … 1614 1606 LogFunc(("[SD%RU8] Updating LVI to %RU16\n", uSD, pStream->u16LVI)); 1615 1607 1616 # 1608 #ifdef HDA_USE_DMA_ACCESS_HANDLER 1617 1609 if (hdaGetDirFromSD(uSD) == PDMAUDIODIR_OUT) 1618 1610 { … … 1622 1614 LogFunc(("[SD%RU8] DMA logging enabled\n", pStream->u8SD)); 1623 1615 } 1624 # 1616 #endif 1625 1617 } 1626 1618 else … … 1633 1625 DEVHDA_UNLOCK(pThis); 1634 1626 return VINF_SUCCESS; /* Always return success to the MMIO handler. */ 1635 #else /* !IN_RING3 */1636 RT_NOREF_PV(pThis); RT_NOREF_PV(iReg); RT_NOREF_PV(u32Value);1637 return VINF_IOM_R3_MMIO_WRITE;1638 #endif /* IN_RING3 */1639 1627 } 1640 1628 1641 1629 static int hdaRegWriteSDFIFOW(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1642 1630 { 1643 #ifdef IN_RING3 1644 DEVHDA_LOCK(pThis); 1631 DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); 1645 1632 1646 1633 uint8_t uSD = HDA_SD_NUM_FROM_REG(pThis, FIFOW, iReg); … … 1648 1635 if (hdaGetDirFromSD(uSD) != PDMAUDIODIR_IN) /* FIFOW for input streams only. */ 1649 1636 { 1637 #ifndef IN_RING0 1650 1638 LogRel(("HDA: Warning: Guest tried to write read-only FIFOW to output stream #%RU8, ignoring\n", uSD)); 1651 1652 1639 DEVHDA_UNLOCK(pThis); 1653 1640 return VINF_SUCCESS; 1641 #else 1642 DEVHDA_UNLOCK(pThis); 1643 return VINF_IOM_R3_MMIO_WRITE; 1644 #endif 1654 1645 } 1655 1646 … … 1691 1682 DEVHDA_UNLOCK(pThis); 1692 1683 return VINF_SUCCESS; /* Always return success to the MMIO handler. */ 1693 #else /* !IN_RING3 */1694 RT_NOREF_PV(pThis); RT_NOREF_PV(iReg); RT_NOREF_PV(u32Value);1695 return VINF_IOM_R3_MMIO_WRITE;1696 #endif /* IN_RING3 */1697 1684 } 1698 1685 … … 1702 1689 static int hdaRegWriteSDFIFOS(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1703 1690 { 1704 #ifdef IN_RING3 1705 DEVHDA_LOCK(pThis); 1691 DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); 1706 1692 1707 1693 uint8_t uSD = HDA_SD_NUM_FROM_REG(pThis, FIFOS, iReg); … … 1756 1742 DEVHDA_UNLOCK(pThis); 1757 1743 return VINF_SUCCESS; /* Always return success to the MMIO handler. */ 1758 #else /* !IN_RING3 */1759 RT_NOREF_PV(pThis); RT_NOREF_PV(iReg); RT_NOREF_PV(u32Value);1760 return VINF_IOM_R3_MMIO_WRITE;1761 #endif /* IN_RING3 */1762 1744 } 1763 1745 -
trunk/src/VBox/Devices/Audio/DevHDACommon.cpp
r71688 r71711 101 101 102 102 #ifdef IN_RING3 103 103 104 /** 104 105 * Sets the actual WALCLK register to the specified wall clock value. … … 117 118 u64WalClk); 118 119 const uint64_t u64FrontAbsWalClk = hdaStreamPeriodGetAbsElapsedWalClk(&hdaGetStreamFromSink(pThis, &pThis->SinkFront)->State.Period); 119 # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND120 # error "Implement me!"121 # endif120 # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND 121 # error "Implement me!" 122 # endif 122 123 123 124 const bool fLineInPassed = hdaStreamPeriodHasPassedAbsWalClk (&hdaGetStreamFromSink(pThis, &pThis->SinkLineIn)->State.Period, u64WalClk); 124 125 const uint64_t u64LineInAbsWalClk = hdaStreamPeriodGetAbsElapsedWalClk(&hdaGetStreamFromSink(pThis, &pThis->SinkLineIn)->State.Period); 125 # ifdef VBOX_WITH_HDA_MIC_IN126 # ifdef VBOX_WITH_HDA_MIC_IN 126 127 const bool fMicInPassed = hdaStreamPeriodHasPassedAbsWalClk (&hdaGetStreamFromSink(pThis, &pThis->SinkMicIn)->State.Period, u64WalClk); 127 128 const uint64_t u64MicInAbsWalClk = hdaStreamPeriodGetAbsElapsedWalClk(&hdaGetStreamFromSink(pThis, &pThis->SinkMicIn)->State.Period); 128 # endif129 130 # ifdef VBOX_STRICT129 # endif 130 131 # ifdef VBOX_STRICT 131 132 const uint64_t u64WalClkCur = ASMAtomicReadU64(&pThis->u64WalClk); 132 # endif133 # endif 133 134 134 135 /* Only drive the WALCLK register forward if all (active) stream periods have passed 135 136 * the specified point in time given by u64WalClk. */ 136 137 if ( ( fFrontPassed 137 # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND138 # error "Implement me!"139 # endif138 # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND 139 # error "Implement me!" 140 # endif 140 141 && fLineInPassed 141 # ifdef VBOX_WITH_HDA_MIC_IN142 # ifdef VBOX_WITH_HDA_MIC_IN 142 143 && fMicInPassed 143 # endif144 # endif 144 145 ) 145 146 || fForce) … … 150 151 * Not the most elegant solution, but works for now ... */ 151 152 u64WalClk = RT_MAX(u64WalClk, u64FrontAbsWalClk); 152 # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND153 # error "Implement me!"154 # endif153 # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND 154 # error "Implement me!" 155 # endif 155 156 u64WalClk = RT_MAX(u64WalClk, u64LineInAbsWalClk); 156 # ifdef VBOX_WITH_HDA_MIC_IN157 # ifdef VBOX_WITH_HDA_MIC_IN 157 158 u64WalClk = RT_MAX(u64WalClk, u64MicInAbsWalClk); 158 # endif159 160 # ifdef VBOX_STRICT159 # endif 160 161 # ifdef VBOX_STRICT 161 162 AssertMsg(u64WalClk >= u64WalClkCur, 162 163 ("Setting WALCLK to a value going backwards does not make any sense (old %RU64 vs. new %RU64)\n", … … 170 171 else 171 172 pThis->u8WalClkStaleCnt = 0; 172 # endif173 # endif 173 174 } 174 175 … … 203 204 if (uSD == uFirstSDI) /* First SDI. */ 204 205 return &pThis->SinkLineIn; 205 # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN206 # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN 206 207 else if (uSD == uFirstSDI + 1) 207 208 return &pThis->SinkMicIn; 208 # else209 # else 209 210 else /* If we don't have a dedicated Mic-In sink, use the always present Line-In sink. */ 210 211 return &pThis->SinkLineIn; 211 # endif212 # endif 212 213 } 213 214 else … … 217 218 if (uSD == uFirstSDO) 218 219 return &pThis->SinkFront; 219 # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND220 # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND 220 221 else if (uSD == uFirstSDO + 1) 221 222 return &pThis->SinkCenterLFE; 222 223 else if (uSD == uFirstSDO + 2) 223 224 return &pThis->SinkRear; 224 # endif225 # endif 225 226 } 226 227 227 228 return NULL; 228 229 } 230 231 #endif /* IN_RING */ 229 232 230 233 /** … … 268 271 return &pThis->aStreams[uSD]; 269 272 } 273 274 #ifdef IN_RING3 270 275 271 276 /** … … 434 439 return rc; 435 440 } 441 436 442 #endif /* IN_RING3 */ 437 443 -
trunk/src/VBox/Devices/Audio/HDAStreamPeriod.cpp
r70125 r71711 412 412 /* All frames transferred? */ 413 413 && pPeriod->framesTransferred >= pPeriod->framesToTransfer; 414 # ifdef VBOX_STRICT414 # ifdef VBOX_STRICT 415 415 if (fIsComplete) 416 416 { … … 418 418 Assert(pPeriod->u64ElapsedWalClk == pPeriod->u64DurationWalClk); 419 419 } 420 # endif420 # endif 421 421 422 422 Log3Func(("[SD%RU8] Period %s - runtime %RU64 / %RU64 (abs @ %RU64, starts @ %RU64, ends @ %RU64), %RU8 IRQs pending\n", … … 429 429 return fIsComplete; 430 430 } 431 431 432 #endif /* IN_RING3 */ 432 433
Note:
See TracChangeset
for help on using the changeset viewer.