intelfb: add vsync interrupt support
[safe/jmp/linux-2.6] / drivers / video / intelfb / intelfb.h
index fb2739f..65ac370 100644 (file)
@@ -8,9 +8,9 @@
 
 
 /*** Version/name ***/
-#define INTELFB_VERSION                        "0.9.3"
+#define INTELFB_VERSION                        "0.9.4"
 #define INTELFB_MODULE_NAME            "intelfb"
-#define SUPPORTED_CHIPSETS             "830M/845G/852GM/855GM/865G/915G/915GM/945G"
+#define SUPPORTED_CHIPSETS             "830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM"
 
 
 /*** Debug/feature defines ***/
 #define PCI_DEVICE_ID_INTEL_915G       0x2582
 #define PCI_DEVICE_ID_INTEL_915GM      0x2592
 #define PCI_DEVICE_ID_INTEL_945G       0x2772
+#define PCI_DEVICE_ID_INTEL_945GM      0x27A2
 
 /* Size of MMIO region */
 #define INTEL_REG_SIZE                 0x80000
 
 #define STRIDE_ALIGNMENT               16
+#define STRIDE_ALIGNMENT_I9XX          64
 
 #define PALETTE_8_ENTRIES              256
 
@@ -127,7 +129,8 @@ enum intel_chips {
        INTEL_865G,
        INTEL_915G,
        INTEL_915GM,
-       INTEL_945G
+       INTEL_945G,
+       INTEL_945GM,
 };
 
 struct intelfb_hwstate {
@@ -192,6 +195,10 @@ struct intelfb_hwstate {
        u32 mem_mode;
        u32 fw_blc_0;
        u32 fw_blc_1;
+       u16 hwstam;
+       u16 ier;
+       u16 iir;
+       u16 imr;
 };
 
 struct intelfb_heap_data {
@@ -201,6 +208,11 @@ struct intelfb_heap_data {
        u32 size;    // in bytes
 };
 
+struct intelfb_vsync {
+       wait_queue_head_t wait;
+       unsigned int count;
+};
+
 struct intelfb_info {
        struct fb_info *info;
        struct fb_ops  *fbops;
@@ -234,7 +246,7 @@ struct intelfb_info {
        u32 fb_start;
 
        /* ring buffer */
-       u8 __iomem *ring_head;
+       u32 ring_head;
        u32 ring_tail;
        u32 ring_tail_mask;
        u32 ring_space;
@@ -264,6 +276,12 @@ struct intelfb_info {
        int fixed_mode;
        int ring_active;
        int flag;
+       unsigned long irq_flags;
+       int open;
+
+       /* vsync */
+       struct intelfb_vsync vsync;
+       spinlock_t int_lock;
 
        /* hw cursor */
        int cursor_on;
@@ -284,6 +302,12 @@ struct intelfb_info {
        int pll_index;
 };
 
+#define IS_I9XX(dinfo) (((dinfo)->chipset == INTEL_915G)||(dinfo->chipset == INTEL_915GM)||((dinfo)->chipset == INTEL_945G)||(dinfo->chipset==INTEL_945GM))
+
+#ifndef FBIO_WAITFORVSYNC
+#define FBIO_WAITFORVSYNC      _IOW('F', 0x20, __u32)
+#endif
+
 /*** function prototypes ***/
 
 extern int intelfb_var_to_depth(const struct fb_var_screeninfo *var);