|
20 | 20 | #include <sof/audio/format.h> |
21 | 21 | #include <sof/bit.h> |
22 | 22 | #include <sof/common.h> |
| 23 | +#include <sof/compiler_attributes.h> |
23 | 24 | #include <ipc/stream.h> |
24 | 25 |
|
25 | 26 | #include <stddef.h> |
|
30 | 31 |
|
31 | 32 | #if CONFIG_PCM_CONVERTER_FORMAT_S16LE && CONFIG_PCM_CONVERTER_FORMAT_S24LE |
32 | 33 |
|
33 | | -static int pcm_convert_s16_to_s24(const struct audio_stream *source, |
34 | | - uint32_t ioffset, struct audio_stream *sink, |
| 34 | +static int pcm_convert_s16_to_s24(const struct audio_stream __sparse_cache *source, |
| 35 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
35 | 36 | uint32_t ooffset, uint32_t samples) |
36 | 37 | { |
37 | 38 | int16_t *src = source->r_ptr; |
@@ -59,8 +60,8 @@ static int pcm_convert_s16_to_s24(const struct audio_stream *source, |
59 | 60 | return samples; |
60 | 61 | } |
61 | 62 |
|
62 | | -static int pcm_convert_s24_to_s16(const struct audio_stream *source, |
63 | | - uint32_t ioffset, struct audio_stream *sink, |
| 63 | +static int pcm_convert_s24_to_s16(const struct audio_stream __sparse_cache *source, |
| 64 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
64 | 65 | uint32_t ooffset, uint32_t samples) |
65 | 66 | { |
66 | 67 | int32_t *src = source->r_ptr; |
@@ -92,8 +93,8 @@ static int pcm_convert_s24_to_s16(const struct audio_stream *source, |
92 | 93 |
|
93 | 94 | #if CONFIG_PCM_CONVERTER_FORMAT_S16LE && CONFIG_PCM_CONVERTER_FORMAT_S32LE |
94 | 95 |
|
95 | | -static int pcm_convert_s16_to_s32(const struct audio_stream *source, |
96 | | - uint32_t ioffset, struct audio_stream *sink, |
| 96 | +static int pcm_convert_s16_to_s32(const struct audio_stream __sparse_cache *source, |
| 97 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
97 | 98 | uint32_t ooffset, uint32_t samples) |
98 | 99 | { |
99 | 100 | int16_t *src = source->r_ptr; |
@@ -121,8 +122,8 @@ static int pcm_convert_s16_to_s32(const struct audio_stream *source, |
121 | 122 | return samples; |
122 | 123 | } |
123 | 124 |
|
124 | | -static int pcm_convert_s32_to_s16(const struct audio_stream *source, |
125 | | - uint32_t ioffset, struct audio_stream *sink, |
| 125 | +static int pcm_convert_s32_to_s16(const struct audio_stream __sparse_cache *source, |
| 126 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
126 | 127 | uint32_t ooffset, uint32_t samples) |
127 | 128 | { |
128 | 129 | int32_t *src = source->r_ptr; |
@@ -154,8 +155,8 @@ static int pcm_convert_s32_to_s16(const struct audio_stream *source, |
154 | 155 |
|
155 | 156 | #if CONFIG_PCM_CONVERTER_FORMAT_S24LE && CONFIG_PCM_CONVERTER_FORMAT_S32LE |
156 | 157 |
|
157 | | -static int pcm_convert_s24_to_s32(const struct audio_stream *source, |
158 | | - uint32_t ioffset, struct audio_stream *sink, |
| 158 | +static int pcm_convert_s24_to_s32(const struct audio_stream __sparse_cache *source, |
| 159 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
159 | 160 | uint32_t ooffset, uint32_t samples) |
160 | 161 | { |
161 | 162 | int32_t *src = source->r_ptr; |
@@ -183,8 +184,8 @@ static int pcm_convert_s24_to_s32(const struct audio_stream *source, |
183 | 184 | return samples; |
184 | 185 | } |
185 | 186 |
|
186 | | -static int pcm_convert_s32_to_s24(const struct audio_stream *source, |
187 | | - uint32_t ioffset, struct audio_stream *sink, |
| 187 | +static int pcm_convert_s32_to_s24(const struct audio_stream __sparse_cache *source, |
| 188 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
188 | 189 | uint32_t ooffset, uint32_t samples) |
189 | 190 | { |
190 | 191 | int32_t *src = source->r_ptr; |
@@ -212,8 +213,8 @@ static int pcm_convert_s32_to_s24(const struct audio_stream *source, |
212 | 213 | return samples; |
213 | 214 | } |
214 | 215 |
|
215 | | -static int pcm_convert_s32_to_s24_be(const struct audio_stream *source, |
216 | | - uint32_t ioffset, struct audio_stream *sink, |
| 216 | +static int pcm_convert_s32_to_s24_be(const struct audio_stream __sparse_cache *source, |
| 217 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
217 | 218 | uint32_t ooffset, uint32_t samples) |
218 | 219 | { |
219 | 220 | int32_t *src = source->r_ptr; |
@@ -377,16 +378,16 @@ static void pcm_convert_f_to_s16_lin(const void *psrc, void *pdst, |
377 | 378 | dst[i] = sat_int16(_pcm_convert_f_to_i(src[i], 15)); |
378 | 379 | } |
379 | 380 |
|
380 | | -static int pcm_convert_s16_to_f(const struct audio_stream *source, |
381 | | - uint32_t ioffset, struct audio_stream *sink, |
| 381 | +static int pcm_convert_s16_to_f(const struct audio_stream __sparse_cache *source, |
| 382 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
382 | 383 | uint32_t ooffset, uint32_t samples) |
383 | 384 | { |
384 | 385 | return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, |
385 | 386 | pcm_convert_s16_to_f_lin); |
386 | 387 | } |
387 | 388 |
|
388 | | -static int pcm_convert_f_to_s16(const struct audio_stream *source, |
389 | | - uint32_t ioffset, struct audio_stream *sink, |
| 389 | +static int pcm_convert_f_to_s16(const struct audio_stream __sparse_cache *source, |
| 390 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
390 | 391 | uint32_t ooffset, uint32_t samples) |
391 | 392 | { |
392 | 393 | return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, |
@@ -421,16 +422,16 @@ static void pcm_convert_f_to_s24_lin(const void *psrc, void *pdst, |
421 | 422 | dst[i] = sat_int24(_pcm_convert_f_to_i(src[i], 23)); |
422 | 423 | } |
423 | 424 |
|
424 | | -static int pcm_convert_s24_to_f(const struct audio_stream *source, |
425 | | - uint32_t ioffset, struct audio_stream *sink, |
| 425 | +static int pcm_convert_s24_to_f(const struct audio_stream __sparse_cache *source, |
| 426 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
426 | 427 | uint32_t ooffset, uint32_t samples) |
427 | 428 | { |
428 | 429 | return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, |
429 | 430 | pcm_convert_s24_to_f_lin); |
430 | 431 | } |
431 | 432 |
|
432 | | -static int pcm_convert_f_to_s24(const struct audio_stream *source, |
433 | | - uint32_t ioffset, struct audio_stream *sink, |
| 433 | +static int pcm_convert_f_to_s24(const struct audio_stream __sparse_cache *source, |
| 434 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
434 | 435 | uint32_t ooffset, uint32_t samples) |
435 | 436 | { |
436 | 437 | return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, |
@@ -465,16 +466,16 @@ static void pcm_convert_f_to_s32_lin(const void *psrc, void *pdst, |
465 | 466 | dst[i] = _pcm_convert_f_to_i(src[i], 31); |
466 | 467 | } |
467 | 468 |
|
468 | | -static int pcm_convert_s32_to_f(const struct audio_stream *source, |
469 | | - uint32_t ioffset, struct audio_stream *sink, |
| 469 | +static int pcm_convert_s32_to_f(const struct audio_stream __sparse_cache *source, |
| 470 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
470 | 471 | uint32_t ooffset, uint32_t samples) |
471 | 472 | { |
472 | 473 | return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, |
473 | 474 | pcm_convert_s32_to_f_lin); |
474 | 475 | } |
475 | 476 |
|
476 | | -static int pcm_convert_f_to_s32(const struct audio_stream *source, |
477 | | - uint32_t ioffset, struct audio_stream *sink, |
| 477 | +static int pcm_convert_f_to_s32(const struct audio_stream __sparse_cache *source, |
| 478 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
478 | 479 | uint32_t ooffset, uint32_t samples) |
479 | 480 | { |
480 | 481 | return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, |
@@ -527,8 +528,8 @@ const struct pcm_func_map pcm_func_map[] = { |
527 | 528 | const size_t pcm_func_count = ARRAY_SIZE(pcm_func_map); |
528 | 529 |
|
529 | 530 | #if CONFIG_PCM_CONVERTER_FORMAT_S16_C16_AND_S16_C32 |
530 | | -static int pcm_convert_s16_c16_to_s16_c32(const struct audio_stream *source, |
531 | | - uint32_t ioffset, struct audio_stream *sink, |
| 531 | +static int pcm_convert_s16_c16_to_s16_c32(const struct audio_stream __sparse_cache *source, |
| 532 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
532 | 533 | uint32_t ooffset, uint32_t samples) |
533 | 534 | { |
534 | 535 | int16_t *src = source->r_ptr; |
@@ -556,8 +557,8 @@ static int pcm_convert_s16_c16_to_s16_c32(const struct audio_stream *source, |
556 | 557 | return samples; |
557 | 558 | } |
558 | 559 |
|
559 | | -static int pcm_convert_s16_c32_to_s16_c16(const struct audio_stream *source, |
560 | | - uint32_t ioffset, struct audio_stream *sink, |
| 560 | +static int pcm_convert_s16_c32_to_s16_c16(const struct audio_stream __sparse_cache *source, |
| 561 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
561 | 562 | uint32_t ooffset, uint32_t samples) |
562 | 563 | { |
563 | 564 | int32_t *src = source->r_ptr; |
@@ -586,8 +587,8 @@ static int pcm_convert_s16_c32_to_s16_c16(const struct audio_stream *source, |
586 | 587 | } |
587 | 588 | #endif |
588 | 589 | #if CONFIG_PCM_CONVERTER_FORMAT_S16_C32_AND_S32_C32 |
589 | | -static int pcm_convert_s16_c32_to_s32_c32(const struct audio_stream *source, |
590 | | - uint32_t ioffset, struct audio_stream *sink, |
| 590 | +static int pcm_convert_s16_c32_to_s32_c32(const struct audio_stream __sparse_cache *source, |
| 591 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
591 | 592 | uint32_t ooffset, uint32_t samples) |
592 | 593 | { |
593 | 594 | int32_t *src = source->r_ptr; |
@@ -615,8 +616,8 @@ static int pcm_convert_s16_c32_to_s32_c32(const struct audio_stream *source, |
615 | 616 | return samples; |
616 | 617 | } |
617 | 618 |
|
618 | | -static int pcm_convert_s32_c32_to_s16_c32(const struct audio_stream *source, |
619 | | - uint32_t ioffset, struct audio_stream *sink, |
| 619 | +static int pcm_convert_s32_c32_to_s16_c32(const struct audio_stream __sparse_cache *source, |
| 620 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
620 | 621 | uint32_t ooffset, uint32_t samples) |
621 | 622 | { |
622 | 623 | int32_t *src = source->r_ptr; |
@@ -645,8 +646,8 @@ static int pcm_convert_s32_c32_to_s16_c32(const struct audio_stream *source, |
645 | 646 | } |
646 | 647 | #endif |
647 | 648 | #if CONFIG_PCM_CONVERTER_FORMAT_S16_C32_AND_S24_C32 |
648 | | -static int pcm_convert_s16_c32_to_s24_c32(const struct audio_stream *source, |
649 | | - uint32_t ioffset, struct audio_stream *sink, |
| 649 | +static int pcm_convert_s16_c32_to_s24_c32(const struct audio_stream __sparse_cache *source, |
| 650 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
650 | 651 | uint32_t ooffset, uint32_t samples) |
651 | 652 | { |
652 | 653 | int32_t *src = source->r_ptr; |
@@ -674,8 +675,8 @@ static int pcm_convert_s16_c32_to_s24_c32(const struct audio_stream *source, |
674 | 675 | return samples; |
675 | 676 | } |
676 | 677 |
|
677 | | -static int pcm_convert_s24_c32_to_s16_c32(const struct audio_stream *source, |
678 | | - uint32_t ioffset, struct audio_stream *sink, |
| 678 | +static int pcm_convert_s24_c32_to_s16_c32(const struct audio_stream __sparse_cache *source, |
| 679 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
679 | 680 | uint32_t ooffset, uint32_t samples) |
680 | 681 | { |
681 | 682 | int32_t *src = source->r_ptr; |
@@ -705,8 +706,8 @@ static int pcm_convert_s24_c32_to_s16_c32(const struct audio_stream *source, |
705 | 706 | #endif |
706 | 707 |
|
707 | 708 | #if CONFIG_PCM_CONVERTER_FORMAT_S24_C24_AND_S24_C32 |
708 | | -static int pcm_convert_s24_c24_to_s24_c32(const struct audio_stream *source, |
709 | | - uint32_t ioffset, struct audio_stream *sink, |
| 709 | +static int pcm_convert_s24_c24_to_s24_c32(const struct audio_stream __sparse_cache *source, |
| 710 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
710 | 711 | uint32_t ooffset, uint32_t samples) |
711 | 712 | { |
712 | 713 | uint8_t *src = source->r_ptr; |
@@ -735,8 +736,8 @@ static int pcm_convert_s24_c24_to_s24_c32(const struct audio_stream *source, |
735 | 736 | return samples; |
736 | 737 | } |
737 | 738 |
|
738 | | -static int pcm_convert_s24_c32_to_s24_c24(const struct audio_stream *source, |
739 | | - uint32_t ioffset, struct audio_stream *sink, |
| 739 | +static int pcm_convert_s24_c32_to_s24_c24(const struct audio_stream __sparse_cache *source, |
| 740 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
740 | 741 | uint32_t ooffset, uint32_t samples) |
741 | 742 | { |
742 | 743 | int32_t *src = source->r_ptr; |
@@ -769,8 +770,8 @@ static int pcm_convert_s24_c32_to_s24_c24(const struct audio_stream *source, |
769 | 770 | } |
770 | 771 |
|
771 | 772 | /* 2x24bit samples are packed into 3x16bit samples for hda link dma */ |
772 | | -static int pcm_convert_s24_c32_to_s24_c24_link_gtw(const struct audio_stream *source, |
773 | | - uint32_t ioffset, struct audio_stream *sink, |
| 773 | +static int pcm_convert_s24_c32_to_s24_c24_link_gtw(const struct audio_stream __sparse_cache *source, |
| 774 | + uint32_t ioffset, struct audio_stream __sparse_cache *sink, |
774 | 775 | uint32_t ooffset, uint32_t samples) |
775 | 776 | { |
776 | 777 | int32_t *src = source->r_ptr; |
|
0 commit comments