]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/agp/agp.h
[AGPGART] Further constification.
[linux-2.6-omap-h63xx.git] / drivers / char / agp / agp.h
index c1fe013c64f34c31c1d9b9cceded9d0d2b51ad08..fdbca25a3948a14437181d2bd4b89567dfcdcf2e 100644 (file)
@@ -19,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.
  *
  */
@@ -53,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 */
 };
@@ -93,19 +93,18 @@ struct aper_size_info_fixed {
 
 struct agp_bridge_driver {
        struct module *owner;
-       void *aperture_sizes;
+       const void *aperture_sizes;
        int num_aperture_sizes;
        enum aper_size_type size_type;
        int cant_use_aperture;
        int needs_scratch_page;
-       struct gatt_mask *masks;
+       const struct gatt_mask *masks;
        int (*fetch_size)(void);
        int (*configure)(void);
        void (*agp_enable)(struct agp_bridge_data *, u32);
        void (*cleanup)(void);
        void (*tlb_flush)(struct agp_memory *);
-       unsigned long (*mask_memory)(struct agp_bridge_data *,
-               unsigned long, int);
+       unsigned long (*mask_memory)(struct agp_bridge_data *, unsigned long, int);
        void (*cache_flush)(void);
        int (*create_gatt_table)(struct agp_bridge_data *);
        int (*free_gatt_table)(struct agp_bridge_data *);
@@ -115,11 +114,12 @@ struct agp_bridge_driver {
        void (*free_by_type)(struct agp_memory *);
        void *(*agp_alloc_page)(struct agp_bridge_data *);
        void (*agp_destroy_page)(void *);
+        int (*agp_type_to_mask_type) (struct agp_bridge_data *, int);
 };
 
 struct agp_bridge_data {
-       struct agp_version *version;
-       struct agp_bridge_driver *driver;
+       const struct agp_version *version;
+       const struct agp_bridge_driver *driver;
        struct vm_operations_struct *vm_ops;
        void *previous_size;
        void *current_size;
@@ -143,6 +143,7 @@ struct agp_bridge_data {
        char major_version;
        char minor_version;
        struct list_head list;
+       u32 apbase_config;
 };
 
 #define KB(x)  ((x) * 1024)
@@ -218,6 +219,7 @@ struct agp_bridge_data {
 #define I810_PTE_MAIN_UNCACHED 0x00000000
 #define I810_PTE_LOCAL         0x00000002
 #define I810_PTE_VALID         0x00000001
+#define I830_PTE_SYSTEM_CACHED  0x00000006
 #define I810_SMRAM_MISCC       0x70
 #define I810_GFX_MEM_WIN_SIZE  0x00010000
 #define I810_GFX_MEM_WIN_32M   0x00010000
@@ -225,6 +227,10 @@ struct agp_bridge_data {
 #define I810_GMS_DISABLE       0x00000000
 #define I810_PGETBL_CTL                0x2020
 #define I810_PGETBL_ENABLED    0x00000001
+#define I965_PGETBL_SIZE_MASK  0x0000000e
+#define I965_PGETBL_SIZE_512KB (0 << 1)
+#define I965_PGETBL_SIZE_256KB (1 << 1)
+#define I965_PGETBL_SIZE_128KB (2 << 1)
 #define I810_DRAM_CTL          0x3000
 #define I810_DRAM_ROW_0                0x00000001
 #define I810_DRAM_ROW_0_SDRAM  0x00000001
@@ -266,8 +272,16 @@ void global_cache_flush(void);
 void get_agp_version(struct agp_bridge_data *bridge);
 unsigned long agp_generic_mask_memory(struct agp_bridge_data *bridge,
        unsigned long addr, int type);
+int agp_generic_type_to_mask_type(struct agp_bridge_data *bridge,
+                                 int type);
 struct agp_bridge_data *agp_generic_find_bridge(struct pci_dev *pdev);
 
+/* generic functions for user-populated AGP memory types */
+struct agp_memory *agp_generic_alloc_user(size_t page_count, int type);
+void agp_alloc_page_array(size_t size, struct agp_memory *mem);
+void agp_free_page_array(struct agp_memory *mem);
+
+
 /* generic routines for agp>=3 */
 int agp3_generic_fetch_size(void);
 void agp3_generic_tlbflush(struct agp_memory *mem);
@@ -276,7 +290,7 @@ void agp3_generic_cleanup(void);
 
 /* aperture sizes have been standardised since v3 */
 #define AGP_GENERIC_SIZES_ENTRIES 11
-extern struct aper_size_info_16 agp3_generic_sizes[];
+extern const 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)))
@@ -284,6 +298,8 @@ extern struct aper_size_info_16 agp3_generic_sizes[];
 extern int agp_off;
 extern int agp_try_unsupported_boot;
 
+long compat_agp_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
+
 /* Chipset independant registers (from AGP Spec) */
 #define AGP_APBASE     0x10