Changeset 82406 in vbox for trunk/src/VBox
- Timestamp:
- Dec 5, 2019 12:47:02 AM (5 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r82255 r82406 522 522 && !(pSink->fStatus & AUDMIXSINK_STS_PENDING_DISABLE)) 523 523 { 524 rc = audioMixerStreamCtlInternal(pStream, PDMAUDIOSTREAMCMD_ENABLE, AUDMIXSTRMCTL_F LAG_NONE);524 rc = audioMixerStreamCtlInternal(pStream, PDMAUDIOSTREAMCMD_ENABLE, AUDMIXSTRMCTL_F_NONE); 525 525 } 526 526 … … 729 729 if (pStream == pSink->In.pStreamRecSource) 730 730 { 731 int rc2 = audioMixerStreamCtlInternal(pStream, enmCmdStream, AUDMIXSTRMCTL_F LAG_NONE);731 int rc2 = audioMixerStreamCtlInternal(pStream, enmCmdStream, AUDMIXSTRMCTL_F_NONE); 732 732 if (rc2 == VERR_NOT_SUPPORTED) 733 733 rc2 = VINF_SUCCESS; … … 743 743 RTListForEach(&pSink->lstStreams, pStream, AUDMIXSTREAM, Node) 744 744 { 745 int rc2 = audioMixerStreamCtlInternal(pStream, enmCmdStream, AUDMIXSTRMCTL_F LAG_NONE);745 int rc2 = audioMixerStreamCtlInternal(pStream, enmCmdStream, AUDMIXSTRMCTL_F_NONE); 746 746 if (rc2 == VERR_NOT_SUPPORTED) 747 747 rc2 = VINF_SUCCESS; -
trunk/src/VBox/Devices/Audio/AudioMixer.h
r77602 r82406 30 30 #include <VBox/vmm/pdmaudioifs.h> 31 31 32 /** 33 * Structure for maintaining an audio mixer instance. 32 33 /** Pointer to an audio mixer sink. */ 34 typedef struct AUDMIXSINK *PAUDMIXSINK; 35 36 37 /** 38 * Audio mixer instance. 34 39 */ 35 40 typedef struct AUDIOMIXER … … 45 50 /** Number of used audio sinks. */ 46 51 uint8_t cSinks; 47 } AUDIOMIXER, *PAUDIOMIXER; 52 } AUDIOMIXER; 53 /** Pointer to an audio mixer instance. */ 54 typedef AUDIOMIXER *PAUDIOMIXER; 48 55 49 56 /** Defines an audio mixer stream's flags. */ … … 51 58 52 59 /** No flags specified. */ 53 #define AUDMIXSTREAM_F LAG_NONE060 #define AUDMIXSTREAM_F_NONE 0 54 61 /** The mixing stream is flagged as being enabled (active). */ 55 #define AUDMIXSTREAM_F LAG_ENABLEDRT_BIT(0)62 #define AUDMIXSTREAM_F_ENABLED RT_BIT(0) 56 63 57 64 /** Defines an audio mixer stream's internal status. */ … … 68 75 69 76 70 /** Prototype needed for AUDMIXSTREAM struct definition. */ 71 typedef struct AUDMIXSINK *PAUDMIXSINK; 72 73 /** 74 * Structure for maintaining an audio mixer stream. 77 /** 78 * Audio mixer stream. 75 79 */ 76 80 typedef struct AUDMIXSTREAM … … 84 88 /** Sink this stream is attached to. */ 85 89 PAUDMIXSINK pSink; 86 /** Stream flags of type AUDMIXSTREAM_F LAG_. */90 /** Stream flags of type AUDMIXSTREAM_F_. */ 87 91 uint32_t fFlags; 88 92 /** Stream status of type AUDMIXSTREAM_STATUS_. */ … … 153 157 154 158 /** 155 * Structure for keeping audio input sink specifics. 159 * Audio input sink specifics. 160 * 156 161 * Do not use directly. Instead, use AUDMIXSINK. 157 162 */ … … 163 168 164 169 /** 165 * Structure for keeping audio output sink specifics. 170 * Audio output sink specifics. 171 * 166 172 * Do not use directly. Instead, use AUDMIXSINK. 167 173 */ … … 171 177 172 178 /** 173 * Structure for maintaining an audio mixer sink.179 * Audio mixer sink. 174 180 */ 175 181 typedef struct AUDMIXSINK … … 220 226 } Dbg; 221 227 #endif 222 } AUDMIXSINK , *PAUDMIXSINK;228 } AUDMIXSINK; 223 229 224 230 /** … … 238 244 239 245 /** No flags specified. */ 240 #define AUDMIXSTRMCTL_F LAG_NONE0246 #define AUDMIXSTRMCTL_F_NONE 0 241 247 242 248 int AudioMixerCreate(const char *pszName, uint32_t uFlags, PAUDIOMIXER *ppMixer); -
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r82405 r82406 346 346 347 347 /** No register description (RD) flags defined. */ 348 #define HDA_RD_F LAG_NONE 0348 #define HDA_RD_F_NONE 0 349 349 /** Writes to SD are allowed while RUN bit is set. */ 350 #define HDA_RD_F LAG_SD_WRITE_RUN RT_BIT(0)350 #define HDA_RD_F_SD_WRITE_RUN RT_BIT(0) 351 351 352 352 /** Emits a single audio stream register set (e.g. OSD0) at a specified offset. */ … … 355 355 /* ------- ------- ---------- ---------- ------------------------- -------------- ----------------- ----------------------------- ----------- */ \ 356 356 /* Offset 0x80 (SD0) */ \ 357 { offset, 0x00003, 0x00FF001F, 0x00F0001F, HDA_RD_F LAG_SD_WRITE_RUN, hdaRegReadU24 , hdaRegWriteSDCTL , HDA_REG_IDX_STRM(name, CTL) , #name " Stream Descriptor Control" }, \357 { offset, 0x00003, 0x00FF001F, 0x00F0001F, HDA_RD_F_SD_WRITE_RUN, hdaRegReadU24 , hdaRegWriteSDCTL , HDA_REG_IDX_STRM(name, CTL) , #name " Stream Descriptor Control" }, \ 358 358 /* Offset 0x83 (SD0) */ \ 359 { offset + 0x3, 0x00001, 0x0000003C, 0x0000001C, HDA_RD_F LAG_SD_WRITE_RUN, hdaRegReadU8 , hdaRegWriteSDSTS , HDA_REG_IDX_STRM(name, STS) , #name " Status" }, \359 { offset + 0x3, 0x00001, 0x0000003C, 0x0000001C, HDA_RD_F_SD_WRITE_RUN, hdaRegReadU8 , hdaRegWriteSDSTS , HDA_REG_IDX_STRM(name, STS) , #name " Status" }, \ 360 360 /* Offset 0x84 (SD0) */ \ 361 { offset + 0x4, 0x00004, 0xFFFFFFFF, 0x00000000, HDA_RD_F LAG_NONE, hdaRegReadLPIB, hdaRegWriteU32 , HDA_REG_IDX_STRM(name, LPIB) , #name " Link Position In Buffer" }, \361 { offset + 0x4, 0x00004, 0xFFFFFFFF, 0x00000000, HDA_RD_F_NONE, hdaRegReadLPIB, hdaRegWriteU32 , HDA_REG_IDX_STRM(name, LPIB) , #name " Link Position In Buffer" }, \ 362 362 /* Offset 0x88 (SD0) */ \ 363 { offset + 0x8, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteSDCBL , HDA_REG_IDX_STRM(name, CBL) , #name " Cyclic Buffer Length" }, \363 { offset + 0x8, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteSDCBL , HDA_REG_IDX_STRM(name, CBL) , #name " Cyclic Buffer Length" }, \ 364 364 /* Offset 0x8C (SD0) -- upper 8 bits are reserved */ \ 365 { offset + 0xC, 0x00002, 0x0000FFFF, 0x000000FF, HDA_RD_F LAG_NONE, hdaRegReadU16 , hdaRegWriteSDLVI , HDA_REG_IDX_STRM(name, LVI) , #name " Last Valid Index" }, \365 { offset + 0xC, 0x00002, 0x0000FFFF, 0x000000FF, HDA_RD_F_NONE, hdaRegReadU16 , hdaRegWriteSDLVI , HDA_REG_IDX_STRM(name, LVI) , #name " Last Valid Index" }, \ 366 366 /* Reserved: FIFO Watermark. ** @todo Document this! */ \ 367 { offset + 0xE, 0x00002, 0x00000007, 0x00000007, HDA_RD_F LAG_NONE, hdaRegReadU16 , hdaRegWriteSDFIFOW, HDA_REG_IDX_STRM(name, FIFOW), #name " FIFO Watermark" }, \367 { offset + 0xE, 0x00002, 0x00000007, 0x00000007, HDA_RD_F_NONE, hdaRegReadU16 , hdaRegWriteSDFIFOW, HDA_REG_IDX_STRM(name, FIFOW), #name " FIFO Watermark" }, \ 368 368 /* Offset 0x90 (SD0) */ \ 369 { offset + 0x10, 0x00002, 0x000000FF, 0x000000FF, HDA_RD_F LAG_NONE, hdaRegReadU16 , hdaRegWriteSDFIFOS, HDA_REG_IDX_STRM(name, FIFOS), #name " FIFO Size" }, \369 { offset + 0x10, 0x00002, 0x000000FF, 0x000000FF, HDA_RD_F_NONE, hdaRegReadU16 , hdaRegWriteSDFIFOS, HDA_REG_IDX_STRM(name, FIFOS), #name " FIFO Size" }, \ 370 370 /* Offset 0x92 (SD0) */ \ 371 { offset + 0x12, 0x00002, 0x00007F7F, 0x00007F7F, HDA_RD_F LAG_NONE, hdaRegReadU16 , hdaRegWriteSDFMT , HDA_REG_IDX_STRM(name, FMT) , #name " Stream Format" }, \371 { offset + 0x12, 0x00002, 0x00007F7F, 0x00007F7F, HDA_RD_F_NONE, hdaRegReadU16 , hdaRegWriteSDFMT , HDA_REG_IDX_STRM(name, FMT) , #name " Stream Format" }, \ 372 372 /* Reserved: 0x94 - 0x98. */ \ 373 373 /* Offset 0x98 (SD0) */ \ 374 { offset + 0x18, 0x00004, 0xFFFFFF80, 0xFFFFFF80, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteSDBDPL , HDA_REG_IDX_STRM(name, BDPL) , #name " Buffer Descriptor List Pointer-Lower Base Address" }, \374 { offset + 0x18, 0x00004, 0xFFFFFF80, 0xFFFFFF80, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteSDBDPL , HDA_REG_IDX_STRM(name, BDPL) , #name " Buffer Descriptor List Pointer-Lower Base Address" }, \ 375 375 /* Offset 0x9C (SD0) */ \ 376 { offset + 0x1C, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteSDBDPU , HDA_REG_IDX_STRM(name, BDPU) , #name " Buffer Descriptor List Pointer-Upper Base Address" }376 { offset + 0x1C, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteSDBDPU , HDA_REG_IDX_STRM(name, BDPU) , #name " Buffer Descriptor List Pointer-Upper Base Address" } 377 377 378 378 /** Defines a single audio stream register set (e.g. OSD0). */ … … 385 385 /* offset size read mask write mask flags read callback write callback index + abbrev */ 386 386 /*------- ------- ---------- ---------- ----------------- ---------------- ------------------- ------------------------ */ 387 { 0x00000, 0x00002, 0x0000FFFB, 0x00000000, HDA_RD_F LAG_NONE, hdaRegReadU16 , hdaRegWriteUnimpl , HDA_REG_IDX(GCAP) }, /* Global Capabilities */388 { 0x00002, 0x00001, 0x000000FF, 0x00000000, HDA_RD_F LAG_NONE, hdaRegReadU8 , hdaRegWriteUnimpl , HDA_REG_IDX(VMIN) }, /* Minor Version */389 { 0x00003, 0x00001, 0x000000FF, 0x00000000, HDA_RD_F LAG_NONE, hdaRegReadU8 , hdaRegWriteUnimpl , HDA_REG_IDX(VMAJ) }, /* Major Version */390 { 0x00004, 0x00002, 0x0000FFFF, 0x00000000, HDA_RD_F LAG_NONE, hdaRegReadU16 , hdaRegWriteU16 , HDA_REG_IDX(OUTPAY) }, /* Output Payload Capabilities */391 { 0x00006, 0x00002, 0x0000FFFF, 0x00000000, HDA_RD_F LAG_NONE, hdaRegReadU16 , hdaRegWriteUnimpl , HDA_REG_IDX(INPAY) }, /* Input Payload Capabilities */392 { 0x00008, 0x00004, 0x00000103, 0x00000103, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteGCTL , HDA_REG_IDX(GCTL) }, /* Global Control */393 { 0x0000c, 0x00002, 0x00007FFF, 0x00007FFF, HDA_RD_F LAG_NONE, hdaRegReadU16 , hdaRegWriteU16 , HDA_REG_IDX(WAKEEN) }, /* Wake Enable */394 { 0x0000e, 0x00002, 0x00000007, 0x00000007, HDA_RD_F LAG_NONE, hdaRegReadU8 , hdaRegWriteSTATESTS, HDA_REG_IDX(STATESTS) }, /* State Change Status */395 { 0x00010, 0x00002, 0xFFFFFFFF, 0x00000000, HDA_RD_F LAG_NONE, hdaRegReadUnimpl, hdaRegWriteUnimpl , HDA_REG_IDX(GSTS) }, /* Global Status */396 { 0x00018, 0x00002, 0x0000FFFF, 0x00000000, HDA_RD_F LAG_NONE, hdaRegReadU16 , hdaRegWriteU16 , HDA_REG_IDX(OUTSTRMPAY) }, /* Output Stream Payload Capability */397 { 0x0001A, 0x00002, 0x0000FFFF, 0x00000000, HDA_RD_F LAG_NONE, hdaRegReadU16 , hdaRegWriteUnimpl , HDA_REG_IDX(INSTRMPAY) }, /* Input Stream Payload Capability */398 { 0x00020, 0x00004, 0xC00000FF, 0xC00000FF, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteU32 , HDA_REG_IDX(INTCTL) }, /* Interrupt Control */399 { 0x00024, 0x00004, 0xC00000FF, 0x00000000, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteUnimpl , HDA_REG_IDX(INTSTS) }, /* Interrupt Status */400 { 0x00030, 0x00004, 0xFFFFFFFF, 0x00000000, HDA_RD_F LAG_NONE, hdaRegReadWALCLK, hdaRegWriteUnimpl , HDA_REG_IDX_NOMEM(WALCLK) }, /* Wall Clock Counter */401 { 0x00034, 0x00004, 0x000000FF, 0x000000FF, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteU32 , HDA_REG_IDX(SSYNC) }, /* Stream Synchronization */402 { 0x00040, 0x00004, 0xFFFFFF80, 0xFFFFFF80, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(CORBLBASE) }, /* CORB Lower Base Address */403 { 0x00044, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(CORBUBASE) }, /* CORB Upper Base Address */404 { 0x00048, 0x00002, 0x000000FF, 0x000000FF, HDA_RD_F LAG_NONE, hdaRegReadU16 , hdaRegWriteCORBWP , HDA_REG_IDX(CORBWP) }, /* CORB Write Pointer */405 { 0x0004A, 0x00002, 0x000080FF, 0x00008000, HDA_RD_F LAG_NONE, hdaRegReadU16 , hdaRegWriteCORBRP , HDA_REG_IDX(CORBRP) }, /* CORB Read Pointer */406 { 0x0004C, 0x00001, 0x00000003, 0x00000003, HDA_RD_F LAG_NONE, hdaRegReadU8 , hdaRegWriteCORBCTL , HDA_REG_IDX(CORBCTL) }, /* CORB Control */407 { 0x0004D, 0x00001, 0x00000001, 0x00000001, HDA_RD_F LAG_NONE, hdaRegReadU8 , hdaRegWriteCORBSTS , HDA_REG_IDX(CORBSTS) }, /* CORB Status */408 { 0x0004E, 0x00001, 0x000000F3, 0x00000003, HDA_RD_F LAG_NONE, hdaRegReadU8 , hdaRegWriteCORBSIZE, HDA_REG_IDX(CORBSIZE) }, /* CORB Size */409 { 0x00050, 0x00004, 0xFFFFFF80, 0xFFFFFF80, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(RIRBLBASE) }, /* RIRB Lower Base Address */410 { 0x00054, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(RIRBUBASE) }, /* RIRB Upper Base Address */411 { 0x00058, 0x00002, 0x000000FF, 0x00008000, HDA_RD_F LAG_NONE, hdaRegReadU8 , hdaRegWriteRIRBWP , HDA_REG_IDX(RIRBWP) }, /* RIRB Write Pointer */412 { 0x0005A, 0x00002, 0x000000FF, 0x000000FF, HDA_RD_F LAG_NONE, hdaRegReadU16 , hdaRegWriteRINTCNT , HDA_REG_IDX(RINTCNT) }, /* Response Interrupt Count */413 { 0x0005C, 0x00001, 0x00000007, 0x00000007, HDA_RD_F LAG_NONE, hdaRegReadU8 , hdaRegWriteU8 , HDA_REG_IDX(RIRBCTL) }, /* RIRB Control */414 { 0x0005D, 0x00001, 0x00000005, 0x00000005, HDA_RD_F LAG_NONE, hdaRegReadU8 , hdaRegWriteRIRBSTS , HDA_REG_IDX(RIRBSTS) }, /* RIRB Status */415 { 0x0005E, 0x00001, 0x000000F3, 0x00000000, HDA_RD_F LAG_NONE, hdaRegReadU8 , hdaRegWriteUnimpl , HDA_REG_IDX(RIRBSIZE) }, /* RIRB Size */416 { 0x00060, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteU32 , HDA_REG_IDX(IC) }, /* Immediate Command */417 { 0x00064, 0x00004, 0x00000000, 0xFFFFFFFF, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteUnimpl , HDA_REG_IDX(IR) }, /* Immediate Response */418 { 0x00068, 0x00002, 0x00000002, 0x00000002, HDA_RD_F LAG_NONE, hdaRegReadIRS , hdaRegWriteIRS , HDA_REG_IDX(IRS) }, /* Immediate Command Status */419 { 0x00070, 0x00004, 0xFFFFFFFF, 0xFFFFFF81, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(DPLBASE) }, /* DMA Position Lower Base */420 { 0x00074, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_F LAG_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(DPUBASE) }, /* DMA Position Upper Base */387 { 0x00000, 0x00002, 0x0000FFFB, 0x00000000, HDA_RD_F_NONE, hdaRegReadU16 , hdaRegWriteUnimpl , HDA_REG_IDX(GCAP) }, /* Global Capabilities */ 388 { 0x00002, 0x00001, 0x000000FF, 0x00000000, HDA_RD_F_NONE, hdaRegReadU8 , hdaRegWriteUnimpl , HDA_REG_IDX(VMIN) }, /* Minor Version */ 389 { 0x00003, 0x00001, 0x000000FF, 0x00000000, HDA_RD_F_NONE, hdaRegReadU8 , hdaRegWriteUnimpl , HDA_REG_IDX(VMAJ) }, /* Major Version */ 390 { 0x00004, 0x00002, 0x0000FFFF, 0x00000000, HDA_RD_F_NONE, hdaRegReadU16 , hdaRegWriteU16 , HDA_REG_IDX(OUTPAY) }, /* Output Payload Capabilities */ 391 { 0x00006, 0x00002, 0x0000FFFF, 0x00000000, HDA_RD_F_NONE, hdaRegReadU16 , hdaRegWriteUnimpl , HDA_REG_IDX(INPAY) }, /* Input Payload Capabilities */ 392 { 0x00008, 0x00004, 0x00000103, 0x00000103, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteGCTL , HDA_REG_IDX(GCTL) }, /* Global Control */ 393 { 0x0000c, 0x00002, 0x00007FFF, 0x00007FFF, HDA_RD_F_NONE, hdaRegReadU16 , hdaRegWriteU16 , HDA_REG_IDX(WAKEEN) }, /* Wake Enable */ 394 { 0x0000e, 0x00002, 0x00000007, 0x00000007, HDA_RD_F_NONE, hdaRegReadU8 , hdaRegWriteSTATESTS, HDA_REG_IDX(STATESTS) }, /* State Change Status */ 395 { 0x00010, 0x00002, 0xFFFFFFFF, 0x00000000, HDA_RD_F_NONE, hdaRegReadUnimpl, hdaRegWriteUnimpl , HDA_REG_IDX(GSTS) }, /* Global Status */ 396 { 0x00018, 0x00002, 0x0000FFFF, 0x00000000, HDA_RD_F_NONE, hdaRegReadU16 , hdaRegWriteU16 , HDA_REG_IDX(OUTSTRMPAY) }, /* Output Stream Payload Capability */ 397 { 0x0001A, 0x00002, 0x0000FFFF, 0x00000000, HDA_RD_F_NONE, hdaRegReadU16 , hdaRegWriteUnimpl , HDA_REG_IDX(INSTRMPAY) }, /* Input Stream Payload Capability */ 398 { 0x00020, 0x00004, 0xC00000FF, 0xC00000FF, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteU32 , HDA_REG_IDX(INTCTL) }, /* Interrupt Control */ 399 { 0x00024, 0x00004, 0xC00000FF, 0x00000000, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteUnimpl , HDA_REG_IDX(INTSTS) }, /* Interrupt Status */ 400 { 0x00030, 0x00004, 0xFFFFFFFF, 0x00000000, HDA_RD_F_NONE, hdaRegReadWALCLK, hdaRegWriteUnimpl , HDA_REG_IDX_NOMEM(WALCLK) }, /* Wall Clock Counter */ 401 { 0x00034, 0x00004, 0x000000FF, 0x000000FF, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteU32 , HDA_REG_IDX(SSYNC) }, /* Stream Synchronization */ 402 { 0x00040, 0x00004, 0xFFFFFF80, 0xFFFFFF80, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(CORBLBASE) }, /* CORB Lower Base Address */ 403 { 0x00044, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(CORBUBASE) }, /* CORB Upper Base Address */ 404 { 0x00048, 0x00002, 0x000000FF, 0x000000FF, HDA_RD_F_NONE, hdaRegReadU16 , hdaRegWriteCORBWP , HDA_REG_IDX(CORBWP) }, /* CORB Write Pointer */ 405 { 0x0004A, 0x00002, 0x000080FF, 0x00008000, HDA_RD_F_NONE, hdaRegReadU16 , hdaRegWriteCORBRP , HDA_REG_IDX(CORBRP) }, /* CORB Read Pointer */ 406 { 0x0004C, 0x00001, 0x00000003, 0x00000003, HDA_RD_F_NONE, hdaRegReadU8 , hdaRegWriteCORBCTL , HDA_REG_IDX(CORBCTL) }, /* CORB Control */ 407 { 0x0004D, 0x00001, 0x00000001, 0x00000001, HDA_RD_F_NONE, hdaRegReadU8 , hdaRegWriteCORBSTS , HDA_REG_IDX(CORBSTS) }, /* CORB Status */ 408 { 0x0004E, 0x00001, 0x000000F3, 0x00000003, HDA_RD_F_NONE, hdaRegReadU8 , hdaRegWriteCORBSIZE, HDA_REG_IDX(CORBSIZE) }, /* CORB Size */ 409 { 0x00050, 0x00004, 0xFFFFFF80, 0xFFFFFF80, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(RIRBLBASE) }, /* RIRB Lower Base Address */ 410 { 0x00054, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(RIRBUBASE) }, /* RIRB Upper Base Address */ 411 { 0x00058, 0x00002, 0x000000FF, 0x00008000, HDA_RD_F_NONE, hdaRegReadU8 , hdaRegWriteRIRBWP , HDA_REG_IDX(RIRBWP) }, /* RIRB Write Pointer */ 412 { 0x0005A, 0x00002, 0x000000FF, 0x000000FF, HDA_RD_F_NONE, hdaRegReadU16 , hdaRegWriteRINTCNT , HDA_REG_IDX(RINTCNT) }, /* Response Interrupt Count */ 413 { 0x0005C, 0x00001, 0x00000007, 0x00000007, HDA_RD_F_NONE, hdaRegReadU8 , hdaRegWriteU8 , HDA_REG_IDX(RIRBCTL) }, /* RIRB Control */ 414 { 0x0005D, 0x00001, 0x00000005, 0x00000005, HDA_RD_F_NONE, hdaRegReadU8 , hdaRegWriteRIRBSTS , HDA_REG_IDX(RIRBSTS) }, /* RIRB Status */ 415 { 0x0005E, 0x00001, 0x000000F3, 0x00000000, HDA_RD_F_NONE, hdaRegReadU8 , hdaRegWriteUnimpl , HDA_REG_IDX(RIRBSIZE) }, /* RIRB Size */ 416 { 0x00060, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteU32 , HDA_REG_IDX(IC) }, /* Immediate Command */ 417 { 0x00064, 0x00004, 0x00000000, 0xFFFFFFFF, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteUnimpl , HDA_REG_IDX(IR) }, /* Immediate Response */ 418 { 0x00068, 0x00002, 0x00000002, 0x00000002, HDA_RD_F_NONE, hdaRegReadIRS , hdaRegWriteIRS , HDA_REG_IDX(IRS) }, /* Immediate Command Status */ 419 { 0x00070, 0x00004, 0xFFFFFFFF, 0xFFFFFF81, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(DPLBASE) }, /* DMA Position Lower Base */ 420 { 0x00074, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_F_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(DPUBASE) }, /* DMA Position Upper Base */ 421 421 /* 4 Serial Data In (SDI). */ 422 422 HDA_REG_MAP_DEF_STREAM(0, SD0), … … 3176 3176 if ( RT_BOOL(uSDCTL & HDA_SDCTL_RUN) 3177 3177 /* Are writes to the register denied if RUN bit is set? */ 3178 && !(g_aHdaRegMap[idxRegDsc].fFlags & HDA_RD_F LAG_SD_WRITE_RUN))3178 && !(g_aHdaRegMap[idxRegDsc].fFlags & HDA_RD_F_SD_WRITE_RUN)) 3179 3179 { 3180 3180 Log(("hdaWriteReg: Warning: Access to %s is blocked! %R[sdctl]\n", g_aHdaRegMap[idxRegDsc].abbrev, uSDCTL)); … … 3394 3394 { 3395 3395 PHDABDLEDESC pDesc = (PHDABDLEDESC)pvStruct; 3396 pDesc->fFlags = fIoc ? HDA_BDLE_F LAG_IOC : 0;3396 pDesc->fFlags = fIoc ? HDA_BDLE_F_IOC : 0; 3397 3397 } 3398 3398 return rc; … … 3416 3416 { 3417 3417 PHDABDLE pState = (PHDABDLE)pvStruct; 3418 pState->Desc.fFlags = fIoc ? HDA_BDLE_F LAG_IOC : 0;3418 pState->Desc.fFlags = fIoc ? HDA_BDLE_F_IOC : 0; 3419 3419 } 3420 3420 return rc; … … 4040 4040 "BDLE(idx:%RU32, off:%RU32, fifow:%RU32, IOC:%RTbool, DMA[%RU32 bytes @ 0x%x])", 4041 4041 pBDLE->State.u32BDLIndex, pBDLE->State.u32BufOff, pBDLE->State.cbBelowFIFOW, 4042 pBDLE->Desc.fFlags & HDA_BDLE_F LAG_IOC, pBDLE->Desc.u32BufSize, pBDLE->Desc.u64BufAddr);4042 pBDLE->Desc.fFlags & HDA_BDLE_F_IOC, pBDLE->Desc.u32BufSize, pBDLE->Desc.u64BufAddr); 4043 4043 } 4044 4044 … … 4196 4196 4197 4197 pHlp->pfnPrintf(pHlp, "\t\t%s #%03d BDLE(adr:0x%llx, size:%RU32, ioc:%RTbool)\n", 4198 pBDLE->State.u32BDLIndex == i ? "*" : " ", i, bd.u64BufAddr, bd.u32BufSize, bd.fFlags & HDA_BDLE_F LAG_IOC);4198 pBDLE->State.u32BDLIndex == i ? "*" : " ", i, bd.u64BufAddr, bd.u32BufSize, bd.fFlags & HDA_BDLE_F_IOC); 4199 4199 4200 4200 cbBDLE += bd.u32BufSize; -
trunk/src/VBox/Devices/Audio/DevHDA.h
r82401 r82406 54 54 55 55 /** 56 * Structure for mapping a stream tag to an HDA stream.56 * Mapping a stream tag to an HDA stream. 57 57 */ 58 58 typedef struct HDATAG … … 63 63 /** Pointer to associated stream. */ 64 64 R3PTRTYPE(PHDASTREAM) pStream; 65 } HDATAG, *PHDATAG; 65 } HDATAG; 66 /** Pointer to a HDA stream tag mapping. */ 67 typedef HDATAG *PHDATAG; 66 68 67 69 /** @todo Make STAM values out of this? */ -
trunk/src/VBox/Devices/Audio/DevHDACommon.cpp
r82332 r82406 567 567 568 568 LogFunc(("\t#%03d BDLE(adr:0x%llx, size:%RU32, ioc:%RTbool)\n", 569 i, bd.u64BufAddr, bd.u32BufSize, bd.fFlags & HDA_BDLE_F LAG_IOC));569 i, bd.u64BufAddr, bd.u32BufSize, bd.fFlags & HDA_BDLE_F_IOC)); 570 570 571 571 cbBDLE += bd.u32BufSize; … … 657 657 bool hdaR3BDLENeedsInterrupt(PHDABDLE pBDLE) 658 658 { 659 return (pBDLE->Desc.fFlags & HDA_BDLE_F LAG_IOC);659 return (pBDLE->Desc.fFlags & HDA_BDLE_F_IOC); 660 660 } 661 661 -
trunk/src/VBox/Devices/Audio/DevHDACommon.h
r82399 r82406 45 45 /** Writable bits. */ 46 46 uint32_t writable; 47 /** Register descriptor (RD) flags of type HDA_RD_FLAG_. 48 * These are used to specify the handling (read/write) 49 * policy of the register. */ 47 /** Register descriptor (RD) flags of type HDA_RD_F_XXX. These are used to 48 * specify the handling (read/write) policy of the register. */ 50 49 uint32_t fFlags; 51 50 /** Read callback. */ … … 532 531 533 532 /** Interrupt on completion (IOC) flag. */ 534 #define HDA_BDLE_F LAG_IOCRT_BIT(0)533 #define HDA_BDLE_F_IOC RT_BIT(0) 535 534 536 535 -
trunk/src/VBox/Devices/Audio/HDACodec.h
r82399 r82406 62 62 63 63 /** 64 * Structure for keeping aHDA codec state.64 * HDA codec state. 65 65 */ 66 66 typedef struct HDACODEC -
trunk/src/VBox/Devices/Audio/HDAStream.h
r82345 r82406 249 249 #ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO 250 250 /** 251 * Structure for keeping a HDA stream thread context.251 * HDA stream thread context (arguments). 252 252 */ 253 253 typedef struct HDASTREAMTHREADCTX -
trunk/src/VBox/Devices/Audio/HDAStreamMap.h
r76565 r82406 23 23 24 24 /** 25 * Structure for keeping an audio stream data mapping.25 * Audio stream data mapping. 26 26 */ 27 27 typedef struct HDASTREAMMAP 28 28 { 29 29 /** The stream's layout. */ 30 PDMAUDIOSTREAMLAYOUT 31 uint8_t 30 PDMAUDIOSTREAMLAYOUT enmLayout; 31 uint8_t cbFrameSize; 32 32 /** Number of mappings in paMappings. */ 33 uint8_t 34 uint8_t 33 uint8_t cMappings; 34 uint8_t aPadding[2]; 35 35 /** Array of stream mappings. 36 36 * Note: The mappings *must* be layed out in an increasing order, e.g. 37 37 * how the data appears in the given data block. */ 38 R3PTRTYPE(PPDMAUDIOSTREAMMAP) 38 R3PTRTYPE(PPDMAUDIOSTREAMMAP) paMappings; 39 39 #if HC_ARCH_BITS == 32 40 RTR3PTR 40 RTR3PTR Padding1; 41 41 #endif 42 42 #ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND 43 43 /** Circular buffer holding for holding audio data for this mapping. */ 44 R3PTRTYPE(PRTCIRCBUF) 44 R3PTRTYPE(PRTCIRCBUF) pCircBuf; 45 45 #endif 46 46 } HDASTREAMMAP; 47 47 AssertCompileSizeAlignment(HDASTREAMMAP, 8); 48 /** Pointer to an audio stream data mapping. */ 48 49 typedef HDASTREAMMAP *PHDASTREAMMAP; 49 50 … … 55 56 void hdaR3StreamMapDestroy(PHDASTREAMMAP pMapping); 56 57 void hdaR3StreamMapReset(PHDASTREAMMAP pMapping); 57 #endif /* IN_RING3 */58 #endif 58 59 /** @} */ 59 60 -
trunk/src/VBox/Devices/Audio/HDAStreamPeriod.cpp
r76553 r82406 50 50 int hdaR3StreamPeriodCreate(PHDASTREAMPERIOD pPeriod) 51 51 { 52 Assert(!(pPeriod->fStatus & HDASTREAMPERIOD_F LAG_VALID));52 Assert(!(pPeriod->fStatus & HDASTREAMPERIOD_F_VALID)); 53 53 54 54 int rc = RTCritSectInit(&pPeriod->CritSect); 55 55 AssertRCReturnStmt(rc, pPeriod->fStatus = 0, rc); 56 pPeriod->fStatus = HDASTREAMPERIOD_F LAG_VALID;56 pPeriod->fStatus = HDASTREAMPERIOD_F_VALID; 57 57 58 58 return VINF_SUCCESS; … … 66 66 void hdaR3StreamPeriodDestroy(PHDASTREAMPERIOD pPeriod) 67 67 { 68 if (pPeriod->fStatus & HDASTREAMPERIOD_F LAG_VALID)68 if (pPeriod->fStatus & HDASTREAMPERIOD_F_VALID) 69 69 { 70 70 RTCritSectDelete(&pPeriod->CritSect); 71 71 72 pPeriod->fStatus = HDASTREAMPERIOD_F LAG_NONE;72 pPeriod->fStatus = HDASTREAMPERIOD_F_NONE; 73 73 } 74 74 } … … 138 138 pPeriod->cIntPending, pPeriod->u8SD)); 139 139 140 pPeriod->fStatus &= ~HDASTREAMPERIOD_F LAG_ACTIVE;140 pPeriod->fStatus &= ~HDASTREAMPERIOD_F_ACTIVE; 141 141 pPeriod->u64StartWalClk = 0; 142 142 pPeriod->u64ElapsedWalClk = 0; … … 157 157 int hdaR3StreamPeriodBegin(PHDASTREAMPERIOD pPeriod, uint64_t u64WalClk) 158 158 { 159 Assert(!(pPeriod->fStatus & HDASTREAMPERIOD_F LAG_ACTIVE)); /* No nested calls. */160 161 pPeriod->fStatus |= HDASTREAMPERIOD_F LAG_ACTIVE;159 Assert(!(pPeriod->fStatus & HDASTREAMPERIOD_F_ACTIVE)); /* No nested calls. */ 160 161 pPeriod->fStatus |= HDASTREAMPERIOD_F_ACTIVE; 162 162 pPeriod->u64StartWalClk = u64WalClk; 163 163 pPeriod->u64ElapsedWalClk = 0; … … 181 181 Log3Func(("[SD%RU8] Took %zuus\n", pPeriod->u8SD, (RTTimeNanoTS() - pPeriod->Dbg.tsStartNs) / 1000)); 182 182 183 if (!(pPeriod->fStatus & HDASTREAMPERIOD_F LAG_ACTIVE))183 if (!(pPeriod->fStatus & HDASTREAMPERIOD_F_ACTIVE)) 184 184 return; 185 185 … … 190 190 Assert(hdaR3StreamPeriodIsComplete(pPeriod)); 191 191 192 pPeriod->fStatus &= ~HDASTREAMPERIOD_F LAG_ACTIVE;192 pPeriod->fStatus &= ~HDASTREAMPERIOD_F_ACTIVE; 193 193 } 194 194 … … 200 200 void hdaR3StreamPeriodPause(PHDASTREAMPERIOD pPeriod) 201 201 { 202 AssertMsg((pPeriod->fStatus & HDASTREAMPERIOD_F LAG_ACTIVE), ("Period %p already in inactive state\n", pPeriod));203 204 pPeriod->fStatus &= ~HDASTREAMPERIOD_F LAG_ACTIVE;202 AssertMsg((pPeriod->fStatus & HDASTREAMPERIOD_F_ACTIVE), ("Period %p already in inactive state\n", pPeriod)); 203 204 pPeriod->fStatus &= ~HDASTREAMPERIOD_F_ACTIVE; 205 205 206 206 Log3Func(("[SD%RU8]\n", pPeriod->u8SD)); … … 214 214 void hdaR3StreamPeriodResume(PHDASTREAMPERIOD pPeriod) 215 215 { 216 AssertMsg(!(pPeriod->fStatus & HDASTREAMPERIOD_F LAG_ACTIVE), ("Period %p already in active state\n", pPeriod));217 218 pPeriod->fStatus |= HDASTREAMPERIOD_F LAG_ACTIVE;216 AssertMsg(!(pPeriod->fStatus & HDASTREAMPERIOD_F_ACTIVE), ("Period %p already in active state\n", pPeriod)); 217 218 pPeriod->fStatus |= HDASTREAMPERIOD_F_ACTIVE; 219 219 220 220 Log3Func(("[SD%RU8]\n", pPeriod->u8SD)); … … 321 321 { 322 322 /* Period not in use? */ 323 if (!(pPeriod->fStatus & HDASTREAMPERIOD_F LAG_ACTIVE))323 if (!(pPeriod->fStatus & HDASTREAMPERIOD_F_ACTIVE)) 324 324 return true; /* ... implies that it has passed. */ 325 325 -
trunk/src/VBox/Devices/Audio/HDAStreamPeriod.h
r76565 r82406 29 29 30 30 struct HDASTREAM; 31 typedef HDASTREAM *PHDASTREAM;31 typedef struct HDASTREAM *PHDASTREAM; 32 32 33 33 #ifdef LOG_ENABLED 34 34 /** 35 * Structure for debug information of anHDA stream's period.35 * Debug stuff for a HDA stream's period. 36 36 */ 37 typedef struct HDASTREAMPERIODD BGINFO37 typedef struct HDASTREAMPERIODDDEBUG 38 38 { 39 39 /** Host start time (in ns) of the period. */ 40 40 uint64_t tsStartNs; 41 } HDASTREAMPERIODD BGINFO, *PHDASTREAMPERIODDBGINFO;41 } HDASTREAMPERIODDDEBUG; 42 42 #endif 43 43 44 44 /** No flags set. */ 45 #define HDASTREAMPERIOD_F LAG_NONE045 #define HDASTREAMPERIOD_F_NONE 0 46 46 /** The stream period has been initialized and is in a valid state. */ 47 #define HDASTREAMPERIOD_F LAG_VALIDRT_BIT(0)47 #define HDASTREAMPERIOD_F_VALID RT_BIT(0) 48 48 /** The stream period is active. */ 49 #define HDASTREAMPERIOD_F LAG_ACTIVERT_BIT(1)49 #define HDASTREAMPERIOD_F_ACTIVE RT_BIT(1) 50 50 51 51 /** 52 * Structure for keeping an HDA stream's (time) period. 52 * HDA stream's time period. 53 * 53 54 * This is needed in order to keep track of stream timing and interrupt delivery. 54 55 */ … … 79 80 uint32_t framesTransferred; 80 81 #ifdef LOG_ENABLED 81 /** Debugging information. */82 HDASTREAMPERIODD BGINFODbg;82 /** Debugging state. */ 83 HDASTREAMPERIODDDEBUG Dbg; 83 84 #endif 84 85 } HDASTREAMPERIOD;
Note:
See TracChangeset
for help on using the changeset viewer.