mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: "Jernej Škrabec" <jernej.skrabec@siol.net>,
	"Douglas Anderson" <dianders@chromium.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	seanpaul@chromium.org, heiko@sntech.de, jonas@kwiboo.se,
	linux-rockchip@lists.infradead.org, dgreid@chromium.org,
	cychiang@chromium.org, David Airlie <airlied@linux.ie>,
	Zheng Yang <zhengyang@rock-chips.com>,
	Sam Ravnborg <sam@ravnborg.org>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [PATCH] drm/bridge/synopsys: dw-hdmi: Handle audio for more clock rates
Date: Wed, 19 Jun 2019 17:22:56 +0200	[thread overview]
Message-ID: <9bba43cb-7070-8b2a-cfc6-f601fd22a315@baylibre.com> (raw)
In-Reply-To: <6219398.I55JWXAmVF@jernej-laptop>

On 18/06/2019 19:23, Jernej Škrabec 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 <dianders@chromium.org>
> 
> 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
> 
> 
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 calculation, it would be great !

Finally could you add the plat_data tmds table as a separate patch to simplify review ?

Thanks,
Neil

  reply	other threads:[~2019-06-19 15:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 23:55 Douglas Anderson
2019-06-18 17:23 ` Jernej Škrabec
2019-06-19 15:22   ` Neil Armstrong [this message]
2019-06-19 21:11     ` Doug Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9bba43cb-7070-8b2a-cfc6-f601fd22a315@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=cychiang@chromium.org \
    --cc=daniel@ffwll.ch \
    --cc=dgreid@chromium.org \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=jernej.skrabec@siol.net \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=sam@ravnborg.org \
    --cc=seanpaul@chromium.org \
    --cc=tglx@linutronix.de \
    --cc=zhengyang@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®