VirtualBox

Changeset 31032 in vbox


Ignore:
Timestamp:
Jul 23, 2010 5:06:16 AM (15 years ago)
Author:
vboxsync
Message:

Audio/HDA: start ptocess CORB only when CORBCTL:DMA != 0 (on CORBCTL or CORBWP write). similar RIRB check is asserted for now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp

    r31031 r31032  
    140140
    141141#define ICH6_HDA_REG_CORBCTL  17 /* 0x4C */
    142 #define ICH6_HDA_COBCTL_RUN_SHIFT (1)
    143 #define ICH6_HDA_COBCTL_CMEIE_SHIFT (0)
     142#define ICH6_HDA_CORBCTL_DMA_SHIFT (1)
     143#define ICH6_HDA_CORBCTL_CMEIE_SHIFT (0)
     144
     145#define CORBCTL(pState) (HDA_REG(pState, CORBCTL))
     146
    144147
    145148#define ICH6_HDA_REG_CORBSTS  18 /* 0x4D */
     
    397400DECLCALLBACK(int)hdaRegWriteCORBWP(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t pu32Value);
    398401DECLCALLBACK(int)hdaRegWriteCORBRP(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value);
     402DECLCALLBACK(int)hdaRegWriteCORBCTL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value);
    399403DECLCALLBACK(int)hdaRegWriteCORBSTS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value);
    400404DECLCALLBACK(int)hdaRegWriteRIRBWP(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t pu32Value);
     
    461465    { 0x00048, 0x00002, 0x000000FF, 0x000000FF, hdaRegReadU16          , hdaRegWriteCORBWP       , "CORBWP"    , "CORB Write Pointer" },
    462466    { 0x0004A, 0x00002, 0x000000FF, 0x000080FF, hdaRegReadU8           , hdaRegWriteCORBRP       , "CORBRP"    , "CORB Read Pointer" },
    463     { 0x0004C, 0x00001, 0x00000003, 0x00000003, hdaRegReadU8           , hdaRegWriteU8           , "CORBCTL"   , "CORB Control" },
     467    { 0x0004C, 0x00001, 0x00000003, 0x00000003, hdaRegReadU8           , hdaRegWriteCORBCTL      , "CORBCTL"   , "CORB Control" },
    464468    { 0x0004D, 0x00001, 0x00000001, 0x00000001, hdaRegReadU8           , hdaRegWriteCORBSTS      , "CORBSTS"   , "CORB Status" },
    465469    { 0x0004E, 0x00001, 0x000000F3, 0x00000000, hdaRegReadU8           , hdaRegWriteUnimplemented, "CORBSIZE"  , "CORB Size" },
     
    611615    if (fLocal)
    612616    {
     617        Assert((HDA_REG_FLAG_VALUE(pState, CORBCTL, DMA)));
    613618        rc = PDMDevHlpPhysRead(ICH6_HDASTATE_2_DEVINS(pState), pState->u64CORBBase, pState->pu32CorbBuf, pState->cbCorbBuf);
    614619        if (RT_FAILURE(rc))
     
    637642    else
    638643    {
     644        Assert((HDA_REG_FLAG_VALUE(pState, RIRBCTL, DMA)));
    639645        rc = PDMDevHlpPhysWrite(ICH6_HDASTATE_2_DEVINS(pState), pState->u64RIRBBase, pState->pu64RirbBuf, pState->cbRirbBuf);
    640646        if (RT_FAILURE(rc))
     
    841847}
    842848
     849DECLCALLBACK(int)hdaRegWriteCORBCTL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)
     850{
     851    int rc = hdaRegWriteU8(pState, offset, index, u32Value);
     852    AssertRC(rc);
     853    if (   CORBWP(pState) != CORBRP(pState)
     854        && HDA_REG_FLAG_VALUE(pState, CORBCTL, DMA) != 0)
     855        return hdaCORBCmdProcess(pState);
     856    return rc;
     857}
     858
    843859DECLCALLBACK(int)hdaRegWriteCORBSTS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)
    844860{
     
    856872        AssertRCReturn(rc, rc);
    857873    if (CORBWP(pState) == CORBRP(pState))
     874        return VINF_SUCCESS;
     875    if (!HDA_REG_FLAG_VALUE(pState, CORBCTL, DMA))
    858876        return VINF_SUCCESS;
    859877    rc = hdaCORBCmdProcess(pState);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette