Re: [RFC/PATCH]Allow agp memory allocations to use node information

From: Christoph Hellwig
Date: Wed May 12 2004 - 15:29:48 EST


not a lot of description here, he? :-)


On Wed, May 12, 2004 at 11:47:39AM -0700, Mike Werner wrote:
> diff -u linux-2.6.6.orig/drivers/char/agp/agp.h
> linux-2.6.6/drivers/char/agp/agp.h
> --- linux-2.6.6.orig/drivers/char/agp/agp.h Sun May 9 19:32:28 2004
>
> +++ linux-2.6.6/drivers/char/agp/agp.h Wed May 12 11:43:19 2004
> @@ -111,7 +111,7 @@
> int (*remove_memory)(struct agp_memory *, off_t, int);
> struct agp_memory *(*alloc_by_type) (size_t, int);
> void (*free_by_type)(struct agp_memory *);
> - void *(*agp_alloc_page)(void);
> + void *(*agp_alloc_page)(int);
> void (*agp_destroy_page)(void *);

Wrong interface. We need to pass a struct agp_bridge_data to
each of the methods anyway for proper support for multiple AGP
bridges in a single system. And once you have that you can simply
use the node id your patches stores in agp_bridge_data.

> +++ linux-2.6.6/drivers/char/agp/intel-mch-agp.c Wed May 12
> 11:16:02 2004
> @@ -43,7 +43,7 @@
> if (pg_count != 1)
> return NULL;
>
> - addr = agp_bridge->driver->agp_alloc_page();
> + addr = agp_bridge->driver->agp_alloc_page(AGPGART_DEFAULT_NODE);

wrong default again. for the agp bridges that have an associated pci
device (aka about everything except hpzx and alpha IIRC) you should
use pcibus_to_cpumask (or what the thing was called). For the others
you should try to contact the maintainers for a proper choice.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/