From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A7A4C43603 for ; Tue, 17 Dec 2019 10:24:21 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A567B21739 for ; Tue, 17 Dec 2019 10:24:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="vFWc6pxw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A567B21739 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 92A3184A; Tue, 17 Dec 2019 11:23:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 92A3184A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1576578258; bh=AVpap8zNFIe8/vHS4sqj5VJ0c5IAtzA8Qhy58Oxhg60=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vFWc6pxwrmOGpAID8c4VRxRW1hU92HiUaOtk8X5YcPobSgOP7fOIKordr/JGfExDJ fqW6JKlXUk31dEQ3gNEDEZvgcpEdf2ho46V1mhNkQbkuduSfvhbwyRlyFrQV4XX7zU AUNbSzR0qpwgHCVnvx4ZjOpgiPLghmUNiT0Y75so= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 237D0F80218; Tue, 17 Dec 2019 11:23:28 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 68CF9F80234; Tue, 17 Dec 2019 11:23:27 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B0A32F80100 for ; Tue, 17 Dec 2019 11:23:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B0A32F80100 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C74C5AEE7; Tue, 17 Dec 2019 10:23:23 +0000 (UTC) Date: Tue, 17 Dec 2019 11:23:23 +0100 Message-ID: From: Takashi Iwai To: Cezary Rojewski In-Reply-To: <20191217095851.19629-5-cezary.rojewski@intel.com> References: <20191217095851.19629-1-cezary.rojewski@intel.com> <20191217095851.19629-5-cezary.rojewski@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: lgirdwood@gmail.com, alsa-devel@alsa-project.org, broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: Re: [alsa-devel] [PATCH 4/7] ALSA: core: Expand DMA buffer information X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, 17 Dec 2019 10:58:48 +0100, Cezary Rojewski wrote: > > Update DMA buffer definition for snd_compr_runtime so it is represented > similarly as in snd_pcm_runtime. While at it, modify > snd_compr_set_runtime_buffer to account for newly added members. > > Signed-off-by: Cezary Rojewski > --- > include/sound/compress_driver.h | 35 ++++++++++++++++++++++++--------- > 1 file changed, 26 insertions(+), 9 deletions(-) > > diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h > index bc88d6f964da..00f633c0c3ba 100644 > --- a/include/sound/compress_driver.h > +++ b/include/sound/compress_driver.h > @@ -23,7 +23,6 @@ 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 > @@ -34,11 +33,14 @@ struct snd_compr_ops; > * @total_bytes_transferred: cumulative bytes transferred by offload DSP > * @sleep: poll sleep > * @private_data: driver private data pointer > + * @dma_area: virtual buffer address > + * @dma_addr: physical buffer address (not accessible from main CPU) > + * @dma_bytes: size of DMA area > + * @dma_buffer_p: runtime dma buffer pointer > */ > 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; > @@ -47,6 +49,11 @@ struct snd_compr_runtime { > u64 total_bytes_transferred; > wait_queue_head_t sleep; > void *private_data; > + > + unsigned char *dma_area; > + dma_addr_t dma_addr; > + size_t dma_bytes; > + struct snd_dma_buffer *dma_buffer_p; Why do we need to have both dma_buffer_p and its values? For consistency with PCM stream? For PCM, dma_area, dma_addr and dma_bytes are the primary data, which aren't necessarily set by the dma_buffer but manually set up by the driver. Just wondering. Takashi _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel