/*1* AGPGART backend specific includes. Not for userspace consumption.2*3* Copyright (C) 2004 Silicon Graphics, Inc.4* Copyright (C) 2002-2003 Dave Jones5* Copyright (C) 1999 Jeff Hartmann6* Copyright (C) 1999 Precision Insight, Inc.7* Copyright (C) 1999 Xi Graphics, Inc.8*9* Permission is hereby granted, free of charge, to any person obtaining a10* copy of this software and associated documentation files (the "Software"),11* to deal in the Software without restriction, including without limitation12* the rights to use, copy, modify, merge, publish, distribute, sublicense,13* and/or sell copies of the Software, and to permit persons to whom the14* Software is furnished to do so, subject to the following conditions:15*16* The above copyright notice and this permission notice shall be included17* in all copies or substantial portions of the Software.18*19* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS20* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,21* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL22* JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,23* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR24* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE25* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.26*27*/2829#ifndef _AGP_BACKEND_H30#define _AGP_BACKEND_H 13132#include <linux/list.h>3334enum chipset_type {35NOT_SUPPORTED,36SUPPORTED,37};3839struct agp_version {40u16 major;41u16 minor;42};4344struct agp_kern_info {45struct agp_version version;46struct pci_dev *device;47enum chipset_type chipset;48unsigned long mode;49unsigned long aper_base;50size_t aper_size;51int max_memory; /* In pages */52int current_memory;53bool cant_use_aperture;54unsigned long page_mask;55const struct vm_operations_struct *vm_ops;56};5758/*59* The agp_memory structure has information about the block of agp memory60* allocated. A caller may manipulate the next and prev pointers to link61* each allocated item into a list. These pointers are ignored by the backend.62* Everything else should never be written to, but the caller may read any of63* the items to determine the status of this block of agp memory.64*/6566struct agp_bridge_data;6768struct agp_memory {69struct agp_memory *next;70struct agp_memory *prev;71struct agp_bridge_data *bridge;72struct page **pages;73size_t page_count;74int key;75int num_scratch_pages;76off_t pg_start;77u32 type;78u32 physical;79bool is_bound;80bool is_flushed;81/* list of agp_memory mapped to the aperture */82struct list_head mapped_list;83/* DMA-mapped addresses */84struct scatterlist *sg_list;85int num_sg;86};8788#define AGP_NORMAL_MEMORY 08990#define AGP_USER_TYPES (1 << 16)91#define AGP_USER_MEMORY (AGP_USER_TYPES)92#define AGP_USER_CACHED_MEMORY (AGP_USER_TYPES + 1)9394extern struct agp_bridge_data *agp_bridge;95extern struct list_head agp_bridges;9697extern struct agp_bridge_data *(*agp_find_bridge)(struct pci_dev *);9899extern void agp_free_memory(struct agp_memory *);100extern struct agp_memory *agp_allocate_memory(struct agp_bridge_data *, size_t, u32);101extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *);102extern int agp_bind_memory(struct agp_memory *, off_t);103extern int agp_unbind_memory(struct agp_memory *);104extern void agp_enable(struct agp_bridge_data *, u32);105extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *);106extern void agp_backend_release(struct agp_bridge_data *);107108#endif /* _AGP_BACKEND_H */109110111