Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tplgtool2.py: show widget CPC in topology graph #1099

Merged
merged 2 commits into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions tools/tplgtool2.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ class SofVendorToken(enum.IntEnum):
SOF_TKN_COMP_FORMAT = 402
SOF_TKN_COMP_CORE_ID = 404
SOF_TKN_COMP_UUID = 405
SOF_TKN_COMP_CPC = 406
# sof_ssp_tokens
SOF_TKN_INTEL_SSP_CLKS_CONTROL = 500
SOF_TKN_INTEL_SSP_MCLK_ID = 501
Expand Down Expand Up @@ -690,10 +691,10 @@ def get_priv_element(comp: Container, token: SofVendorToken, default = None):
return default

@staticmethod
def get_core_id(widget: Container, default = None):
"Get widget core ID."
return GroupedTplg.get_priv_element(widget["widget"], SofVendorToken.SOF_TKN_COMP_CORE_ID, default)
def get_widget_token_value(widget: Container, token: SofVendorToken, default = None):
"Get the value for specified token"
return GroupedTplg.get_priv_element(widget["widget"], token, default)

@staticmethod
def get_widget_uuid(widget: Container, default = None):
"Get widget UUID."
Expand Down Expand Up @@ -741,7 +742,7 @@ def coreids(self):
"All available core IDs."
cores = set()
for widget in self.widget_list:
core = self.get_core_id(widget)
core = self.get_widget_token_value(widget, SofVendorToken.SOF_TKN_COMP_CORE_ID)
if core is None:
cores.add(-1) # placeholder for the lack of core ID
else:
Expand Down Expand Up @@ -917,12 +918,15 @@ def _display_node_attrs(self, name: str, widget: Container):
attr = {}
if not self.without_nodeinfo:
sublabel = self.node_sublabel(widget)
core = GroupedTplg.get_core_id(widget)
core = GroupedTplg.get_widget_token_value(widget, SofVendorToken.SOF_TKN_COMP_CORE_ID)
if core is not None:
if self.show_core == 'always' or (
self.show_core == 'auto' and self._tplg.has_core_differences
):
sublabel2 += f'<BR ALIGN="CENTER"/><SUB>core:{core}</SUB>'
comp_cpc = GroupedTplg.get_widget_token_value(widget, SofVendorToken.SOF_TKN_COMP_CPC)
if comp_cpc is not None:
sublabel2 += f'<BR ALIGN="CENTER"/><SUB>cpc:{comp_cpc}</SUB>'
display_name = name
wname = widget.widget.name
# See the *_NUM_REGEX above
Expand Down
Loading