Commit f2c9df10 authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/i915: Round TMDS clock to nearest



Use round-to-nearest behavour when calculating the TMDS clock.
Matches what we do for most other clock related things.

Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220907091057.11572-18-ville.syrjala@linux.intel.com
parent c46af562
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4505,7 +4505,8 @@ int intel_crtc_dotclock(const struct intel_crtc_state *pipe_config)
		dotclock = intel_dotclock_calculate(pipe_config->port_clock,
						    &pipe_config->dp_m_n);
	else if (pipe_config->has_hdmi_sink && pipe_config->pipe_bpp > 24)
		dotclock = pipe_config->port_clock * 24 / pipe_config->pipe_bpp;
		dotclock = DIV_ROUND_CLOSEST(pipe_config->port_clock * 24,
					     pipe_config->pipe_bpp);
	else
		dotclock = pipe_config->port_clock;

+1 −1
Original line number Diff line number Diff line
@@ -1892,7 +1892,7 @@ int intel_hdmi_tmds_clock(int clock, int bpc, bool ycbcr420_output)
	 *  1.5x for 12bpc
	 *  1.25x for 10bpc
	 */
	return clock * bpc / 8;
	return DIV_ROUND_CLOSEST(clock * bpc, 8);
}

static bool intel_hdmi_source_bpc_possible(struct drm_i915_private *i915, int bpc)