Changeset 59172 in vbox for trunk/src/VBox/Devices/Audio/DevIchHda.cpp
- Timestamp:
- Dec 17, 2015 10:32:08 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchHda.cpp
r59161 r59172 1485 1485 AssertPtrReturn(pStrmSt, VERR_INVALID_POINTER); 1486 1486 1487 #ifdef VBOX_STRICT 1488 AssertReleaseMsg(!RT_BOOL(HDA_STREAM_REG(pThis, CTL, u8Strm) & HDA_REG_FIELD_FLAG_MASK(SDCTL, RUN)), 1489 ("Cannot initialize stream %RU8 while in running state\n", u8Strm)); 1490 #endif 1491 1487 1492 pStrmSt->u8Strm = u8Strm; 1488 1493 pStrmSt->u64BaseDMA = RT_MAKE_U64(HDA_STREAM_REG(pThis, BDPL, u8Strm), … … 1583 1588 AssertReturnVoid(u8Strm <= 7); /** @todo Use a define for MAX_STREAMS! */ 1584 1589 1585 /* 1586 * Stop the stream and wait until our internal processing is done. 1587 */ 1588 int rc2 = hdaStreamStop(pStrmSt); 1589 if (RT_FAILURE(rc2)) 1590 { 1591 AssertReleaseMsgFailed(("HDA: Unable to stop stream %RU8, rc=%Rrc\n", pStrmSt->u8Strm, rc2)); 1592 return; 1593 } 1590 #ifdef VBOX_STRICT 1591 AssertReleaseMsg(!RT_BOOL(HDA_STREAM_REG(pThis, CTL, u8Strm) & HDA_REG_FIELD_FLAG_MASK(SDCTL, RUN)), 1592 ("Cannot reset stream %RU8 while in running state\n", u8Strm)); 1593 #endif 1594 1594 1595 1595 /* … … 1600 1600 1601 1601 /* 1602 * First, initializethe internal stream state.1602 * First, reset the internal stream state. 1603 1603 */ 1604 rc2 = hdaStreamInit(pThis, pStrmSt, u8Strm); 1605 AssertRC(rc2); 1604 pStrmSt->u8Strm = u8Strm; 1605 pStrmSt->u64BaseDMA = 0; 1606 pStrmSt->u32CBL = 0; 1607 pStrmSt->u16FMT = 0; 1608 pStrmSt->u16FIFOS = 0; 1609 pStrmSt->u16LVI = 0; 1606 1610 1607 1611 /* 1608 * Second, initialize registers.1612 * Second, initialize the registers. 1609 1613 */ 1610 1614 HDA_STREAM_REG(pThis, STS, u8Strm) = 0; … … 1612 1616 * bits are reserved for stream number 18.2.33, resets SDnCTL except SRST bit. */ 1613 1617 HDA_STREAM_REG(pThis, CTL, u8Strm) = 0x40000 | (HDA_STREAM_REG(pThis, CTL, u8Strm) & HDA_REG_FIELD_FLAG_MASK(SDCTL, SRST)); 1614 1615 1618 /* ICH6 defines default values (0x77 for input and 0xBF for output descriptors) of FIFO size. 18.2.39. */ 1616 1619 HDA_STREAM_REG(pThis, FIFOS, u8Strm) = u8Strm < 4 ? HDA_SDINFIFO_120B : HDA_SDONFIFO_192B; … … 1624 1627 HDA_STREAM_REG(pThis, BDPL, u8Strm) = 0; 1625 1628 1629 /* Report that we're done resetting this stream. */ 1630 HDA_STREAM_REG(pThis, CTL, u8Strm) = 0; 1631 1626 1632 LogFunc(("[SD%RU8]: Reset\n", u8Strm)); 1627 1633 1628 1634 /* Exit reset mode. */ 1629 1635 ASMAtomicXchgBool(&pStrmSt->State.fInReset, false); 1630 1631 /*1632 * Start stream again.1633 */1634 rc2 = hdaStreamStart(pStrmSt);1635 AssertRC(rc2);1636 1636 } 1637 1637 … … 1997 1997 { 1998 1998 #ifdef IN_RING3 1999 /* 2000 * Only (re-)initialize the stream when not running. 2001 */ 2002 if (!fRun && !fInRun) 2003 { 2004 int rc2 = hdaStreamInit(pThis, pStrmSt, u8Strm); 2005 AssertRC(rc2); 2006 } 2007 1999 2008 /* 2000 2009 * We enter here to change DMA states only. … … 2036 2045 } 2037 2046 } 2038 2039 if (pStrmSt)2040 {2041 int rc2 = hdaStreamInit(pThis, pStrmSt, u8Strm);2042 AssertRC(rc2);2043 }2044 2045 2047 #else /* !IN_RING3 */ 2046 2048 return VINF_IOM_R3_MMIO_WRITE; … … 4154 4156 4155 4157 if (pStrmSt) 4156 {4157 /* hdaStreamReset prevents changing the SRST bit, so we force it to zero here. */4158 HDA_STREAM_REG(pThis, CTL, u8Strm) = 0;4159 4160 4158 hdaStreamReset(pThis, pStrmSt, u8Strm); 4161 }4162 4159 } 4163 4160
Note:
See TracChangeset
for help on using the changeset viewer.