From patchwork Mon May 22 10:13:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 685083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE0F7C77B73 for ; Mon, 22 May 2023 10:13:58 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6D2EF827; Mon, 22 May 2023 12:13:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6D2EF827 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1684750435; bh=xAfwhPwzw+QIQIDTrZt1pCAhye7FjaOM8KudtbYVwLM=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=fJ5PXKuky5JCU9fzEiYgx425WNKThPOJ0XgXPNbHqi7Oq4iYOeO1PUyB5Hh/Guotg DEhK0lFDH88aZpwkIsFQggXdFU/1GYWHXC2e/u5Iai25keZijxcH2OjxA1t0q0bW1E t17fXS5cqCbcpPek+9dTK0m/BxBtXrzSNdC8/S/Q= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 27279F80544; Mon, 22 May 2023 12:12:35 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 839C0F80542; Mon, 22 May 2023 12:12:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4AA5EF8053D; Mon, 22 May 2023 12:12:29 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A0F00F80086 for ; Mon, 22 May 2023 12:12:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A0F00F80086 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Ne7+iBEA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684750342; x=1716286342; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xAfwhPwzw+QIQIDTrZt1pCAhye7FjaOM8KudtbYVwLM=; b=Ne7+iBEAWjEUsvKiVis1svrFfGXOyCcu0+yibs76uErRy7oFTGK8aJJU BcvD0n5yL2/agCxq5lZOcQzm567+gdYE1eVo5f5ABQIyBH57ngG1w9Bma 5rm+XjdN8APH71oZamcRC10tJ5SfGDfJH5XqjSGdYKW2nOTXEfJZnY9Jt B7KeI+NtGlzhSqs0S40+yj4bU71Sd8XUfX/oVd6fcqQJ9YZU3ufHKuqFb 5Gj+7pZbTGC6h5W3ekFaqm/N2mfNIUMpseepgWlbTd8PCTez7t7koJ/z8 0oaqQ9hTj9xEaRzkguPFZkzzStsbqFqz4nkvd9+Bwm2at5JanVvu3w06K g==; X-IronPort-AV: E=McAfee;i="6600,9927,10717"; a="350390644" X-IronPort-AV: E=Sophos;i="6.00,184,1681196400"; d="scan'208";a="350390644" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2023 03:12:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10717"; a="736365224" X-IronPort-AV: E=Sophos;i="6.00,184,1681196400"; d="scan'208";a="736365224" Received: from bbattach-mobl.ger.corp.intel.com (HELO pujfalus-desk.ger.corp.intel.com) ([10.251.220.157]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2023 03:12:15 -0700 From: Peter Ujfalusi To: lgirdwood@gmail.com, broonie@kernel.org Cc: alsa-devel@alsa-project.org, pierre-louis.bossart@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com Subject: [PATCH 0/5] ASoC: SOF: ipc4: Querry CPC value from firmware's manifest Date: Mon, 22 May 2023 13:13:08 +0300 Message-Id: <20230522101313.12519-1-peter.ujfalusi@linux.intel.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Message-ID-Hash: A3AYKSG4DY7TMCOMZBVGTBHVK4SWYEYW X-Message-ID-Hash: A3AYKSG4DY7TMCOMZBVGTBHVK4SWYEYW X-MailFrom: peter.ujfalusi@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hi, Hi, The MOD_INIT_INSTANCE message contains a CPC (Cycles Per Chunk/processing unit) parameter. This CPC value is used by the firmware to calculate the total cycles needed by the enabled module instances and based on this it can decide to set the frequency of the DSP core(s). The manifest section of the firmware image contains a module configuration section, where a per module table of configurations are listed with measured CPC values as triplet of IBS/IBS/CPC (Input/Output buffer size - corresponding to the selected audio format). In case the CPC value is 0 (missing from the manifest or the configuration cannot be matched) the firmware will force the DSP cores to maximum speed to avoid audio glitches due to starvation. In these cases the kernel will print a warning message to let the SOF developers know about the gap and provide information to correct it with a firmware update. Regards, Peter --- Peter Ujfalusi (5): ASoC: SOF: ipc4-loader: Drop unused bss_size from struct sof_ipc4_fw_module ASoC: SOF: ipc4-loader: Save a pointer to fm_config in sof_ipc4_fw_module ASoC: SOF: ipc4-topology: Rename sof_ipc4_update_pipeline_mem_usage() to be generic ASoC: SOF: ipc4-topology: Do not use the CPC value from topology ASoC: SOF: ipc4-loader/topology: Query the CPC value from manifest sound/soc/sof/ipc4-loader.c | 72 ++++++++++++++++++++++++++++++++--- sound/soc/sof/ipc4-priv.h | 10 ++++- sound/soc/sof/ipc4-topology.c | 33 +++++++++------- 3 files changed, 94 insertions(+), 21 deletions(-)