Commit graph

7 commits

Author SHA1 Message Date
Jaroslav Kysela
472ab5db67 topology: improve the printf buffer management
The commit d04e72c9a5 introduced
the dynamic printf buffer allocation for each tplg_save_printf()
call.

Introduce 'struct tplg_buf' which carries extra information about
the temporary printf buffer and the destination buffer to save allocation
requests.

The printf buffer is also allocated using 1024 bytes chunks.

A comparison between 'alloc everyting' and 'cache+chunk alloc' for the
random picked topology file:

  1: 18,620 allocs, 18,620 frees, 7,239,688 bytes allocated
  2: 12,490 allocs, 12,490 frees, 962,568 bytes allocated

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-08-31 19:51:49 +02:00
Jaroslav Kysela
84c6aeef5c topology: fix sort_config()
The temporary config array must be initialized for all compound types.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-08-31 14:26:02 +02:00
Jaroslav Kysela
dc778bade6 topology: return correct value in tplg_save_printf()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-08-31 13:21:26 +02:00
Piotr Maziarz
d04e72c9a5 topology: Make buffer for saving dynamic size
Some fields can exceed size limit, e.g. private data has no size
restriction. Therefore it needs to be dynamically increased.

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-08-31 13:03:01 +02:00
Jaroslav Kysela
822f0c443b topology: use snd_config_is_array() function
... instead the own array test.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-08 12:04:41 +02:00
Jaroslav Kysela
b6c9afb4f5 topology: implement snd_tplg_decode
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
aa1bac2d04 topology: add snd_tplg_save()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00