Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1138269ybi; Wed, 19 Jun 2019 14:19:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKd+Vf5/mbp25XMCHLOsmMok1JlaZ/0y85Cdp8++OEz/8lMvGyGK5dzvO6ayoDe5OVe25R X-Received: by 2002:a17:902:2868:: with SMTP id e95mr6378907plb.319.1560979149031; Wed, 19 Jun 2019 14:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560979149; cv=none; d=google.com; s=arc-20160816; b=rtTMkWjHNkXP1Pb0oc2rlfpgNSuyaCG6c/X7xL7xCVA/8E2UH1G+ZM/0kCXPd2tNN1 8i255BMEOYaoGTrC1KYP0kYLpwnUr4ChG8RfE4A4sP3YVkzuhLxkhzRXQcMMrvabFb9N ++qysh8MgToNsgh6SGlxgNt9aCo6BNVICBcI3RVhv+CkjmK4HDB64dAtCQc3vUICDL1B MRLP8MgeBV8yN5rj8rilD+8XkXWbHRjKjHsV0gMV9eT7o2f//yMzg1S5Rj+KL95X+CQd jDU+zmk9JCIqAlVYSY4r8cwfmCLWiLWJiOhoPSFcz8mFUWPjOyu+4Vthx+x0l7FEwcKt Xw9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=XY7aJ7dmXPxqNPvIOXdraSG/mXJqcFutpgqcMN/Km28=; b=M1tzabVhUmceCnRpIwUKh0kjiMmvVLD3jiuMRIpM0qlN2aBlURK4faTFiwLypMEdRR qSjn0nPDv5kn7DTxWy7e+8238StdykFqppNIvmrdvkhra0izjydCOSKdvYoFs2CHXtdO DRjjMnCivXDUbuZaokvrq3whEK8/drNys5CyfjMZXueia3VYq61wMx6J4F4QicoMOHR5 4OZJ62Z9DvxEjH38o52Gw6NpxS8CJLfkUzsM/mC+Ag7ezTf4dhdbMeNUmInYYCxWu8z3 PmMCbND0EmoSjolt4Q5RxWWnu/gbsWaOAH7l+pmS2Ha+taN0ZD8kw6f57/W8IjI6EV2J Hv/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VNslJ7mh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c142si17105626pfc.194.2019.06.19.14.18.53; Wed, 19 Jun 2019 14:19:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VNslJ7mh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730482AbfFSVSe (ORCPT + 99 others); Wed, 19 Jun 2019 17:18:34 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:40064 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726175AbfFSVSe (ORCPT ); Wed, 19 Jun 2019 17:18:34 -0400 Received: by mail-io1-f65.google.com with SMTP id n5so159223ioc.7 for ; Wed, 19 Jun 2019 14:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=XY7aJ7dmXPxqNPvIOXdraSG/mXJqcFutpgqcMN/Km28=; b=VNslJ7mhNRCKEXVbWHWhBbcjyZQQnZuTLynWJkzRy6HJWCzrYxgAE2HhkW/VSd5Pz9 SHfFCPP+ICxn6nicRTh1QtGs0tabSVxS4XDWpZ26c2/+NvIS9qM5t7B+rePUZMndCsUY d/Xt1q1xsTgqaK/ACYSjZ3NODpHgZdE4uqn5I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=XY7aJ7dmXPxqNPvIOXdraSG/mXJqcFutpgqcMN/Km28=; b=ISPcDOvZcEDHo4qF1Cb+kn4uTUpkp68GeB6+YviBijCzfzcOuAni3ofeX82gMkM2E8 uHwSLZJ2PYhE+ZYQgbuodI5x6O6c7JOSXyWHO+gKr8ZjeJaryTgQ80wXPHaScuUDjCFA Pyegy2MQNcw3u2afLXBOIAW5xSwPoQZjzZ2TYJ9g3h5KlB+SyCNIusjq6et7jHcLUdae +2g5qSziDlbghVEDghAOqU1eXzwwaZ1mFL79qifxb94bgwfR18rE1soe+21yDIB2w3It m+4UgwxCwr3OGsfLswspIRr7pw0od4cj9UOQMrlOr/kCDForMI9MKXy0L90k/VFAVAZk YIFg== X-Gm-Message-State: APjAAAUvEPBoEx6dqRJ0RkzQLzemzkjuj6KkhE+wgJ/JQw9jZxWcowto u4GbuAUxHlF1G/b/12MoF8e0KgY3D5U= X-Received: by 2002:a5d:85c3:: with SMTP id e3mr37007257ios.265.1560979113182; Wed, 19 Jun 2019 14:18:33 -0700 (PDT) Received: from mail-io1-f50.google.com (mail-io1-f50.google.com. [209.85.166.50]) by smtp.gmail.com with ESMTPSA id x13sm15366123ioj.18.2019.06.19.14.18.33 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jun 2019 14:18:33 -0700 (PDT) Received: by mail-io1-f50.google.com with SMTP id r185so553009iod.6 for ; Wed, 19 Jun 2019 14:18:33 -0700 (PDT) X-Received: by 2002:a02:5b05:: with SMTP id g5mr93849116jab.114.1560978714620; Wed, 19 Jun 2019 14:11:54 -0700 (PDT) MIME-Version: 1.0 References: <20190617235558.64571-1-dianders@chromium.org> <6219398.I55JWXAmVF@jernej-laptop> <9bba43cb-7070-8b2a-cfc6-f601fd22a315@baylibre.com> In-Reply-To: <9bba43cb-7070-8b2a-cfc6-f601fd22a315@baylibre.com> From: Doug Anderson Date: Wed, 19 Jun 2019 14:11:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/bridge/synopsys: dw-hdmi: Handle audio for more clock rates To: Neil Armstrong Cc: =?UTF-8?Q?Jernej_=C5=A0krabec?= , Andrzej Hajda , Laurent Pinchart , Sean Paul , =?UTF-8?Q?Heiko_St=C3=BCbner?= , Jonas Karlman , "open list:ARM/Rockchip SoC..." , Dylan Reid , Cheng-Yi Chiang , David Airlie , Zheng Yang , Sam Ravnborg , dri-devel , LKML , Thomas Gleixner , Daniel Vetter Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Jun 19, 2019 at 8:23 AM Neil Armstrong wr= ote: > > On 18/06/2019 19:23, Jernej =C5=A0krabec wrote: > > Hi! > > > > Dne torek, 18. junij 2019 ob 01:55:58 CEST je Douglas Anderson napisal(= a): > >> Let's add some better support for HDMI audio to dw_hdmi. > >> Specifically: > >> > >> 1. For 44.1 kHz audio the old code made the assumption that an N of > >> 6272 was right most of the time. That wasn't true and the new table > >> should give better 44.1 kHz audio for many more rates. > >> > >> 2. The new table has values from the HDMI spec for 297 MHz and 594 > >> MHz. > >> > >> 3. There is now code to try to come up with a more idea N/CTS for > >> clock rates that aren't in the table. This code is a bit slow because > >> it iterates over every possible value of N and picks the best one, but > >> it should make a good fallback. > >> > >> 4. The new code allows for platforms that know they make a clock rate > >> slightly differently to pick different N/CTS values. For instance on > >> rk3288 we can make 25,176,471 Hz instead of 25,174,825.1748... Hz > >> (25.2 MHz / 1.001). A future patch to the rk3288 platform code could > >> enable support for this clock rate and specify the N/CTS that would be > >> ideal. > >> > >> NOTE: the oddest part of this patch comes about because computing the > >> ideal N/CTS means knowing the _exact_ clock rate, not a rounded > >> version of it. The drm framework makes this harder by rounding rates > >> to kHz, but even if it didn't there might be cases where the ideal > >> rate could only be calculated if we knew the real (non-integral) rate. > >> This means that in cases where we know (or believe) that the true rate > >> is something other than the rate we are told by drm. > >> > >> Signed-off-by: Douglas Anderson > > > > Which bus is used for audio transfer on your device? If it is I2S, whic= h is > > commonly used, then please be aware of this patch: > > https://lists.freedesktop.org/archives/dri-devel/2019-June/221539.html > > > > It avoids exact N/CTS calculation by enabling auto detection. It is wel= l > > tested on multiple SoCs from Allwinner, Amlogic and Rockchip. > > > > Best regards, > > Jernej > > > > > Hi Douglas, > > Thanks for your work ! > > If you could rebase on top of https://lists.freedesktop.org/archives/dri-= devel/2019-June/221539.html > so we can make use of your extended N table with automatic CTS HW calcula= tion, it would be great ! Thanks to you and Jernej for pointing me at this. It seems likely that patch by itself would solve problems we found and I'll pick that into my tree. Probably my patch is no longer quite as useful atop yours, but I'll still post a v2 since (in theory) folks that aren't using I2S might find it useful. I guess it's also possible (?) that picking an N where CTS would be able to be integral has some type of advantage, even with auto CTS? > Finally could you add the plat_data tmds table as a separate patch to sim= plify review ? Sure. I'm probably not going to be able to post the patch to actually use it, so I guess we could just not bother applying the 2nd patch unless someone ever needs it. -Doug