<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Could also use do_div.  Either way:</p>
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</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 Nicholas Kazlauskas <nicholas.kazlauskas@amd.com><br>
<b>Sent:</b> Wednesday, December 19, 2018 9:12:09 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Li, Sun peng (Leo); Wentland, Harry; Kazlauskas, Nicholas<br>
<b>Subject:</b> [PATCH] drm/amd/display: Use div_u64 for flip timestamp ns to ms</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Resolves __udivdi3 missing errors when building for i386.<br>
<br>
Fixes: 6378ef012ddc ("drm/amd/display: Add below the range support for FreeSync")<br>
<br>
Change-Id: I4ded5790160054e6908367f20a63257225517714<br>
Cc: Leo Li <sunpeng.li@amd.com><br>
Cc: Harry Wentland <harry.wentland@amd.com><br>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com><br>
---<br>
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++++-<br>
 1 file changed, 4 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
index e16e62139ec3..920649332055 100644<br>
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
@@ -4550,6 +4550,7 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc,<br>
                               struct dc_state *state)<br>
 {<br>
         unsigned long flags;<br>
+       uint64_t timestamp_ns;<br>
         uint32_t target_vblank;<br>
         int r, vpos, hpos;<br>
         struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);<br>
@@ -4612,7 +4613,9 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc,<br>
         addr.address.grph.addr.low_part = lower_32_bits(afb->address);<br>
         addr.address.grph.addr.high_part = upper_32_bits(afb->address);<br>
         addr.flip_immediate = async_flip;<br>
-       addr.flip_timestamp_in_us = ktime_get_ns() / 1000;<br>
+<br>
+       timestamp_ns = ktime_get_ns();<br>
+       addr.flip_timestamp_in_us = div_u64(timestamp_ns, 1000);<br>
 <br>
 <br>
         if (acrtc->base.state->event)<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>