2009-07-01 14:21:40

by Andy Whitcroft

[permalink] [raw]
Subject: [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.

Signed-off-by: Andy Whitcroft <[email protected]>
---
drivers/gpu/drm/i915/intel_display.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 73e7b9c..9f79de3 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -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);

--
1.6.3.rc3.199.g24398


2009-07-01 16:13:04

by Jesse Barnes

[permalink] [raw]
Subject: Re: [PATCH 1/1] i915: fix up a raw 64bit divide

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.
>
> Signed-off-by: Andy Whitcroft <[email protected]>

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

Acked-by: Jesse Barnes <[email protected]>

--
Jesse Barnes, Intel Open Source Technology Center

2009-07-01 16:32:41

by Andy Whitcroft

[permalink] [raw]
Subject: Re: [PATCH 1/1] i915: fix up a raw 64bit divide

On Wed, Jul 01, 2009 at 09:12:55AM -0700, Jesse Barnes wrote:
> 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.
> >
> > Signed-off-by: Andy Whitcroft <[email protected]>
>
> 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.

> Acked-by: Jesse Barnes <[email protected]>

Thanks.

-apw

2009-07-02 00:59:53

by Zhenyu Wang

[permalink] [raw]
Subject: Re: [PATCH 1/1] i915: fix up a raw 64bit divide

On 2009.07.01 09:12:55 -0700, Jesse Barnes wrote:
> 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.
> >
> > Signed-off-by: Andy Whitcroft <[email protected]>
>
> I think building with newer GCCs will prevent this error, but the fix
> looks fine.
>
> Acked-by: Jesse Barnes <[email protected]>
>

yeah, sorry I didn't catch that.

Acked-by: Zhenyu Wang <[email protected]>

--
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827


Attachments:
(No filename) (814.00 B)
signature.asc (197.00 B)
Digital signature
Download all attachments

2009-07-05 10:19:08

by Sergio Luis

[permalink] [raw]
Subject: Re: [PATCH 1/1] i915: fix up a raw 64bit divide

On Wed, Jul 1, 2009 at 1:12 PM, Jesse Barnes<[email protected]> wrote:
> 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.
>>
>> Signed-off-by: Andy Whitcroft <[email protected]>
>
> 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.

>
> Acked-by: Jesse Barnes <[email protected]>
>
> --
> Jesse Barnes, Intel Open Source Technology Center
> --