Rev 467 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
467 | giacomo | 1 | #ifndef _LINUX_SISFB |
2 | #define _LINUX_SISFB |
||
3 | |||
4 | #include <linux/spinlock.h> |
||
5 | |||
6 | #include <asm/ioctl.h> |
||
7 | #include <asm/types.h> |
||
8 | |||
9 | #define DISPTYPE_CRT1 0x00000008L |
||
10 | #define DISPTYPE_CRT2 0x00000004L |
||
11 | #define DISPTYPE_LCD 0x00000002L |
||
12 | #define DISPTYPE_TV 0x00000001L |
||
13 | #define DISPTYPE_DISP1 DISPTYPE_CRT1 |
||
14 | #define DISPTYPE_DISP2 (DISPTYPE_CRT2 | DISPTYPE_LCD | DISPTYPE_TV) |
||
15 | #define DISPMODE_SINGLE 0x00000020L |
||
16 | #define DISPMODE_MIRROR 0x00000010L |
||
17 | #define DISPMODE_DUALVIEW 0x00000040L |
||
18 | |||
19 | #define HASVB_NONE 0x00 |
||
20 | #define HASVB_301 0x01 |
||
21 | #define HASVB_LVDS 0x02 |
||
22 | #define HASVB_TRUMPION 0x04 |
||
23 | #define HASVB_LVDS_CHRONTEL 0x10 |
||
24 | #define HASVB_302 0x20 |
||
25 | #define HASVB_303 0x40 |
||
26 | #define HASVB_CHRONTEL 0x80 |
||
27 | |||
28 | /* TW: *Never* change the order of the following enum */ |
||
29 | typedef enum _SIS_CHIP_TYPE { |
||
30 | SIS_VGALegacy = 0, |
||
31 | SIS_300, |
||
32 | SIS_630, |
||
33 | SIS_540, |
||
34 | SIS_730, |
||
35 | SIS_315H, |
||
36 | SIS_315, |
||
37 | SIS_315PRO, |
||
38 | SIS_550, |
||
39 | SIS_650, |
||
40 | SIS_740, |
||
41 | SIS_330, |
||
42 | MAX_SIS_CHIP |
||
43 | } SIS_CHIP_TYPE; |
||
44 | |||
45 | typedef enum _VGA_ENGINE { |
||
46 | UNKNOWN_VGA = 0, |
||
47 | SIS_300_VGA, |
||
48 | SIS_315_VGA, |
||
49 | } VGA_ENGINE; |
||
50 | |||
51 | typedef enum _TVTYPE { |
||
52 | TVMODE_NTSC = 0, |
||
53 | TVMODE_PAL, |
||
54 | TVMODE_HIVISION, |
||
55 | TVMODE_TOTAL |
||
56 | } SIS_TV_TYPE; |
||
57 | |||
58 | typedef enum _TVPLUGTYPE { |
||
59 | TVPLUG_Legacy = 0, |
||
60 | TVPLUG_COMPOSITE, |
||
61 | TVPLUG_SVIDEO, |
||
62 | TVPLUG_SCART, |
||
63 | TVPLUG_TOTAL |
||
64 | } SIS_TV_PLUG; |
||
65 | |||
66 | struct sis_memreq { |
||
67 | unsigned long offset; |
||
68 | unsigned long size; |
||
69 | }; |
||
70 | |||
71 | struct mode_info { |
||
72 | int bpp; |
||
73 | int xres; |
||
74 | int yres; |
||
75 | int v_xres; |
||
76 | int v_yres; |
||
77 | int org_x; |
||
78 | int org_y; |
||
79 | unsigned int vrate; |
||
80 | }; |
||
81 | |||
82 | struct ap_data { |
||
83 | struct mode_info minfo; |
||
84 | unsigned long iobase; |
||
85 | unsigned int mem_size; |
||
86 | unsigned long disp_state; |
||
87 | SIS_CHIP_TYPE chip; |
||
88 | unsigned char hasVB; |
||
89 | SIS_TV_TYPE TV_type; |
||
90 | SIS_TV_PLUG TV_plug; |
||
91 | unsigned long version; |
||
92 | char reserved[256]; |
||
93 | }; |
||
94 | |||
95 | struct video_info { |
||
96 | int chip_id; |
||
97 | unsigned int video_size; |
||
98 | unsigned long video_base; |
||
99 | char * video_vbase; |
||
100 | unsigned long mmio_base; |
||
101 | char * mmio_vbase; |
||
102 | unsigned long vga_base; |
||
103 | unsigned long mtrr; |
||
104 | unsigned long heapstart; |
||
105 | |||
106 | int video_bpp; |
||
107 | int video_cmap_len; |
||
108 | int video_width; |
||
109 | int video_height; |
||
110 | int video_vwidth; |
||
111 | int video_vheight; |
||
112 | int org_x; |
||
113 | int org_y; |
||
114 | int video_linelength; |
||
115 | unsigned int refresh_rate; |
||
116 | |||
117 | unsigned long disp_state; |
||
118 | unsigned char hasVB; |
||
119 | unsigned char TV_type; |
||
120 | unsigned char TV_plug; |
||
121 | |||
122 | SIS_CHIP_TYPE chip; |
||
123 | unsigned char revision_id; |
||
124 | |||
125 | unsigned short DstColor; /* TW: For 2d acceleration */ |
||
126 | unsigned long SiS310_AccelDepth; |
||
127 | unsigned long CommandReg; |
||
128 | |||
129 | spinlock_t lockaccel; |
||
130 | |||
131 | unsigned int pcibus; |
||
132 | unsigned int pcislot; |
||
133 | unsigned int pcifunc; |
||
134 | |||
135 | int accel; |
||
136 | |||
137 | unsigned short subsysvendor; |
||
138 | unsigned short subsysdevice; |
||
139 | |||
140 | char reserved[236]; |
||
141 | }; |
||
142 | |||
143 | |||
144 | /* TW: Addtional IOCTL for communication sisfb <> X driver */ |
||
145 | /* If changing this, vgatypes.h must also be changed (for X driver) */ |
||
146 | |||
147 | /* TW: ioctl for identifying and giving some info (esp. memory heap start) */ |
||
148 | |||
149 | /* |
||
150 | * NOTE! The ioctl types used to be "size_t" by mistake, but were |
||
151 | * really meant to be __u32. Changed to "__u32" even though that |
||
152 | * changes the value on 64-bit architectures, because the value |
||
153 | * (with a 4-byte size) is also hardwired in vgatypes.h for user |
||
154 | * space exports. So "__u32" is actually more compatible, duh! |
||
155 | */ |
||
156 | #define SISFB_GET_INFO _IOR('n',0xF8,__u32) |
||
157 | #define SISFB_GET_VBRSTATUS _IOR('n',0xF9,__u32) |
||
158 | |||
159 | /* TW: Structure argument for SISFB_GET_INFO ioctl */ |
||
160 | typedef struct _SISFB_INFO sisfb_info, *psisfb_info; |
||
161 | |||
162 | struct _SISFB_INFO { |
||
163 | unsigned long sisfb_id; /* for identifying sisfb */ |
||
164 | #ifndef SISFB_ID |
||
165 | #define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */ |
||
166 | #endif |
||
167 | int chip_id; /* PCI ID of detected chip */ |
||
168 | int memory; /* video memory in KB which sisfb manages */ |
||
169 | int heapstart; /* heap start (= sisfb "mem" argument) in KB */ |
||
170 | unsigned char fbvidmode; /* current sisfb mode */ |
||
171 | |||
172 | unsigned char sisfb_version; |
||
173 | unsigned char sisfb_revision; |
||
174 | unsigned char sisfb_patchlevel; |
||
175 | |||
176 | unsigned char sisfb_caps; /* Sisfb capabilities */ |
||
177 | |||
178 | int sisfb_tqlen; /* turbo queue length (in KB) */ |
||
179 | |||
180 | unsigned int sisfb_pcibus; /* The card's PCI ID */ |
||
181 | unsigned int sisfb_pcislot; |
||
182 | unsigned int sisfb_pcifunc; |
||
183 | |||
184 | unsigned char sisfb_lcdpdc; /* PanelDelayCompensation */ |
||
185 | |||
186 | unsigned char sisfb_lcda; /* Detected status of LCDA for low res/text modes */ |
||
187 | |||
188 | char reserved[235]; /* for future use */ |
||
189 | }; |
||
190 | |||
191 | #ifdef __KERNEL__ |
||
192 | extern struct video_info ivideo; |
||
193 | |||
194 | extern void sis_malloc(struct sis_memreq *req); |
||
195 | extern void sis_free(unsigned long base); |
||
196 | extern void sis_dispinfo(struct ap_data *rec); |
||
197 | #endif |
||
198 | #endif |