public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Maxime Ripard <mripard@kernel.org>
To: Javier Martinez Canillas <javierm@redhat.com>
Cc: Jani Nikula <jani.nikula@intel.com>,
	linux-kernel@vger.kernel.org, David Airlie <airlied@gmail.com>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Nicolas Frattaroli <nicolas.frattaroli@collabora.com>,
	Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/8] drm/display: hdmi: Add common TMDS character rate constants
Date: Wed, 20 May 2026 10:13:26 +0200	[thread overview]
Message-ID: <20260520-yellow-panther-of-dew-de32eb@penduick> (raw)
In-Reply-To: <875x4iy1em.fsf@ocarina.mail-host-address-is-not-set>

[-- Attachment #1: Type: text/plain, Size: 2386 bytes --]

On Wed, May 20, 2026 at 09:40:17AM +0200, Javier Martinez Canillas wrote:
> Jani Nikula <jani.nikula@intel.com> writes:
> 
> Hello Jani,
> 
> > On Tue, 19 May 2026, Javier Martinez Canillas <javierm@redhat.com> wrote:
> 
> [...]
> 
> >>  
> >> +/* HDMI spec TMDS character rate limits (in Hz) */
> >> +#define DRM_HDMI_TMDS_CHAR_RATE_MIN	25000000
> >> +#define DRM_HDMI_TMDS_CHAR_RATE_MAX_1_0	165000000
> >> +#define DRM_HDMI_TMDS_CHAR_RATE_MAX_1_3	340000000
> >> +#define DRM_HDMI_TMDS_CHAR_RATE_MAX_2_0	600000000
> >
> > Usually everything in DRM is in kHz, and Hz is the exception.
> >
> 
> That is correct but in this case these constants are to be used with the
> HDMI helpers. Both struct drm_connector_hdmi_state.tmds_char_rate and
> the struct drm_bridge_funcs.hdmi_tmds_char_rate_valid() callback expect
> the TMDS char rate to be defined in Hz.
> 
> If we define these in kHz, it means that drivers will have to * 1000 at
> every call site.

As long as the unit is obvious from the name, I think we'll be fine, and
we can even have both Hz and kHz defines if we want to.

> > I'm also not sure the 1_0, 1_3, and 2_0 really help anyone reading the
> > code. I won't remember what they mean in Hz or kHz, and I'll have to
> > look them up every single time.
> >
> 
> I discussed this with Maxime before posting the patches since I wondered
> the same. He suggested that the max TMDS character rate was linked to the
> HDMI spec versions and that it would be more readable to name it using
> the spec version rather than the resolution.

As usual, it's both the spec and hardware capabilities. But some like
the HDMI 1.3/1.4 max is used to know where to setup the scrambler for
example, and is used everywhere.

I still think it has value, but we don't have to force anyone to use
them either.

I'd prefer to use the DRM_HDMI_$SPEC_TMDS_CHAR_RATE_MAX_HZ though

> The other naming I suggested was:
> 
> /* HDMI spec TMDS character rate limits (in Hz) */
> #define DRM_HDMI_TMDS_CHAR_RATE_MIN		 25000000
> #define DRM_HDMI_TMDS_CHAR_RATE_74_25MHZ	 74250000
> #define DRM_HDMI_TMDS_CHAR_RATE_148_5MHZ	148500000
> #define DRM_HDMI_TMDS_CHAR_RATE_297MHZ		297000000
> #define DRM_HDMI_TMDS_CHAR_RATE_MAX_1_4		340000000

Honestly, I'm not sure if it's worth defining if we'll have the
frequency in the define name.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

  parent reply	other threads:[~2026-05-20  8:13 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19 14:46 [PATCH 0/8] drm/display: hdmi: Add common TMDS character rate constants Javier Martinez Canillas
2026-05-19 14:46 ` [PATCH 1/8] " Javier Martinez Canillas
2026-05-19 15:20   ` Jani Nikula
2026-05-20  7:40     ` Javier Martinez Canillas
2026-05-20  7:51       ` Jani Nikula
2026-05-20  8:13       ` Maxime Ripard [this message]
2026-05-20  8:36         ` Javier Martinez Canillas
2026-05-20  9:56   ` Dmitry Baryshkov
2026-05-20 12:17     ` Javier Martinez Canillas
2026-05-20 12:58   ` Heiko Stuebner
2026-05-25 12:44   ` Claude review: " Claude Code Review Bot
2026-05-19 14:46 ` [PATCH 2/8] drm/bridge: dw-hdmi: Use the common TMDS char rate constant Javier Martinez Canillas
2026-05-20 12:59   ` Heiko Stuebner
2026-05-20 13:32   ` Neil Armstrong
2026-05-25 12:44   ` Claude review: " Claude Code Review Bot
2026-05-19 14:46 ` [PATCH 3/8] drm/bridge: dw-hdmi-qp: " Javier Martinez Canillas
2026-05-20 13:33   ` Neil Armstrong
2026-05-25 12:44   ` Claude review: " Claude Code Review Bot
2026-05-19 14:47 ` [PATCH 4/8] drm/bridge: inno-hdmi: " Javier Martinez Canillas
2026-05-20 13:00   ` Heiko Stuebner
2026-05-25 12:44   ` Claude review: " Claude Code Review Bot
2026-05-19 14:47 ` [PATCH 5/8] drm/sti: hdmi: Use the common TMDS char rate constants Javier Martinez Canillas
2026-05-25 12:44   ` Claude review: " Claude Code Review Bot
2026-05-19 14:47 ` [PATCH 6/8] drm/sun4i: hdmi: Use the common TMDS char rate constant Javier Martinez Canillas
2026-05-19 14:57   ` Chen-Yu Tsai
2026-05-25 12:44   ` Claude review: " Claude Code Review Bot
2026-05-19 14:47 ` [PATCH 7/8] drm/msm/hdmi: Use the common TMDS char rate constants in 8996 PHY Javier Martinez Canillas
2026-05-20  9:51   ` Dmitry Baryshkov
2026-05-25 12:44   ` Claude review: " Claude Code Review Bot
2026-05-19 14:47 ` [PATCH 8/8] drm/msm/hdmi: Use the common TMDS char rate constants in 8998 PHY Javier Martinez Canillas
2026-05-20  9:51   ` Dmitry Baryshkov
2026-05-25 12:44   ` Claude review: " Claude Code Review Bot
2026-05-25 12:44 ` Claude review: drm/display: hdmi: Add common TMDS character rate constants Claude Code Review Bot

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=20260520-yellow-panther-of-dew-de32eb@penduick \
    --to=mripard@kernel.org \
    --cc=airlied@gmail.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=javierm@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.frattaroli@collabora.com \
    --cc=simona@ffwll.ch \
    /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