On Tue, Nov 02, 2021 at 03:59:33PM +0100, Maxime Ripard wrote: > --- a/include/drm/drm_modes.h > +++ b/include/drm/drm_modes.h > @@ -424,6 +424,21 @@ static inline bool drm_mode_is_stereo(const struct drm_display_mode *mode) > return mode->flags & DRM_MODE_FLAG_3D_MASK; > } > > +/** > + * drm_mode_hdmi_requires_scrambling - Checks if a mode requires HDMI Scrambling > + * @mode: DRM display mode > + * > + * Checks if a given display mode requires the scrambling to be enabled. > + * > + * Returns: > + * A boolean stating whether it's required or not. > + */ > +static inline bool > +drm_mode_hdmi_requires_scrambling(const struct drm_display_mode *mode) > +{ > + return mode->clock > DRM_HDMI_14_MAX_TMDS_CLK_KHZ; > +} That's only correct for 8bpc. The actual limit is on the TMDS clock (or rather TMDS character rate as HDMI 2.0 calls it due to the 1/1 vs. 1/4 magic for the actually transmitted TMDS clock). -- Ville Syrjälä Intel