4 #define FB_ACCEL_SMI 0xab
6 #define MHZ(x) ((x) * 1000000)
8 #define DEFAULT_SM750_CHIP_CLOCK 290
9 #define DEFAULT_SM750LE_CHIP_CLOCK 333
10 #ifndef SM750LE_REVISION_ID
11 #define SM750LE_REVISION_ID ((unsigned char)0xfe)
15 sm750_24TFT = 0, /* 24bit tft */
16 sm750_dualTFT = 2, /* dual 18 bit tft */
17 sm750_doubleTFT = 1, /* 36 bit double pixel tft */
20 /* vga channel is not concerned */
22 sm750_simul_pri, /* primary => all head */
23 sm750_simul_sec, /* secondary => all head */
24 sm750_dual_normal, /* primary => panel head and secondary => crt */
25 sm750_dual_swap, /* primary => crt head and secondary => panel */
30 /* enum value equal to the register filed data */
37 sm750_pnc = 3, /* panel and crt */
42 /* below three clocks are in unit of MHZ*/
51 /* base virtual address of DPR registers */
52 volatile unsigned char __iomem *dprBase;
53 /* base virtual address of de data port */
54 volatile unsigned char __iomem *dpPortBase;
56 /* function pointers */
57 void (*de_init)(struct lynx_accel *);
59 int (*de_wait)(void);/* see if hardware ready to work */
61 int (*de_fillrect)(struct lynx_accel *, u32, u32, u32, u32,
62 u32, u32, u32, u32, u32);
64 int (*de_copyarea)(struct lynx_accel *, u32, u32, u32, u32,
68 int (*de_imageblit)(struct lynx_accel *, const char *, u32, u32, u32, u32,
79 struct fb_info *fbinfo[2];
80 struct lynx_accel accel;
87 /* all smi graphic adaptor got below attributes */
88 unsigned long vidmem_start;
89 unsigned long vidreg_start;
93 unsigned char __iomem *pvMem;
97 struct init_status initParm;
98 enum sm750_pnltype pnltype;
99 enum sm750_dataflow dataflow;
103 * 0: no hardware cursor
104 * 1: primary crtc hw cursor enabled,
105 * 2: secondary crtc hw cursor enabled
106 * 3: both ctrc hw cursor enabled
112 /* cursor width ,height and size */
116 /* hardware limitation */
119 /* base virtual address and offset of cursor image */
120 char __iomem *vstart;
122 /* mmio addr of hw cursor */
123 volatile char __iomem *mmio;
127 unsigned char __iomem *vCursor; /* virtual address of cursor */
128 unsigned char __iomem *vScreen; /* virtual address of on_screen */
129 int oCursor; /* cursor address offset in vidmem */
130 int oScreen; /* onscreen address offset in vidmem */
131 int channel;/* which channel this crtc stands for*/
132 resource_size_t vidmem_size;/* this view's video memory max size */
134 /* below attributes belong to info->fix, their value depends on specific adaptor*/
135 u16 line_pad;/* padding information:0,1,2,4,8,16,... */
142 /* cursor information */
143 struct lynx_cursor cursor;
146 struct lynxfb_output {
150 * which paths(s) this output stands for,for sm750:
151 * paths=1:means output for panel paths
152 * paths=2:means output for crt paths
153 * paths=3:means output for both panel and crt paths
158 * which channel these outputs linked with,for sm750:
159 * *channel=0 means primary channel
160 * *channel=1 means secondary channel
161 * output->channel ==> &crtc->channel
165 int (*proc_setBLANK)(struct lynxfb_output*, int);
169 /* either 0 or 1 for dual head adaptor,0 is the older one registered */
171 unsigned int pseudo_palette[256];
172 struct lynxfb_crtc crtc;
173 struct lynxfb_output output;
174 struct fb_info *info;
175 struct sm750_dev *dev;
178 static inline unsigned long ps_to_hz(unsigned int psvalue)
180 unsigned long long numerator = 1000 * 1000 * 1000 * 1000ULL;
181 /* 10^12 / picosecond period gives frequency in Hz */
182 do_div(numerator, psvalue);
183 return (unsigned long)numerator;
186 int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev);
187 int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev);
188 void hw_sm750_initAccel(struct sm750_dev *sm750_dev);
189 int hw_sm750_deWait(void);
190 int hw_sm750le_deWait(void);
192 int hw_sm750_output_setMode(struct lynxfb_output *output,
193 struct fb_var_screeninfo *var,
194 struct fb_fix_screeninfo *fix);
196 int hw_sm750_crtc_checkMode(struct lynxfb_crtc *crtc,
197 struct fb_var_screeninfo *var);
199 int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc,
200 struct fb_var_screeninfo *var,
201 struct fb_fix_screeninfo *fix);
203 int hw_sm750_setColReg(struct lynxfb_crtc *crtc, ushort index,
204 ushort red, ushort green, ushort blue);
206 int hw_sm750_setBLANK(struct lynxfb_output *output, int blank);
207 int hw_sm750le_setBLANK(struct lynxfb_output *output, int blank);
208 int hw_sm750_pan_display(struct lynxfb_crtc *crtc,
209 const struct fb_var_screeninfo *var,
210 const struct fb_info *info);