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 74379C43603 for ; Tue, 17 Dec 2019 10:20:25 +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 853B82072D for ; Tue, 17 Dec 2019 10:20:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="bzrX/VM4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 853B82072D 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 40C8785D; Tue, 17 Dec 2019 11:19:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 40C8785D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1576578022; bh=M/UBySV7HerOX9uCwSgnN0p11MSjNsB76vGgoRTSiOo=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bzrX/VM443J95wsMaoMiirTfota++ajObTTM96KyOiJzFv/AYvhD/vFk+H1eFm+9f wKuWldlbYk0LxKn55/ovl1lX8rvfcJGAa5dnS/aMptUr2o1bVSiSCi8YrhYjgPXpYy 4ML5m6Aibu5vNe+M6EiBuPNK7Zf0CrUGrPjsryQ8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B8BE4F80218; Tue, 17 Dec 2019 11:19:31 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BA9CCF80088; Tue, 17 Dec 2019 11:19:29 +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 7A869F80088 for ; Tue, 17 Dec 2019 11:19:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7A869F80088 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 46FC5B2A3; Tue, 17 Dec 2019 10:19:26 +0000 (UTC) Date: Tue, 17 Dec 2019 11:19:25 +0100 Message-ID: From: Takashi Iwai To: Cezary Rojewski In-Reply-To: <20191217095851.19629-2-cezary.rojewski@intel.com> References: <20191217095851.19629-1-cezary.rojewski@intel.com> <20191217095851.19629-2-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 1/7] ALSA: hda: Allow for compress stream to hdac_ext_stream assignment 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:45 +0100, Cezary Rojewski wrote: > > Currently only PCM streams can enlist hdac_stream for their data > transfer. Add cstream field to hdac_ext_stream to expose possibility of > compress stream assignment in place of PCM one. > Limited to HOST-type only. > > Rather than copying entire hdac_ext_host_stream_assign, declare separate > PCM and compress wrappers and reuse it for both cases. > > Signed-off-by: Cezary Rojewski > --- > include/sound/hdaudio.h | 1 + > include/sound/hdaudio_ext.h | 2 ++ > sound/hda/ext/hdac_ext_stream.c | 46 +++++++++++++++++++++++++++++---- > 3 files changed, 44 insertions(+), 5 deletions(-) > > diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h > index e05b95e83d5a..9a8bf1eb7d69 100644 > --- a/include/sound/hdaudio.h > +++ b/include/sound/hdaudio.h > @@ -481,6 +481,7 @@ struct hdac_stream { > struct snd_pcm_substream *substream; /* assigned substream, > * set in PCM open > */ > + struct snd_compr_stream *cstream; > unsigned int format_val; /* format value to be set in the > * controller and the codec > */ One might use union for pointing to either PCM or compr stream and identify the type with some flag. struct hdac_stream { union { struct snd_pcm_substream *substream; struct snd_compr_stream *cstream; }; bool is_compr; .... But, I'm not advocating for this. Although this makes the stream assignment more handy, it might lead to refer to a wrong object if you don't check the flag properly, too. It really depends on the code. thanks, Takashi _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel