Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / drivers / char / drm / i810_drv.h
index 67c5c88..e8cf3ff 100644 (file)
 #ifndef _I810_DRV_H_
 #define _I810_DRV_H_
 
+/* General customization:
+ */
+
+#define DRIVER_AUTHOR          "VA Linux Systems Inc."
+
+#define DRIVER_NAME            "i810"
+#define DRIVER_DESC            "Intel i810"
+#define DRIVER_DATE            "20030605"
+
+/* Interface history
+ *
+ * 1.1   - XFree86 4.1
+ * 1.2   - XvMC interfaces
+ *       - XFree86 4.2
+ * 1.2.1 - Disable copying code (leave stub ioctls for backwards compatibility)
+ *       - Remove requirement for interrupt (leave stubs again)
+ * 1.3   - Add page flipping.
+ * 1.4   - fix DRM interface
+ */
+#define DRIVER_MAJOR           1
+#define DRIVER_MINOR           4
+#define DRIVER_PATCHLEVEL      0
+
 typedef struct drm_i810_buf_priv {
-       u32 *in_use;
-       int my_use_idx;
+       u32 *in_use;
+       int my_use_idx;
        int currently_mapped;
        void *virtual;
        void *kernel_virtual;
 } drm_i810_buf_priv_t;
 
-typedef struct _drm_i810_ring_buffer{
+typedef struct _drm_i810_ring_buffer {
        int tail_mask;
        unsigned long Start;
        unsigned long End;
@@ -56,16 +79,15 @@ typedef struct drm_i810_private {
        drm_map_t *mmio_map;
 
        drm_i810_sarea_t *sarea_priv;
-       drm_i810_ring_buffer_t ring;
+       drm_i810_ring_buffer_t ring;
 
-       void *hw_status_page;
-       unsigned long counter;
+       void *hw_status_page;
+       unsigned long counter;
 
        dma_addr_t dma_status_page;
 
        drm_buf_t *mmap_buffer;
 
-
        u32 front_di1, back_di1, zi1;
 
        int back_offset;
@@ -74,7 +96,7 @@ typedef struct drm_i810_private {
        int overlay_physical;
        int w, h;
        int pitch;
-       int back_pitch;
+       int back_pitch;
        int depth_pitch;
 
        int do_boxes;
@@ -84,60 +106,25 @@ typedef struct drm_i810_private {
        int page_flipping;
 
        wait_queue_head_t irq_queue;
-       atomic_t irq_received;
-       atomic_t irq_emitted;
-  
-        int front_offset;
+       atomic_t irq_received;
+       atomic_t irq_emitted;
+
+       int front_offset;
 } drm_i810_private_t;
 
                                /* i810_dma.c */
-extern int  i810_dma_schedule(drm_device_t *dev, int locked);
-extern int  i810_getbuf(struct inode *inode, struct file *filp,
-                       unsigned int cmd, unsigned long arg);
-extern int  i810_dma_init(struct inode *inode, struct file *filp,
-                         unsigned int cmd, unsigned long arg);
-extern int  i810_dma_cleanup(drm_device_t *dev);
-extern int  i810_flush_ioctl(struct inode *inode, struct file *filp,
-                            unsigned int cmd, unsigned long arg);
-extern void i810_reclaim_buffers(struct file *filp);
-extern int  i810_getage(struct inode *inode, struct file *filp,
-                       unsigned int cmd, unsigned long arg);
-extern int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma);
-
-/* Obsolete:
- */
-extern int i810_copybuf(struct inode *inode, struct file *filp,
-                       unsigned int cmd, unsigned long arg);
-/* Obsolete:
- */
-extern int i810_docopy(struct inode *inode, struct file *filp,
-                      unsigned int cmd, unsigned long arg);
-
-extern int i810_rstatus(struct inode *inode, struct file *filp,
-                       unsigned int cmd, unsigned long arg);
-extern int i810_ov0_info(struct inode *inode, struct file *filp,
-                       unsigned int cmd, unsigned long arg);
-extern int i810_fstatus(struct inode *inode, struct file *filp,
-                       unsigned int cmd, unsigned long arg);
-extern int i810_ov0_flip(struct inode *inode, struct file *filp,
-                       unsigned int cmd, unsigned long arg);
-extern int i810_dma_mc(struct inode *inode, struct file *filp,
-                       unsigned int cmd, unsigned long arg);
-
-
-extern void i810_dma_quiescent(drm_device_t *dev);
-
-int i810_dma_vertex(struct inode *inode, struct file *filp,
-                   unsigned int cmd, unsigned long arg);
-
-int i810_swap_bufs(struct inode *inode, struct file *filp,
-                  unsigned int cmd, unsigned long arg);
-
-int i810_clear_bufs(struct inode *inode, struct file *filp,
-                   unsigned int cmd, unsigned long arg);
-
-int i810_flip_bufs(struct inode *inode, struct file *filp,
-                  unsigned int cmd, unsigned long arg);
+extern int i810_driver_dma_quiescent(drm_device_t * dev);
+extern void i810_driver_reclaim_buffers_locked(drm_device_t * dev,
+                                              struct file *filp);
+extern int i810_driver_load(struct drm_device *, unsigned long flags);
+extern void i810_driver_lastclose(drm_device_t * dev);
+extern void i810_driver_preclose(drm_device_t * dev, DRMFILE filp);
+extern void i810_driver_reclaim_buffers_locked(drm_device_t * dev,
+                                              struct file *filp);
+extern int i810_driver_device_is_agp(drm_device_t * dev);
+
+extern drm_ioctl_desc_t i810_ioctls[];
+extern int i810_max_ioctl;
 
 #define I810_BASE(reg)         ((unsigned long) \
                                dev_priv->mmio_map->handle)
@@ -187,7 +174,6 @@ int i810_flip_bufs(struct inode *inode, struct file *filp,
 #define INST_OP_FLUSH        0x02000000
 #define INST_FLUSH_MAP_CACHE 0x00000001
 
-
 #define BB1_START_ADDR_MASK   (~0x7)
 #define BB1_PROTECTED         (1<<0)
 #define BB1_UNPROTECTED       (0<<0)
@@ -246,8 +232,8 @@ int i810_flip_bufs(struct inode *inode, struct file *filp,
 #define BR00_OP_SRC_COPY_BLT 0x10C00000
 #define BR13_SOLID_PATTERN   0x80000000
 
-#define WAIT_FOR_PLANE_A_SCANLINES (1<<1) 
-#define WAIT_FOR_PLANE_A_FLIP      (1<<2) 
+#define WAIT_FOR_PLANE_A_SCANLINES (1<<1)
+#define WAIT_FOR_PLANE_A_FLIP      (1<<2)
 #define WAIT_FOR_VBLANK (1<<3)
 
 #endif