Changeset 58926 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Nov 30, 2015 10:11:22 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchHda.cpp
r58925 r58926 277 277 #define HDA_RMX_DPUBASE 31 278 278 #define DPUBASE(pThis) (HDA_REG((pThis), DPUBASE)) 279 /** DMA Position Buffer Enable (3.3.32). */ 280 #define DPBASE_ENABLED RT_BIT(0) 279 281 280 #define DPBASE_ADDR_MASK (~(uint64_t)0x7f) 282 281 … … 704 703 * Made out of DPLBASE + DPUBASE (3.3.32 + 3.3.33). */ 705 704 uint64_t u64DPBase; 705 /** DMA position buffer enable bit. */ 706 bool fDMAPosition; 706 707 /** Pointer to CORB buffer. */ 707 708 R3PTRTYPE(uint32_t *) pu32CorbBuf; … … 769 770 } HDACALLBACKCTX, *PHDACALLBACKCTX; 770 771 #endif 771 772 #define ISD0FMT_TO_AUDIO_SELECTOR(pThis) \773 ( AUDIO_FORMAT_SELECTOR((pThis)->pCodec, In, SDFMT_BASE_RATE(pThis, 0), SDFMT_MULT(pThis, 0), SDFMT_DIV(pThis, 0)) )774 #define OSD0FMT_TO_AUDIO_SELECTOR(pThis) \775 ( AUDIO_FORMAT_SELECTOR((pThis)->pCodec, Out, SDFMT_BASE_RATE(pThis, 4), SDFMT_MULT(pThis, 4), SDFMT_DIV(pThis, 4)) )776 777 772 778 773 /********************************************************************************************************************************* … … 949 944 { 0x00064, 0x00004, 0x00000000, 0xFFFFFFFF, hdaRegReadU32 , hdaRegWriteUnimpl , HDA_REG_IDX(IR) }, /* Immediate Response */ 950 945 { 0x00068, 0x00002, 0x00000002, 0x00000002, hdaRegReadIRS , hdaRegWriteIRS , HDA_REG_IDX(IRS) }, /* Immediate Command Status */ 951 { 0x00070, 0x00004, 0xFFFFFFFF, 0xFFFFFF81, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(DPLBASE) }, /* MA Position Lower Base */946 { 0x00070, 0x00004, 0xFFFFFFFF, 0xFFFFFF81, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(DPLBASE) }, /* DMA Position Lower Base */ 952 947 { 0x00074, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(DPUBASE) }, /* DMA Position Upper Base */ 953 948 /* 4 Input Stream Descriptors (ISD). */ … … 1022 1017 Assert(u32LPIB <= pStrmSt->u32CBL); 1023 1018 1024 LogFlowFunc(("uStrm=%RU8, LPIB=%RU32 (DMA Position : %RTbool)\n",1025 pStrmSt->u8Strm, u32LPIB, RT_BOOL(pThis->u64DPBase & DPBASE_ENABLED)));1019 LogFlowFunc(("uStrm=%RU8, LPIB=%RU32 (DMA Position Buffer Enabled: %RTbool)\n", 1020 pStrmSt->u8Strm, u32LPIB, pThis->fDMAPosition)); 1026 1021 1027 1022 /* Update LPIB in any case. */ … … 1029 1024 1030 1025 /* Do we need to tell the current DMA position? */ 1031 if (pThis-> u64DPBase & DPBASE_ENABLED)1026 if (pThis->fDMAPosition) 1032 1027 { 1033 1028 int rc2 = PDMDevHlpPCIPhysWrite(pThis->CTX_SUFF(pDevIns), … … 1130 1125 #endif 1131 1126 1127 /* 1128 * Switch to the next BDLE entry and do a wrap around 1129 * if we reached the end of the Buffer Descriptor List (BDL). 1130 */ 1132 1131 pStrmSt->State.uCurBDLE++; 1133 1132 if (pStrmSt->State.uCurBDLE == pStrmSt->State.cBDLE) … … 1146 1145 1147 1146 #ifdef DEBUG 1148 LogFlowFunc(("uOldBDLE=%RU16, uCurBDLE=%RU16 %R[bdle]\n", uOldBDLE, pStrmSt->State.uCurBDLE, pBDLE)); 1147 LogFlowFunc(("uOldBDLE=%RU16, uCurBDLE=%RU16, cBDLE=%RU32, %R[bdle]\n", 1148 uOldBDLE, pStrmSt->State.uCurBDLE, pStrmSt->State.cBDLE, pBDLE)); 1149 1149 #endif 1150 1150 return pBDLE; … … 2240 2240 break; 2241 2241 case HDA_REG_DPLBASE: 2242 /** @todo: first bit has special meaning */2242 { 2243 2243 pThis->u64DPBase &= UINT64_C(0xFFFFFFFF00000000); 2244 2244 pThis->u64DPBase |= pThis->au32Regs[iRegMem]; 2245 2246 /* Also make sure to handle the DMA position enable bit. */ 2247 bool fEnabled = pThis->au32Regs[iRegMem] & RT_BIT_32(0); 2248 if (pThis->fDMAPosition != fEnabled) 2249 { 2250 LogRel(("HDA: %s DMA position buffer\n", fEnabled ? "Enabled" : "Disabled")); 2251 pThis->fDMAPosition = fEnabled; 2252 2253 if (pThis->fDMAPosition) 2254 { 2255 /* Immediately tell the position. */ 2256 hdaStreamUpdateLPIB(pThis, &pThis->StrmStLineIn, HDA_STREAM_REG(pThis, LPIB, pThis->StrmStLineIn.u8Strm)); 2257 hdaStreamUpdateLPIB(pThis, &pThis->StrmStMicIn, HDA_STREAM_REG(pThis, LPIB, pThis->StrmStMicIn.u8Strm)); 2258 hdaStreamUpdateLPIB(pThis, &pThis->StrmStOut, HDA_STREAM_REG(pThis, LPIB, pThis->StrmStOut.u8Strm)); 2259 } 2260 } 2245 2261 break; 2262 } 2246 2263 case HDA_REG_DPUBASE: 2247 2264 pThis->u64DPBase &= UINT64_C(0x00000000FFFFFFFF); … … 2249 2266 break; 2250 2267 default: 2251 AssertMsgFailed(("Invalid index "));2268 AssertMsgFailed(("Invalid index\n")); 2252 2269 break; 2253 2270 }
Note:
See TracChangeset
for help on using the changeset viewer.