vserver 2.0 rc7
[linux-2.6.git] / drivers / char / drm / drmP.h
index ab61660..21f4c54 100644 (file)
@@ -422,7 +422,7 @@ typedef struct drm_file {
        unsigned long     ioctl_count;
        struct drm_file   *next;
        struct drm_file   *prev;
-       struct drm_device *dev;
+       struct drm_head   *head;
        int               remove_auth_on_close;
        unsigned long     lock_count;
        void              *driver_priv;
@@ -497,6 +497,7 @@ typedef struct drm_agp_head {
        DRM_AGP_KERN       agp_info;    /**< AGP device information */
        drm_agp_mem_t      *memory;     /**< memory entries */
        unsigned long      mode;        /**< AGP mode */
+       struct agp_bridge_data  *bridge;
        int                enabled;     /**< whether the AGP bus as been enabled */
        int                acquired;    /**< whether the AGP device has been acquired */
        unsigned long      base;
@@ -592,19 +593,31 @@ struct drm_driver {
        struct file_operations fops;
        struct pci_driver pci_driver;
 };
+
 /**
- * DRM device structure.
+ * DRM head structure. This structure represent a video head on a card
+ * that may contain multiple heads. Embed one per head of these in the
+ * private drm_device structure.
+ */
+typedef struct drm_head {
+       int minor;                      /**< Minor device number */
+       struct drm_device *dev;
+       struct proc_dir_entry *dev_root;  /**< proc directory entry */
+       dev_t device;                   /**< Device number for mknod */
+       struct class_device *dev_class;
+} drm_head_t;
+
+/**
+ * DRM device structure. This structure represent a complete card that
+ * may contain multiple heads.
  */
 typedef struct drm_device {
        char              *unique;      /**< Unique identifier: e.g., busid */
        int               unique_len;   /**< Length of unique field */
-       dev_t             device;       /**< Device number for mknod */
        char              *devname;     /**< For /proc/interrupts */
-       int               minor;        /**< Minor device number */
        int               if_version;   /**< Highest interface version set */
 
        int               blocked;      /**< Blocked due to VC switch? */
-       struct proc_dir_entry *root;    /**< Root for this device's entries */
 
        /** \name Locks */
        /*@{*/
@@ -720,17 +733,9 @@ typedef struct drm_device {
 
        struct            drm_driver *driver;
        drm_local_map_t   *agp_buffer_map;
+       drm_head_t primary;             /**< primary screen head */
 } drm_device_t;
 
-typedef struct drm_minor {
-       enum {
-               DRM_MINOR_FREE = 0,
-               DRM_MINOR_PRIMARY,
-       } type;
-       drm_device_t *dev;
-       struct proc_dir_entry  *dev_root; /**< proc directory entry */
-} drm_minor_t;
-
 static __inline__ int drm_core_check_feature(struct drm_device *dev, int feature)
 {
        return ((dev->driver->driver_features & feature) ? 1 : 0);
@@ -807,7 +812,7 @@ extern void      *drm_ioremap_nocache(unsigned long offset, unsigned long size,
                                           drm_device_t *dev);
 extern void         drm_ioremapfree(void *pt, unsigned long size, drm_device_t *dev);
 
-extern DRM_AGP_MEM   *drm_alloc_agp(int pages, u32 type);
+extern DRM_AGP_MEM   *drm_alloc_agp(struct agp_bridge_data *bridge, int pages, u32 type);
 extern int           drm_free_agp(DRM_AGP_MEM *handle, int pages);
 extern int           drm_bind_agp(DRM_AGP_MEM *handle, unsigned int start);
 extern int           drm_unbind_agp(DRM_AGP_MEM *handle);
@@ -930,10 +935,10 @@ extern int           drm_vblank_wait(drm_device_t *dev, unsigned int *vbl_seq);
 extern void          drm_vbl_send_signals( drm_device_t *dev );
 
                                /* AGP/GART support (drm_agpsupport.h) */
-extern drm_agp_head_t *drm_agp_init(void);
+extern drm_agp_head_t *drm_agp_init(drm_device_t *dev);
 extern int            drm_agp_acquire(struct inode *inode, struct file *filp,
                                       unsigned int cmd, unsigned long arg);
-extern void           drm_agp_do_release(void);
+extern void           drm_agp_do_release(drm_device_t *dev);
 extern int            drm_agp_release(struct inode *inode, struct file *filp,
                                       unsigned int cmd, unsigned long arg);
 extern int            drm_agp_enable(struct inode *inode, struct file *filp,
@@ -948,18 +953,20 @@ extern int            drm_agp_unbind(struct inode *inode, struct file *filp,
                                      unsigned int cmd, unsigned long arg);
 extern int            drm_agp_bind(struct inode *inode, struct file *filp,
                                    unsigned int cmd, unsigned long arg);
-extern DRM_AGP_MEM    *drm_agp_allocate_memory(size_t pages, u32 type);
+extern DRM_AGP_MEM    *drm_agp_allocate_memory(struct agp_bridge_data *bridge, size_t pages, u32 type);
 extern int            drm_agp_free_memory(DRM_AGP_MEM *handle);
 extern int            drm_agp_bind_memory(DRM_AGP_MEM *handle, off_t start);
 extern int            drm_agp_unbind_memory(DRM_AGP_MEM *handle);
 
                                /* Stub support (drm_stub.h) */
-extern int            drm_probe(struct pci_dev *pdev, const struct pci_device_id *ent, struct drm_driver *driver);
-
-extern int           drm_put_minor(drm_device_t *dev);
+extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
+                    struct drm_driver *driver);
+extern int drm_put_dev(drm_device_t * dev);
+extern int drm_get_head(drm_device_t * dev, drm_head_t *head);
+extern int drm_put_head(drm_head_t * head);
 extern unsigned int   drm_debug;
 extern unsigned int   drm_cards_limit;
-extern drm_minor_t    *drm_minors;
+extern drm_head_t **drm_heads;
 extern struct drm_sysfs_class *drm_class;
 extern struct proc_dir_entry *drm_proc_root;