Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4024077ybi; Tue, 18 Jun 2019 10:23:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWzKl27LJDY1N7763ifppA6D/EBGlWTEDoCE1g2+ngA3dHD5uy02irCLiSKG9UwUf6TaFw X-Received: by 2002:a17:90a:21ac:: with SMTP id q41mr6446161pjc.31.1560878635387; Tue, 18 Jun 2019 10:23:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560878635; cv=none; d=google.com; s=arc-20160816; b=my8ZOl7YUh+SSl8UymVZhMcNKUEKW1P8vlJ8BGGzCGcynYHRtCjaeiBhMYvBP3ycZ1 IU6DBOFQj4d1zaA6m7lUUgsz91EcCcbUUS7oGyXy5uNmRlF2a/o1Y6O+SDtqTw5qIwDK CO0rJsJs1BATXzeF+QXvVO7ShAddHviVq8BDHYxIesken3fOl1LtPx8k4Q17YI3ryOaU PUbS310L3+PjHs02+QDIc4oX0Gp0donbawdqBP+wT+Dz1Xgh8P4UmjhMQa5JmTfext9T ZJfZibrEx2tbQADgXXbbwmyx/se0WN9bTRsjoNgU+H3QJGmuLvWJTRa3iUGr+igaE/lz e+HQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=jvQ9Zl2mKwyA/02IHCYxHPYvDp7xjFKbyI3uM1I1KWk=; b=hW4/H94P8zxOLqBnA4JJz45hX7WsS6tg4zwllKY4G7VdFS9S0tpnwE2xEWVzoa6nf+ Iq4tcYf6WbFVB92k20dc7jgT9yYjFW7mg0LpGtx67F7PACPo6PADQXceUo9mnZxwwxRk Cg9Cse/j6yh9m2HBIQEw3mtkhq2aUSo7iDa0x4vyknr+LavHUmGCy94AlWaWyyshfRTE GoBzMVxZFIKfIcK5UZu6YU/O0PYcTYUzLh9H/wB+PQogjkJHKYuZCAMtAAWW+XFSY1t9 bdwkx+2cwry0X69tBEjhn52eHbYZo4Cp6UiqGUH2Fd4iWMLiKtEs8L9WGp4SjeSxFXLn rJCg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=siol.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf7si12510381plb.216.2019.06.18.10.23.39; Tue, 18 Jun 2019 10:23:55 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=siol.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729856AbfFRRX0 (ORCPT + 99 others); Tue, 18 Jun 2019 13:23:26 -0400 Received: from mailoutvs37.siol.net ([185.57.226.228]:57499 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729325AbfFRRXZ (ORCPT ); Tue, 18 Jun 2019 13:23:25 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTP id 1EA4E5203EB; Tue, 18 Jun 2019 19:23:22 +0200 (CEST) X-Virus-Scanned: amavisd-new at psrvmta12.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta12.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id SvDg82OCXHri; Tue, 18 Jun 2019 19:23:21 +0200 (CEST) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTPS id A4E9F5223EF; Tue, 18 Jun 2019 19:23:21 +0200 (CEST) Received: from jernej-laptop.localnet (cpe-86-58-52-202.static.triera.net [86.58.52.202]) (Authenticated sender: jernej.skrabec@siol.net) by mail.siol.net (Zimbra) with ESMTPA id 76FF65203EB; Tue, 18 Jun 2019 19:23:18 +0200 (CEST) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Douglas Anderson Cc: Andrzej Hajda , Laurent Pinchart , seanpaul@chromium.org, heiko@sntech.de, jonas@kwiboo.se, linux-rockchip@lists.infradead.org, narmstrong@baylibre.com, dgreid@chromium.org, cychiang@chromium.org, David Airlie , Zheng Yang , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Daniel Vetter Subject: Re: [PATCH] drm/bridge/synopsys: dw-hdmi: Handle audio for more clock rates Date: Tue, 18 Jun 2019 19:23:18 +0200 Message-ID: <6219398.I55JWXAmVF@jernej-laptop> In-Reply-To: <20190617235558.64571-1-dianders@chromium.org> References: <20190617235558.64571-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, which 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 well tested on multiple SoCs from Allwinner, Amlogic and Rockchip. Best regards, Jernej