Changeset 89875 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 24, 2021 9:57:51 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHdaStream.cpp
r89874 r89875 1171 1171 } 1172 1172 1173 #if 0 /* unused */1174 /**1175 * Get the size of the current BDLE.1176 *1177 * @returns The size (in bytes).1178 * @param pStreamShared The stream to check.1179 */1180 DECLINLINE(RTGCPHYS) hdaStreamDmaBufGetSize(PHDASTREAM pStreamShared)1181 {1182 uint8_t idxBdle = pStreamShared->State.idxCurBdle;1183 AssertStmt(idxBdle < pStreamShared->State.cBdles, idxBdle = 0);1184 return pStreamShared->State.aBdl[idxBdle].cb;1185 }1186 #endif1187 1188 1173 /** 1189 1174 * Checks if the current BDLE is completed. … … 1369 1354 pStreamShared->State.aBdl[pStreamShared->State.idxCurBdle].cb, 1370 1355 pStreamShared->State.aBdl[pStreamShared->State.idxCurBdle].fFlags)); 1371 1372 #if 0 /* Moved to the transfer loops */1373 /*1374 * Update the stream's current position.1375 *1376 * Do this as accurate and close to the actual data transfer as possible.1377 * All guests rely on this, depending on the mechanism they use (LPIB register or DMA counters).1378 *1379 * Note for Windows 10: The OS' driver is *very* picky about *when* the (DMA) positions get updated!1380 * Not doing this at the right time will result in ugly sound crackles!1381 */1382 hdaStreamSetPositionAdd(pStreamShared, pDevIns, pThis, hdaStreamDmaBufGetSize(pStreamShared));1383 #endif1384 1356 1385 1357 /* Does the current BDLE require an interrupt to be sent? */ … … 2629 2601 2630 2602 2631 # if 0 /* unused - no prototype even */2632 /**2633 * Updates an HDA stream's current read or write buffer position (depending on the stream type) by2634 * updating its associated LPIB register and DMA position buffer (if enabled).2635 *2636 * @returns Set LPIB value.2637 * @param pDevIns The device instance.2638 * @param pStream HDA stream to update read / write position for.2639 * @param u32LPIB New LPIB (position) value to set.2640 */2641 uint32_t hdaR3StreamUpdateLPIB(PPDMDEVINS pDevIns, PHDASTATE pThis, PHDASTREAM pStreamShared, uint32_t u32LPIB)2642 {2643 AssertMsg(u32LPIB <= pStreamShared->u32CBL,2644 ("[SD%RU8] New LPIB (%RU32) exceeds CBL (%RU32)\n", pStreamShared->u8SD, u32LPIB, pStreamShared->u32CBL));2645 2646 u32LPIB = RT_MIN(u32LPIB, pStreamShared->u32CBL);2647 2648 LogFlowFunc(("[SD%RU8] LPIB=%RU32 (DMA Position Buffer Enabled: %RTbool)\n",2649 pStreamShared->u8SD, u32LPIB, pThis->fDMAPosition));2650 2651 /* Update LPIB in any case. */2652 HDA_STREAM_REG(pThis, LPIB, pStreamShared->u8SD) = u32LPIB;2653 2654 /* Do we need to tell the current DMA position? */2655 if (pThis->fDMAPosition)2656 {2657 int rc2 = PDMDevHlpPCIPhysWrite(pDevIns,2658 pThis->u64DPBase + (pStreamShared->u8SD * 2 * sizeof(uint32_t)),2659 (void *)&u32LPIB, sizeof(uint32_t));2660 AssertRC(rc2);2661 }2662 2663 return u32LPIB;2664 }2665 # endif2666 2667 2603 # ifdef HDA_USE_DMA_ACCESS_HANDLER 2668 2604 /**
Note:
See TracChangeset
for help on using the changeset viewer.