<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Monday, May 6, 2019 2:01 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org; dufresnep@gmail.com; werner.lueckel@googlemail.com<br>
<b>Subject:</b> [PATCH] drm/radeon: prefer lower reference dividers</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[CAUTION: External Email]<br>
<br>
Instead of the closest reference divider prefer the lowest,<br>
this fixes flickering issues on HP Compaq nx9420.<br>
<br>
Bugs: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=108514">https://bugs.freedesktop.org/show_bug.cgi?id=108514</a><br>
Suggested-by: Paul Dufresne <dufresnep@gmail.com><br>
Signed-off-by: Christian König <christian.koenig@amd.com><br>
---<br>
drivers/gpu/drm/radeon/radeon_display.c | 4 ++--<br>
1 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c<br>
index 9d3ac8b981da..d8e2d7b3b836 100644<br>
--- a/drivers/gpu/drm/radeon/radeon_display.c<br>
+++ b/drivers/gpu/drm/radeon/radeon_display.c<br>
@@ -921,12 +921,12 @@ static void avivo_get_fb_ref_div(unsigned nom, unsigned den, unsigned post_div,<br>
ref_div_max = max(min(100 / post_div, ref_div_max), 1u);<br>
<br>
/* get matching reference and feedback divider */<br>
- *ref_div = min(max(DIV_ROUND_CLOSEST(den, post_div), 1u), ref_div_max);<br>
+ *ref_div = min(max(den/post_div, 1u), ref_div_max);<br>
*fb_div = DIV_ROUND_CLOSEST(nom * *ref_div * post_div, den);<br>
<br>
/* limit fb divider to its maximum */<br>
if (*fb_div > fb_div_max) {<br>
- *ref_div = DIV_ROUND_CLOSEST(*ref_div * fb_div_max, *fb_div);<br>
+ *ref_div = (*ref_div * fb_div_max)/(*fb_div);<br>
*fb_div = fb_div_max;<br>
}<br>
}<br>
--<br>
2.17.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>