audio: tdfb: place IIR emphasis coefficients in .rodata - #11116
Conversation
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR moves the direction-of-arrival (tdfb) IIR emphasis coefficient tables into read-only memory by marking them static const, ensuring the linker places them in .rodata instead of .data and enabling safer user-space access.
Changes:
- Mark
iir_emphasis_48kandiir_emphasis_16kasstatic constso they are treated as read-only data - Prevent mutable global placement of coefficient tables (reducing
.datausage and supporting user-space execution)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| */ | ||
|
|
||
| uint32_t iir_emphasis_48k[20] = { | ||
| static const uint32_t iir_emphasis_48k[20] = { |
| }; | ||
|
|
||
| uint32_t iir_emphasis_16k[20] = { | ||
| static const uint32_t iir_emphasis_16k[20] = { |
|
@singalsu Can you check, ok to you? |
31f6da7 to
f3540de
Compare
|
V2:
|
The direction-of-arrival emphasis coefficient tables iir_emphasis_48k and iir_emphasis_16k were declared as mutable globals, so the linker placed them in the .data section. The tables are read-only coefficient data, never modified, so mark them static const. This mirrors how sound_dose stores its IIR coefficient table. As another benefit, this change makes it possible to run tdfb in user-space as user threads can access rodata. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
f3540de to
b7d1caf
Compare
|
V3:
|
PR 11116: test resultsRun date: 2026-09-03 13:39 UTC Tested commit: b7d1caf45deddb7b5be132747aa1d5a6d46a41de |
|
Fuzzer fails are known #11162 , rest is good, proceeding with merge. |
The direction-of-arrival emphasis coefficient tables iir_emphasis_48k and iir_emphasis_16k were declared as mutable globals, so the linker placed them in the .data section.
The tables are read-only coefficient data, never modified, so mark them static const. This mirrors how sound_dose stores its IIR coefficient table.
As another benefit, this change makes it possible to run tdfb in user-space as user threads can access rodata.