Skip to content

Commit

Permalink
topology2: ONLY merge avs-tplg/ and sof-ace-tplg/ under production/
Browse files Browse the repository at this point in the history
Main branch commit 65e4c1f ("topology2: Merge avs-tplg and
sof-ace-tplg under production directory") did way too many things in the
same commit. It should have been split into 2 or 3 different
commits. Renaming and splitting a file in the same commit is almost
never a good idea. Making actual coding changes at the same time adds
insult to injury: it makes these changes almost impossible to spot in
the git diff.

When you add the usual "stable versus main" branch divergence on top, it
all compounds to make a backport incredibly complex, time-consuming and
error-prone.

So this backport to stable-v2.8 does NOT do all those things at once. It
does only the MINIMUM to achieve the "merge of avs-tplg/ and
sof-ace-tplg/ under production/" and that's it.

When a file is renamed, it _only_ renames that file - as should
have been done in the original pull request. All other changes from that
original commit are dropped and should be manually cherry-picked to
stable-v2.8 if desired or wanted as a dependency and foundation for
further backports.

   -------- original commit message for reference -------

Merge the avs-tplg and sof-ace-tplg under a common production directory.

After a successful build CMake will copy the topology files to a target
directory from where they can be copied to DUT/release:

$ tree tools/build_tools/topology/topology2/target
tools/build_tools/topology/topology2/target
├── development
│   ├── cavs-sdw-hdmi.tplg
│   ├── cavs-sdw-src-gain-mixin.tplg
        ...
│   ├── sof-tgl-nocodec-rtcaec.tplg
│   └── sof-tgl-nocodec.tplg
├── sof-ace-tplg -> sof-ipc4-tplg
└── sof-ipc4-tplg
    ├── sof-adl-rt711-4ch.tplg
    ├── sof-adl-rt711-l0-rt1316-l12-rt714-l3.tplg
        ...
    ├── sof-tgl-rt712.tplg
    └── sof-tgl-rt715-rt711-rt1308-mono.tplg

As noted in the documentation, on the deployed system a symlink is needed
for ACE1/2 platforms for backwards compatibility:
sof-ace-tplg -> sof-ipc4-tplg

Link: https://github.com/thesofproject/sof-docs/blob/master/getting_started/intel_debug/introduction.rst#2-topology-file

             ------------------

For reference, here's the part of the original commit which is NOT
backported here:

The sof-hda-generic-2/4ch.tplg will be generated without embedded NHLT as
it is not used under normal circumstance.
Two flavor of the generic topology is generated for CAVS2.5 and ACE1/2 with
included NHLT binary in case it is used by existing users, but it is
unlikely.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
(cherry picked from commit 65e4c1f)
  • Loading branch information
ujfalusi authored and marc-hb committed Feb 12, 2024
1 parent c33329d commit 1fd55c3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 35 deletions.
15 changes: 11 additions & 4 deletions tools/topology/topology2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
# 3.17 required: foreach(<loop_var>... IN ZIP_LISTS <lists>)
cmake_minimum_required(VERSION 3.17)

add_custom_target(topologies2)
add_custom_target(topologies2 ALL
# Create directory structure to be provided for deployment
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/target/sof-ipc4-tplg
COMMAND ${CMAKE_COMMAND} -E create_symlink sof-ipc4-tplg ${CMAKE_CURRENT_BINARY_DIR}/target/sof-ace-tplg
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/target/development
# copy the topology files only to target
COMMAND ${CMAKE_COMMAND} -E copy_if_different production/*.tplg ${CMAKE_CURRENT_BINARY_DIR}/target/sof-ipc4-tplg/
COMMAND ${CMAKE_COMMAND} -E copy_if_different development/*.tplg ${CMAKE_CURRENT_BINARY_DIR}/target/development/
)

# Check alsatplg version and build topology2 if alsatplg version is
# 1.2.7 or greater, see https://github.com/thesofproject/sof/issues/5323
Expand All @@ -29,7 +37,6 @@ add_custom_target(abi_target
DEPENDS abi.conf
)

add_dependencies(topologies2 topology2_cavs topology2_ace topology2_dev)
add_subdirectory(avs-tplg)
add_dependencies(topologies2 topology2_dev topology2_prod)
add_subdirectory(development)
add_subdirectory(sof-ace-tplg)
add_subdirectory(production)
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# SPDX-License-Identifier: BSD-3-Clause

include(tplg-targets.cmake)
include(tplg-targets-hda-cavs25.cmake)
include(tplg-targets-ace.cmake)

add_custom_target(topology2_cavs)
add_custom_target(topology2_prod)

foreach(tplg ${TPLGS})
set(defines "")
Expand All @@ -22,6 +23,6 @@ foreach(tplg ${TPLGS})
"${CMAKE_CURRENT_SOURCE_DIR}/../${input}" "${output}"
"${CMAKE_CURRENT_SOURCE_DIR}/../" "${defines}")

add_custom_target(topology2_avs_${output} DEPENDS ${output}.tplg)
add_dependencies(topology2_cavs topology2_avs_${output})
add_custom_target(topology2_${output} DEPENDS ${output}.tplg)
add_dependencies(topology2_prod topology2_${output})
endforeach()
27 changes: 0 additions & 27 deletions tools/topology/topology2/sof-ace-tplg/CMakeLists.txt

This file was deleted.

0 comments on commit 1fd55c3

Please sign in to comment.