Skip to content

dma: SG elem lists replaced with arrays#458

Merged
lgirdwood merged 1 commit intomasterfrom
topic/sgl-array
Oct 8, 2018
Merged

dma: SG elem lists replaced with arrays#458
lgirdwood merged 1 commit intomasterfrom
topic/sgl-array

Conversation

@mmaka1
Copy link
Copy Markdown

@mmaka1 mmaka1 commented Oct 3, 2018

Multiple alloctions of SG elements linked as a list
replaced with single allocations of arrays.

  • the code flows (esp. cleanup-on-error) are simplified,

  • number of 64bytes chunk allocations reduced from 18 to 12 for
    example very basic topology, no increase in other areas
    (2-period sgls still fit),

  • more efficient allocation for host page tables on legacy platforms;
    instead of going from a desc array to the list that is copied to
    another list, there is just a single allocation of array moved
    to the destination component.

Signed-off-by: Marcin Maka marcin.maka@linux.intel.com

@mmaka1 mmaka1 requested a review from lgirdwood October 3, 2018 13:01
@lgirdwood
Copy link
Copy Markdown
Member

@mmaka1 looks like host build failed.

depbase=`echo testbench.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I../../src/include  -I /home/sof/work/sof.git/host-lib/include/sof -I /home/sof/work/sof.git/src/library/include -I /home/sof/work/sof.git/src/include -I /home/sof/work/sof.git/src/arch/host/include -DSOF_INC=\"/home/sof/work/sof.git/host-lib/include/sof\"  -O3 -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 -g -Wall -g -O2 -MT testbench.o -MD -MP -MF $depbase.Tpo -c -o testbench.o testbench.c &&\
mv -f $depbase.Tpo $depbase.Po
/bin/bash ../../libtool  --tag=CC   --mode=link gcc -O3 -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 -g -Wall -g -O2 -lpthread -L../ipc -L../audio/.libs  -o testbench testbench.o -ldl -lm -lsof_ipc libtb_common.a -lsof -lcrypto 
libtool: link: gcc -O3 -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 -g -Wall -g -O2 -o .libs/testbench testbench.o  -lpthread -L../ipc -L../audio/.libs -ldl -lm /home/sof/work/sof.git/src/ipc/.libs/libsof_ipc.so libtb_common.a /home/sof/work/sof.git/src/audio/.libs/libsof.so -lcrypto -Wl,-rpath -Wl,/home/sof/work/sof.git/host-lib/lib
/home/sof/work/sof.git/src/audio/.libs/libsof.so: undefined reference to `dma_sg_free'
/home/sof/work/sof.git/src/audio/.libs/libsof.so: undefined reference to `dma_sg_alloc'
collect2: error: ld returned 1 exit status
Makefile:452: recipe for target 'testbench' failed
make[2]: *** [testbench] Error 1
make[2]: Leaving directory '/home/sof/work/sof.git/src/host'
Makefile:383: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/sof/work/sof.git/src'
Makefile:436: recipe for target 'all-recursive' failed

@mmaka1
Copy link
Copy Markdown
Author

mmaka1 commented Oct 3, 2018

@lgirdwood I tried to compile the host locally but it failed with: ../../src/include/host/topology.h:34:10: fatal error: sound/asoc.h: No such file or directory. Are some dependency checks missing in the config routine?

@lgirdwood
Copy link
Copy Markdown
Member

@mmaka1 oh it could be you are missing the linux kernel headers on your dev machine. These can be installed via the package manager or are alternatively missing alsa-lib development package.

@mmaka1
Copy link
Copy Markdown
Author

mmaka1 commented Oct 3, 2018

@lrgirdwood Yes, I have the headers available in /usr/include/alsa on my machine. And assumed this should satisfy the build environment requirements. I just could not find anything like -I pointing there when followed the scripts/host-build-all.sh. That is why I asked about missing dependency checks (and compiler settings) in the configure.
Could not find anything like optional --with for host build to configure the location documented in the README.md too.

@tlauda
Copy link
Copy Markdown
Contributor

tlauda commented Oct 4, 2018

@mmaka1 @lgirdwood Had the same problem. It looks like the gcc searches for the alsa headers in /usr/include/sound not in /usr/include/alsa/sound. Maybe the path has changed with the different versions of alsa. I've just copied the headers and it worked, but I don't know what should be the right solution.

@lgirdwood
Copy link
Copy Markdown
Member

@mmaka1 @tlauda can you try this

diff --git a/configure.ac b/configure.ac
index 02c2579a..ba2cbf16 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,6 +137,8 @@ case "$with_arch" in
 
        ARCH="host"
        AC_SUBST(ARCH)
+
+       AC_CHECK_HEADERS([sound/asoc.h])
     ;;
     *)
        if test "$have_rimage" = "no" && test "$have_doc" = "no" ; then

This should hopefully detect and add the include path to your -I flags

@mmaka1 mmaka1 force-pushed the topic/sgl-array branch 2 times, most recently from 626f89a to be1ed48 Compare October 6, 2018 14:04
Multiple alloctions of SG elements linked as a list
replaced with single allocations of arrays.

- The code flows (esp. cleanup-on-error) are simplified,

- number of 64bytes chunk allocations reduced from 18 to 12 for
  example very basic topology, no increase in other areas
  (2-period sgls still fit),

- more efficient allocation for host page tables on legacy platforms;
  instead of going from a desc array to the list that is copied to
  another list, there is just a single allocation of array moved
  to the destination component.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
@mmaka1
Copy link
Copy Markdown
Author

mmaka1 commented Oct 8, 2018

@lgirdwood CI restarted and passed.

@lgirdwood lgirdwood merged commit ccaff5c into master Oct 8, 2018
@lgirdwood
Copy link
Copy Markdown
Member

@mmaka1 I will fix the header issue in a separate patch, looks a little more complex than my patch above.

@mmaka1 mmaka1 deleted the topic/sgl-array branch October 9, 2018 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants