Commit Graph

7512 Commits

Author SHA1 Message Date
Ranjani Sridharan 42dd0a6932 codec_adapter: check if more fragments are expected first.
Check if more fragments of config data are expected first and return
immediately to make the code easier to follow.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-11 20:40:48 +02:00
Ranjani Sridharan 6241f50549 codec_adapter: remove unnecessary braces
Remove the unnecessary braces in codec_adapter_set_params().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-11 20:40:48 +02:00
Ranjani Sridharan 6aa96e231b codec_adapter: remove unnecessary goto's
Remove the goto's and return the appropriate values to simplify the
codec_adapter_set_params() function.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-11 20:40:48 +02:00
Ranjani Sridharan 85169d3da5 codec_adapter: drop the type parameter in codec_adapter_set_params()
It can be accessed via cdata in the function.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-11 20:40:48 +02:00
Pierre-Louis Bossart 71cd9666a9 platform: cavs: make IMR restore feature default - except APL/GLK
Let's enable this capability, with CAVS_1_5 left out for now since there
are known issues with suspend-resume on Up2 board that were never
root-caused.

Enabling this at the firmware level is not enough, this capability
need to be enabled by kernel patches in
https://github.com/thesofproject/linux/pull/3340

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-01-11 15:59:07 +00:00
Lionel Koenig c687815185 topology1: Undefine after in DAI & PIPELINE macros
In order to ease comprehension and avoid side-effect of constants being
defined after calling a macro, this change undefined the locally define
constants for pipelines and dai macros.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-01-11 15:57:41 +00:00
Michal Wasko 954614b5fb codeowner: add Marcin to review ipc changes
Marcin is responsible for ipc4 enabling in SOF
and integration with Windows drivers.

Signed-off-by: Michal Wasko <michal.wasko@intel.com>
2022-01-11 15:39:13 +00:00
Guennadi Liakhovetski 2317e879c7 DAI: join identical trigger handling flows
All SSP drivers handle COMP_TRIGGER_RELEASE and COMP_TRIGGER_START in
the same way. Similarly sai.c handles COMP_TRIGGER_PAUSE and
COMP_TRIGGER_STOP identically. This patch joins those flows.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski 03fb524f15 heap: remove unused mm_pm_context_{save,restore}()
mm_pm_context_save() and mm_pm_context_restore() are never used,
remove them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski 1de8e74b9e DMA: remove unused dma_pm_context_{store,restore} operations
.dma_pm_context_store and .dma_pm_context_restore DMA operations are
never used, remove them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski ca0e94ddab DAI: remove unused pm_context_{store,restore} operations
.pm_context_store and .pm_context_restore DAI operations are never
used, remove them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski eb0ef7bb85 component: convert COMP_TRIGGER_* values to an enum
COMP_TRIGGER_* values are internal to SOF, they aren't a part of an
API, their numeric values are unimportant. Convert them to an enum to
make removing deprecated and adding new values easier.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski 95f7b8e68e ipc: remove two unused trigger commands
COMP_TRIGGER_SUSPEND and COMP_TRIGGER_RESUME are never issues, remove
them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Lionel Koenig 3b48da9cf5 platform: allow primary core stack size config.
Allow to set the primary core stack size using the Kconfig mechanism.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-01-10 15:56:56 +00:00
Lionel Koenig ba77d3a74f xtos: Add stub for some missing OS function
In order to ease porting algorithm to SOF, it is convenient to have
stubs for some operating system function.
Those stubs are not meant to be called.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-01-10 13:12:39 +00:00
Marc Herbert f50b6fe0ad topologies: switch all .m4 files to codec_provider and codec_consumer
All .tplg output files have been compared and are strictly identical
after the change.

The deprecation warnings were added more than one year ago in
https://github.com/alsa-project/alsa-lib/commits//706192341d1d0bbb906

Now that we just upgraded our Docker image to ALSA 1.2.6
(https://hub.docker.com/r/thesofproject/sof/tags) so #5153 can enable
topology v2, the volume of warnings has became unbearable.  For instance
good luck trying to find the actual error messages for the build
failures of #5155 - they're totally drowned in these deprecation
warnings.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:52:26 +00:00
Marc Herbert 950728c095 Docker: sof: add ninja-build
We should gradually switch to ninja as a default.

ninja-build is apparently missing from build-essential

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:52:04 +00:00
Marc Herbert e64a6cfd31 trace.c: rename emit_recent_entry() to emit_suppressed_entry() + comments
This makes much clearer why this function is not called when the burst
is short enough.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:50:21 +00:00
Marc Herbert 7614351b74 trace: log "hidden" feature turning off adaptive filtering at run-time
Also clarify related Kconfig help strings.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:50:21 +00:00
Marc Herbert 5fd7c88f3d trace.c: minor #ifdef simplification in trace_log_filtered()
Group two #ifdef into one.

Top of block variables do not require C99.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:50:21 +00:00
Marc Herbert a51a64665b Replace perf_*_trace() macros with functions.
The fewer macros, the better.

Commit 1758279623 ("perf: make trace part of perf counting
configurable") provided no specific rationale for using macros. It did
not explain why it passed some ignored arguments either - renamed
accordingly.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:50:21 +00:00
YC Hung e7f6430004 topology1: mt8195: support 1ms pipeline capture period
1.Default support 1ms period capture pipeline to update host position
  more precisely.
2.Revise pipeline 1 to playback and pipeline 4 to capture in comment.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
2022-01-10 11:48:08 +00:00
Rander Wang e64fdf2e40 codeowner: add rander to review ipc changes
I am working on ipc interface for IPC4 and will
focus on ipc interface for both IPC3 & IPC4.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-01-10 11:47:22 +00:00
Ranjani Sridharan 90e6925e7c codec_adapter: rename comp_get_codec()
to comp_get_module_data(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 681a4338af codec_adapter: rename codec_id in struct ca_config
to module_id. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 34e2eb13c6 codec_adapter: rename codec_free_all_memory()
to module_free_all_memory(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 77deb27e33 codec_adapter: rename codec_allocate/free_memory()
to module_allocate/free_memory(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 032cddc854 codec_adapter: rename codec_load_config()
to module_load_config(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan ae0e7fb774 codec_adapter: rename codec_process() to module_process()
No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan fdddd20c8b codec_adapter: rename codec_apply_runtime_config()
Rename it to module_apply_runtime_config(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 39150a9301 codec_adapter: rename codec_prepare() to module_prepare()
Rename codec_prepare() to module_prepare(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 2f06f173de codec_adapter: rename codec_reset() to module_reset()
Rename codec_reset() to module_reset. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan bf8a77ecdc codec_adapter: Rename codec_free() to module_free()
Rename the codec_free() function to module_free() and remove an
unnecessary pair of braces from the function. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan e9d87f4c4c codec_adapter: rename codec_init() to module_init()
Rename the codec_init() function to module_init(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 0485e5dbad codec_adapter: rename struct codec_param to module_param
Rename codec_param to module_params. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 60288c4051 codec_adapter: rename codec_cfg_type to module_cfg_type
Rename enum codec_cfg_type to module_cfg_type. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan b6b7c3c9b8 codec_adapter: rename codec_processing_data to module_processing_data
Rename struct codec_processing_data to module_processing_data. No
functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 77315d436b codec_adapter: rename codec_memory to module_memory
Rename struct codec_memory to module_memory. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan e240b41ea9 codec_adapter: fix typo in comment
It's struct codec_param not codec_config.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan d8d79fba9d codec_adapter: rename codec_config to module_config
Rename struct codec_config to struct module_config. No functional
change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan f158e14fbf codec_adapter: rename codec_state to module_state
Rename the enum codec_state to module_state. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 251191832e codec_adapter: rename codec_data to module_data
Rename struct codec_data to struct module_data. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 92ff6b3aff codec_adapter: rename struct comp_data to struct processing_module
Rename struct comp_data to processing_module. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan aeecf5a741 codec_adapter: dts: check for !cd->ca_source instead of == NULL
Make checkpatch happy

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan d577f4b760 codec_adapter: rename codec_interface to module_interface
The interface will be common for all processing modules not just the
codecs. So rename struct codec_interface to struct module_interface.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Allen-KH Cheng e9e6db4299 arch: xtensa: fix unaligned pointer in irq dispatcher
In 8186 mtk dsp (hifi5), we meet a system exception when irq is rasied.
The panic is LoadStoreAlignmentCause.
We found the problem is in int-xxx-dispatcher.S

mov a11, a1
addi a11, a11, UEXC_cp1
xchal_cp1_store a11, a12, a13, a14, a15

In xchal_cp1_store macro, ptr must a certain byte aligned address
In the 8186 mtk dsp Xtensa header, we have

/*
 *  Macro to store the state of TIE coprocessor AudioEngineLX.
 *  Required parameters:
 *      ptr         Save area pointer address register (clobbered)
 *                  (register must contain a 16 byte aligned address).
 *      at1..at4    Four temporary address registers (first XCHAL_CP1_NUM_ATMPS
 *                  registers are clobbered, the remaining are unused).
 *  Optional parameters are the same as for xchal_ncp_store.
 */

.macro xchal_cp1_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0

In xtruntime-frames.h, the UEXC_cp1 macro is
STRUCT_AFIELD (long,4,UEXC_,cp1, XCHAL_CP1_SA_SIZE / 4)

I have checked history and found the original UEXC_cp1 define is using STRUCT_AFIELD.
(After 3e1eebe)
In 8186 mtk dsp, we need 16 aligned address in xchal_cp1_store using STRUCT_AFIELD_A
with XCHAL_TOTAL_SA_ALIGN.
2022-01-10 10:37:03 +00:00
Marc Herbert b339ca95e9 Remove scripts/host-build-all.sh
scripts/host-build-all.sh has been replaced and deprecated for more
than a year.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-07 15:29:14 +00:00
Marc Herbert 55e862c92e docker-run.sh: switch from "sof" shortcut to full "thesoftproject/sof"
It's super annoying and time-consuming to update the image and wonder
why the previous one is still used. Shortcuts are nice in interactive
use but pointless in scripts.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-07 15:25:53 +00:00
Marc Herbert f79d2341af docker-run.sh: log command run and image digests
There's frequent confusion between image ID and image digest: display
both.

Show both sof and thesofproject/sof.

Use set -x to display the full command that is run.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-07 15:25:53 +00:00
Ranjani Sridharan 308a24a92b topology2: Add build support
Add build support for topology2. Topology2 will be built only if the
alsatplg version if 1.2.6 or greater.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-06 21:38:43 +00:00