Skip to content

Commit fc9edf7

Browse files
singalsulgirdwood
authored andcommitted
Tools: Testbench: Increase bytes size limit and avoid duplication
The max size is increased to 8 kB. Instead of copying the data from topology to controls array the data can be referenced with a pointer. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent b85ab32 commit fc9edf7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tools/testbench/include/testbench/utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define TB_MAX_CMD_CHARS 256
2323
#define TB_MAX_CTL_NAME_CHARS 128
2424
#define TB_MAX_VOLUME_SIZE 120
25-
#define TB_MAX_BYTES_DATA_SIZE 512
25+
#define TB_MAX_BYTES_DATA_SIZE 8192
2626

2727
/* number of widgets types supported in testbench */
2828
#define TB_NUM_WIDGETS_SUPPORTED 16
@@ -43,7 +43,7 @@ struct tb_ctl {
4343
unsigned int type;
4444
unsigned int volume_table[TB_MAX_VOLUME_SIZE];
4545
unsigned int index;
46-
char data[TB_MAX_BYTES_DATA_SIZE];
46+
char *data;
4747
char name[TB_MAX_CTL_NAME_CHARS];
4848
union {
4949
struct snd_soc_tplg_mixer_control mixer_ctl;

tools/testbench/topology_ipc4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ static int tb_kcontrol_cb_new(struct snd_soc_tplg_ctl_hdr *tplg_ctl,
13581358
tplg_bytes->priv.size);
13591359
return -EINVAL;
13601360
}
1361-
memcpy(ctl->data, tplg_bytes->priv.data, tplg_bytes->priv.size);
1361+
ctl->data = tplg_bytes->priv.data;
13621362
ctl->comp_info = comp_info;
13631363
strncpy(ctl->name, tplg_ctl->name, TB_MAX_CTL_NAME_CHARS);
13641364
break;

0 commit comments

Comments
 (0)