Changeset 62972 in vbox
- Timestamp:
- Aug 4, 2016 10:44:09 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchHda.cpp
r62632 r62972 2632 2632 AssertMsgFailed(("Unsupported bits per sample %x\n", 2633 2633 EXTRACT_VALUE(u32SDFMT, HDA_SDFMT_BITS_MASK, HDA_SDFMT_BITS_SHIFT))); 2634 enmFmt = PDMAUDIOFMT_INVALID; 2634 2635 rc = VERR_NOT_SUPPORTED; 2635 2636 break; … … 2983 2984 DECLINLINE(int) hdaRegWriteSDLock(PHDASTATE pThis, PHDASTREAM pStream, uint32_t iReg, uint32_t u32Value) 2984 2985 { 2986 RT_NOREF(pThis, iReg, u32Value); 2985 2987 AssertPtr(pThis); /* don't bother returning errors */ 2986 2988 AssertPtr(pStream); 2987 2989 2988 # ifdef VBOX_STRICT2990 # ifdef VBOX_STRICT 2989 2991 /* Check if the SD's RUN bit is set. */ 2990 2992 uint32_t u32SDCTL = HDA_STREAM_REG(pThis, CTL, pStream->u8SD); … … 2994 2996 LogFunc(("[SD%RU8]: Warning: Cannot write to register 0x%x (0x%x) when RUN bit is set (%R[sdctl])\n", 2995 2997 pStream->u8SD, iReg, u32Value, u32SDCTL)); 2996 # ifdef DEBUG_andy2998 # ifdef DEBUG_andy 2997 2999 AssertFailed(); 3000 # endif 3001 return VERR_ACCESS_DENIED; 3002 } 2998 3003 # endif 2999 return VERR_ACCESS_DENIED;3000 }3001 #endif3002 3004 3003 3005 /** @todo r=bird: Why on EARTH are we using mutexes? USE CRITICAL SECTIONS!! */ … … 3491 3493 3492 3494 PHDABDLE pBDLE = &pStream->State.BDLE; 3495 #ifdef LOG_ENABLED 3493 3496 const uint32_t u32LPIB = HDA_STREAM_REG(pThis, LPIB, pStream->u8SD); 3497 #endif 3494 3498 3495 3499 /* Check if the current BDLE entry is complete (full). */ … … 3656 3660 if (cbBuf >= hdaStreamGetFIFOW(pThis, pStream)) 3657 3661 { 3662 #if defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_HDA_51_SURROUND) 3658 3663 PHDASTREAMMAPPING pMapping = &pStream->State.Mapping; 3664 #endif 3659 3665 3660 3666 /** @todo Which channel is which? */ … … 3701 3707 * Write data to according mixer sinks. 3702 3708 */ 3703 rc2 = AudioMixerSinkWrite(pThis->SinkFront.pMixSink, AUDMIXOP_COPY, pvDataFront, cbDataFront,3709 rc2 = AudioMixerSinkWrite(pThis->SinkFront.pMixSink, AUDMIXOP_COPY, pvDataFront, (uint32_t)cbDataFront, 3704 3710 NULL /* pcbWritten */); 3705 3711 AssertRC(rc2); … … 4161 4167 static DECLCALLBACK(void) hdaTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 4162 4168 { 4169 RT_NOREF(pDevIns); 4163 4170 PHDASTATE pThis = (PHDASTATE)pvUser; 4164 4171 Assert(pThis == PDMINS_2_DATA(pDevIns, PHDASTATE)); … … 4167 4174 STAM_PROFILE_START(&pThis->StatTimer, a); 4168 4175 4169 uint64_t cTicksNow = TMTimerGet(pTimer); 4170 uint64_t cTicksElapsed = cTicksNow - pThis->uTimerTS; 4176 uint64_t cTicksNow = TMTimerGet(pTimer); 4171 4177 4172 4178 LogFlowFuncEnter(); … … 4373 4379 /* State sanity checks. */ 4374 4380 Assert(pStream->State.fInReset == false); 4375 4376 uint32_t u32LPIB = HDA_STREAM_REG(pThis, LPIB, pStream->u8SD); 4377 Assert(u32LPIB <= pStream->u32CBL); 4381 Assert(HDA_STREAM_REG(pThis, LPIB, pStream->u8SD) <= pStream->u32CBL); 4378 4382 4379 4383 bool fInterrupt = false; … … 4757 4761 * @callback_method_impl{FNPCIIOREGIONMAP} 4758 4762 */ 4759 static DECLCALLBACK(int) hdaPciIoRegionMap(PPCIDEVICE pPciDev, int iRegion, RTGCPHYS GCPhysAddress, uint32_t cb, 4760 PCIADDRESSSPACE enmType) 4761 { 4763 static DECLCALLBACK(int) 4764 hdaPciIoRegionMap(PPCIDEVICE pPciDev, int iRegion, RTGCPHYS GCPhysAddress, uint32_t cb, PCIADDRESSSPACE enmType) 4765 { 4766 RT_NOREF(iRegion, enmType); 4762 4767 PPDMDEVINS pDevIns = pPciDev->pDevIns; 4763 4768 PHDASTATE pThis = RT_FROM_MEMBER(pPciDev, HDASTATE, PciDev); 4764 RTIOPORT Port = (RTIOPORT)GCPhysAddress;4765 int rc;4766 4769 4767 4770 /* … … 4772 4775 */ 4773 4776 Assert(enmType == PCI_ADDRESS_SPACE_MEM); 4774 rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL /*pvUser*/, 4775 IOMMMIO_FLAGS_READ_DWORD 4776 | IOMMMIO_FLAGS_WRITE_PASSTHRU, 4777 hdaMMIOWrite, hdaMMIORead, "HDA"); 4778 4777 int rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL /*pvUser*/, 4778 IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_PASSTHRU, 4779 hdaMMIOWrite, hdaMMIORead, "HDA"); 4779 4780 if (RT_FAILURE(rc)) 4780 4781 return rc; … … 4805 4806 static int hdaSaveStream(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, PHDASTREAM pStrm) 4806 4807 { 4808 RT_NOREF(pDevIns); 4809 #ifdef DEBUG 4807 4810 PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); 4808 4811 #endif 4809 4812 LogFlowFunc(("[SD%RU8]\n", pStrm->u8SD)); 4810 4813 … … 4879 4882 4880 4883 /* Save stream states. */ 4881 int rc;4882 4884 for (uint8_t i = 0; i < HDA_MAX_STREAMS; i++) 4883 4885 { 4884 rc = hdaSaveStream(pDevIns, pSSM, &pThis->aStreams[i]);4886 int rc = hdaSaveStream(pDevIns, pSSM, &pThis->aStreams[i]); 4885 4887 AssertRCReturn(rc, rc); 4886 4888 } 4887 4889 4888 return rc;4890 return VINF_SUCCESS; 4889 4891 } 4890 4892 … … 5620 5622 static int hdaAttachInternal(PPDMDEVINS pDevIns, PHDADRIVER pDrv, unsigned uLUN, uint32_t fFlags) 5621 5623 { 5624 RT_NOREF(fFlags); 5622 5625 PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); 5623 5626 … … 5698 5701 static DECLCALLBACK(void) hdaDetach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags) 5699 5702 { 5703 RT_NOREF(pDevIns, uLUN, fFlags); 5700 5704 LogFunc(("iLUN=%u, fFlags=0x%x\n", uLUN, fFlags)); 5701 5705 } … … 5792 5796 static DECLCALLBACK(int) hdaConstruct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg) 5793 5797 { 5798 RT_NOREF(iInstance); 5799 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); 5794 5800 PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); 5795 5801 Assert(iInstance == 0); 5796 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns);5797 5802 5798 5803 /*
Note:
See TracChangeset
for help on using the changeset viewer.