Skip to content
Commit 111f4c33 authored by Jonathan Liu's avatar Jonathan Liu Committed by Maxime Ripard
Browse files

drm/sun4i: hdmi: Check for unset best_parent in sun4i_tmds_determine_rate



It is possible that if there is no exact rate match and
"rounded = clk_hw_round_rate(parent, ideal)" gives high enough values
(e.g. if rounded is 2 * ideal) that the condition
"abs(rate - rounded / i) < abs(rate - best_parent / best_div)" is never
met and best_parent is never set. This results in req->rate and
req->best_parent_rate being assigned 0.

To avoid this, we set best_parent to the first calculated rate if it is
unset. The sun4i_tmds_calc_divider function already has a similar check.

Fixes: 9c568101 ("drm/sun4i: Add HDMI support")
Signed-off-by: default avatarJonathan Liu <net147@gmail.com>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180109020323.11852-2-net147@gmail.com
parent b0bb2224
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment