2004-01-20 21:24:33

by Adrian Bunk

[permalink] [raw]
Subject: [2.6 patch] disallow DRM on 386

I got the following compile error in 2.6.1-mm5 with X86_CMPXCHG=n.
This problem is not specific to -mm, and it always occurs when you
include support for the 386 cpu (oposed to the 486 or later cpus) since
in this case X86_CMPXCHG=n and therefoore cmpxchg isn't defined in
include/asm-i386/system.h .

The patch below disallows DRM if X86_CMPXCHG=n.

Please apply
Adrian

--- linux-2.6.1-mm5/drivers/char/drm/Kconfig.old 2004-01-20 14:42:27.000000000 +0100
+++ linux-2.6.1-mm5/drivers/char/drm/Kconfig 2004-01-20 14:43:02.000000000 +0100
@@ -6,6 +6,7 @@
#
config DRM
bool "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)"
+ depends on !X86 || X86_CMPXCHG
help
Kernel-level support for the Direct Rendering Infrastructure (DRI)
introduced in XFree86 4.0. If you say Y here, you need to select


2004-01-20 22:46:48

by grundig

[permalink] [raw]
Subject: Re: [2.6 patch] disallow DRM on 386

El Tue, 20 Jan 2004 22:24:21 +0100 Adrian Bunk <[email protected]> escribi?:

> I got the following compile error in 2.6.1-mm5 with X86_CMPXCHG=n.
> This problem is not specific to -mm, and it always occurs when you
> include support for the 386 cpu (oposed to the 486 or later cpus) since
> in this case X86_CMPXCHG=n and therefoore cmpxchg isn't defined in
> include/asm-i386/system.h .
>
> The patch below disallows DRM if X86_CMPXCHG=n.

I got a "cmpxchg not defined" error when compiling the drm stuff in -mm5.
When I looked at the configuration, I saw that all the cpus types had been selected
(I didn't even realize of your stuuf and menuconfig put the defaults). I removed
all types of cpus except PIII and it compiled.

2004-01-20 23:03:33

by Adrian Bunk

[permalink] [raw]
Subject: Re: [2.6 patch] disallow DRM on 386

On Tue, Jan 20, 2004 at 11:44:03PM +0100, Diego Calleja wrote:
> El Tue, 20 Jan 2004 22:24:21 +0100 Adrian Bunk <[email protected]> escribi?:
>
> > I got the following compile error in 2.6.1-mm5 with X86_CMPXCHG=n.
> > This problem is not specific to -mm, and it always occurs when you
> > include support for the 386 cpu (oposed to the 486 or later cpus) since
> > in this case X86_CMPXCHG=n and therefoore cmpxchg isn't defined in
> > include/asm-i386/system.h .
> >
> > The patch below disallows DRM if X86_CMPXCHG=n.
>
> I got a "cmpxchg not defined" error when compiling the drm stuff in -mm5.
> When I looked at the configuration, I saw that all the cpus types had been selected
> (I didn't even realize of your stuuf and menuconfig put the defaults). I removed
> all types of cpus except PIII and it compiled.

Yup, that's exactly the problem.

Selecting CPU_386 in -mm4 or -mm5 or selecting M386 in other kernels
triggers it.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2004-01-20 23:31:10

by Andrew Morton

[permalink] [raw]
Subject: Re: [2.6 patch] disallow DRM on 386

Adrian Bunk <[email protected]> wrote:
>
> On Tue, Jan 20, 2004 at 11:44:03PM +0100, Diego Calleja wrote:
> > El Tue, 20 Jan 2004 22:24:21 +0100 Adrian Bunk <[email protected]> escribi?:
> >
> > > I got the following compile error in 2.6.1-mm5 with X86_CMPXCHG=n.
> > > This problem is not specific to -mm, and it always occurs when you
> > > include support for the 386 cpu (oposed to the 486 or later cpus) since
> > > in this case X86_CMPXCHG=n and therefoore cmpxchg isn't defined in
> > > include/asm-i386/system.h .
> > >
> > > The patch below disallows DRM if X86_CMPXCHG=n.
> >
> > I got a "cmpxchg not defined" error when compiling the drm stuff in -mm5.
> > When I looked at the configuration, I saw that all the cpus types had been selected
> > (I didn't even realize of your stuuf and menuconfig put the defaults). I removed
> > all types of cpus except PIII and it compiled.
>
> Yup, that's exactly the problem.
>
> Selecting CPU_386 in -mm4 or -mm5 or selecting M386 in other kernels
> triggers it.
>

I'll remove 386 from the default CPU types as well.

2004-01-21 00:09:28

by Alan

[permalink] [raw]
Subject: Re: [Dri-devel] [2.6 patch] disallow DRM on 386

On Maw, 2004-01-20 at 21:24, Adrian Bunk wrote:
> I got the following compile error in 2.6.1-mm5 with X86_CMPXCHG=n.
> This problem is not specific to -mm, and it always occurs when you
> include support for the 386 cpu (oposed to the 486 or later cpus) since
> in this case X86_CMPXCHG=n and therefoore cmpxchg isn't defined in
> include/asm-i386/system.h .
>
> The patch below disallows DRM if X86_CMPXCHG=n.

Ugly.

Fix system.h to always define cmpxchg.h and check its presence at
runtime when the DRM module loads, then you can build 386 kernels that
support DRI on higher machines.

The problem isnt that cmpxchg definitely doesn't exist, so system.h is
wrong IMHO

2004-01-21 00:37:34

by Adrian Bunk

[permalink] [raw]
Subject: Re: [2.6 patch] disallow DRM on 386

On Tue, Jan 20, 2004 at 03:31:58PM -0800, Andrew Morton wrote:
> Adrian Bunk <[email protected]> wrote:
> >
> > On Tue, Jan 20, 2004 at 11:44:03PM +0100, Diego Calleja wrote:
> > > El Tue, 20 Jan 2004 22:24:21 +0100 Adrian Bunk <[email protected]> escribi?:
> > >
> > > > I got the following compile error in 2.6.1-mm5 with X86_CMPXCHG=n.
> > > > This problem is not specific to -mm, and it always occurs when you
> > > > include support for the 386 cpu (oposed to the 486 or later cpus) since
> > > > in this case X86_CMPXCHG=n and therefoore cmpxchg isn't defined in
> > > > include/asm-i386/system.h .
> > > >
> > > > The patch below disallows DRM if X86_CMPXCHG=n.
> > >
> > > I got a "cmpxchg not defined" error when compiling the drm stuff in -mm5.
> > > When I looked at the configuration, I saw that all the cpus types had been selected
> > > (I didn't even realize of your stuuf and menuconfig put the defaults). I removed
> > > all types of cpus except PIII and it compiled.
> >
> > Yup, that's exactly the problem.
> >
> > Selecting CPU_386 in -mm4 or -mm5 or selecting M386 in other kernels
> > triggers it.
> >
>
> I'll remove 386 from the default CPU types as well.

Thanks, this sounds reasonable.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2004-01-21 00:28:36

by Adrian Bunk

[permalink] [raw]
Subject: Re: [Dri-devel] [2.6 patch] disallow DRM on 386

On Wed, Jan 21, 2004 at 12:04:59AM +0000, Alan Cox wrote:
> On Maw, 2004-01-20 at 21:24, Adrian Bunk wrote:
> > I got the following compile error in 2.6.1-mm5 with X86_CMPXCHG=n.
> > This problem is not specific to -mm, and it always occurs when you
> > include support for the 386 cpu (oposed to the 486 or later cpus) since
> > in this case X86_CMPXCHG=n and therefoore cmpxchg isn't defined in
> > include/asm-i386/system.h .
> >
> > The patch below disallows DRM if X86_CMPXCHG=n.
>
> Ugly.
>
> Fix system.h to always define cmpxchg.h and check its presence at
> runtime when the DRM module loads, then you can build 386 kernels that
> support DRI on higher machines.
>
> The problem isnt that cmpxchg definitely doesn't exist, so system.h is
> wrong IMHO

???

AFAIR cmpxchg wasn't present in cpus earlier than the 486.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2004-01-21 18:00:34

by Alan

[permalink] [raw]
Subject: Re: [Dri-devel] [2.6 patch] disallow DRM on 386

On Mer, 2004-01-21 at 00:28, Adrian Bunk wrote:
> > Fix system.h to always define cmpxchg.h and check its presence at
> > runtime when the DRM module loads, then you can build 386 kernels that
> > support DRI on higher machines.
> >
> > The problem isnt that cmpxchg definitely doesn't exist, so system.h is
> > wrong IMHO
>
> ???
>
> AFAIR cmpxchg wasn't present in cpus earlier than the 486.

This is not relevant to the discussion assuming you are talking about
kernels for 386 and higher as well as kernels solely for Intel 386. If
the kernel is for 386 and higher then the DRI modules should be built
but should check for cmpxchg at run time - as we do with many other
CPU features