Skip to contentSkip to conversation

drm/amd/display: Use div_u64 for flip timestamp ns to ms

PATCH In review Nicholas Kazlauskas 2 participants 2 messages Dec 19, 2018 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Use div_u64 for flip timestamp ns to ms

Resolves __udivdi3 missing errors when building for i386.

Fixes 6378ef012ddc ("drm/amd/display: Add below the range support for FreeSync")
Change-Id I4ded5790160054e6908367f20a63257225517714
Cc Leo Li <[email protected]>
Cc Harry Wentland <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -1
index e16e62139ec3..920649332055 100644
@@ -4550,6 +4550,7 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc,
 			      struct dc_state *state)
 {
 	unsigned long flags;
+	uint64_t timestamp_ns;
 	uint32_t target_vblank;
 	int r, vpos, hpos;
 	struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
@@ -4612,7 +4613,9 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc,
 	addr.address.grph.addr.low_part = lower_32_bits(afb->address);
 	addr.address.grph.addr.high_part = upper_32_bits(afb->address);
 	addr.flip_immediate = async_flip;
-	addr.flip_timestamp_in_us = ktime_get_ns() / 1000;
+
+	timestamp_ns = ktime_get_ns();
+	addr.flip_timestamp_in_us = div_u64(timestamp_ns, 1000);
 
 
 	if (acrtc->base.state->event)
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20181219141209.6255-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

Could also use do_div. Either way:

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Nicholas Kazlauskas <[email protected]>
Sent: Wednesday, December 19, 2018 9:12:09 AM
To: [email protected]
Cc: Li, Sun peng (Leo); Wentland, Harry; Kazlauskas, Nicholas
Subject: [PATCH] drm/amd/display: Use div_u64 for flip timestamp ns to ms

Resolves __udivdi3 missing errors when building for i386.

Fixes 6378ef012ddc ("drm/amd/display: Add below the range support for FreeSync")
Change-Id I4ded5790160054e6908367f20a63257225517714
Cc Leo Li <[email protected]>
Cc Harry Wentland <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -1
index e16e62139ec3..920649332055 100644
@@ -4550,6 +4550,7 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc,
                               struct dc_state *state)
 {
         unsigned long flags;
+       uint64_t timestamp_ns;
         uint32_t target_vblank;
         int r, vpos, hpos;
         struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
@@ -4612,7 +4613,9 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc,
         addr.address.grph.addr.low_part = lower_32_bits(afb->address);
         addr.address.grph.addr.high_part = upper_32_bits(afb->address);
         addr.flip_immediate = async_flip;
-       addr.flip_timestamp_in_us = ktime_get_ns() / 1000;
+
+       timestamp_ns = ktime_get_ns();
+       addr.flip_timestamp_in_us = div_u64(timestamp_ns, 1000);
 
 
         if (acrtc->base.state->event)

--
2.17.1

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx