Skip to contentSkip to conversation

include/drm/drm_fixed.h:159: undefined reference to `__aeabi_uldivmod'

PATCH Lazare, Jordan 1 participant 1 message Feb 4, 2016 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 201602042139.QGVt3N0M%[email protected]

A message that is not in the archive (sent off-list or not yet received): BY1PR12MB040849664CD1FE77DAC560798CD10@BY1PR12MB0408.namprd12.prod.outlook.com

Lazare, Jordan

author Reviewed-by Harry Wentland Reviewed-by Alex Deucher
#2 lore raw

Hi Dave,

I have a small fix to the following patch in the drm-fixes-mst branch to resolve a 32-bit compile error. I've attached the patch separately and also squashed it into the previous change.

Thanks,
Jordan

commit 6d3d3d07381401ac6b89dfd429002c9d6ffda5e3

Author: Harry Wentland <[email protected]>
Date:   Fri Jan 22 17:07:25 2016 -0500

drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil

-----Original Message-----
From: Wentland, Harry
Sent: Thursday, February 04, 2016 11:40 AM
To: Lazare, Jordan
Subject: FW: [drm:drm-fixes-mst 5/9] include/drm/drm_fixed.h:159: undefined reference to `__aeabi_uldivmod'

-----Original Message-----
From: kbuild test robot [mailto:[email protected]]
Sent: February 4, 2016 8:34 AM
To: Wentland, Harry <[email protected]>
Cc: [email protected]; Dave Airlie <[email protected]>; Deucher, Alexander <[email protected]>
Subject: [drm:drm-fixes-mst 5/9] include/drm/drm_fixed.h:159: undefined reference to `__aeabi_uldivmod'

tree:   git://people.freedesktop.org/~airlied/linux.git drm-fixes-mst
head:   18ddcd63d22663841b8f61ee52733736bf3a4c7e
commit: 275e06c063ea920c4b89ee293b1975080f887b00 [5/9] drm/dp/mst: Calculate MST PBN with 31.32 fixed point
config: arm-exynos_defconfig (attached as .config)

reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
git checkout 275e06c063ea920c4b89ee293b1975080f887b00
# save the attached .config to linux build tree
make.cross ARCH=arm

All errors (new ones prefixed by >>):

drivers/built-in.o: In function `drm_fixp_from_fraction':

Quoted 1 line
Quoted 1 line

include/drm/drm_fixed.h:159: undefined reference to `__aeabi_uldivmod'

include/drm/drm_fixed.h:160: undefined reference to `__aeabi_uldivmod'

vim +159 include/drm/drm_fixed.h

210a0b9e Alex Deucher   2013-03-22  143  	if (shift > DRM_FIXED_POINT)
210a0b9e Alex Deucher   2013-03-22  144  		return result >> (shift - DRM_FIXED_POINT);
210a0b9e Alex Deucher   2013-03-22  145  
210a0b9e Alex Deucher   2013-03-22  146  	return result;
210a0b9e Alex Deucher   2013-03-22  147  }
210a0b9e Alex Deucher   2013-03-22  148  
6d3d3d07 Harry Wentland 2016-01-22  149  static inline s64 drm_fixp_from_fraction(s64 a, s64 b)
6d3d3d07 Harry Wentland 2016-01-22  150  {
6d3d3d07 Harry Wentland 2016-01-22  151  	s64 res;
6d3d3d07 Harry Wentland 2016-01-22  152  	bool a_neg = a < 0;
6d3d3d07 Harry Wentland 2016-01-22  153  	bool b_neg = b < 0;
6d3d3d07 Harry Wentland 2016-01-22  154  	u64 a_abs = a_neg ? -a : a;
6d3d3d07 Harry Wentland 2016-01-22  155  	u64 b_abs = b_neg ? -b : b;
6d3d3d07 Harry Wentland 2016-01-22  156  	u64 rem;
6d3d3d07 Harry Wentland 2016-01-22  157  
6d3d3d07 Harry Wentland 2016-01-22  158  	/* determine integer part */
6d3d3d07 Harry Wentland 2016-01-22 @159  	u64 res_abs = a_abs / b_abs;
6d3d3d07 Harry Wentland 2016-01-22  160  	rem = a_abs % b_abs;
6d3d3d07 Harry Wentland 2016-01-22  161  
6d3d3d07 Harry Wentland 2016-01-22  162  	/* determine fractional part */
6d3d3d07 Harry Wentland 2016-01-22  163  	{
6d3d3d07 Harry Wentland 2016-01-22  164  		u32 i = DRM_FIXED_POINT;
6d3d3d07 Harry Wentland 2016-01-22  165  
6d3d3d07 Harry Wentland 2016-01-22  166  		do {
6d3d3d07 Harry Wentland 2016-01-22  167  			rem <<= 1;

:::::: The code at line 159 was first introduced by commit
:::::: 6d3d3d07381401ac6b89dfd429002c9d6ffda5e3 drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil

:::::: TO: Harry Wentland <[email protected]> :::::: CC: Dave Airlie <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

From 3265ce5f823fafd795437aa3be68375855d25dcb Mon Sep 17 00:00:00 2001
From: Jordan Lazare <[email protected]>
Date: Thu, 4 Feb 2016 14:19:18 -0500
Subject: [PATCH] drm/dp/mst: Fix 32 bit fixed point division calculations

64 bit division was broken on 32 bit systems after fixed point calculation changes. This patch uses the proper div64_u64_rem function.

---
 include/drm/drm_fixed.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/drm/drm_fixed.h +1 -2
index 16e725c..553210c 100644
@@ -156,8 +156,7 @@ static inline s64 drm_fixp_from_fraction(s64 a, s64 b)
 	u64 rem;
 
 	/* determine integer part */
-	u64 res_abs = a_abs / b_abs;
-	rem = a_abs % b_abs;
+	u64 res_abs  = div64_u64_rem(a_abs, b_abs, &rem);
 
 	/* determine fractional part */
 	{
Signature · 1 line
1.9.1

From 6bb9296a52c3e1e839edca752f6c3d81243f9e4c Mon Sep 17 00:00:00 2001
From: Harry Wentland <[email protected]>
Date: Fri, 22 Jan 2016 17:07:25 -0500
Subject: [PATCH] drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil

drm_fixp_from_fraction allows us to create a fixed point directly from a fraction, rather than creating fixed point values and dividing later. This avoids overflow of our 64 bit value for large numbers.

drm_fixp2int_ceil allows us to return the ceiling of our fixed point value.

---
 include/drm/drm_fixed.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 51 insertions(+), 2 deletions(-)
include/drm/drm_fixed.h +51 -2

75 lines not on this page · raw message

Signature · 1 line
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel