X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fagp%2Fagp.h;h=3c623b67ea1cd87de906a65c6ccb6655cc9f46ab;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=aaa2df812d305c5e6c69b94011feb2c867a76a45;hpb=6a77f38946aaee1cd85eeec6cf4229b204c15071;p=linux-2.6.git diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h index aaa2df812..3c623b67e 100644 --- a/drivers/char/agp/agp.h +++ b/drivers/char/agp/agp.h @@ -1,5 +1,6 @@ /* * AGPGART + * Copyright (C) 2004 Silicon Graphics, Inc. * Copyright (C) 2002-2004 Dave Jones * Copyright (C) 1999 Jeff Hartmann * Copyright (C) 1999 Precision Insight, Inc. @@ -18,9 +19,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ @@ -52,7 +53,7 @@ enum aper_size_type { struct gatt_mask { unsigned long mask; u32 type; - /* totally device specific, for integrated chipsets that + /* totally device specific, for integrated chipsets that * might have different types of memory masks. For other * devices this will probably be ignored */ }; @@ -100,18 +101,18 @@ struct agp_bridge_driver { struct gatt_mask *masks; int (*fetch_size)(void); int (*configure)(void); - void (*agp_enable)(u32); + void (*agp_enable)(struct agp_bridge_data *, u32); void (*cleanup)(void); void (*tlb_flush)(struct agp_memory *); - unsigned long (*mask_memory)(unsigned long, int); + unsigned long (*mask_memory)(struct agp_bridge_data *, unsigned long, int); void (*cache_flush)(void); - int (*create_gatt_table)(void); - int (*free_gatt_table)(void); + int (*create_gatt_table)(struct agp_bridge_data *); + int (*free_gatt_table)(struct agp_bridge_data *); int (*insert_memory)(struct agp_memory *, off_t, int); 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)(struct agp_bridge_data *); void (*agp_destroy_page)(void *); }; @@ -137,8 +138,11 @@ struct agp_bridge_data { int max_memory_agp; /* in number of pages */ int aperture_size_idx; int capndx; + int flags; char major_version; char minor_version; + struct list_head list; + u32 apbase_config; }; #define KB(x) ((x) * 1024) @@ -243,24 +247,26 @@ int agp_frontend_initialize(void); void agp_frontend_cleanup(void); /* Generic routines. */ -void agp_generic_enable(u32 mode); -int agp_generic_create_gatt_table(void); -int agp_generic_free_gatt_table(void); +void agp_generic_enable(struct agp_bridge_data *bridge, u32 mode); +int agp_generic_create_gatt_table(struct agp_bridge_data *bridge); +int agp_generic_free_gatt_table(struct agp_bridge_data *bridge); struct agp_memory *agp_create_memory(int scratch_pages); int agp_generic_insert_memory(struct agp_memory *mem, off_t pg_start, int type); int agp_generic_remove_memory(struct agp_memory *mem, off_t pg_start, int type); struct agp_memory *agp_generic_alloc_by_type(size_t page_count, int type); void agp_generic_free_by_type(struct agp_memory *curr); -void *agp_generic_alloc_page(void); +void *agp_generic_alloc_page(struct agp_bridge_data *bridge); void agp_generic_destroy_page(void *addr); void agp_free_key(int key); int agp_num_entries(void); -u32 agp_collect_device_status(u32 mode, u32 command); +u32 agp_collect_device_status(struct agp_bridge_data *bridge, u32 mode, u32 command); void agp_device_command(u32 command, int agp_v3); int agp_3_5_enable(struct agp_bridge_data *bridge); void global_cache_flush(void); void get_agp_version(struct agp_bridge_data *bridge); -unsigned long agp_generic_mask_memory(unsigned long addr, int type); +unsigned long agp_generic_mask_memory(struct agp_bridge_data *bridge, + unsigned long addr, int type); +struct agp_bridge_data *agp_generic_find_bridge(struct pci_dev *pdev); /* generic routines for agp>=3 */ int agp3_generic_fetch_size(void); @@ -272,6 +278,8 @@ void agp3_generic_cleanup(void); #define AGP_GENERIC_SIZES_ENTRIES 11 extern struct aper_size_info_16 agp3_generic_sizes[]; +#define virt_to_gart(x) (phys_to_gart(virt_to_phys(x))) +#define gart_to_virt(x) (phys_to_virt(gart_to_phys(x))) extern int agp_off; extern int agp_try_unsupported_boot; @@ -315,4 +323,11 @@ extern int agp_try_unsupported_boot; #define AGPCTRL_APERENB (1<<8) #define AGPCTRL_GTLBEN (1<<7) +#define AGP2_RESERVED_MASK 0x00fffcc8 +#define AGP3_RESERVED_MASK 0x00ff00c4 + +#define AGP_ERRATA_FASTWRITES 1<<0 +#define AGP_ERRATA_SBA 1<<1 +#define AGP_ERRATA_1X 1<<2 + #endif /* _AGP_BACKEND_PRIV_H */