From patchwork Wed Sep 26 10:23:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10615661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A4A0515A6 for ; Wed, 26 Sep 2018 10:26:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FB082A7A4 for ; Wed, 26 Sep 2018 10:26:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93DD22A7A9; Wed, 26 Sep 2018 10:26:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02DFD2A7AF for ; Wed, 26 Sep 2018 10:26:08 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 8304D2678C5; Wed, 26 Sep 2018 12:26:03 +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 3F2E82678BD; Wed, 26 Sep 2018 12:25:59 +0200 (CEST) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by alsa0.perex.cz (Postfix) with ESMTP id 8C4F42678BA for ; Wed, 26 Sep 2018 12:25:57 +0200 (CEST) Received: by mail-wm1-f65.google.com with SMTP id o2-v6so1688817wmh.5 for ; Wed, 26 Sep 2018 03:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4syfqTgzquPxdJpZoTtqhiu/8ooDs0QTCE3IX5nC3NM=; b=k191EyrXLxWe+xiQxSAFleVYd57c5YfWYMhvy3ifTPCKeKUNV6EfTXWfrPdGHCSRdU DxJ8I9SNiz1uJP3Q8WbPqouHfzduVLENter9FM0Mre29fpJ2loEIapa2BizMqOVx6U9/ EPGWwZGV3Vmg55d401Z5Ph+RzI1bl4JGnDfxI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4syfqTgzquPxdJpZoTtqhiu/8ooDs0QTCE3IX5nC3NM=; b=XlCVl8AUgq2DuEqhu2zq9TD4mg/1ElBZOrrbzziCCjmL0ApZ258/CjCUcmN2FjJTRn MxHQ+SOf7W60me6S0b9TCADT3hs80YNW/fcZz5eH9lF4q7eQwRgqwMMwOF3AYiPFBfAR SAjglW2ZlA0lW5wTsTlDuDSetf9/m4jfvcfJnAKsgMEMoFBZOqlI4Vgf2HqKKSCSk4zM jkRjllJoHePfXnlnkv/W2DU3Ck9y6W0A5sDHmtarL1UAf800Ny9g0v8Ep7SbZ25134eH eDQrXpNXjIHyOjHGIZZftNZVaJ/Fhg+FTvLIfQBB9vymOtvT6+wUtQkmQizDj2M2O8C9 epTw== X-Gm-Message-State: ABuFfojJzHVJVm7zOHjdtBn8C48lbko7H1yy503UopeVzsAU/2AjrIfR 9ekLE/cyUC75/JGv2HZM1weMAw== X-Google-Smtp-Source: ACcGV61i85jCbDz71x/RTs5M3lny71g92xieAMhZk4rXdqW0VR2CdPNm4PoWugbN19c61u83cF06yA== X-Received: by 2002:a1c:7fc6:: with SMTP id a189-v6mr3682238wmd.42.1537957556849; Wed, 26 Sep 2018 03:25:56 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id b12sm4442648wrx.11.2018.09.26.03.25.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Sep 2018 03:25:56 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, alsa-devel@alsa-project.org, robh+dt@kernel.org Date: Wed, 26 Sep 2018 11:23:45 +0100 Message-Id: <20180926102349.23481-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180926102349.23481-1-srinivas.kandagatla@linaro.org> References: <20180926102349.23481-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, bgoswami@codeaurora.org, lgirdwood@gmail.com, tiwai@suse.com, linux-kernel@vger.kernel.org, vkoul@kernel.org, rohitkr@codeaurora.org, Srinivas Kandagatla Subject: [alsa-devel] [PATCH v2 1/5] ALSA: soc-compress: add support to snd_compr_set_runtime_buffer() 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds support to set runtime dma buffer on compressed stream. Signed-off-by: Srinivas Kandagatla --- include/sound/compress_driver.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h index ea8c93bbb0e0..0cdc3999ecfa 100644 --- a/include/sound/compress_driver.h +++ b/include/sound/compress_driver.h @@ -23,6 +23,7 @@ struct snd_compr_ops; * struct snd_compr_runtime: runtime stream description * @state: stream state * @ops: pointer to DSP callbacks + * @dma_buffer_p: runtime dma buffer pointer * @buffer: pointer to kernel buffer, valid only when not in mmap mode or * DSP doesn't implement copy * @buffer_size: size of the above buffer @@ -37,6 +38,7 @@ struct snd_compr_ops; struct snd_compr_runtime { snd_pcm_state_t state; struct snd_compr_ops *ops; + struct snd_dma_buffer *dma_buffer_p; void *buffer; u64 buffer_size; u32 fragment_size; @@ -175,6 +177,23 @@ static inline void snd_compr_drain_notify(struct snd_compr_stream *stream) wake_up(&stream->runtime->sleep); } +/** + * snd_compr_set_runtime_buffer - Set the Compress runtime buffer + * @substream: compress substream to set + * @bufp: the buffer information, NULL to clear + * + * Copy the buffer information to runtime buffer when @bufp is non-NULL. + * Otherwise it clears the current buffer information. + */ +static inline void snd_compr_set_runtime_buffer( + struct snd_compr_stream *substream, + struct snd_dma_buffer *bufp) +{ + struct snd_compr_runtime *runtime = substream->runtime; + + runtime->dma_buffer_p = bufp; +} + int snd_compr_stop_error(struct snd_compr_stream *stream, snd_pcm_state_t state);