Changeset 59272 in vbox
- Timestamp:
- Jan 6, 2016 10:23:56 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchHda.cpp
r59262 r59272 3631 3631 Assert(uPass == SSM_PASS_FINAL); NOREF(uPass); 3632 3632 3633 Log FlowFunc(("uVersion=%RU32, uPass=0x%x\n", uVersion, uPass));3633 LogRel2(("hdaLoadExec: uVersion=%RU32, uPass=0x%x\n", uVersion, uPass)); 3634 3634 3635 3635 /* … … 3743 3743 /* Output */ 3744 3744 rc = hdaStreamInit(pThis, &pThis->StrmStOut, 4 /* Stream number, hardcoded */); 3745 AssertRCBreak(rc); 3745 if (RT_FAILURE(rc)) 3746 break; 3746 3747 HDA_SSM_LOAD_BDLE_STATE_PRE_V5(uVersion, ( pThis->StrmStOut.State.cBDLE 3747 3748 ? &pThis->StrmStOut.State.paBDLE[0].State : &StateBDLEDummy)); 3748 3749 /* Microphone-In */ 3749 3750 rc = hdaStreamInit(pThis, &pThis->StrmStMicIn, 2 /* Stream number, hardcoded */); 3750 AssertRCBreak(rc); 3751 if (RT_FAILURE(rc)) 3752 break; 3751 3753 HDA_SSM_LOAD_BDLE_STATE_PRE_V5(uVersion, ( pThis->StrmStMicIn.State.cBDLE 3752 3754 ? &pThis->StrmStMicIn.State.paBDLE[0].State : &StateBDLEDummy)); 3753 3755 /* Line-In */ 3754 3756 rc = hdaStreamInit(pThis, &pThis->StrmStLineIn, 0 /* Stream number, hardcoded */); 3755 AssertRCBreak(rc); 3757 if (RT_FAILURE(rc)) 3758 break; 3756 3759 HDA_SSM_LOAD_BDLE_STATE_PRE_V5(uVersion, ( pThis->StrmStLineIn.State.cBDLE 3757 3760 ? &pThis->StrmStLineIn.State.paBDLE[0].State : &StateBDLEDummy)); … … 3765 3768 uint32_t cStreams; 3766 3769 rc = SSMR3GetU32(pSSM, &cStreams); 3767 AssertRCBreak(rc); 3770 if (RT_FAILURE(rc)) 3771 break; 3772 3773 LogRel2(("hdaLoadExec: cStreams=%RU32\n", cStreams)); 3768 3774 3769 3775 /* Load stream states. */ … … 3772 3778 uint8_t uStreamID; 3773 3779 rc = SSMR3GetU8(pSSM, &uStreamID); 3774 AssertRCBreak(rc); 3780 if (RT_FAILURE(rc)) 3781 break; 3775 3782 3776 3783 PHDASTREAM pStrm; … … 3798 3805 RT_BZERO(pStrm, sizeof(HDASTREAM)); 3799 3806 rc = SSMR3GetStructEx(pSSM, &pStrm->State, sizeof(HDASTREAMSTATE), 0 /* fFlags */, g_aSSMStreamStateFields5, NULL); 3800 AssertRCBreak(rc); 3807 if (RT_FAILURE(rc)) 3808 break; 3801 3809 3802 3810 rc = hdaStreamInit(pThis, pStrm, uStreamID); 3803 AssertRCBreak(rc); 3811 if (RT_FAILURE(rc)) 3812 { 3813 LogRel(("HDA: Stream #%RU32: Inititialization of stream (ID=%RU8, cBDLE=%RU32) failed, rc=%Rrc\n", i, uStreamID, pStrm->State.cBDLE, rc)); 3814 break; 3815 } 3804 3816 3805 3817 /* Load BDLE states. */ … … 3808 3820 for (uint32_t a = 0; a < pStrm->State.cBDLE; a++) 3809 3821 { 3810 /* v5 did not save the BDLE state correctly, so skip. */ 3811 pState = uVersion == HDA_SSM_VERSION_5 3812 ? &StateDummy : &pStrm->State.paBDLE[a].State; 3813 3814 rc = SSMR3GetStructEx(pSSM, pState, sizeof(HDABDLESTATE), 3815 0 /* fFlags */, g_aSSMBDLEStateFields5, NULL); 3816 AssertRCBreak(rc); 3822 if (uVersion == HDA_SSM_VERSION_5) 3823 { 3824 /* v5 saved the entire HDABDLE struct instead of only HDABDLESTATE, 3825 * so skip. */ 3826 rc = SSMR3Skip(pSSM, 0x120 /* sizeof(HDABLDE) in v5 */); 3827 } 3828 else 3829 { 3830 rc = SSMR3GetStructEx(pSSM, &pStrm->State.paBDLE[a].State, sizeof(HDABDLESTATE), 3831 0 /* fFlags */, g_aSSMBDLEStateFields5, NULL); 3832 } 3833 if (RT_FAILURE(rc)) 3834 break; 3817 3835 } 3818 3836 … … 3839 3857 #ifdef VBOX_WITH_HDA_MIC_IN 3840 3858 bool fEnableMicIn = RT_BOOL(HDA_SDCTL(pThis, 2 /** @todo Use a define. */) & HDA_REG_FIELD_FLAG_MASK(SDCTL, RUN)); 3841 #else3842 bool fEnableMicIn = fEnableIn; /* Mic In == Line In */3843 3859 #endif 3844 3860 bool fEnableOut = RT_BOOL(HDA_SDCTL(pThis, 4 /** @todo Use a define. */) & HDA_REG_FIELD_FLAG_MASK(SDCTL, RUN)); … … 3850 3866 if (RT_FAILURE(rc)) 3851 3867 break; 3868 #ifdef VBOX_WITH_HDA_MIC_IN 3852 3869 rc = pDrv->pConnector->pfnEnableIn(pDrv->pConnector, pDrv->MicIn.pStrmIn, fEnableMicIn); 3853 3870 if (RT_FAILURE(rc)) 3854 3871 break; 3872 #endif 3855 3873 rc = pDrv->pConnector->pfnEnableOut(pDrv->pConnector, pDrv->Out.pStrmOut, fEnableOut); 3856 3874 if (RT_FAILURE(rc)) … … 3863 3881 pThis->u64CORBBase = RT_MAKE_U64(HDA_REG(pThis, CORBLBASE), HDA_REG(pThis, CORBUBASE)); 3864 3882 pThis->u64RIRBBase = RT_MAKE_U64(HDA_REG(pThis, RIRBLBASE), HDA_REG(pThis, RIRBUBASE)); 3865 pThis->u64DPBase = RT_MAKE_U64(HDA_REG(pThis, DPLBASE), HDA_REG(pThis, DPUBASE));3883 pThis->u64DPBase = RT_MAKE_U64(HDA_REG(pThis, DPLBASE), HDA_REG(pThis, DPUBASE)); 3866 3884 } 3867 3885 else … … 4106 4124 { 4107 4125 pDrv->pConnector->pfnEnableIn(pDrv->pConnector, pDrv->LineIn.pStrmIn, false /* Disable */); 4126 #ifdef VBOX_WITH_HDA_MIC_IN 4108 4127 /* Ignore rc. */ 4109 4128 pDrv->pConnector->pfnEnableIn(pDrv->pConnector, pDrv->MicIn.pStrmIn, false /* Disable */); 4129 #endif 4110 4130 /* Ditto. */ 4111 4131 pDrv->pConnector->pfnEnableOut(pDrv->pConnector, pDrv->Out.pStrmOut, false /* Disable */);
Note:
See TracChangeset
for help on using the changeset viewer.