Skip to contentSkip to conversation

drm/amd/display: fix compiling error on 32-Bit Linux

PATCH Superseded Rex Zhu 2 participants 2 messages Apr 17, 2018 1 message not in the archive

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Rex Zhu

author
#0 lore raw

PATCH 1/1 drm/amd/display: fix compiling error on 32-Bit Linux

ERROR: "__udivdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!

---
 drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +3 -2
index 5e12e46..d1f57d0 100644
@@ -616,6 +616,7 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,
 	unsigned int refresh_range = 0;
 	unsigned int min_refresh_in_uhz = 0;
 	unsigned int max_refresh_in_uhz = 0;
+	unsigned long long tmp;
 
 	if (mod_freesync == NULL)
 		return;
@@ -646,8 +647,8 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,
 	 * calculated from pixel rate and vertical/horizontal totals, but
 	 * this should be allowed instead of blocking FreeSync.
 	 */
-	if ((min_refresh_in_uhz / 1000000) >
-			((nominal_field_rate_in_uhz + 1000000 - 1) / 1000000))
+	tmp = div_u64(nominal_field_rate_in_uhz + 1000000 - 1, 1000000);
+	if ((min_refresh_in_uhz / 1000000) > tmp)
 		nominal_field_rate_in_range = false;
 
 	// Full range may be larger than current video timing, so cap at nominal
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by
#2 lore raw
In reply to a message not in the archive

I think Harry sent out a similar patch a few days ago.

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Rex Zhu <[email protected]>
Sent: Tuesday, April 17, 2018 5:37:59 AM
To: [email protected]
Cc: Zhu, Rex
Subject: [PATCH] drm/amd/display: fix compiling error on 32-Bit Linux

ERROR: "__udivdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!

---
 drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +3 -2
index 5e12e46..d1f57d0 100644
@@ -616,6 +616,7 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,
         unsigned int refresh_range = 0;
         unsigned int min_refresh_in_uhz = 0;
         unsigned int max_refresh_in_uhz = 0;
+       unsigned long long tmp;
 
         if (mod_freesync == NULL)
                 return;
@@ -646,8 +647,8 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,
          * calculated from pixel rate and vertical/horizontal totals, but
          * this should be allowed instead of blocking FreeSync.
          */
-       if ((min_refresh_in_uhz / 1000000) >
-                       ((nominal_field_rate_in_uhz + 1000000 - 1) / 1000000))
+       tmp = div_u64(nominal_field_rate_in_uhz + 1000000 - 1, 1000000);
+       if ((min_refresh_in_uhz / 1000000) > tmp)
                 nominal_field_rate_in_range = false;
 
         // Full range may be larger than current video timing, so cap at nominal

--
1.9.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