This set of patches proposes a new API for dma_get() that procures a DMAC based on the requested copy dir, caps, dev type and flags indicating shared/exclusive access. It also updates the existing user of dma_get() to use the new API based on the specific usage. The API uses the number of channels draning in each DMAC to balance the load between the platform DMAC's for users requesting shared access privilege. This provides a primitive level of QoS and prevents overloading any DMAC.
The platform DMAC definitions have also been updated to include information about copy capabilities supported and the type of DMA.
Test Results: 1. Minnowboard Turbot w 5651: Passed all feature tests 2. Up Squared Board w Hifiberry DAC+: Passed all playback feature tests
v4 changes: 1. Modified platform DMAC definition with copy cap, copy dir dev types supported 2. Modified dma_get() API to request DMAC based on above criteria
Ranjani Sridharan (5): platform: dma: move dmac initialization dma: update platform DMAC definitions with the supported dev types, dir and capabilities dma: introduce parameter to store the number of channels draining dma: Introduce new API for dma_get() dma:trace: dma_copy_new() does not need DMAC ID anymore
src/arch/xtensa/Makefile.am | 1 + src/audio/dai.c | 7 +- src/audio/host.c | 14 +-- src/drivers/dw-dma.c | 13 ++- src/drivers/hda-dma.c | 10 ++- src/host/common_test.c | 2 +- src/include/sof/dma.h | 43 ++++++--- src/ipc/apl-ipc.c | 8 +- src/ipc/byt-ipc.c | 9 +- src/ipc/cnl-ipc.c | 8 +- src/ipc/dma-copy.c | 10 ++- src/ipc/hsw-ipc.c | 9 +- src/lib/Makefile.am | 11 ++- src/lib/dma-trace.c | 2 +- src/lib/dma.c | 89 +++++++++++++++++++ src/platform/apollolake/dma.c | 39 ++++++-- .../apollolake/include/platform/dma.h | 5 ++ .../apollolake/include/platform/platform.h | 3 - src/platform/apollolake/platform.c | 22 +---- src/platform/baytrail/dma.c | 34 +++++-- src/platform/baytrail/include/platform/dma.h | 9 ++ .../baytrail/include/platform/platform.h | 3 - src/platform/baytrail/platform.c | 23 +---- src/platform/cannonlake/dma.c | 39 ++++++-- .../cannonlake/include/platform/dma.h | 6 ++ .../cannonlake/include/platform/platform.h | 3 - src/platform/cannonlake/platform.c | 23 +---- src/platform/haswell/dma.c | 40 +++++++-- src/platform/haswell/include/platform/dma.h | 5 ++ .../haswell/include/platform/platform.h | 3 - src/platform/haswell/platform.c | 21 +---- 31 files changed, 362 insertions(+), 152 deletions(-) create mode 100644 src/lib/dma.c