2002-06-19 16:18:40

by Dave Jones

[permalink] [raw]
Subject: [PATCH] Split up agpgart into per implementation files.

Something I've been meaning to do for a long time, and no-one has
beaten me to it, is to do something about agpgart_be.c, which seems
to grow and grow and..

I've just put up a patch at..
ftp.kernel.org/pub/linux/kernel/people/davej/patches/agp/
which splits up the huge monolithic file into implementation
specific files.

This is a first cut, so I'll not be surprised if you manage to break
the compile, but please do try.. I've tried several combinations,
and it all seems to work out ok, but I can only test on VIA boards
here. You should see absolutely no change in behaviour if all goes
to plan.

I'm particularly interested in hearing if I got the CONFIG_AGP_I180
changes right. The patch is against 2.5.23, but may apply with
trivial rejects to 2.4-current if you're feeling lucky.

There's lots more that can be done to cut down some of the duplication
that this patch introduces, but it's a good start at making the
backend code a little easier to navigate.

Comments?

Dave.

--
| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs


2002-06-20 12:49:49

by Nicolas ASPERT

[permalink] [raw]
Subject: Re: [PATCH] Split up agpgart into per implementation files.

Dave Jones wrote:

> There's lots more that can be done to cut down some of the duplication
> that this patch introduces, but it's a good start at making the
> backend code a little easier to navigate.
>
> Comments?
>

Definitely a good idea !
The code is much easier to read.

For those interested in trying this with 2.4, here is an adaptation of
the patch for 2.4.19-pre10-ac2 . I did not include neither the changes
made in 2.5.23 (at least they should not be here), nor the intel 460
stuff (not present in 2.4).

You can find the patch at :
http://ltswww.epfl.ch/~aspert/patches/agpgart-split-2.4.19-pre10-ac2.diff.bz2

For those using kbuild, a replacement for the Makefile.in in
'drivers/char/agp' can be found at :
http://ltswww.epfl.ch/~aspert/patches/Makefile.in

Please test (it compiles OK but I don't have a test box at hand)

a+
--
Nicolas Aspert Signal Processing Institute (ITS)
Swiss Federal Institute of Technology (EPFL)


2002-06-20 14:11:20

by Dave Jones

[permalink] [raw]
Subject: Re: [PATCH] Split up agpgart into per implementation files.

On Thu, Jun 20, 2002 at 02:49:45PM +0200, Nicolas Aspert wrote:

> Definitely a good idea !
> The code is much easier to read.

Exactly. It also becomes a little easier to slot in support
for new vendors, than navigating a 120kb .c file.

> For those interested in trying this with 2.4, here is an adaptation of
> the patch for 2.4.19-pre10-ac2 . I did not include neither the changes
> made in 2.5.23 (at least they should not be here), nor the intel 460
> stuff (not present in 2.4).

Thanks for doing this.. I goofed the Makefile, and it doesn't build
correctly as modules under 2.5. Fixed one is at http://www.codemonkey.org.uk/Makefile
Just drop it into drivers/char/agp/ after applying my patch.
Due to build system differences, I'm not sure if your 2.4 patch also
suffers the same problem..

Oh, and agp.h has the definition of PFX below code which uses it,
and should be moved around..

Dave

--
| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs

2002-06-20 14:32:14

by Nicolas ASPERT

[permalink] [raw]
Subject: Re: [PATCH] Split up agpgart into per implementation files.


> Thanks for doing this.. I goofed the Makefile, and it doesn't build
> correctly as modules under 2.5. Fixed one is at http://www.codemonkey.org.uk/Makefile
> Just drop it into drivers/char/agp/ after applying my patch.
> Due to build system differences, I'm not sure if your 2.4 patch also
> suffers the same problem..

Not sure about that... the Makefile you supplied was looking like a 2.4
one (and looks correct from what I understand from the Docs). I must say
that I used kbuild-2.5 port to 2.4 to build the module (kbuild-2.5 makes
the build of a single module really easy), so I did not test the
original Makefile (kernel-Makefile guru around while it builds ?).


> Oh, and agp.h has the definition of PFX below code which uses it,
> and should be moved around..
>

Damn, you're right. Why the h&*( the compiler did not yell about this one ??
A corrected version can be found at
http://ltswww.epfl.ch/~aspert/patches/agpgart-split-2.4.19-pre10-ac2-2.diff.bz2

a+

--
Nicolas Aspert Signal Processing Institute (ITS)
Swiss Federal Institute of Technology (EPFL)