Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * AGPGART module version 0.99
0003  * Copyright (C) 1999 Jeff Hartmann
0004  * Copyright (C) 1999 Precision Insight, Inc.
0005  * Copyright (C) 1999 Xi Graphics, Inc.
0006  *
0007  * Permission is hereby granted, free of charge, to any person obtaining a
0008  * copy of this software and associated documentation files (the "Software"),
0009  * to deal in the Software without restriction, including without limitation
0010  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0011  * and/or sell copies of the Software, and to permit persons to whom the
0012  * Software is furnished to do so, subject to the following conditions:
0013  *
0014  * The above copyright notice and this permission notice shall be included
0015  * in all copies or substantial portions of the Software.
0016  *
0017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
0018  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0019  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0020  * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, 
0021  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
0022  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
0023  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0024  *
0025  */
0026 #ifndef _AGP_H
0027 #define _AGP_H 1
0028 
0029 #include <linux/mutex.h>
0030 #include <linux/agp_backend.h>
0031 #include <uapi/linux/agpgart.h>
0032 
0033 struct agp_info {
0034     struct agp_version version; /* version of the driver        */
0035     u32 bridge_id;      /* bridge vendor/device         */
0036     u32 agp_mode;       /* mode info of bridge          */
0037     unsigned long aper_base;/* base of aperture             */
0038     size_t aper_size;   /* size of aperture             */
0039     size_t pg_total;    /* max pages (swap + system)    */
0040     size_t pg_system;   /* max pages (system)           */
0041     size_t pg_used;     /* current pages used           */
0042 };
0043 
0044 struct agp_setup {
0045     u32 agp_mode;       /* mode info of bridge          */
0046 };
0047 
0048 /*
0049  * The "prot" down below needs still a "sleep" flag somehow ...
0050  */
0051 struct agp_segment {
0052     off_t pg_start;     /* starting page to populate    */
0053     size_t pg_count;    /* number of pages              */
0054     int prot;       /* prot flags for mmap          */
0055 };
0056 
0057 struct agp_segment_priv {
0058     off_t pg_start;
0059     size_t pg_count;
0060     pgprot_t prot;
0061 };
0062 
0063 struct agp_region {
0064     pid_t pid;      /* pid of process               */
0065     size_t seg_count;   /* number of segments           */
0066     struct agp_segment *seg_list;
0067 };
0068 
0069 struct agp_allocate {
0070     int key;        /* tag of allocation            */
0071     size_t pg_count;    /* number of pages              */
0072     u32 type;       /* 0 == normal, other devspec   */
0073     u32 physical;           /* device specific (some devices  
0074                  * need a phys address of the     
0075                  * actual page behind the gatt    
0076                  * table)                        */
0077 };
0078 
0079 struct agp_bind {
0080     int key;        /* tag of allocation            */
0081     off_t pg_start;     /* starting page to populate    */
0082 };
0083 
0084 struct agp_unbind {
0085     int key;        /* tag of allocation            */
0086     u32 priority;       /* priority for paging out      */
0087 };
0088 
0089 struct agp_client {
0090     struct agp_client *next;
0091     struct agp_client *prev;
0092     pid_t pid;
0093     int num_segments;
0094     struct agp_segment_priv **segments;
0095 };
0096 
0097 struct agp_controller {
0098     struct agp_controller *next;
0099     struct agp_controller *prev;
0100     pid_t pid;
0101     int num_clients;
0102     struct agp_memory *pool;
0103     struct agp_client *clients;
0104 };
0105 
0106 #define AGP_FF_ALLOW_CLIENT     0
0107 #define AGP_FF_ALLOW_CONTROLLER     1
0108 #define AGP_FF_IS_CLIENT        2
0109 #define AGP_FF_IS_CONTROLLER        3
0110 #define AGP_FF_IS_VALID         4
0111 
0112 struct agp_file_private {
0113     struct agp_file_private *next;
0114     struct agp_file_private *prev;
0115     pid_t my_pid;
0116     unsigned long access_flags; /* long req'd for set_bit --RR */
0117 };
0118 
0119 struct agp_front_data {
0120     struct mutex agp_mutex;
0121     struct agp_controller *current_controller;
0122     struct agp_controller *controllers;
0123     struct agp_file_private *file_priv_list;
0124     bool used_by_controller;
0125     bool backend_acquired;
0126 };
0127 
0128 #endif              /* _AGP_H */