diff options
author | Christian König <christian.koenig@amd.com> | 2019-05-06 13:57:52 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-05-09 18:46:56 -0400 |
commit | 2e26ccb119bde03584be53406bbd22e711b0d6e6 (patch) | |
tree | 47f2e625ddffe57f47b0653e3a6a5b4833e7e46c | |
parent | db8a974f7e6966d73b4e6afa673c5b8bc31a111e (diff) |
drm/radeon: prefer lower reference dividers
Instead of the closest reference divider prefer the lowest,
this fixes flickering issues on HP Compaq nx9420.
Bugs: https://bugs.freedesktop.org/show_bug.cgi?id=108514
Suggested-by: Paul Dufresne <dufresnep@gmail.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_display.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index aa898c699101..433df7036f96 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -922,12 +922,12 @@ static void avivo_get_fb_ref_div(unsigned nom, unsigned den, unsigned post_div, | |||
922 | ref_div_max = max(min(100 / post_div, ref_div_max), 1u); | 922 | ref_div_max = max(min(100 / post_div, ref_div_max), 1u); |
923 | 923 | ||
924 | /* get matching reference and feedback divider */ | 924 | /* get matching reference and feedback divider */ |
925 | *ref_div = min(max(DIV_ROUND_CLOSEST(den, post_div), 1u), ref_div_max); | 925 | *ref_div = min(max(den/post_div, 1u), ref_div_max); |
926 | *fb_div = DIV_ROUND_CLOSEST(nom * *ref_div * post_div, den); | 926 | *fb_div = DIV_ROUND_CLOSEST(nom * *ref_div * post_div, den); |
927 | 927 | ||
928 | /* limit fb divider to its maximum */ | 928 | /* limit fb divider to its maximum */ |
929 | if (*fb_div > fb_div_max) { | 929 | if (*fb_div > fb_div_max) { |
930 | *ref_div = DIV_ROUND_CLOSEST(*ref_div * fb_div_max, *fb_div); | 930 | *ref_div = (*ref_div * fb_div_max)/(*fb_div); |
931 | *fb_div = fb_div_max; | 931 | *fb_div = fb_div_max; |
932 | } | 932 | } |
933 | } | 933 | } |