Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp4011106ybd; Tue, 25 Jun 2019 12:23:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzjIbalUGSn+N1oE65EdDjREizKGEZ/cZ8Wh0C6G+9DGeC0H4OfXkYFLHZFZI6ndoW3lVT X-Received: by 2002:a63:c65:: with SMTP id 37mr18125499pgm.158.1561490611275; Tue, 25 Jun 2019 12:23:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561490611; cv=none; d=google.com; s=arc-20160816; b=nNt+OE84DqbXASQTnjY27bqu6BLfj74WiS9fAe7FzlNgDdTt86WyKwqH6KijxQnhJs GcFN6GTja5Xprfgr2Cpa2cdPn0CRmUlrS3vb7E+F0BvtzbyPDWD7R3Vd2vHvefRqMido LSOnNV5IkLec/ukbv/81MZh4RfAlly2hR4XEU3NO8ZIqU9DfBt04kuo0P4a0Vdiu2tli ojoUvKAG+Qc3/RXm+4GPl7kQm35IHKiupZwIRr3tzbx6SFw77xUDGEtapfiFy/BFy74N uUhf5qfjVlmQvZbIumHYPx+c10VZpRrBCDyZpXYL4IXux/qOQrbHJNatdMGxeAuACW5w BaJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=gwY+oa4CU+2jLrCTvWh4nbvrkKnM/pKWMZeBvxC7ZU0=; b=D6Qp8KMG51mPi+Acdsp2FBHlvgs2vE9ctKpFgvKL1I0sLh+AbwkaWzwZQOK8Gq+AWl E6XOmUXuqewx7FEdNmObLurjurtJUvioO1JK5VPg+dbcBKfDi+W/qJtKfCE3maUWPsmZ 3UfLdx6VzieBABLZWCCa/lYPb0GTTNZQxFK1KUdgIBvqFnbzTbnjfRrgcI8Ntmx9VvzW nZRU1J+uecNS7Jg8iZ7C2aNj9GMF5+Mk5vT7dFh6mLAKg1mwJQCnk49+2YLV8n1IoNk8 Vdgo/3fcZ0jAauWRltSYXHK+jKjQb+x6Zmaq0efWwNxYAVAUra6h3BE3RrXwf6BdRl+h DSPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UnAYvApE; 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 k3si973449pls.146.2019.06.25.12.23.15; Tue, 25 Jun 2019 12:23:31 -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=UnAYvApE; 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 S1728865AbfFYQ0r (ORCPT + 99 others); Tue, 25 Jun 2019 12:26:47 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:42925 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726740AbfFYQ0q (ORCPT ); Tue, 25 Jun 2019 12:26:46 -0400 Received: by mail-io1-f68.google.com with SMTP id u19so517730ior.9 for ; Tue, 25 Jun 2019 09:26:45 -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; bh=gwY+oa4CU+2jLrCTvWh4nbvrkKnM/pKWMZeBvxC7ZU0=; b=UnAYvApESHYhIZR/6fC9tpaOr5kt+ZnKyBE9mrQhqGpqI2byLeJRHdhAOAAgquPl1T HbDW11YvB3zM5qCXzEXKmtW4ZCBN6EK+1UjFx+KwSt8v0elkLfQ0eK3KSju0odSDKVlW bKPaxgduKYKyR8eFnQWp8Tn2593l1UvURVSt8= 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; bh=gwY+oa4CU+2jLrCTvWh4nbvrkKnM/pKWMZeBvxC7ZU0=; b=QREq/6XVhFvjyGfOVOqr6lDOYUmENwcuUPylWzZ04BCVqT8dLRPw0tpW/GOzVuzA5S 7UMdvnP8/q7xR9MELHHLTX67qy8U8cCLzLUmDbIN9/ITvJ4Ye487NNnnWB2s0Jw3vSAY aAS2U+zpYdUhETGnR4tFlyOtLCG3HZ8bQ7AdKZzALHIoQhzIQR5WiAynS8GeHq3WTakE 43o+Lu1Gl/M2KL3MRHAkedUBkscPpiRIEQzBOPaTpu+qtdtnEfgTCWPaFImDdNdSqrKp nDx5KdsKstSCA3JXbCZIABXE+X07J7zIvxofuJhGlefn1nCeisMWpEk6eFB0lj8CQ+7+ txTA== X-Gm-Message-State: APjAAAXQFcE49+XMZ/+OX9dr235j2TZHa3OU6K1B0rsZ1+HDgRqBFnUL 7CIohqq8XVciarJaNQeJqipnvfwlOdM= X-Received: by 2002:a02:cb4b:: with SMTP id k11mr50003483jap.109.1561480005354; Tue, 25 Jun 2019 09:26:45 -0700 (PDT) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com. [209.85.166.52]) by smtp.gmail.com with ESMTPSA id y20sm16466583iol.34.2019.06.25.09.26.43 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jun 2019 09:26:43 -0700 (PDT) Received: by mail-io1-f52.google.com with SMTP id u13so1129723iop.0 for ; Tue, 25 Jun 2019 09:26:43 -0700 (PDT) X-Received: by 2002:a6b:5103:: with SMTP id f3mr7084335iob.142.1561480003100; Tue, 25 Jun 2019 09:26:43 -0700 (PDT) MIME-Version: 1.0 References: <20190619210718.134951-1-dianders@chromium.org> In-Reply-To: From: Doug Anderson Date: Tue, 25 Jun 2019 09:26:28 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] drm/bridge/synopsys: dw-hdmi: Handle audio for more clock rates To: Andrzej Hajda Cc: Laurent Pinchart , Sean Paul , Jernej Skrabec , =?UTF-8?Q?Heiko_St=C3=BCbner?= , Jonas Karlman , Maxime Ripard , Neil Armstrong , "open list:ARM/Rockchip SoC..." , Dylan Reid , Cheng-Yi Chiang , Jerome Brunet , Sam Ravnborg , dri-devel , LKML , David Airlie , Daniel Vetter Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Jun 25, 2019 at 9:07 AM Andrzej Hajda wrote: > > On 19.06.2019 23:07, Douglas Anderson wrote: > > 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 pick a more ideal value. > > > Why? I ask because it is against recommendation from HDMI specs. The place where it does matter (and why I originally did this work) is when you don't have auto-CTS. In such a case you really need "N" and "CTS" to make the math work and both be integral. This makes sure that you don't slowly accumulate offsets. I'm hoping that this point should be non-controversial so I won't argue it more. I am an admitted non-expert, but I have a feeling that with Auto-CTS either the old number or the new numbers would produce pretty much the same experience. AKA: anyone using auto-CTS won't notice any change at all. I guess the question is: with Auto-CTS should you pick the "ideal" 6272 or a value that allows CTS to be the closest to integral as possible. By reading between the lines of the spec, I decided that it was slightly more important to allow for an integral CTS. If achieving an integral CTS wasn't a goal then the spec wouldn't even have listed special cases for any of the clock rates. We would just be using the ideal N and Auto-CTS and be done with it. The whole point of the tables they list is to make CTS integral. > > 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. > > > > NOTES: > > - 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. > > - This patch makes much less of a difference after the patch > > ("drm/bridge: dw-hdmi: Use automatic CTS generation mode when using > > non-AHB audio"), at least if you're using I2S audio. The main goal > > of picking a good N is to make it possible to get a nice integral > > CTS value, but if CTS is automatic then that's much less critical. > > > As I said above HDMI recommendations are different from those from your > patch. Please elaborate why? > > Btw I've seen your old patches introducing recommended N/CTS calculation > helpers in HDMI framework, unfortunately abandoned due to lack of interest. > > Maybe resurrecting them would be a good idea, with assumption there will > be users :) I have old patches introducing this into the HDMI framework? I don't remember them / can't find them. Can you provide a pointer? -Doug