Commit ea2b7a5
committed
audio: buffer: move dp_heap_user lifecycle to IPC and module adapter
The mod_heap_user (dp_heap_user) reference count management in
comp_buffer_free() does not belong there - a buffer's free method
should not be responsible for freeing a module's private heap.
Additionally, in CONFIG_SOF_USERSPACE_LL builds, comp_buffer_free()
may run in user-space context where rfree() of kernel-allocated
memory is not ok.
- Add dp_heap_put() helper to dp_schedule.h for reference-counted
DP heap release
- Move buffer-side client_count decrements to IPC layer
(ipc_comp_disconnect, ipc_pipeline_module_free, ipc_comp_connect
error paths)
- Move raw data buffer client_count management to
module_adapter_free/prepare with DP domain guard
- Fix module_adapter_mem_free() where CONFIG_SOF_USERSPACE_LL
incorrectly reassigned mod_heap for DP modules
- Fix client_count increment guard in ipc_comp_connect() to check
dp pointer rather than dp_heap
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>1 parent fed1761 commit ea2b7a5
4 files changed
Lines changed: 80 additions & 19 deletions
File tree
- src
- audio
- buffers
- module_adapter
- include/sof/schedule
- ipc/ipc4
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 160 | | |
167 | 161 | | |
168 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 189 | + | |
| 190 | + | |
194 | 191 | | |
195 | 192 | | |
196 | 193 | | |
| |||
641 | 638 | | |
642 | 639 | | |
643 | 640 | | |
644 | | - | |
| 641 | + | |
| 642 | + | |
645 | 643 | | |
646 | 644 | | |
647 | 645 | | |
| |||
687 | 685 | | |
688 | 686 | | |
689 | 687 | | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
690 | 691 | | |
691 | 692 | | |
692 | 693 | | |
| |||
1479 | 1480 | | |
1480 | 1481 | | |
1481 | 1482 | | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
1482 | 1486 | | |
1483 | 1487 | | |
1484 | 1488 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
128 | 145 | | |
129 | 146 | | |
130 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
460 | 469 | | |
461 | 470 | | |
462 | 471 | | |
463 | 472 | | |
464 | | - | |
| 473 | + | |
465 | 474 | | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
466 | 480 | | |
467 | 481 | | |
468 | 482 | | |
469 | 483 | | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
470 | 494 | | |
471 | 495 | | |
472 | 496 | | |
473 | 497 | | |
474 | | - | |
| 498 | + | |
475 | 499 | | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
476 | 505 | | |
477 | 506 | | |
478 | 507 | | |
| |||
738 | 767 | | |
739 | 768 | | |
740 | 769 | | |
741 | | - | |
| 770 | + | |
742 | 771 | | |
743 | 772 | | |
744 | 773 | | |
| |||
782 | 811 | | |
783 | 812 | | |
784 | 813 | | |
| 814 | + | |
| 815 | + | |
785 | 816 | | |
786 | 817 | | |
787 | 818 | | |
| |||
869 | 900 | | |
870 | 901 | | |
871 | 902 | | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
872 | 907 | | |
873 | 908 | | |
874 | 909 | | |
| |||
950 | 985 | | |
951 | 986 | | |
952 | 987 | | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
953 | 995 | | |
954 | 996 | | |
955 | 997 | | |
| |||
965 | 1007 | | |
966 | 1008 | | |
967 | 1009 | | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
968 | 1014 | | |
969 | 1015 | | |
970 | 1016 | | |
| |||
0 commit comments