On Tue, 19 May 2026, Javier Martinez Canillas <[email protected]> wrote:
> Several DRM drivers already define their own constants for minimum and
> maximum TMDS character rates.
>
> By defining common rate constants in a shared header, drivers can just use
> them instead of having driver local define macros or use magic numbers.
>
> The values defined in the <drm/display/drm_hdmi_helper.h> header correspond
> to maximum TMDS character rates defined by each HDMI specification version:
>
>   - DRM_HDMI_TMDS_CHAR_RATE_MIN:    25 MHz (minimum for all versions)
>   - DRM_HDMI_TMDS_CHAR_RATE_MAX_1_0: 165 MHz (HDMI 1.0 maximum)
>   - DRM_HDMI_TMDS_CHAR_RATE_MAX_1_3: 340 MHz (HDMI 1.3 maximum)
>   - DRM_HDMI_TMDS_CHAR_RATE_MAX_2_0: 600 MHz (HDMI 2.0 maximum)
>
> Suggested-by: Maxime Ripard <[email protected]>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---
>
>  include/drm/display/drm_hdmi_helper.h | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/include/drm/display/drm_hdmi_helper.h 
> b/include/drm/display/drm_hdmi_helper.h
> index 9c31ed90516b..0ee246ff82e0 100644
> --- a/include/drm/display/drm_hdmi_helper.h
> +++ b/include/drm/display/drm_hdmi_helper.h
> @@ -5,6 +5,12 @@
>  
>  #include <linux/hdmi.h>
>  
> +/* 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.

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.

BR,
Jani.

> +
>  struct drm_connector;
>  struct drm_connector_state;
>  struct drm_display_mode;

-- 
Jani Nikula, Intel

Reply via email to