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=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 674BAC4363D for ; Tue, 22 Sep 2020 15:59:46 +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 ACBFA2084C for ; Tue, 22 Sep 2020 15:59:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="cKsU5KEo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACBFA2084C 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 BDB731724; Tue, 22 Sep 2020 17:58:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BDB731724 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1600790382; bh=TsDOA7aV10KA66dES+2ACqtLJItls343iQDkUJADYqo=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=cKsU5KEomcGYmF25KRSmMMz19RUMNuKbHOXX5dwX9E7N4Rmsk5/cw/3KoCeIZVRR/ BX1DghfdFLrcZFIk3Yd3v7jRKvAtTJyorD4DaReWdbLZCQ/AuZOdHSVLC4KKwwd5+1 0xNlVGGETk8A7QrTO5FX4aybxTNtRfCoR+HZzSSE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 57BF9F800ED; Tue, 22 Sep 2020 17:58:52 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 63E50F80232; Tue, 22 Sep 2020 17:58:51 +0200 (CEST) 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 073C8F800ED; Tue, 22 Sep 2020 17:58:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 073C8F800ED X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5F43EACA1; Tue, 22 Sep 2020 15:59:15 +0000 (UTC) Date: Tue, 22 Sep 2020 17:58:38 +0200 Message-ID: From: Takashi Iwai To: Pawel Harlozinski Subject: Re: [PATCH v3 1/1] ALSA: hda: Refactor calculating SDnFMT according to specification In-Reply-To: <20200922153332.4919-1-pawel.harlozinski@linux.intel.com> References: <20200922153332.4919-1-pawel.harlozinski@linux.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") Content-Type: text/plain; charset=US-ASCII Cc: cezary.rojewski@intel.com, patch@alsa-project.org, kai.vehmanen@linux.intel.com, alsa-devel@alsa-project.org, pierre-louis.bossart@linux.intel.com, lgirdwood@gmail.com, broonie@kernel.org, amadeuszx.slawinski@linux.intel.com 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, 22 Sep 2020 17:33:32 +0200, Pawel Harlozinski wrote: > > Fix setting SDnFMT based on :wq > High Definition Audio Specification Rev. 1.0a page 48. > > Bits per Sample (BITS): > 000 = 8 bits. The data will be packed in memory in 8-bit containers on 16-bit boundaries. > 001 = 16 bits. The data will be packed in memory in 16-bit containers on 16-bit boundaries. > 010 = 20 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 011 = 24 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 100 = 32 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 101-111 = Reserved > > Set SDnFMT depending on which format was given. > Henceforth split cases for formats 20, 24, 32 bits, > but leave constraints to maxbps. > > Signed-off-by: Pawel Harlozinski As I repeatedly wrote, the bits 20 and 24 cases never hit practically, hence this "refactoring" doesn't give any change in reality. Your commit misses that point. That said, this can be taken as a complementary for the theoretical case, but the situation has to be clarified in the commit log, and the subject should be adjusted as well. thanks, Takashi > > --- > > v3: drop gerrit Change-Id > v2: leave constraints to maxbps > > sound/hda/hdac_device.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c > index 3e9e9ac804f6..ccc47a10ba63 100644 > --- a/sound/hda/hdac_device.c > +++ b/sound/hda/hdac_device.c > @@ -764,7 +764,14 @@ unsigned int snd_hdac_calc_stream_format(unsigned int rate, > val |= AC_FMT_BITS_16; > break; > case 20: > + val |= AC_FMT_BITS_20; > + break; > case 24: > + if (maxbps >= 24) > + val |= AC_FMT_BITS_24; > + else > + val |= AC_FMT_BITS_20; > + break; > case 32: > if (maxbps >= 32 || format == SNDRV_PCM_FORMAT_FLOAT_LE) > val |= AC_FMT_BITS_32; > -- > 2.17.1 >