Commit Graph

4398 Commits

Author SHA1 Message Date
Tomasz Lauda 551f859291 alloc: rename RZONE_FLAG_UNCACHED
Renames RZONE_FLAG_UNCACHED to SOF_MEM_FLAG_SHARED.
It's more generic name, which describes more accurately what is
the intention of this flag. Most of the platforms don't have
uncached regions, which can be used to synchronize data between cores.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-23 21:11:48 +01:00
Tomasz Lauda 5f85648c5a alloc: create enum type for heap zones
Creates new mem_zone enum type for heap zones.
We don't want to leave them as flags and allow
zone combinations.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-23 21:11:48 +01:00
Tomasz Lauda bc246b5da8 alloc: remove zone argument from balloc functions
Removes zone argument from balloc related functions.
They always use RZONE_BUFFER, so passing something else
is very misleading, especially it changes nothing.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-23 21:11:48 +01:00
Tomasz Lauda 66baf6e08c alloc: remove zone from alloc_trace_*_heap functions
Removes zone argument from alloc_trace_*_heap functions.
They are using specific heaps anyway, so passing zone is pointless.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-23 21:11:48 +01:00
Tomasz Lauda 39f54e0f3b alloc: remove unnecessary zone argument
Removes unnecessary zone argument passed to some of the
internal functions. It was previously used to check for flags,
but since they were extracted to separate parameter, it's no
longer needed.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-23 21:11:48 +01:00
Tomasz Lauda 6a8a3d02f1 alloc: extract flags to separate argument
Extracts flags from zone to use them as a separate argument
during allocations. It allows for addition of new zones and
also is more clear this way.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-23 21:11:48 +01:00
Tomasz Lauda 73c216a098 alloc: use dedicated trace_mem_error macros
Uses dedicated trace_mem_error macros instead of usual
trace_error calls.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-23 21:11:48 +01:00
Tomasz Lauda f4f0dd41da alloc: move trace macros to header
Moves trace macros to alloc.h header in order to use
them in the header itself.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-23 21:11:48 +01:00
Paul Olaru 343d111db7 alloc: Fix bug in handling first_free member of the block map
That field is intended to point to the first free block of this
particular block map (part of heap). As long as the heap doesn't fill
up the old code manages it correctly.

However once the block map becomes full (all blocks are occupied)
this member will no longer point to a free block.

Without this fix rfree may fail to update this pointer to point to the
correct block when freeing a block from a full heap. Not updating this
will cause subsequent memory allocations to hand out used blocks as if
they were free. This fix ensures that will not happen in this edge case.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-12-23 11:05:08 +00:00
Marcin Maka d077b9728d scripts: checkpatch: accept long trace strings (80+ characters)
This is an exception similar to the kernel pr_...() family.
Having a log string in a single line is much more readable for
a person who works with the trace output frequently.

Splitting trace strings into multiple lines seems to be a worse
alternative since it generates another warning anyway and encourages
developers to create very long trace entries which are wrapped
on a trace console and less readable.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-12-21 18:43:03 +01:00
Marcin Maka 53eaa8c884 kpb: disable pm-runtime of master dsp core for data draining
Lower power state must be disabled before host wakes up and
sends 'quit D0ix' to make sure the draining goes at full speed.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-12-20 18:55:53 +01:00
Marcin Maka 622472dce0 ipc: pm: handle prevent-power-gating flag in pm-runtime
Driver may enable/disable the pm-runtime of dsp master
core by using SOF_PM_PPG flag in PM_GATE ipc command.

Platform may decide to lock the master core in a high
state (or range of states) when pm-runtime is disabled
by the driver in order to guarantee higher performance.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-12-20 18:55:53 +01:00
Lech Betlej aea593b128 tools: add community key signature to sof_ri_info
A public key signature of community key used to sign FW
binaries is added. The script can provide on output info if
evaluated FW image was signed with the key.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2019-12-20 17:07:07 +01:00
Seppo Ingalsuo ee90a1fde6 EQ FIR: Add note about reduced capability as xtensa gcc build
This patch adds the note into kconfig for COMP_FIR about
max. filter tap count restriction for xtensa gcc version.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-12-20 13:47:18 +00:00
Seppo Ingalsuo a5cc4df67b EQ FIR: Small code optimization for gcc build
This patch improves a bit (about 1.3%) the execution speed with a
simpler pointer arithmetic based FIR filter core. The comments
about used 32 bit fractional format are updated (Q1.31), earlier
ones were old assumptions for SOF.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-12-20 13:47:18 +00:00
Seppo Ingalsuo 234c84abac EQ FIR: Add check for a build specific filter length limitation
This patch defines a total channels combined filter length limit
of 80 for xtensa gcc build (e.g. 40 taps max for stereo). The check
is done in prepare() where the filters are configured. If the
length is exceeded the playback is terminated gracefully. A xt-xcc
build or testbench build for x86 is not limited.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-12-20 13:47:18 +00:00
Seppo Ingalsuo f7b9e6270f Tools: EQ: Make a light FIR configuration to test with GCC build
The Xtensa GCC build on APL platform can process about 40 taps
FIR filter so it is useful to have one such configuration. The
eq_fir_mid.txt is be applied with sof-ctl tool.

The patch contains the Octave script modification. The print of final
filter length is added to blob packer script to see the resulting
length when the filter is generated. The small filter spec change
helps the filter tool to achieve result that is close to requested
shape.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-12-20 13:47:18 +00:00
Marcin Maka 3aa7b21a2b tools: sof_ri_info: display fw extension parameters
Detailed information from Platform Fx Extension, part
of the manifest may be useful for a deeper signed image
analysis.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-12-20 11:47:14 +01:00
Seppo Ingalsuo 48882ee259 ASRC: Fix memory leak in reset()
This patch adds the missing freeing of data structures those
were allocated in prepare(). Successive pipeline runs without
suspend in between have consumed more and more RAM every time.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-12-20 01:06:35 +01:00
Curtis Malainey c1be04e64c EQ: GUI: Remove globals
Globals should not exist if they don't have to, they are limiting to
extensibility

Signed-off-by: Curtis Malainey <cujomalainey@google.com>
2019-12-19 20:44:35 +00:00
Curtis Malainey 64f60cdad3 EQ: GUI: Add remote deployment
Add function to deploy eq automatically to dut at runtime

Signed-off-by: Curtis Malainey <cujomalainey@google.com>
2019-12-19 20:44:35 +00:00
Curtis Malainey 33048b7f72 EQ: GUI: Load dsp.ini from ChromeOS
Add function that parses dsp.ini files into the GUI format and then into
SOF format.

Signed-off-by: Curtis Malainey <cujomalainey@google.com>
2019-12-19 20:44:35 +00:00
Curtis Malainey 50e27a10b0 EQ: GUI: Add external control window
Add window for controlling loading and deployment

Signed-off-by: Curtis Malainey <cujomalainey@google.com>
2019-12-19 20:44:35 +00:00
Curtis Malainey fe2d9c197f EQ: Handle edge case in peaking filter
Handle div by 0 case for gui

Signed-off-by: Curtis Malainey <cujomalainey@google.com>
2019-12-19 20:44:35 +00:00
Curtis Malainey 30bbfb49bb EQ: Add chromium signal processing elements
Add modules for signal processing of biquad filters needed for chromium

Signed-off-by: Curtis Malainey <cujomalainey@google.com>
2019-12-19 20:44:35 +00:00
Curtis Malainey 65c6da750a EQ: Add gui for IIR filters
Recreate gui for audio-tuning.appspot.com using SOF config. For IIR
filters only currently. Once DRC is ported then GUI can be ported as
well.

Signed-off-by: Curtis Malainey <cujomalainey@google.com>
2019-12-19 20:44:35 +00:00
Tomasz Lauda 7c8e815c99 interrupt: make irq names const
Changes interrupt controller names to const.
They are not supposed to be modified.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:38:31 +00:00
Tomasz Lauda 8d79b82a77 cavs: interrupt: move irq names to cavs header
Moves interrupt controller names to cavs platform header.
They are only used by cAVS platforms and shouldn't be
generic to xtensa architecture.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:38:31 +00:00
Tomasz Lauda 2451c59f38 ll_schedule: fix task insertion
Fixes low latency task insertion into the priority list.
Tasks should be inserted into the list from the highest to
the lowest priority. Tasks with the same priority should be
served on a first-come-first-serve basis. Note that the
list_item_append method, which is used to insert task into
the list is a bit misleading, since it normally should work
on list's head instead of any element from the list.
This piece of code should be revisited in the future and
proper list_item_insert method should be implemented and used.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:35:30 +00:00
Tomasz Lauda 29f7387b98 task: describe structures
Describes task structures.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:29:59 +00:00
Tomasz Lauda d9fd6030cb task: remove flags
SOF_SCHEDULE_FLAG_IDLE is no longer needed, since EDF scheduler
has been improved and relies only on deadlines. Let's remove it,
but keep flags field. It may come in handy in the future.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:29:59 +00:00
Tomasz Lauda 8fe7b72682 edf_schedule: remove priority
Removes need to pass EDF task priority during initialization.
Also removes priority definitions, which were only used by
EDF scheduler. Priorities of EDF tasks are now deprecated.
We are scheduling based only on deadline.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:29:59 +00:00
Tomasz Lauda 92d52f24fe edf_schedule: improve algorithm to use dynamic deadlines
Improves EDF scheduling algorithm to use dynamically calculated
deadlines instead of static ones. It also simplifies the way
it chooses the next task to be executed and is first step for
further simplifications.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:29:59 +00:00
Tomasz Lauda fd98e4b3ca task: add get_deadline operation
Adds new get_deadline operation to task. It is used by EDF scheduler
to support dynamic task deadlines. With static deadline we cannot
truly support almost full DSP utilization.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:29:59 +00:00
Tomasz Lauda c42f9bd621 task: extract task ops to separate struct
Extracts task operations to separate struct. This way we can
add additional ops without need to endlessly adding parameters
to schedule_edf_task_init function.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:29:59 +00:00
Tomasz Lauda 2baeeadeda schedule: separate task init functions for schedulers
Separates task init functions for all currently supported schedulers.
Some of the parameters are not common, so there is no need to
artificially extend function signatures.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:29:59 +00:00
Tomasz Lauda 85f0eee820 edf_schedule: do not schedule tasks with state RESCHEDULE
EDF tasks with state SOF_TASK_STATE_RESCHEDULE should be handled
separately and not scheduled immediately.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:29:59 +00:00
Pan Xiuli c28ecb9a87 dw-dma: register notifier in dma get instead of dma probe
notifier is unregister in dma put. need to register it in get to make
sure we do not lose any notifier.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-12-19 16:33:49 +00:00
Tomasz Lauda 468d897314 eq_fir: set fir_delay pointer to NULL when freed
Sets fir_delay pointer to NULL when freed to prevent attempts
to free the buffer multiple times.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 09:53:56 +01:00
Tomasz Lauda 60e7f304dc eq_iir: set iir_delay pointer to NULL when freed
Sets iir_delay pointer to NULL when freed to prevent attempts
to free the buffer multiple times.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 09:53:56 +01:00
Ranjani Sridharan f587993c75 topology: byt/cht: Add virtual widgets
Add the required virtual widgets to the BYT codec topology
to suppress the errors seen due to the dapm routes set up
in the machine driver and move them to the common header.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2019-12-18 15:38:15 +00:00
Tomasz Lauda 19ae126962 ipc: change memory allocation for IPC notifications
Changes the way of allocating IPC notifications by using
dynamic allocation instead of statically defined array.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-18 10:26:54 +00:00
Tomasz Lauda f2241bc019 ipc: change ipc_queue_host_message replace argument to bool
Changes one of the arguments of ipc_queue_host_message function from
uint32_t to bool.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-18 10:26:54 +00:00
Tomasz Lauda 9a4025eeda ipc: remove host reply unused code
Clean ups IPC drivers by removing unused code on host reply.
It saves us roughly over 4600 bytes in ipc_msg queue alone.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-18 10:26:54 +00:00
Tomasz Lauda 3f3698f461 pipeline: refactor posn_offset calculation
Refactors pipeline's posn_offset calculation to include
pipeline_id rather than static map of calculated offsets.
This way we can remove posn_map from ipc structure.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-18 10:26:54 +00:00
Tomasz Lauda 7332fb2f65 ipc: remove callback
Removes callback from ipc structure. It's not used and
if it's going to be needed in the future, the new notification
system should be used anyway.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-18 10:26:54 +00:00
Tomasz Lauda 76563333a6 ipc: remove ipc_process_msg_queue function
Removes ipc_process_msg_queue function as it's no longer needed.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-18 10:26:54 +00:00
Tomasz Lauda 1178606b08 ipc: remove flag dsp_pending
Removes dsp_pending flag. IPC notifications aren't sent
if the list is empty, so additional flag is not needed.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-18 10:26:54 +00:00
Tomasz Lauda d5864a78b9 ipc: remove argument from ipc_platform_send_msg
Removes argument from ipc_platform_send_msg function in order
to use static _ipc instance. It will allow for removal of not needed
function in future commits.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-18 10:26:54 +00:00
Janusz Jankowski 3d44dead6f Revert "kpb: refactor some of KPBs macros"
This reverts commit 0eabf51c9d.
2019-12-17 11:14:07 +01:00