Skip to contentSkip to conversation

i915: fix up a raw 64bit divide

PATCH In review Andy Whitcroft 4 participants 5 messages Jul 1, 2009 – Jul 5, 2009

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

PATCH 1/1 i915: fix up a raw 64bit divide

We are seeing compilation failures on i386 in some environments due to an undefined reference as below:

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

This is generated due to a raw 64 bit divide in the i915 driver. Fix up this raw divide.

---
 drivers/gpu/drm/i915/intel_display.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
index 73e7b9c..9f79de3 100644
@@ -1574,7 +1574,7 @@ igdng_compute_m_n(int bytes_per_pixel, int nlanes,
 
 	temp = (u64) DATA_N * pixel_clock;
 	temp = div_u64(temp, link_clock);
-	m_n->gmch_m = (temp * bytes_per_pixel) / nlanes;
+	m_n->gmch_m = div_u64(temp * bytes_per_pixel, nlanes);
 	m_n->gmch_n = DATA_N;
 	fdi_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n);
 
Signature · 1 line
1.6.3.rc3.199.g24398
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Wed, 1 Jul 2009 15:20:59 +0100 Andy Whitcroft <[email protected]> wrote:

We are seeing compilation failures on i386 in some environments due to an undefined reference as below:

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

This is generated due to a raw 64 bit divide in the i915 driver. Fix up this raw divide.

I think building with newer GCCs will prevent this error, but the fix looks fine.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#2 lore raw
Quoted 8 lines · Jesse Barnes
Quoted 5 lines · On Wed, 1 Jul 2009 15:20:59 +0100 Andy Whitcroft <[email protected]> wrote:

We are seeing compilation failures on i386 in some environments due to an undefined reference as below:

    ERROR: "__udivdi3" [drivers/gpu/drm/i915/i915.ko] undefined!
Quoted 7 lines
Quoted 4 lines

This is generated due to a raw 64 bit divide in the i915 driver. Fix up this raw divide.

I think building with newer GCCs will prevent this error, but the fix looks fine.

Yeah I suspect gcc interactions here, as builds on older userspace were failing in this way but not so in the very latest karmic userspace. I suspect its still correct to avoid these currently.

Quoted 1 line

Thanks.

-apw

Acked-by
#3 lore raw
In reply to Jesse Barnes
Quoted 11 lines · Jesse Barnes
Quoted 8 lines · On Wed, 1 Jul 2009 15:20:59 +0100 Andy Whitcroft <[email protected]> wrote:

We are seeing compilation failures on i386 in some environments due to an undefined reference as below:

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

This is generated due to a raw 64 bit divide in the i915 driver. Fix up this raw divide.

Quoted 7 lines
Quoted 1 line

I think building with newer GCCs will prevent this error, but the fix looks fine.

yeah, sorry I didn't catch that.

Signature · 3 lines
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
#4 lore raw
In reply to Jesse Barnes
Quoted 8 lines · Jesse Barnes
Quoted 5 lines · On Wed,  1 Jul 2009 15:20:59 +0100 Andy Whitcroft <[email protected]> wrote:

We are seeing compilation failures on i386 in some environments due to an undefined reference as below:

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

Quoted 7 lines
Quoted 4 lines

This is generated due to a raw 64 bit divide in the i915 driver.  Fix up this raw divide.

I think building with newer GCCs will prevent this error, but the fix looks fine.

I get it in here (31-rc2), with gcc 4.2.4, but only if I have CONFIG_DEBUG_SECTION_MISMATCH=y. With this patch it works regardless of that option.

Quoted 6 lines

--
Jesse Barnes, Intel Open Source Technology Center
--