core: improve alignment

Use the CPU alignment to align memory of allocated buffers. This makes
it more likely that all CPU optimizations can be done.
This commit is contained in:
Wim Taymans 2019-10-17 09:34:27 +02:00
parent c8ffcaaefe
commit 7798cf7364
6 changed files with 53 additions and 13 deletions

View file

@ -37,7 +37,8 @@
#define NAME "buffers"
#define MAX_BUFFERS 64
#define MAX_ALIGN 32
#define MAX_BUFFERS 64
struct port {
struct spa_node *node;
@ -246,8 +247,12 @@ int pw_buffers_negotiate(struct pw_core *core, uint32_t flags,
else
max_buffers = MAX_BUFFERS;
if ((str = pw_properties_get(core->properties, "cpu.max-align")) != NULL)
align = pw_properties_parse_int(str);
else
align = MAX_ALIGN;
minsize = stride = 0;
align = 8;
param = find_param(params, n_params, SPA_TYPE_OBJECT_ParamBuffers);
if (param) {
uint32_t qmax_buffers = max_buffers,