Lines Matching refs:par
158 static inline u8 vga_inb(struct tdfx_par *par, u32 reg) in vga_inb() argument
160 return inb(par->iobase + reg - 0x300); in vga_inb()
163 static inline void vga_outb(struct tdfx_par *par, u32 reg, u8 val) in vga_outb() argument
165 outb(val, par->iobase + reg - 0x300); in vga_outb()
168 static inline void gra_outb(struct tdfx_par *par, u32 idx, u8 val) in gra_outb() argument
170 vga_outb(par, GRA_I, idx); in gra_outb()
172 vga_outb(par, GRA_D, val); in gra_outb()
176 static inline void seq_outb(struct tdfx_par *par, u32 idx, u8 val) in seq_outb() argument
178 vga_outb(par, SEQ_I, idx); in seq_outb()
180 vga_outb(par, SEQ_D, val); in seq_outb()
184 static inline u8 seq_inb(struct tdfx_par *par, u32 idx) in seq_inb() argument
186 vga_outb(par, SEQ_I, idx); in seq_inb()
188 return vga_inb(par, SEQ_D); in seq_inb()
191 static inline void crt_outb(struct tdfx_par *par, u32 idx, u8 val) in crt_outb() argument
193 vga_outb(par, CRT_I, idx); in crt_outb()
195 vga_outb(par, CRT_D, val); in crt_outb()
199 static inline u8 crt_inb(struct tdfx_par *par, u32 idx) in crt_inb() argument
201 vga_outb(par, CRT_I, idx); in crt_inb()
203 return vga_inb(par, CRT_D); in crt_inb()
206 static inline void att_outb(struct tdfx_par *par, u32 idx, u8 val) in att_outb() argument
210 tmp = vga_inb(par, IS1_R); in att_outb()
211 vga_outb(par, ATT_IW, idx); in att_outb()
212 vga_outb(par, ATT_IW, val); in att_outb()
215 static inline void vga_disable_video(struct tdfx_par *par) in vga_disable_video() argument
219 s = seq_inb(par, 0x01) | 0x20; in vga_disable_video()
220 seq_outb(par, 0x00, 0x01); in vga_disable_video()
221 seq_outb(par, 0x01, s); in vga_disable_video()
222 seq_outb(par, 0x00, 0x03); in vga_disable_video()
225 static inline void vga_enable_video(struct tdfx_par *par) in vga_enable_video() argument
229 s = seq_inb(par, 0x01) & 0xdf; in vga_enable_video()
230 seq_outb(par, 0x00, 0x01); in vga_enable_video()
231 seq_outb(par, 0x01, s); in vga_enable_video()
232 seq_outb(par, 0x00, 0x03); in vga_enable_video()
235 static inline void vga_enable_palette(struct tdfx_par *par) in vga_enable_palette() argument
237 vga_inb(par, IS1_R); in vga_enable_palette()
239 vga_outb(par, ATT_IW, 0x20); in vga_enable_palette()
242 static inline u32 tdfx_inl(struct tdfx_par *par, unsigned int reg) in tdfx_inl() argument
244 return readl(par->regbase_virt + reg); in tdfx_inl()
247 static inline void tdfx_outl(struct tdfx_par *par, unsigned int reg, u32 val) in tdfx_outl() argument
249 writel(val, par->regbase_virt + reg); in tdfx_outl()
252 static inline void banshee_make_room(struct tdfx_par *par, int size) in banshee_make_room() argument
256 while ((tdfx_inl(par, STATUS) & 0x1f) < size - 1) in banshee_make_room()
262 struct tdfx_par *par = info->par; in banshee_wait_idle() local
265 banshee_make_room(par, 1); in banshee_wait_idle()
266 tdfx_outl(par, COMMAND_3D, COMMAND_3D_NOP); in banshee_wait_idle()
269 if ((tdfx_inl(par, STATUS) & STATUS_BUSY) == 0) in banshee_wait_idle()
279 static inline void do_setpalentry(struct tdfx_par *par, unsigned regno, u32 c) in do_setpalentry() argument
281 banshee_make_room(par, 2); in do_setpalentry()
282 tdfx_outl(par, DACADDR, regno); in do_setpalentry()
284 tdfx_inl(par, DACADDR); in do_setpalentry()
285 tdfx_outl(par, DACDATA, c); in do_setpalentry()
339 struct tdfx_par *par = info->par; in do_write_regs() local
344 tdfx_outl(par, MISCINIT1, tdfx_inl(par, MISCINIT1) | 0x01); in do_write_regs()
346 crt_outb(par, 0x11, crt_inb(par, 0x11) & 0x7f); /* CRT unprotect */ in do_write_regs()
348 banshee_make_room(par, 3); in do_write_regs()
349 tdfx_outl(par, VGAINIT1, reg->vgainit1 & 0x001FFFFF); in do_write_regs()
350 tdfx_outl(par, VIDPROCCFG, reg->vidcfg & ~0x00000001); in do_write_regs()
352 tdfx_outl(par, PLLCTRL1, reg->mempll); in do_write_regs()
353 tdfx_outl(par, PLLCTRL2, reg->gfxpll); in do_write_regs()
355 tdfx_outl(par, PLLCTRL0, reg->vidpll); in do_write_regs()
357 vga_outb(par, MISC_W, reg->misc[0x00] | 0x01); in do_write_regs()
360 seq_outb(par, i, reg->seq[i]); in do_write_regs()
363 crt_outb(par, i, reg->crt[i]); in do_write_regs()
366 gra_outb(par, i, reg->gra[i]); in do_write_regs()
369 att_outb(par, i, reg->att[i]); in do_write_regs()
371 crt_outb(par, 0x1a, reg->ext[0]); in do_write_regs()
372 crt_outb(par, 0x1b, reg->ext[1]); in do_write_regs()
374 vga_enable_palette(par); in do_write_regs()
375 vga_enable_video(par); in do_write_regs()
377 banshee_make_room(par, 9); in do_write_regs()
378 tdfx_outl(par, VGAINIT0, reg->vgainit0); in do_write_regs()
379 tdfx_outl(par, DACMODE, reg->dacmode); in do_write_regs()
380 tdfx_outl(par, VIDDESKSTRIDE, reg->stride); in do_write_regs()
381 tdfx_outl(par, HWCURPATADDR, reg->curspataddr); in do_write_regs()
383 tdfx_outl(par, VIDSCREENSIZE, reg->screensize); in do_write_regs()
384 tdfx_outl(par, VIDDESKSTART, reg->startaddr); in do_write_regs()
385 tdfx_outl(par, VIDPROCCFG, reg->vidcfg); in do_write_regs()
386 tdfx_outl(par, VGAINIT1, reg->vgainit1); in do_write_regs()
387 tdfx_outl(par, MISCINIT0, reg->miscinit0); in do_write_regs()
389 banshee_make_room(par, 8); in do_write_regs()
390 tdfx_outl(par, SRCBASE, reg->startaddr); in do_write_regs()
391 tdfx_outl(par, DSTBASE, reg->startaddr); in do_write_regs()
392 tdfx_outl(par, COMMANDEXTRA_2D, 0); in do_write_regs()
393 tdfx_outl(par, CLIP0MIN, 0); in do_write_regs()
394 tdfx_outl(par, CLIP0MAX, 0x0fff0fff); in do_write_regs()
395 tdfx_outl(par, CLIP1MIN, 0); in do_write_regs()
396 tdfx_outl(par, CLIP1MAX, 0x0fff0fff); in do_write_regs()
397 tdfx_outl(par, SRCXY, 0); in do_write_regs()
402 static unsigned long do_lfb_size(struct tdfx_par *par, unsigned short dev_id) in do_lfb_size() argument
404 u32 draminit0 = tdfx_inl(par, DRAMINIT0); in do_lfb_size()
405 u32 draminit1 = tdfx_inl(par, DRAMINIT1); in do_lfb_size()
424 miscinit1 = tdfx_inl(par, MISCINIT1); in do_lfb_size()
428 banshee_make_room(par, 1); in do_lfb_size()
429 tdfx_outl(par, MISCINIT1, miscinit1); in do_lfb_size()
437 struct tdfx_par *par = info->par; in tdfxfb_check_var() local
465 (par->max_pixclock < VOODOO3_MAX_PIXCLOCK)) { in tdfxfb_check_var()
499 if (PICOS2KHZ(var->pixclock) > par->max_pixclock) { in tdfxfb_check_var()
544 struct tdfx_par *par = info->par; in tdfxfb_set_par() local
568 if (freq > par->max_pixclock / 2) { in tdfxfb_set_par()
569 freq = freq > par->max_pixclock ? par->max_pixclock : freq; in tdfxfb_set_par()
682 reg.vgainit1 = tdfx_inl(par, VGAINIT1) & 0x1fffff; in tdfxfb_set_par()
704 reg.miscinit0 = tdfx_inl(par, MISCINIT0); in tdfxfb_set_par()
742 struct tdfx_par *par = info->par; in tdfxfb_setcolreg() local
761 do_setpalentry(par, regno, rgbcol); in tdfxfb_setcolreg()
774 par->palette[regno] = rgbcol; in tdfxfb_setcolreg()
789 struct tdfx_par *par = info->par; in tdfxfb_blank() local
791 u32 dacmode = tdfx_inl(par, DACMODE); in tdfxfb_blank()
812 banshee_make_room(par, 1); in tdfxfb_blank()
813 tdfx_outl(par, DACMODE, dacmode); in tdfxfb_blank()
815 vga_disable_video(par); in tdfxfb_blank()
817 vga_enable_video(par); in tdfxfb_blank()
827 struct tdfx_par *par = info->par; in tdfxfb_pan_display() local
833 banshee_make_room(par, 1); in tdfxfb_pan_display()
834 tdfx_outl(par, VIDDESKSTART, addr); in tdfxfb_pan_display()
846 struct tdfx_par *par = info->par; in tdfxfb_fillrect() local
870 banshee_make_room(par, 6); in tdfxfb_fillrect()
871 tdfx_outl(par, DSTFORMAT, fmt); in tdfxfb_fillrect()
873 tdfx_outl(par, COLORFORE, rect->color); in tdfxfb_fillrect()
875 tdfx_outl(par, COLORFORE, par->palette[rect->color]); in tdfxfb_fillrect()
877 tdfx_outl(par, COMMAND_2D, COMMAND_2D_FILLRECT | (tdfx_rop << 24)); in tdfxfb_fillrect()
878 tdfx_outl(par, DSTBASE, dstbase); in tdfxfb_fillrect()
879 tdfx_outl(par, DSTSIZE, rect->width | (rect->height << 16)); in tdfxfb_fillrect()
880 tdfx_outl(par, LAUNCH_2D, dx | (dy << 16)); in tdfxfb_fillrect()
889 struct tdfx_par *par = info->par; in tdfxfb_copyarea() local
932 banshee_make_room(par, 8); in tdfxfb_copyarea()
934 tdfx_outl(par, SRCFORMAT, fmt); in tdfxfb_copyarea()
935 tdfx_outl(par, DSTFORMAT, fmt); in tdfxfb_copyarea()
936 tdfx_outl(par, COMMAND_2D, blitcmd); in tdfxfb_copyarea()
937 tdfx_outl(par, DSTSIZE, area->width | (area->height << 16)); in tdfxfb_copyarea()
938 tdfx_outl(par, DSTXY, dx | (dy << 16)); in tdfxfb_copyarea()
939 tdfx_outl(par, SRCBASE, srcbase); in tdfxfb_copyarea()
940 tdfx_outl(par, DSTBASE, dstbase); in tdfxfb_copyarea()
941 tdfx_outl(par, LAUNCH_2D, sx | (sy << 16)); in tdfxfb_copyarea()
946 struct tdfx_par *par = info->par; in tdfxfb_imageblit() local
960 banshee_make_room(par, 6 + ((size + 3) >> 2)); in tdfxfb_imageblit()
968 banshee_make_room(par, 9); in tdfxfb_imageblit()
971 tdfx_outl(par, COLORFORE, image->fg_color); in tdfxfb_imageblit()
972 tdfx_outl(par, COLORBACK, image->bg_color); in tdfxfb_imageblit()
976 tdfx_outl(par, COLORFORE, in tdfxfb_imageblit()
977 par->palette[image->fg_color]); in tdfxfb_imageblit()
978 tdfx_outl(par, COLORBACK, in tdfxfb_imageblit()
979 par->palette[image->bg_color]); in tdfxfb_imageblit()
997 tdfx_outl(par, DSTBASE, dstbase); in tdfxfb_imageblit()
998 tdfx_outl(par, SRCXY, 0); in tdfxfb_imageblit()
999 tdfx_outl(par, DSTXY, dx | (dy << 16)); in tdfxfb_imageblit()
1000 tdfx_outl(par, COMMAND_2D, in tdfxfb_imageblit()
1002 tdfx_outl(par, SRCFORMAT, srcfmt); in tdfxfb_imageblit()
1003 tdfx_outl(par, DSTFORMAT, dstfmt); in tdfxfb_imageblit()
1004 tdfx_outl(par, DSTSIZE, image->width | (image->height << 16)); in tdfxfb_imageblit()
1014 banshee_make_room(par, fifo_free); in tdfxfb_imageblit()
1016 tdfx_outl(par, LAUNCH_2D, *(u32 *)chardata); in tdfxfb_imageblit()
1021 banshee_make_room(par, 3); in tdfxfb_imageblit()
1026 tdfx_outl(par, LAUNCH_2D, *chardata); in tdfxfb_imageblit()
1029 tdfx_outl(par, LAUNCH_2D, *(u16 *)chardata); in tdfxfb_imageblit()
1032 tdfx_outl(par, LAUNCH_2D, in tdfxfb_imageblit()
1041 struct tdfx_par *par = info->par; in tdfxfb_cursor() local
1053 vidcfg = tdfx_inl(par, VIDPROCCFG); in tdfxfb_cursor()
1055 tdfx_outl(par, VIDPROCCFG, vidcfg | VIDCFG_HWCURSOR_ENABLE); in tdfxfb_cursor()
1057 tdfx_outl(par, VIDPROCCFG, vidcfg & ~VIDCFG_HWCURSOR_ENABLE); in tdfxfb_cursor()
1080 banshee_make_room(par, 2); in tdfxfb_cursor()
1081 tdfx_outl(par, HWCURC0, bg_color); in tdfxfb_cursor()
1082 tdfx_outl(par, HWCURC1, fg_color); in tdfxfb_cursor()
1091 banshee_make_room(par, 1); in tdfxfb_cursor()
1092 tdfx_outl(par, HWCURLOC, (y << 16) + x); in tdfxfb_cursor()
1169 struct tdfx_par *par = chan->par; in tdfxfb_i2c_setscl() local
1172 r = tdfx_inl(par, VIDSERPARPORT); in tdfxfb_i2c_setscl()
1177 tdfx_outl(par, VIDSERPARPORT, r); in tdfxfb_i2c_setscl()
1178 tdfx_inl(par, VIDSERPARPORT); /* flush posted write */ in tdfxfb_i2c_setscl()
1184 struct tdfx_par *par = chan->par; in tdfxfb_i2c_setsda() local
1187 r = tdfx_inl(par, VIDSERPARPORT); in tdfxfb_i2c_setsda()
1192 tdfx_outl(par, VIDSERPARPORT, r); in tdfxfb_i2c_setsda()
1193 tdfx_inl(par, VIDSERPARPORT); /* flush posted write */ in tdfxfb_i2c_setsda()
1203 struct tdfx_par *par = chan->par; in tdfxfb_i2c_getscl() local
1205 return (0 != (tdfx_inl(par, VIDSERPARPORT) & I2C_SCL_IN)); in tdfxfb_i2c_getscl()
1211 struct tdfx_par *par = chan->par; in tdfxfb_i2c_getsda() local
1213 return (0 != (tdfx_inl(par, VIDSERPARPORT) & I2C_SDA_IN)); in tdfxfb_i2c_getsda()
1219 struct tdfx_par *par = chan->par; in tdfxfb_ddc_setscl() local
1222 r = tdfx_inl(par, VIDSERPARPORT); in tdfxfb_ddc_setscl()
1227 tdfx_outl(par, VIDSERPARPORT, r); in tdfxfb_ddc_setscl()
1228 tdfx_inl(par, VIDSERPARPORT); /* flush posted write */ in tdfxfb_ddc_setscl()
1234 struct tdfx_par *par = chan->par; in tdfxfb_ddc_setsda() local
1237 r = tdfx_inl(par, VIDSERPARPORT); in tdfxfb_ddc_setsda()
1242 tdfx_outl(par, VIDSERPARPORT, r); in tdfxfb_ddc_setsda()
1243 tdfx_inl(par, VIDSERPARPORT); /* flush posted write */ in tdfxfb_ddc_setsda()
1249 struct tdfx_par *par = chan->par; in tdfxfb_ddc_getscl() local
1251 return (0 != (tdfx_inl(par, VIDSERPARPORT) & DDC_SCL_IN)); in tdfxfb_ddc_getscl()
1257 struct tdfx_par *par = chan->par; in tdfxfb_ddc_getsda() local
1259 return (0 != (tdfx_inl(par, VIDSERPARPORT) & DDC_SDA_IN)); in tdfxfb_ddc_getsda()
1286 chan->par = NULL; in tdfxfb_setup_ddc_bus()
1314 chan->par = NULL; in tdfxfb_setup_i2c_bus()
1321 struct tdfx_par *par = info->par; in tdfxfb_create_i2c_busses() local
1323 tdfx_outl(par, VIDINFORMAT, 0x8160); in tdfxfb_create_i2c_busses()
1324 tdfx_outl(par, VIDSERPARPORT, 0xcffc0020); in tdfxfb_create_i2c_busses()
1326 par->chan[0].par = par; in tdfxfb_create_i2c_busses()
1327 par->chan[1].par = par; in tdfxfb_create_i2c_busses()
1329 tdfxfb_setup_ddc_bus(&par->chan[0], "Voodoo3-DDC", info->dev); in tdfxfb_create_i2c_busses()
1330 tdfxfb_setup_i2c_bus(&par->chan[1], "Voodoo3-I2C", info->dev); in tdfxfb_create_i2c_busses()
1333 static void tdfxfb_delete_i2c_busses(struct tdfx_par *par) in tdfxfb_delete_i2c_busses() argument
1335 if (par->chan[0].par) in tdfxfb_delete_i2c_busses()
1336 i2c_del_adapter(&par->chan[0].adapter); in tdfxfb_delete_i2c_busses()
1337 par->chan[0].par = NULL; in tdfxfb_delete_i2c_busses()
1339 if (par->chan[1].par) in tdfxfb_delete_i2c_busses()
1340 i2c_del_adapter(&par->chan[1].adapter); in tdfxfb_delete_i2c_busses()
1341 par->chan[1].par = NULL; in tdfxfb_delete_i2c_busses()
1344 static int tdfxfb_probe_i2c_connector(struct tdfx_par *par, in tdfxfb_probe_i2c_connector() argument
1350 if (par->chan[0].par) in tdfxfb_probe_i2c_connector()
1351 edid = fb_ddc_read(&par->chan[0].adapter); in tdfxfb_probe_i2c_connector()
1390 default_par = info->par; in tdfxfb_probe()
1605 struct tdfx_par *par = info->par; in tdfxfb_remove() local
1609 tdfxfb_delete_i2c_busses(par); in tdfxfb_remove()
1611 arch_phys_wc_del(par->wc_cookie); in tdfxfb_remove()
1612 iounmap(par->regbase_virt); in tdfxfb_remove()