Changeset 88168 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Mar 17, 2021 6:58:41 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 143318
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r88164 r88168 4177 4177 4178 4178 /** Worker for hdaR3DbgInfoBDL. */ 4179 static void hdaR3DbgPrintBDL(PPDMDEVINS pDevIns, PHDASTATE pThis, PCDBGFINFOHLP pHlp, int idxStream) 4180 { 4181 const PHDASTREAM pStream = &pThis->aStreams[idxStream]; 4179 static void hdaR3DbgPrintBDL(PPDMDEVINS pDevIns, PHDASTATE pThis, PHDASTATER3 pThisCC, PCDBGFINFOHLP pHlp, int idxStream) 4180 { 4181 const PHDASTREAM pStream = &pThis->aStreams[idxStream]; 4182 const PHDASTREAMR3 pStreamR3 = &pThisCC->aStreams[idxStream]; 4183 PCPDMAUDIOPCMPROPS pGuestProps = &pStreamR3->State.Mapping.GuestProps; 4182 4184 4183 4185 uint64_t const u64BaseDMA = RT_MAKE_U64(HDA_STREAM_REG(pThis, BDPL, idxStream), … … 4210 4212 if (bd.fFlags & ~HDA_BDLE_F_IOC) 4211 4213 RTStrPrintf(szFlags, sizeof(szFlags), " !!fFlags=%#x!!\n", bd.fFlags); 4212 pHlp->pfnPrintf(pHlp, " %sBDLE%03u: %s%#011RX64 LB %#06x %s%s\n", idxCurBdle == i ? "=>" : " ", i, "%%", bd.u64BufAddr, 4213 bd.u32BufSize, bd.fFlags & HDA_BDLE_F_IOC ? " IOC=1" : "", szFlags); 4214 pHlp->pfnPrintf(pHlp, " %sBDLE%03u: %s%#011RX64 LB %#06x (%RU64 us) %s%s\n", idxCurBdle == i ? "=>" : " ", i, "%%", 4215 bd.u64BufAddr, bd.u32BufSize, PDMAudioPropsBytesToMicro(pGuestProps, bd.u32BufSize), 4216 bd.fFlags & HDA_BDLE_F_IOC ? " IOC=1" : "", szFlags); 4214 4217 4215 4218 if (memcmp(&bd, &pStream->State.aBdl[i], sizeof(bd)) != 0) … … 4224 4227 cbTotal += bd.u32BufSize; 4225 4228 } 4226 pHlp->pfnPrintf(pHlp, " Total: %#RX64 bytes (%RU64)\n", cbTotal, cbTotal); 4229 pHlp->pfnPrintf(pHlp, " Total: %#RX64 bytes (%RU64), %u ms\n", cbTotal, cbTotal, 4230 PDMAudioPropsBytesToMilli(&pStreamR3->State.Mapping.GuestProps, (uint32_t)cbTotal)); 4227 4231 if (cbTotal != u32CBL) 4228 4232 pHlp->pfnPrintf(pHlp, " Warning: %#RX64 bytes does not match CBL (%#RX64)!\n", cbTotal, u32CBL); … … 4241 4245 pStream->State.aSchedule[i].cPeriodTicks, pStream->State.aSchedule[i].idxFirst, 4242 4246 pStream->State.aSchedule[i].idxFirst + pStream->State.aSchedule[i].cEntries - 1); 4243 4244 /*4245 * DMA counters:4246 */4247 uint64_t const uDPBase = pThis->u64DPBase & DPBASE_ADDR_MASK;4248 pHlp->pfnPrintf(pHlp, " DMA counters %#011RX64 LB %#x, %s:\n", uDPBase, u16LVI * 2 * sizeof(uint32_t),4249 pThis->fDMAPosition ? "enabled" : "disabled");4250 if (uDPBase)4251 for (uint16_t i = 0; i < u16LVI + 1; i++)4252 {4253 struct4254 {4255 uint32_t uPos;4256 uint32_t uReserved;4257 } Buf = { 0 , 0 };4258 PDMDevHlpPCIPhysRead(pDevIns, uDPBase + i * sizeof(Buf), &Buf, sizeof(Buf));4259 4260 char szReserved[64];4261 szReserved[0] = '\0';4262 if (Buf.uReserved != 0)4263 RTStrPrintf(szReserved, sizeof(szReserved), " reserved=%#x", Buf.uReserved);4264 pHlp->pfnPrintf(pHlp, " #%03d DMA @ %#x%s\n", i, Buf.uPos, szReserved);4265 }4266 else4267 pHlp->pfnPrintf(pHlp, " No counters.\n");4268 4247 } 4269 4248 … … 4302 4281 { 4303 4282 PHDASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PHDASTATE); 4283 PHDASTATER3 pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PHDASTATER3); 4304 4284 int idxStream = hdaR3DbgLookupStrmIdx(pHlp, pszArgs); 4305 4285 if (idxStream != -1) 4306 hdaR3DbgPrintBDL(pDevIns, pThis, p Hlp, idxStream);4286 hdaR3DbgPrintBDL(pDevIns, pThis, pThisCC, pHlp, idxStream); 4307 4287 else 4288 { 4308 4289 for (idxStream = 0; idxStream < HDA_MAX_STREAMS; ++idxStream) 4309 hdaR3DbgPrintBDL(pDevIns, pThis, pHlp, idxStream); 4290 hdaR3DbgPrintBDL(pDevIns, pThis, pThisCC, pHlp, idxStream); 4291 idxStream = -1; 4292 } 4293 4294 /* 4295 * DMA stream positions: 4296 */ 4297 uint64_t const uDPBase = pThis->u64DPBase & DPBASE_ADDR_MASK; 4298 pHlp->pfnPrintf(pHlp, "DMA counters %#011RX64 LB %#x, %s:\n", uDPBase, HDA_MAX_STREAMS * 2 * sizeof(uint32_t), 4299 pThis->fDMAPosition ? "enabled" : "disabled"); 4300 if (uDPBase) 4301 { 4302 struct 4303 { 4304 uint32_t off, uReserved; 4305 } aPositions[HDA_MAX_STREAMS]; 4306 RT_ZERO(aPositions); 4307 PDMDevHlpPCIPhysRead(pDevIns, uDPBase , &aPositions[0], sizeof(aPositions)); 4308 4309 for (unsigned i = 0; i < RT_ELEMENTS(aPositions); i++) 4310 if (idxStream == -1 || i == (unsigned)idxStream) /* lazy bird */ 4311 { 4312 char szReserved[64]; 4313 szReserved[0] = '\0'; 4314 if (aPositions[i].uReserved != 0) 4315 RTStrPrintf(szReserved, sizeof(szReserved), " reserved=%#x", aPositions[i].uReserved); 4316 pHlp->pfnPrintf(pHlp, " Stream #%u DMA @ %#x%s\n", i, aPositions[i].off, szReserved); 4317 } 4318 } 4310 4319 } 4311 4320
Note:
See TracChangeset
for help on using the changeset viewer.