apatard@mandriva.com | d7636e0 | 2010-05-19 10:44:14 +0200 | [diff] [blame] | 1 | #ifndef _LINUX_XGIFB |
| 2 | #define _LINUX_XGIFB |
| 3 | #include <linux/spinlock.h> |
| 4 | #include <asm/ioctl.h> |
| 5 | #include <asm/types.h> |
| 6 | |
| 7 | #define DISPTYPE_CRT1 0x00000008L |
| 8 | #define DISPTYPE_CRT2 0x00000004L |
| 9 | #define DISPTYPE_LCD 0x00000002L |
| 10 | #define DISPTYPE_TV 0x00000001L |
| 11 | #define DISPTYPE_DISP1 DISPTYPE_CRT1 |
| 12 | #define DISPTYPE_DISP2 (DISPTYPE_CRT2 | DISPTYPE_LCD | DISPTYPE_TV) |
| 13 | #define DISPMODE_SINGLE 0x00000020L |
| 14 | #define DISPMODE_MIRROR 0x00000010L |
| 15 | #define DISPMODE_DUALVIEW 0x00000040L |
| 16 | |
| 17 | #define HASVB_NONE 0x00 |
| 18 | #define HASVB_301 0x01 |
| 19 | #define HASVB_LVDS 0x02 |
| 20 | #define HASVB_TRUMPION 0x04 |
| 21 | #define HASVB_LVDS_CHRONTEL 0x10 |
| 22 | #define HASVB_302 0x20 |
| 23 | #define HASVB_303 0x40 |
| 24 | #define HASVB_CHRONTEL 0x80 |
| 25 | |
| 26 | #ifndef XGIFB_ID |
| 27 | #define XGIFB_ID 0x53495346 /* Identify myself with 'XGIF' */ |
| 28 | #endif |
| 29 | |
Bill Pemberton | 716083c | 2010-06-17 13:10:52 -0400 | [diff] [blame] | 30 | enum XGI_CHIP_TYPE { |
apatard@mandriva.com | d7636e0 | 2010-05-19 10:44:14 +0200 | [diff] [blame] | 31 | XGI_VGALegacy = 0, |
| 32 | XGI_300, |
| 33 | XGI_630, |
| 34 | XGI_730, |
| 35 | XGI_540, |
| 36 | XGI_315H, |
| 37 | XGI_315, |
| 38 | XGI_315PRO, |
| 39 | XGI_550, |
| 40 | XGI_640, |
| 41 | XGI_740, |
| 42 | XGI_650, |
| 43 | XGI_650M, |
| 44 | XGI_330 = 16, |
| 45 | XGI_660, |
| 46 | XGI_661, |
| 47 | XGI_760, |
| 48 | XG40 = 32, |
| 49 | XG41, |
| 50 | XG42, |
| 51 | XG45, |
| 52 | XG20 = 48, |
| 53 | XG21, |
| 54 | XG27, |
| 55 | MAX_XGI_CHIP |
Bill Pemberton | 716083c | 2010-06-17 13:10:52 -0400 | [diff] [blame] | 56 | }; |
apatard@mandriva.com | d7636e0 | 2010-05-19 10:44:14 +0200 | [diff] [blame] | 57 | |
Bill Pemberton | 716083c | 2010-06-17 13:10:52 -0400 | [diff] [blame] | 58 | enum xgi_tvtype { |
apatard@mandriva.com | d7636e0 | 2010-05-19 10:44:14 +0200 | [diff] [blame] | 59 | TVMODE_NTSC = 0, |
| 60 | TVMODE_PAL, |
| 61 | TVMODE_HIVISION, |
| 62 | TVTYPE_PALM, // vicki@030226 |
| 63 | TVTYPE_PALN, // vicki@030226 |
| 64 | TVTYPE_NTSCJ, // vicki@030226 |
| 65 | TVMODE_TOTAL |
Bill Pemberton | 716083c | 2010-06-17 13:10:52 -0400 | [diff] [blame] | 66 | }; |
apatard@mandriva.com | d7636e0 | 2010-05-19 10:44:14 +0200 | [diff] [blame] | 67 | |
| 68 | |
Bill Pemberton | 716083c | 2010-06-17 13:10:52 -0400 | [diff] [blame] | 69 | struct XGIfb_info { |
| 70 | unsigned long XGIfb_id; |
apatard@mandriva.com | d7636e0 | 2010-05-19 10:44:14 +0200 | [diff] [blame] | 71 | int chip_id; /* PCI ID of detected chip */ |
| 72 | int memory; /* video memory in KB which XGIfb manages */ |
| 73 | int heapstart; /* heap start (= XGIfb "mem" argument) in KB */ |
| 74 | unsigned char fbvidmode; /* current XGIfb mode */ |
| 75 | |
| 76 | unsigned char XGIfb_version; |
| 77 | unsigned char XGIfb_revision; |
| 78 | unsigned char XGIfb_patchlevel; |
| 79 | |
| 80 | unsigned char XGIfb_caps; /* XGIfb capabilities */ |
| 81 | |
| 82 | int XGIfb_tqlen; /* turbo queue length (in KB) */ |
| 83 | |
| 84 | unsigned int XGIfb_pcibus; /* The card's PCI ID */ |
| 85 | unsigned int XGIfb_pcislot; |
| 86 | unsigned int XGIfb_pcifunc; |
| 87 | |
| 88 | unsigned char XGIfb_lcdpdc; /* PanelDelayCompensation */ |
| 89 | |
| 90 | unsigned char XGIfb_lcda; /* Detected status of LCDA for low res/text modes */ |
| 91 | |
| 92 | char reserved[235]; /* for future use */ |
| 93 | }; |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
Bill Pemberton | a3e735a | 2010-06-17 13:10:53 -0400 | [diff] [blame] | 98 | enum xgi_tv_plug { /* vicki@030226 */ |
apatard@mandriva.com | d7636e0 | 2010-05-19 10:44:14 +0200 | [diff] [blame] | 99 | // TVPLUG_Legacy = 0, |
| 100 | // TVPLUG_COMPOSITE, |
| 101 | // TVPLUG_SVIDEO, |
| 102 | // TVPLUG_SCART, |
| 103 | // TVPLUG_TOTAL |
| 104 | TVPLUG_UNKNOWN = 0, |
| 105 | TVPLUG_COMPOSITE = 1, |
| 106 | TVPLUG_SVIDEO = 2, |
| 107 | TVPLUG_COMPOSITE_AND_SVIDEO = 3, |
| 108 | TVPLUG_SCART = 4, |
| 109 | TVPLUG_YPBPR_525i = 5, |
| 110 | TVPLUG_YPBPR_525P = 6, |
| 111 | TVPLUG_YPBPR_750P = 7, |
| 112 | TVPLUG_YPBPR_1080i = 8, |
| 113 | TVPLUG_TOTAL |
Bill Pemberton | a3e735a | 2010-06-17 13:10:53 -0400 | [diff] [blame] | 114 | }; |
apatard@mandriva.com | d7636e0 | 2010-05-19 10:44:14 +0200 | [diff] [blame] | 115 | |
| 116 | |
| 117 | struct mode_info { |
| 118 | int bpp; |
| 119 | int xres; |
| 120 | int yres; |
| 121 | int v_xres; |
| 122 | int v_yres; |
| 123 | int org_x; |
| 124 | int org_y; |
| 125 | unsigned int vrate; |
| 126 | }; |
| 127 | |
| 128 | struct ap_data { |
| 129 | struct mode_info minfo; |
| 130 | unsigned long iobase; |
| 131 | unsigned int mem_size; |
| 132 | unsigned long disp_state; |
Bill Pemberton | 716083c | 2010-06-17 13:10:52 -0400 | [diff] [blame] | 133 | enum XGI_CHIP_TYPE chip; |
apatard@mandriva.com | d7636e0 | 2010-05-19 10:44:14 +0200 | [diff] [blame] | 134 | unsigned char hasVB; |
Bill Pemberton | 716083c | 2010-06-17 13:10:52 -0400 | [diff] [blame] | 135 | enum xgi_tvtype TV_type; |
Bill Pemberton | a3e735a | 2010-06-17 13:10:53 -0400 | [diff] [blame] | 136 | enum xgi_tv_plug TV_plug; |
apatard@mandriva.com | d7636e0 | 2010-05-19 10:44:14 +0200 | [diff] [blame] | 137 | unsigned long version; |
| 138 | char reserved[256]; |
| 139 | }; |
| 140 | |
| 141 | |
| 142 | |
| 143 | /* If changing this, vgatypes.h must also be changed (for X driver) */ |
| 144 | |
| 145 | |
| 146 | /* |
| 147 | * NOTE! The ioctl types used to be "size_t" by mistake, but were |
| 148 | * really meant to be __u32. Changed to "__u32" even though that |
| 149 | * changes the value on 64-bit architectures, because the value |
| 150 | * (with a 4-byte size) is also hardwired in vgatypes.h for user |
| 151 | * space exports. So "__u32" is actually more compatible, duh! |
| 152 | */ |
| 153 | #define XGIFB_GET_INFO _IOR('n',0xF8,__u32) |
| 154 | #define XGIFB_GET_VBRSTATUS _IOR('n',0xF9,__u32) |
| 155 | |
| 156 | |
| 157 | |
| 158 | struct video_info{ |
| 159 | int chip_id; |
| 160 | unsigned int video_size; |
| 161 | unsigned long video_base; |
| 162 | char * video_vbase; |
| 163 | unsigned long mmio_base; |
| 164 | char * mmio_vbase; |
| 165 | unsigned long vga_base; |
| 166 | unsigned long mtrr; |
| 167 | unsigned long heapstart; |
| 168 | |
| 169 | int video_bpp; |
| 170 | int video_cmap_len; |
| 171 | int video_width; |
| 172 | int video_height; |
| 173 | int video_vwidth; |
| 174 | int video_vheight; |
| 175 | int org_x; |
| 176 | int org_y; |
| 177 | int video_linelength; |
| 178 | unsigned int refresh_rate; |
| 179 | |
| 180 | unsigned long disp_state; |
| 181 | unsigned char hasVB; |
| 182 | unsigned char TV_type; |
| 183 | unsigned char TV_plug; |
| 184 | |
Bill Pemberton | 716083c | 2010-06-17 13:10:52 -0400 | [diff] [blame] | 185 | enum XGI_CHIP_TYPE chip; |
apatard@mandriva.com | d7636e0 | 2010-05-19 10:44:14 +0200 | [diff] [blame] | 186 | unsigned char revision_id; |
| 187 | |
| 188 | unsigned short DstColor; |
| 189 | unsigned long XGI310_AccelDepth; |
| 190 | unsigned long CommandReg; |
| 191 | |
| 192 | spinlock_t lockaccel; |
| 193 | |
| 194 | unsigned int pcibus; |
| 195 | unsigned int pcislot; |
| 196 | unsigned int pcifunc; |
| 197 | |
| 198 | int accel; |
| 199 | unsigned short subsysvendor; |
| 200 | unsigned short subsysdevice; |
| 201 | |
| 202 | char reserved[236]; |
| 203 | }; |
| 204 | |
| 205 | |
| 206 | extern struct video_info xgi_video_info; |
| 207 | |
apatard@mandriva.com | d7636e0 | 2010-05-19 10:44:14 +0200 | [diff] [blame] | 208 | #endif |