Blame view

include/linux/agp_backend.h 3.45 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  /*
   * AGPGART backend specific includes. Not for userspace consumption.
   *
   * Copyright (C) 2004 Silicon Graphics, Inc.
   * Copyright (C) 2002-2003 Dave Jones
   * Copyright (C) 1999 Jeff Hartmann
   * Copyright (C) 1999 Precision Insight, Inc.
   * Copyright (C) 1999 Xi Graphics, Inc.
   *
   * Permission is hereby granted, free of charge, to any person obtaining a
   * copy of this software and associated documentation files (the "Software"),
   * to deal in the Software without restriction, including without limitation
   * the rights to use, copy, modify, merge, publish, distribute, sublicense,
   * and/or sell copies of the Software, and to permit persons to whom the
   * Software is furnished to do so, subject to the following conditions:
   *
   * The above copyright notice and this permission notice shall be included
   * in all copies or substantial portions of the Software.
   *
   * 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 
   * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   *
   */
  
  #ifndef _AGP_BACKEND_H
  #define _AGP_BACKEND_H 1
a8c84df9f   Keith Packard   intel/agp: rewrit...
32
  #include <linux/list.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
  enum chipset_type {
  	NOT_SUPPORTED,
  	SUPPORTED,
  };
  
  struct agp_version {
  	u16 major;
  	u16 minor;
  };
  
  struct agp_kern_info {
  	struct agp_version version;
  	struct pci_dev *device;
  	enum chipset_type chipset;
  	unsigned long mode;
  	unsigned long aper_base;
  	size_t aper_size;
  	int max_memory;		/* In pages */
  	int current_memory;
c72580129   Joe Perches   drivers/char/agp ...
52
  	bool cant_use_aperture;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
53
  	unsigned long page_mask;
f0f37e2f7   Alexey Dobriyan   const: mark struc...
54
  	const struct vm_operations_struct *vm_ops;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
  };
  
  /*
   * The agp_memory structure has information about the block of agp memory
   * allocated.  A caller may manipulate the next and prev pointers to link
   * each allocated item into a list.  These pointers are ignored by the backend.
   * Everything else should never be written to, but the caller may read any of
   * the items to determine the status of this block of agp memory.
   */
  
  struct agp_bridge_data;
  
  struct agp_memory {
  	struct agp_memory *next;
  	struct agp_memory *prev;
  	struct agp_bridge_data *bridge;
07613ba2f   Dave Airlie   agp: switch AGP t...
71
  	struct page **pages;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
72
73
74
75
76
77
  	size_t page_count;
  	int key;
  	int num_scratch_pages;
  	off_t pg_start;
  	u32 type;
  	u32 physical;
c72580129   Joe Perches   drivers/char/agp ...
78
79
  	bool is_bound;
  	bool is_flushed;
a8c84df9f   Keith Packard   intel/agp: rewrit...
80
81
  	/* list of agp_memory mapped to the aperture */
  	struct list_head mapped_list;
ff663cf87   Zhenyu Wang   agp: Add generic ...
82
83
84
  	/* DMA-mapped addresses */
  	struct scatterlist *sg_list;
  	int num_sg;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
85
86
87
  };
  
  #define AGP_NORMAL_MEMORY 0
a030ce447   Thomas Hellstrom   [AGPGART] Allow d...
88
89
90
  #define AGP_USER_TYPES (1 << 16)
  #define AGP_USER_MEMORY (AGP_USER_TYPES)
  #define AGP_USER_CACHED_MEMORY (AGP_USER_TYPES + 1)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
91
92
93
94
95
96
97
98
99
100
101
102
103
  extern struct agp_bridge_data *agp_bridge;
  extern struct list_head agp_bridges;
  
  extern struct agp_bridge_data *(*agp_find_bridge)(struct pci_dev *);
  
  extern void agp_free_memory(struct agp_memory *);
  extern struct agp_memory *agp_allocate_memory(struct agp_bridge_data *, size_t, u32);
  extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *);
  extern int agp_bind_memory(struct agp_memory *, off_t);
  extern int agp_unbind_memory(struct agp_memory *);
  extern void agp_enable(struct agp_bridge_data *, u32);
  extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *);
  extern void agp_backend_release(struct agp_bridge_data *);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
104
  #endif				/* _AGP_BACKEND_H */