Commit 03667e3
ASoC: atmel: mchp-i2s-mcc: Improve maxburst calculation for better performance
The period size represents the size of the DMA descriptor. To ensure all
DMA descriptors start from a well-aligned address, the period size must
be divided by (sample size * maxburst), not just by maxburst.
This adjustment allows for computing a higher maxburst value, thereby
increasing the performance of the DMA transfer.
Previously, snd_pcm_lib_period_bytes() returned 0 because the runtime HW
parameters are computed after the hw_params() callbacks are used.
To address this, we now use params_*() functions to compute the period
size accurately. This change optimizes the DMA transfer performance by
ensuring proper alignment and efficient use of maxburst values.
[andrei.simion@microchip.com: Reword commit message and commit title.
Add macros with values for maximum DMA chunk size allowed.
Add DMA_BURST_ALIGNED preprocessor function to check the alignment of the
DMA burst]
Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Signed-off-by: Andrei Simion <andrei.simion@microchip.com>
Link: https://patch.msgid.link/20240905095633.113784-1-andrei.simion@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent e328ab3 commit 03667e3
1 file changed
Lines changed: 33 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
224 | 233 | | |
225 | 234 | | |
226 | 235 | | |
| |||
504 | 513 | | |
505 | 514 | | |
506 | 515 | | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
507 | 530 | | |
508 | 531 | | |
509 | 532 | | |
510 | 533 | | |
511 | 534 | | |
512 | 535 | | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
513 | 540 | | |
514 | 541 | | |
515 | 542 | | |
| |||
519 | 546 | | |
520 | 547 | | |
521 | 548 | | |
522 | | - | |
| 549 | + | |
523 | 550 | | |
524 | | - | |
| 551 | + | |
525 | 552 | | |
526 | 553 | | |
527 | 554 | | |
| |||
630 | 657 | | |
631 | 658 | | |
632 | 659 | | |
633 | | - | |
| 660 | + | |
| 661 | + | |
634 | 662 | | |
635 | | - | |
| 663 | + | |
636 | 664 | | |
637 | | - | |
| 665 | + | |
638 | 666 | | |
639 | 667 | | |
640 | 668 | | |
| |||
0 commit comments