Skip to content

audio: tdfb: place IIR emphasis coefficients in .rodata - #11116

Open
kv2019i wants to merge 1 commit into
thesofproject:mainfrom
kv2019i:202608-ll-user-tdfb-coeffs
Open

audio: tdfb: place IIR emphasis coefficients in .rodata#11116
kv2019i wants to merge 1 commit into
thesofproject:mainfrom
kv2019i:202608-ll-user-tdfb-coeffs

Conversation

@kv2019i

@kv2019i kv2019i commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

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.

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>
@kv2019i
kv2019i requested a review from singalsu as a code owner August 24, 2026 14:19
@kv2019i
kv2019i requested review from jsarha, lgirdwood, lyakh and singalsu and a lite review from Copilot and removed request for singalsu August 24, 2026 14:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_48k and iir_emphasis_16k as static const so they are treated as read-only data
  • Prevent mutable global placement of coefficient tables (reducing .data usage 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] = {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants