From patchwork Mon Jun 19 16:23:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 105887 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp929175obh; Mon, 19 Jun 2017 09:24:57 -0700 (PDT) X-Received: by 10.223.162.156 with SMTP id s28mr18880733wra.97.1497889497606; Mon, 19 Jun 2017 09:24:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497889497; cv=none; d=google.com; s=arc-20160816; b=qBi5PbKV7ydDzuVimG3ihnFNiIFi6t8uVX+hpj50dPzVONkPeT/0dyAr9OBs76wAnj pHR4xyt9htahK6JTmxrfZhNaMzLpui8vEY06VFLt2IGiSHOWAs6iKSfcG2U90tEgmf1x A+oplVp0dOkaTwVWTQfvc5adts41CBZmxFromz6ysOApuGUDZ6AJuJ09ccRSXoTfgz19 rIUvpbP2raJNFUtxPM/WpgJK8kIebowS0XP8NiSRLQK98lUzcRE3CQCekNi89e3WNIlJ Cx5WXhmRW2vRyVw8HhKSemtAw6t7UfjhA6VprbyyrXP7ImVbZ3FNlRNBA5qvlrD7SrUX MOsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :delivered-to:arc-authentication-results; bh=3YpRi1B1ow82RKS5yDFVwInZcKWiHrc+0oNFsgKt0IA=; b=Rs/X84VSghJdA5funPNuWC9ECoLjtcOw+HAEmzAx5RlKMtjzVH0cR5QW3RpZfEt/jF K7wz4jdMiDAn4/9gIDKkew+T3vH0GEAS9sAPyPJw66fkGrG9drmwgBszRHtQj4ohF6AR UCNTm9E7K8cRlYUoisUn6M2pm1z6Y8Pk71kthAbmGakgDWrEwqjQaxskqn38sVyjXGOh /CK0nF4x/f1cUUBtwefJyNqMz1/vLqcJGthhLqQA32Km3cS5QdPu4ASZiHG4iA/ufWAT TmDmymd1KnpjOyFdnw8IFRe6qcjlJcANftojyeR2pesaLvWAnPTMv9O1yk0vbJRqeo0v kMGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id q18si10485723wrb.366.2017.06.19.09.24.57; Mon, 19 Jun 2017 09:24:57 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 8CA1F267192; Mon, 19 Jun 2017 18:24:17 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7039D267168; Mon, 19 Jun 2017 18:24:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_PASS,T_RP_MATCHES_RCVD,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id F0738267135 for ; Mon, 19 Jun 2017 18:24:07 +0200 (CEST) Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dMzT6-0007sm-TD; Mon, 19 Jun 2017 16:24:03 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1dMzT4-0002Pd-Bc; Mon, 19 Jun 2017 17:23:58 +0100 From: Mark Brown To: Ramesh Babu In-Reply-To: <1497267657-20359-3-git-send-email-subhransu.s.prusty@intel.com> Message-Id: Date: Mon, 19 Jun 2017 17:23:58 +0100 X-SA-Exim-Connect-IP: 2001:470:1f1d:6b5::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Cc: alsa-devel@alsa-project.org, tiwai@suse.de, lgirdwood@gmail.com, patches.audio@intel.com, broonie@kernel.org, "Subhransu S. Prusty" Subject: [alsa-devel] Applied "ASoC: Intel: Skylake: Fix dma buffer size calculation" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: Intel: Skylake: Fix dma buffer size calculation has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From f6e6ab1d16ec9dafa65557b5637f5217b32702ef Mon Sep 17 00:00:00 2001 From: Ramesh Babu Date: Mon, 19 Jun 2017 11:59:20 +0530 Subject: [PATCH] ASoC: Intel: Skylake: Fix dma buffer size calculation DMA buffer size for gateway copier will be calculated based on: For host DMA copier: Input buffer size (ibs) for output direction (playback) Output buffer size (obs) for input direction (capture) For link DMA copier: IBS for input direction (capture) OBS for output direction (playback) Update the driver to use the above. Signed-off-by: Ramesh Babu Signed-off-by: Subhransu S. Prusty Acked-By: Vinod Koul Signed-off-by: Mark Brown --- sound/soc/intel/skylake/skl-messages.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) -- 2.11.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index 5a465020ebd8..eca85827dbd2 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c @@ -507,6 +507,8 @@ static void skl_setup_cpr_gateway_cfg(struct skl_sst *ctx, struct skl_module_cfg *mconfig, struct skl_cpr_cfg *cpr_mconfig) { + u32 dma_io_buf; + cpr_mconfig->gtw_cfg.node_id = skl_get_node_id(ctx, mconfig); if (cpr_mconfig->gtw_cfg.node_id == SKL_NON_GATEWAY_CPR_NODE_ID) { @@ -514,10 +516,29 @@ static void skl_setup_cpr_gateway_cfg(struct skl_sst *ctx, return; } - if (SKL_CONN_SOURCE == mconfig->hw_conn_type) - cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->obs; - else - cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->ibs; + switch (mconfig->hw_conn_type) { + case SKL_CONN_SOURCE: + if (mconfig->dev_type == SKL_DEVICE_HDAHOST) + dma_io_buf = mconfig->ibs; + else + dma_io_buf = mconfig->obs; + break; + + case SKL_CONN_SINK: + if (mconfig->dev_type == SKL_DEVICE_HDAHOST) + dma_io_buf = mconfig->obs; + else + dma_io_buf = mconfig->ibs; + break; + + default: + dev_warn(ctx->dev, "wrong connection type: %d\n", + mconfig->hw_conn_type); + return; + } + + cpr_mconfig->gtw_cfg.dma_buffer_size = + mconfig->dma_buffer_size * dma_io_buf; cpr_mconfig->cpr_feature_mask = 0; cpr_mconfig->gtw_cfg.config_length = 0;