Skip to content

Commit

Permalink
Merge tag 'drm-misc-fixes-2018-01-17' of git://anongit.freedesktop.or…
Browse files Browse the repository at this point in the history
…g/drm/drm-misc into drm-fixes

Final 4.15 drm-misc pull:

Just 3 sun4i patches to fix clock computation/checks.

* tag 'drm-misc-fixes-2018-01-17' of git://anongit.freedesktop.org/drm/drm-misc:
  drm/sun4i: hdmi: Add missing rate halving check in sun4i_tmds_determine_rate
  drm/sun4i: hdmi: Fix incorrect assignment in sun4i_tmds_determine_rate
  drm/sun4i: hdmi: Check for unset best_parent in sun4i_tmds_determine_rate
  • Loading branch information
Dave Airlie committed Jan 18, 2018
2 parents 894219d + 3b9c57c commit 75f195f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c
Original file line number Diff line number Diff line change
@@ -102,10 +102,13 @@ static int sun4i_tmds_determine_rate(struct clk_hw *hw,
goto out;
}

if (abs(rate - rounded / i) <
abs(rate - best_parent / best_div)) {
if (!best_parent ||
abs(rate - rounded / i / j) <
abs(rate - best_parent / best_half /
best_div)) {
best_parent = rounded;
best_div = i;
best_half = i;
best_div = j;
}
}
}

0 comments on commit 75f195f

Please sign in to comment.