Merge branch 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6

* 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6:
sisfb: delete osdef.h
sisfb: move the CONFIG warning to sis_main.c
sisfb: replace SiS_SetMemory with memset_io
sisfb: remove InPort/OutPort wrappers
sisfb: use CONFIG_FB_SIS_301/315 instead of SIS301/315H
sisfb: delete redudant #define SIS_LINUX_KERNEL
sisfb: delete dead SIS_XORG_XF86 code
sisfb: delete fallback code for pci_map_rom()
sisfb: delete obsolete PCI ROM bug workaround
fbdev: Update documentation index file.
lxfb: Program panel v/h sync output polarity correctly
fbcmap: integer overflow bug
fbcmap: cleanup white space in fb_alloc_cmap()
MAINTAINERS: Add fbdev patchwork entry, tidy up file patterns.
fbdev: da8xx: punt duplicated FBIO_WAITFORVSYNC define
fbdev: sh_mobile_lcdcfb: fix bug in reconfig()

+284 -1280
+25 -7
Documentation/fb/00-INDEX
··· 4 4 Geert Uytterhoeven <geert@linux-m68k.org> 5 5 6 6 00-INDEX 7 - - this file 7 + - this file. 8 8 arkfb.txt 9 9 - info on the fbdev driver for ARK Logic chips. 10 10 aty128fb.txt 11 11 - info on the ATI Rage128 frame buffer driver. 12 12 cirrusfb.txt 13 13 - info on the driver for Cirrus Logic chipsets. 14 + cmap_xfbdev.txt 15 + - an introduction to fbdev's cmap structures. 14 16 deferred_io.txt 15 17 - an introduction to deferred IO. 18 + efifb.txt 19 + - info on the EFI platform driver for Intel based Apple computers. 20 + ep93xx-fb.txt 21 + - info on the driver for EP93xx LCD controller. 16 22 fbcon.txt 17 23 - intro to and usage guide for the framebuffer console (fbcon). 18 24 framebuffer.txt 19 25 - introduction to frame buffer devices. 20 - imacfb.txt 21 - - info on the generic EFI platform driver for Intel based Macs. 26 + gxfb.txt 27 + - info on the framebuffer driver for AMD Geode GX2 based processors. 22 28 intel810.txt 23 29 - documentation for the Intel 810/815 framebuffer driver. 24 30 intelfb.txt 25 31 - docs for Intel 830M/845G/852GM/855GM/865G/915G/945G fb driver. 26 32 internals.txt 27 33 - quick overview of frame buffer device internals. 34 + lxfb.txt 35 + - info on the framebuffer driver for AMD Geode LX based processors. 28 36 matroxfb.txt 29 37 - info on the Matrox framebuffer driver for Alpha, Intel and PPC. 38 + metronomefb.txt 39 + - info on the driver for the Metronome display controller. 30 40 modedb.txt 31 41 - info on the video mode database. 32 - matroxfb.txt 33 - - info on the Matrox frame buffer driver. 34 42 pvr2fb.txt 35 43 - info on the PowerVR 2 frame buffer driver. 36 44 pxafb.txt ··· 47 39 - info on the fbdev driver for S3 Trio/Virge chips. 48 40 sa1100fb.txt 49 41 - information about the driver for the SA-1100 LCD controller. 42 + sh7760fb.txt 43 + - info on the SH7760/SH7763 integrated LCDC Framebuffer driver. 50 44 sisfb.txt 51 45 - info on the framebuffer device driver for various SiS chips. 52 46 sstfb.txt 53 47 - info on the frame buffer driver for 3dfx' Voodoo Graphics boards. 54 48 tgafb.txt 55 - - info on the TGA (DECChip 21030) frame buffer driver 49 + - info on the TGA (DECChip 21030) frame buffer driver. 50 + tridentfb.txt 51 + info on the framebuffer driver for some Trident chip based cards. 52 + uvesafb.txt 53 + - info on the userspace VESA (VBE2+ compliant) frame buffer device. 56 54 vesafb.txt 57 - - info on the VESA frame buffer device 55 + - info on the VESA frame buffer device. 56 + viafb.modes 57 + - list of modes for VIA Integration Graphic Chip. 58 + viafb.txt 59 + - info on the VIA Integration Graphic Chip console framebuffer driver. 58 60 vt8623fb.txt 59 61 - info on the fb driver for the graphics core in VIA VT8623 chipsets.
+3 -1
MAINTAINERS
··· 2444 2444 FRAMEBUFFER LAYER 2445 2445 L: linux-fbdev@vger.kernel.org 2446 2446 W: http://linux-fbdev.sourceforge.net/ 2447 + Q: http://patchwork.kernel.org/project/linux-fbdev/list/ 2447 2448 T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6.git 2448 2449 S: Orphan 2449 2450 F: Documentation/fb/ 2450 - F: drivers/video/fb* 2451 + F: drivers/video/ 2452 + F: include/video/ 2451 2453 F: include/linux/fb.h 2452 2454 2453 2455 FREESCALE DMA DRIVER
+42 -24
drivers/video/fbcmap.c
··· 88 88 * 89 89 */ 90 90 91 - int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp) 91 + int fb_alloc_cmap_gfp(struct fb_cmap *cmap, int len, int transp, gfp_t flags) 92 92 { 93 - int size = len*sizeof(u16); 93 + int size = len * sizeof(u16); 94 + int ret = -ENOMEM; 94 95 95 - if (cmap->len != len) { 96 - fb_dealloc_cmap(cmap); 97 - if (!len) 98 - return 0; 99 - if (!(cmap->red = kmalloc(size, GFP_ATOMIC))) 100 - goto fail; 101 - if (!(cmap->green = kmalloc(size, GFP_ATOMIC))) 102 - goto fail; 103 - if (!(cmap->blue = kmalloc(size, GFP_ATOMIC))) 104 - goto fail; 105 - if (transp) { 106 - if (!(cmap->transp = kmalloc(size, GFP_ATOMIC))) 96 + if (cmap->len != len) { 97 + fb_dealloc_cmap(cmap); 98 + if (!len) 99 + return 0; 100 + 101 + cmap->red = kmalloc(size, flags); 102 + if (!cmap->red) 103 + goto fail; 104 + cmap->green = kmalloc(size, flags); 105 + if (!cmap->green) 106 + goto fail; 107 + cmap->blue = kmalloc(size, flags); 108 + if (!cmap->blue) 109 + goto fail; 110 + if (transp) { 111 + cmap->transp = kmalloc(size, flags); 112 + if (!cmap->transp) 113 + goto fail; 114 + } else { 115 + cmap->transp = NULL; 116 + } 117 + } 118 + cmap->start = 0; 119 + cmap->len = len; 120 + ret = fb_copy_cmap(fb_default_cmap(len), cmap); 121 + if (ret) 107 122 goto fail; 108 - } else 109 - cmap->transp = NULL; 110 - } 111 - cmap->start = 0; 112 - cmap->len = len; 113 - fb_copy_cmap(fb_default_cmap(len), cmap); 114 - return 0; 123 + return 0; 115 124 116 125 fail: 117 - fb_dealloc_cmap(cmap); 118 - return -ENOMEM; 126 + fb_dealloc_cmap(cmap); 127 + return ret; 128 + } 129 + 130 + int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp) 131 + { 132 + return fb_alloc_cmap_gfp(cmap, len, transp, GFP_ATOMIC); 119 133 } 120 134 121 135 /** ··· 264 250 int rc, size = cmap->len * sizeof(u16); 265 251 struct fb_cmap umap; 266 252 253 + if (size < 0 || size < cmap->len) 254 + return -E2BIG; 255 + 267 256 memset(&umap, 0, sizeof(struct fb_cmap)); 268 - rc = fb_alloc_cmap(&umap, cmap->len, cmap->transp != NULL); 257 + rc = fb_alloc_cmap_gfp(&umap, cmap->len, cmap->transp != NULL, 258 + GFP_KERNEL); 269 259 if (rc) 270 260 return rc; 271 261 if (copy_from_user(umap.red, cmap->red, size) ||
+2 -2
drivers/video/geode/lxfb_ops.c
··· 276 276 write_fp(par, FP_PT1, 0); 277 277 temp = FP_PT2_SCRC; 278 278 279 - if (info->var.sync & FB_SYNC_HOR_HIGH_ACT) 279 + if (!(info->var.sync & FB_SYNC_HOR_HIGH_ACT)) 280 280 temp |= FP_PT2_HSP; 281 281 282 - if (info->var.sync & FB_SYNC_VERT_HIGH_ACT) 282 + if (!(info->var.sync & FB_SYNC_VERT_HIGH_ACT)) 283 283 temp |= FP_PT2_VSP; 284 284 285 285 write_fp(par, FP_PT2, temp);
+2 -2
drivers/video/sh_mobile_lcdcfb.c
··· 860 860 /* Couldn't reconfigure, hopefully, can continue as before */ 861 861 return; 862 862 863 - info->fix.line_length = mode2.xres * (ch->cfg.bpp / 8); 863 + info->fix.line_length = mode1.xres * (ch->cfg.bpp / 8); 864 864 865 865 /* 866 866 * fb_set_var() calls the notifier change internally, only if ··· 868 868 * user event, we have to call the chain ourselves. 869 869 */ 870 870 event.info = info; 871 - event.data = &mode2; 871 + event.data = &mode1; 872 872 fb_notifier_call_chain(evnt, &event); 873 873 } 874 874
+49 -636
drivers/video/sis/init.c
··· 62 62 63 63 #include "init.h" 64 64 65 - #ifdef SIS300 65 + #ifdef CONFIG_FB_SIS_300 66 66 #include "300vtbl.h" 67 67 #endif 68 68 69 - #ifdef SIS315H 69 + #ifdef CONFIG_FB_SIS_315 70 70 #include "310vtbl.h" 71 71 #endif 72 72 ··· 78 78 /* POINTER INITIALIZATION */ 79 79 /*********************************************/ 80 80 81 - #if defined(SIS300) || defined(SIS315H) 81 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 82 82 static void 83 83 InitCommonPointer(struct SiS_Private *SiS_Pr) 84 84 { ··· 160 160 } 161 161 #endif 162 162 163 - #ifdef SIS300 163 + #ifdef CONFIG_FB_SIS_300 164 164 static void 165 165 InitTo300Pointer(struct SiS_Private *SiS_Pr) 166 166 { ··· 237 237 } 238 238 #endif 239 239 240 - #ifdef SIS315H 240 + #ifdef CONFIG_FB_SIS_315 241 241 static void 242 242 InitTo310Pointer(struct SiS_Private *SiS_Pr) 243 243 { ··· 321 321 SiSInitPtr(struct SiS_Private *SiS_Pr) 322 322 { 323 323 if(SiS_Pr->ChipType < SIS_315H) { 324 - #ifdef SIS300 324 + #ifdef CONFIG_FB_SIS_300 325 325 InitTo300Pointer(SiS_Pr); 326 326 #else 327 327 return false; 328 328 #endif 329 329 } else { 330 - #ifdef SIS315H 330 + #ifdef CONFIG_FB_SIS_315 331 331 InitTo310Pointer(SiS_Pr); 332 332 #else 333 333 return false; ··· 340 340 /* HELPER: Get ModeID */ 341 341 /*********************************************/ 342 342 343 - #ifndef SIS_XORG_XF86 344 343 static 345 - #endif 346 344 unsigned short 347 345 SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, 348 346 int Depth, bool FSTN, int LCDwidth, int LCDheight) ··· 882 884 void 883 885 SiS_SetReg(SISIOADDRESS port, unsigned short index, unsigned short data) 884 886 { 885 - OutPortByte(port, index); 886 - OutPortByte(port + 1, data); 887 + outb((u8)index, port); 888 + outb((u8)data, port + 1); 887 889 } 888 890 889 891 void 890 892 SiS_SetRegByte(SISIOADDRESS port, unsigned short data) 891 893 { 892 - OutPortByte(port, data); 894 + outb((u8)data, port); 893 895 } 894 896 895 897 void 896 898 SiS_SetRegShort(SISIOADDRESS port, unsigned short data) 897 899 { 898 - OutPortWord(port, data); 900 + outw((u16)data, port); 899 901 } 900 902 901 903 void 902 904 SiS_SetRegLong(SISIOADDRESS port, unsigned int data) 903 905 { 904 - OutPortLong(port, data); 906 + outl((u32)data, port); 905 907 } 906 908 907 909 unsigned char 908 910 SiS_GetReg(SISIOADDRESS port, unsigned short index) 909 911 { 910 - OutPortByte(port, index); 911 - return(InPortByte(port + 1)); 912 + outb((u8)index, port); 913 + return inb(port + 1); 912 914 } 913 915 914 916 unsigned char 915 917 SiS_GetRegByte(SISIOADDRESS port) 916 918 { 917 - return(InPortByte(port)); 919 + return inb(port); 918 920 } 919 921 920 922 unsigned short 921 923 SiS_GetRegShort(SISIOADDRESS port) 922 924 { 923 - return(InPortWord(port)); 925 + return inw(port); 924 926 } 925 927 926 928 unsigned int 927 929 SiS_GetRegLong(SISIOADDRESS port) 928 930 { 929 - return(InPortLong(port)); 931 + return inl(port); 930 932 } 931 933 932 934 void ··· 1087 1089 SiSInitPCIetc(struct SiS_Private *SiS_Pr) 1088 1090 { 1089 1091 switch(SiS_Pr->ChipType) { 1090 - #ifdef SIS300 1092 + #ifdef CONFIG_FB_SIS_300 1091 1093 case SIS_300: 1092 1094 case SIS_540: 1093 1095 case SIS_630: ··· 1106 1108 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x5A); 1107 1109 break; 1108 1110 #endif 1109 - #ifdef SIS315H 1111 + #ifdef CONFIG_FB_SIS_315 1110 1112 case SIS_315H: 1111 1113 case SIS_315: 1112 1114 case SIS_315PRO: ··· 1150 1152 /* HELPER: SetLVDSetc */ 1151 1153 /*********************************************/ 1152 1154 1153 - #ifdef SIS_LINUX_KERNEL 1154 1155 static 1155 - #endif 1156 1156 void 1157 1157 SiSSetLVDSetc(struct SiS_Private *SiS_Pr) 1158 1158 { ··· 1170 1174 if((temp == 1) || (temp == 2)) return; 1171 1175 1172 1176 switch(SiS_Pr->ChipType) { 1173 - #ifdef SIS300 1177 + #ifdef CONFIG_FB_SIS_300 1174 1178 case SIS_540: 1175 1179 case SIS_630: 1176 1180 case SIS_730: ··· 1184 1188 } 1185 1189 break; 1186 1190 #endif 1187 - #ifdef SIS315H 1191 + #ifdef CONFIG_FB_SIS_315 1188 1192 case SIS_550: 1189 1193 case SIS_650: 1190 1194 case SIS_740: ··· 1416 1420 /* HELPER: GetVBType */ 1417 1421 /*********************************************/ 1418 1422 1419 - #ifdef SIS_LINUX_KERNEL 1420 1423 static 1421 - #endif 1422 1424 void 1423 1425 SiS_GetVBType(struct SiS_Private *SiS_Pr) 1424 1426 { ··· 1481 1487 /* HELPER: Check RAM size */ 1482 1488 /*********************************************/ 1483 1489 1484 - #ifdef SIS_LINUX_KERNEL 1485 1490 static bool 1486 1491 SiS_CheckMemorySize(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1487 1492 unsigned short ModeIdIndex) ··· 1494 1501 if(AdapterMemSize < memorysize) return false; 1495 1502 return true; 1496 1503 } 1497 - #endif 1498 1504 1499 1505 /*********************************************/ 1500 1506 /* HELPER: Get DRAM type */ 1501 1507 /*********************************************/ 1502 1508 1503 - #ifdef SIS315H 1509 + #ifdef CONFIG_FB_SIS_315 1504 1510 static unsigned char 1505 1511 SiS_Get310DRAMType(struct SiS_Private *SiS_Pr) 1506 1512 { ··· 1566 1574 /* HELPER: ClearBuffer */ 1567 1575 /*********************************************/ 1568 1576 1569 - #ifdef SIS_LINUX_KERNEL 1570 1577 static void 1571 1578 SiS_ClearBuffer(struct SiS_Private *SiS_Pr, unsigned short ModeNo) 1572 1579 { ··· 1578 1587 1579 1588 if(SiS_Pr->SiS_ModeType >= ModeEGA) { 1580 1589 if(ModeNo > 0x13) { 1581 - SiS_SetMemory(memaddr, memsize, 0); 1590 + memset_io(memaddr, 0, memsize); 1582 1591 } else { 1583 1592 pBuffer = (unsigned short SISIOMEMTYPE *)memaddr; 1584 1593 for(i = 0; i < 0x4000; i++) writew(0x0000, &pBuffer[i]); ··· 1587 1596 pBuffer = (unsigned short SISIOMEMTYPE *)memaddr; 1588 1597 for(i = 0; i < 0x4000; i++) writew(0x0720, &pBuffer[i]); 1589 1598 } else { 1590 - SiS_SetMemory(memaddr, 0x8000, 0); 1599 + memset_io(memaddr, 0, 0x8000); 1591 1600 } 1592 1601 } 1593 - #endif 1594 1602 1595 1603 /*********************************************/ 1596 1604 /* HELPER: SearchModeID */ ··· 2122 2132 SiS_SetReg(SiS_Pr->SiS_P3d4,0x14,0x4F); 2123 2133 } 2124 2134 2125 - #ifdef SIS315H 2135 + #ifdef CONFIG_FB_SIS_315 2126 2136 if(SiS_Pr->ChipType == XGI_20) { 2127 2137 SiS_SetReg(SiS_Pr->SiS_P3d4,0x04,crt1data[4] - 1); 2128 2138 if(!(temp = crt1data[5] & 0x1f)) { ··· 2205 2215 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2c,clkb); 2206 2216 2207 2217 if(SiS_Pr->ChipType >= SIS_315H) { 2208 - #ifdef SIS315H 2218 + #ifdef CONFIG_FB_SIS_315 2209 2219 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2D,0x01); 2210 2220 if(SiS_Pr->ChipType == XGI_20) { 2211 2221 unsigned short mf = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); ··· 2226 2236 /* FIFO */ 2227 2237 /*********************************************/ 2228 2238 2229 - #ifdef SIS300 2239 + #ifdef CONFIG_FB_SIS_300 2230 2240 void 2231 2241 SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *idx1, 2232 2242 unsigned short *idx2) ··· 2496 2506 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x09,0x80,data); 2497 2507 2498 2508 /* Write foreground and background queue */ 2499 - #ifdef SIS_LINUX_KERNEL 2500 2509 templ = sisfb_read_nbridge_pci_dword(SiS_Pr, 0x50); 2501 - #else 2502 - templ = pciReadLong(0x00000000, 0x50); 2503 - #endif 2504 2510 2505 2511 if(SiS_Pr->ChipType == SIS_730) { 2506 2512 ··· 2516 2530 2517 2531 } 2518 2532 2519 - #ifdef SIS_LINUX_KERNEL 2520 2533 sisfb_write_nbridge_pci_dword(SiS_Pr, 0x50, templ); 2521 2534 templ = sisfb_read_nbridge_pci_dword(SiS_Pr, 0xA0); 2522 - #else 2523 - pciWriteLong(0x00000000, 0x50, templ); 2524 - templ = pciReadLong(0x00000000, 0xA0); 2525 - #endif 2526 2535 2527 2536 /* GUI grant timer (PCI config 0xA3) */ 2528 2537 if(SiS_Pr->ChipType == SIS_730) { ··· 2533 2552 2534 2553 } 2535 2554 2536 - #ifdef SIS_LINUX_KERNEL 2537 2555 sisfb_write_nbridge_pci_dword(SiS_Pr, 0xA0, templ); 2538 - #else 2539 - pciWriteLong(0x00000000, 0xA0, templ); 2540 - #endif 2541 2556 } 2542 - #endif /* SIS300 */ 2557 + #endif /* CONFIG_FB_SIS_300 */ 2543 2558 2544 - #ifdef SIS315H 2559 + #ifdef CONFIG_FB_SIS_315 2545 2560 static void 2546 2561 SiS_SetCRT1FIFO_310(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) 2547 2562 { ··· 2589 2612 } 2590 2613 2591 2614 if(SiS_Pr->ChipType < SIS_315H) { 2592 - #ifdef SIS300 2615 + #ifdef CONFIG_FB_SIS_300 2593 2616 if(VCLK > 150) data |= 0x80; 2594 2617 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0x7B,data); 2595 2618 ··· 2598 2621 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xF7,data); 2599 2622 #endif 2600 2623 } else if(SiS_Pr->ChipType < XGI_20) { 2601 - #ifdef SIS315H 2624 + #ifdef CONFIG_FB_SIS_315 2602 2625 if(VCLK >= 166) data |= 0x0c; 2603 2626 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xf3,data); 2604 2627 ··· 2607 2630 } 2608 2631 #endif 2609 2632 } else { 2610 - #ifdef SIS315H 2633 + #ifdef CONFIG_FB_SIS_315 2611 2634 if(VCLK >= 200) data |= 0x0c; 2612 2635 if(SiS_Pr->ChipType == XGI_20) data &= ~0x04; 2613 2636 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xf3,data); ··· 2652 2675 unsigned short ModeIdIndex, unsigned short RRTI) 2653 2676 { 2654 2677 unsigned short data, infoflag = 0, modeflag, resindex; 2655 - #ifdef SIS315H 2678 + #ifdef CONFIG_FB_SIS_315 2656 2679 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 2657 2680 unsigned short data2, data3; 2658 2681 #endif ··· 2713 2736 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0F,0xB7,data); 2714 2737 } 2715 2738 2716 - #ifdef SIS315H 2739 + #ifdef CONFIG_FB_SIS_315 2717 2740 if(SiS_Pr->ChipType >= SIS_315H) { 2718 2741 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x31,0xfb); 2719 2742 } ··· 2803 2826 2804 2827 SiS_SetVCLKState(SiS_Pr, ModeNo, RRTI, ModeIdIndex); 2805 2828 2806 - #ifdef SIS315H 2829 + #ifdef CONFIG_FB_SIS_315 2807 2830 if(((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->ChipType < SIS_661)) || 2808 2831 (SiS_Pr->ChipType == XGI_40)) { 2809 2832 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40) { ··· 2822 2845 #endif 2823 2846 } 2824 2847 2825 - #ifdef SIS315H 2848 + #ifdef CONFIG_FB_SIS_315 2826 2849 static void 2827 2850 SiS_SetupDualChip(struct SiS_Private *SiS_Pr) 2828 2851 { ··· 2976 2999 SiS_Pr->SiS_SelectCRT2Rate = 0; 2977 3000 SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2); 2978 3001 2979 - #ifdef SIS_XORG_XF86 2980 - xf86DrvMsgVerb(0, X_PROBED, 4, "(init: VBType=0x%04x, VBInfo=0x%04x)\n", 2981 - SiS_Pr->SiS_VBType, SiS_Pr->SiS_VBInfo); 2982 - #endif 2983 - 2984 3002 if(SiS_Pr->SiS_VBInfo & SetSimuScanMode) { 2985 3003 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { 2986 3004 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; ··· 3000 3028 } 3001 3029 3002 3030 switch(SiS_Pr->ChipType) { 3003 - #ifdef SIS300 3031 + #ifdef CONFIG_FB_SIS_300 3004 3032 case SIS_300: 3005 3033 SiS_SetCRT1FIFO_300(SiS_Pr, ModeNo, RefreshRateTableIndex); 3006 3034 break; ··· 3011 3039 break; 3012 3040 #endif 3013 3041 default: 3014 - #ifdef SIS315H 3042 + #ifdef CONFIG_FB_SIS_315 3015 3043 if(SiS_Pr->ChipType == XGI_20) { 3016 3044 unsigned char sr2b = 0, sr2c = 0; 3017 3045 switch(ModeNo) { ··· 3034 3062 3035 3063 SiS_SetCRT1ModeRegs(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 3036 3064 3037 - #ifdef SIS315H 3065 + #ifdef CONFIG_FB_SIS_315 3038 3066 if(SiS_Pr->ChipType == XGI_40) { 3039 3067 SiS_SetupDualChip(SiS_Pr); 3040 3068 } ··· 3042 3070 3043 3071 SiS_LoadDAC(SiS_Pr, ModeNo, ModeIdIndex); 3044 3072 3045 - #ifdef SIS_LINUX_KERNEL 3046 3073 if(SiS_Pr->SiS_flag_clearbuffer) { 3047 3074 SiS_ClearBuffer(SiS_Pr, ModeNo); 3048 3075 } 3049 - #endif 3050 3076 3051 3077 if(!(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SwitchCRT2 | SetCRT2ToLCDA))) { 3052 3078 SiS_WaitRetrace1(SiS_Pr); ··· 3074 3104 static void 3075 3105 SiS_ResetVB(struct SiS_Private *SiS_Pr) 3076 3106 { 3077 - #ifdef SIS315H 3107 + #ifdef CONFIG_FB_SIS_315 3078 3108 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 3079 3109 unsigned short temp; 3080 3110 ··· 3109 3139 * which locks CRT2 in some way to CRT1 timing. Disable 3110 3140 * this here. 3111 3141 */ 3112 - #ifdef SIS315H 3142 + #ifdef CONFIG_FB_SIS_315 3113 3143 if((IS_SIS651) || (IS_SISM650) || 3114 3144 SiS_Pr->ChipType == SIS_340 || 3115 3145 SiS_Pr->ChipType == XGI_40) { ··· 3130 3160 static void 3131 3161 SiS_Handle760(struct SiS_Private *SiS_Pr) 3132 3162 { 3133 - #ifdef SIS315H 3163 + #ifdef CONFIG_FB_SIS_315 3134 3164 unsigned int somebase; 3135 3165 unsigned char temp1, temp2, temp3; 3136 3166 ··· 3140 3170 (!(SiS_Pr->SiS_SysFlags & SF_760UMA)) ) 3141 3171 return; 3142 3172 3143 - #ifdef SIS_LINUX_KERNEL 3144 3173 somebase = sisfb_read_mio_pci_word(SiS_Pr, 0x74); 3145 - #else 3146 - somebase = pciReadWord(0x00001000, 0x74); 3147 - #endif 3148 3174 somebase &= 0xffff; 3149 3175 3150 3176 if(somebase == 0) return; ··· 3156 3190 temp2 = 0x0b; 3157 3191 } 3158 3192 3159 - #ifdef SIS_LINUX_KERNEL 3160 3193 sisfb_write_nbridge_pci_byte(SiS_Pr, 0x7e, temp1); 3161 3194 sisfb_write_nbridge_pci_byte(SiS_Pr, 0x8d, temp2); 3162 - #else 3163 - pciWriteByte(0x00000000, 0x7e, temp1); 3164 - pciWriteByte(0x00000000, 0x8d, temp2); 3165 - #endif 3166 3195 3167 3196 SiS_SetRegByte((somebase + 0x85), temp3); 3168 3197 #endif 3169 3198 } 3170 3199 3171 3200 /*********************************************/ 3172 - /* X.org/XFree86: SET SCREEN PITCH */ 3173 - /*********************************************/ 3174 - 3175 - #ifdef SIS_XORG_XF86 3176 - static void 3177 - SiS_SetPitchCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn) 3178 - { 3179 - SISPtr pSiS = SISPTR(pScrn); 3180 - unsigned short HDisplay = pSiS->scrnPitch >> 3; 3181 - 3182 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x13,(HDisplay & 0xFF)); 3183 - SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0xF0,(HDisplay >> 8)); 3184 - } 3185 - 3186 - static void 3187 - SiS_SetPitchCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn) 3188 - { 3189 - SISPtr pSiS = SISPTR(pScrn); 3190 - unsigned short HDisplay = pSiS->scrnPitch2 >> 3; 3191 - 3192 - /* Unlock CRT2 */ 3193 - if(pSiS->VGAEngine == SIS_315_VGA) 3194 - SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2F, 0x01); 3195 - else 3196 - SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24, 0x01); 3197 - 3198 - SiS_SetReg(SiS_Pr->SiS_Part1Port,0x07,(HDisplay & 0xFF)); 3199 - SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0xF0,(HDisplay >> 8)); 3200 - } 3201 - 3202 - static void 3203 - SiS_SetPitch(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn) 3204 - { 3205 - SISPtr pSiS = SISPTR(pScrn); 3206 - bool isslavemode = false; 3207 - 3208 - if( (pSiS->VBFlags2 & VB2_VIDEOBRIDGE) && 3209 - ( ((pSiS->VGAEngine == SIS_300_VGA) && 3210 - (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0xa0) == 0x20) || 3211 - ((pSiS->VGAEngine == SIS_315_VGA) && 3212 - (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x50) == 0x10) ) ) { 3213 - isslavemode = true; 3214 - } 3215 - 3216 - /* We need to set pitch for CRT1 if bridge is in slave mode, too */ 3217 - if((pSiS->VBFlags & DISPTYPE_DISP1) || (isslavemode)) { 3218 - SiS_SetPitchCRT1(SiS_Pr, pScrn); 3219 - } 3220 - /* We must not set the pitch for CRT2 if bridge is in slave mode */ 3221 - if((pSiS->VBFlags & DISPTYPE_DISP2) && (!isslavemode)) { 3222 - SiS_SetPitchCRT2(SiS_Pr, pScrn); 3223 - } 3224 - } 3225 - #endif 3226 - 3227 - /*********************************************/ 3228 3201 /* SiSSetMode() */ 3229 3202 /*********************************************/ 3230 3203 3231 - #ifdef SIS_XORG_XF86 3232 - /* We need pScrn for setting the pitch correctly */ 3233 - bool 3234 - SiSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo, bool dosetpitch) 3235 - #else 3236 3204 bool 3237 3205 SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) 3238 - #endif 3239 3206 { 3240 3207 SISIOADDRESS BaseAddr = SiS_Pr->IOAddress; 3241 3208 unsigned short RealModeNo, ModeIdIndex; 3242 3209 unsigned char backupreg = 0; 3243 - #ifdef SIS_LINUX_KERNEL 3244 3210 unsigned short KeepLockReg; 3245 3211 3246 3212 SiS_Pr->UseCustomMode = false; 3247 3213 SiS_Pr->CRT1UsesCustomMode = false; 3248 - #endif 3249 3214 3250 3215 SiS_Pr->SiS_flag_clearbuffer = 0; 3251 3216 3252 3217 if(SiS_Pr->UseCustomMode) { 3253 3218 ModeNo = 0xfe; 3254 3219 } else { 3255 - #ifdef SIS_LINUX_KERNEL 3256 3220 if(!(ModeNo & 0x80)) SiS_Pr->SiS_flag_clearbuffer = 1; 3257 - #endif 3258 3221 ModeNo &= 0x7f; 3259 3222 } 3260 3223 ··· 3196 3301 SiS_GetSysFlags(SiS_Pr); 3197 3302 3198 3303 SiS_Pr->SiS_VGAINFO = 0x11; 3199 - #if defined(SIS_XORG_XF86) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(__AMD64__) || defined(__amd64__) || defined(__x86_64__)) 3200 - if(pScrn) SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff); 3201 - #endif 3202 3304 3203 - #ifdef SIS_LINUX_KERNEL 3204 3305 KeepLockReg = SiS_GetReg(SiS_Pr->SiS_P3c4,0x05); 3205 - #endif 3206 3306 SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86); 3207 3307 3208 3308 SiSInitPCIetc(SiS_Pr); ··· 3234 3344 SiS_GetLCDResInfo(SiS_Pr, ModeNo, ModeIdIndex); 3235 3345 SiS_SetLowModeTest(SiS_Pr, ModeNo); 3236 3346 3237 - #ifdef SIS_LINUX_KERNEL 3238 3347 /* Check memory size (kernel framebuffer driver only) */ 3239 3348 if(!SiS_CheckMemorySize(SiS_Pr, ModeNo, ModeIdIndex)) { 3240 3349 return false; 3241 3350 } 3242 - #endif 3243 3351 3244 3352 SiS_OpenCRTC(SiS_Pr); 3245 3353 ··· 3272 3384 SiS_DisplayOn(SiS_Pr); 3273 3385 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xFF); 3274 3386 3275 - #ifdef SIS315H 3387 + #ifdef CONFIG_FB_SIS_315 3276 3388 if(SiS_Pr->ChipType >= SIS_315H) { 3277 3389 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 3278 3390 if(!(SiS_IsDualEdge(SiS_Pr))) { ··· 3284 3396 3285 3397 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 3286 3398 if(SiS_Pr->ChipType >= SIS_315H) { 3287 - #ifdef SIS315H 3399 + #ifdef CONFIG_FB_SIS_315 3288 3400 if(!SiS_Pr->SiS_ROMNew) { 3289 3401 if(SiS_IsVAMode(SiS_Pr)) { 3290 3402 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01); ··· 3312 3424 } 3313 3425 } 3314 3426 3315 - #ifdef SIS_XORG_XF86 3316 - if(pScrn) { 3317 - /* SetPitch: Adapt to virtual size & position */ 3318 - if((ModeNo > 0x13) && (dosetpitch)) { 3319 - SiS_SetPitch(SiS_Pr, pScrn); 3320 - } 3321 - 3322 - /* Backup/Set ModeNo in BIOS scratch area */ 3323 - SiS_GetSetModeID(pScrn, ModeNo); 3324 - } 3325 - #endif 3326 - 3327 3427 SiS_CloseCRTC(SiS_Pr); 3328 3428 3329 3429 SiS_Handle760(SiS_Pr); 3330 3430 3331 - #ifdef SIS_LINUX_KERNEL 3332 3431 /* We never lock registers in XF86 */ 3333 3432 if(KeepLockReg != 0xA1) SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x00); 3334 - #endif 3335 3433 3336 3434 return true; 3337 3435 } 3338 - 3339 - /*********************************************/ 3340 - /* X.org/XFree86: SiSBIOSSetMode() */ 3341 - /* for non-Dual-Head mode */ 3342 - /*********************************************/ 3343 - 3344 - #ifdef SIS_XORG_XF86 3345 - bool 3346 - SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 3347 - DisplayModePtr mode, bool IsCustom) 3348 - { 3349 - SISPtr pSiS = SISPTR(pScrn); 3350 - unsigned short ModeNo = 0; 3351 - 3352 - SiS_Pr->UseCustomMode = false; 3353 - 3354 - if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) { 3355 - 3356 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting custom mode %dx%d\n", 3357 - SiS_Pr->CHDisplay, 3358 - (mode->Flags & V_INTERLACE ? SiS_Pr->CVDisplay * 2 : 3359 - (mode->Flags & V_DBLSCAN ? SiS_Pr->CVDisplay / 2 : 3360 - SiS_Pr->CVDisplay))); 3361 - 3362 - } else { 3363 - 3364 - /* Don't need vbflags here; checks done earlier */ 3365 - ModeNo = SiS_GetModeNumber(pScrn, mode, pSiS->VBFlags); 3366 - if(!ModeNo) return false; 3367 - 3368 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting standard mode 0x%x\n", ModeNo); 3369 - 3370 - } 3371 - 3372 - return(SiSSetMode(SiS_Pr, pScrn, ModeNo, true)); 3373 - } 3374 - 3375 - /*********************************************/ 3376 - /* X.org/XFree86: SiSBIOSSetModeCRT2() */ 3377 - /* for Dual-Head modes */ 3378 - /*********************************************/ 3379 - 3380 - bool 3381 - SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 3382 - DisplayModePtr mode, bool IsCustom) 3383 - { 3384 - SISIOADDRESS BaseAddr = SiS_Pr->IOAddress; 3385 - SISPtr pSiS = SISPTR(pScrn); 3386 - #ifdef SISDUALHEAD 3387 - SISEntPtr pSiSEnt = pSiS->entityPrivate; 3388 - #endif 3389 - unsigned short ModeIdIndex; 3390 - unsigned short ModeNo = 0; 3391 - unsigned char backupreg = 0; 3392 - 3393 - SiS_Pr->UseCustomMode = false; 3394 - 3395 - /* Remember: Custom modes for CRT2 are ONLY supported 3396 - * -) on the 30x/B/C, and 3397 - * -) if CRT2 is LCD or VGA, or CRT1 is LCDA 3398 - */ 3399 - 3400 - if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) { 3401 - 3402 - ModeNo = 0xfe; 3403 - 3404 - } else { 3405 - 3406 - ModeNo = SiS_GetModeNumber(pScrn, mode, pSiS->VBFlags); 3407 - if(!ModeNo) return false; 3408 - 3409 - } 3410 - 3411 - SiSRegInit(SiS_Pr, BaseAddr); 3412 - SiSInitPtr(SiS_Pr); 3413 - SiS_GetSysFlags(SiS_Pr); 3414 - #if defined(i386) || defined(__i386) || defined(__i386__) || defined(__AMD64__) || defined(__amd64__) || defined(__x86_64__) 3415 - SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff); 3416 - #else 3417 - SiS_Pr->SiS_VGAINFO = 0x11; 3418 - #endif 3419 - 3420 - SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86); 3421 - 3422 - SiSInitPCIetc(SiS_Pr); 3423 - SiSSetLVDSetc(SiS_Pr); 3424 - SiSDetermineROMUsage(SiS_Pr); 3425 - 3426 - /* Save mode info so we can set it from within SetMode for CRT1 */ 3427 - #ifdef SISDUALHEAD 3428 - if(pSiS->DualHeadMode) { 3429 - pSiSEnt->CRT2ModeNo = ModeNo; 3430 - pSiSEnt->CRT2DMode = mode; 3431 - pSiSEnt->CRT2IsCustom = IsCustom; 3432 - pSiSEnt->CRT2CR30 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); 3433 - pSiSEnt->CRT2CR31 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31); 3434 - pSiSEnt->CRT2CR35 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); 3435 - pSiSEnt->CRT2CR38 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); 3436 - #if 0 3437 - /* We can't set CRT2 mode before CRT1 mode is set - says who...? */ 3438 - if(pSiSEnt->CRT1ModeNo == -1) { 3439 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 3440 - "Setting CRT2 mode delayed until after setting CRT1 mode\n"); 3441 - return true; 3442 - } 3443 - #endif 3444 - pSiSEnt->CRT2ModeSet = true; 3445 - } 3446 - #endif 3447 - 3448 - if(SiS_Pr->UseCustomMode) { 3449 - 3450 - unsigned short temptemp = SiS_Pr->CVDisplay; 3451 - 3452 - if(SiS_Pr->CModeFlag & DoubleScanMode) temptemp >>= 1; 3453 - else if(SiS_Pr->CInfoFlag & InterlaceMode) temptemp <<= 1; 3454 - 3455 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 3456 - "Setting custom mode %dx%d on CRT2\n", 3457 - SiS_Pr->CHDisplay, temptemp); 3458 - 3459 - } else { 3460 - 3461 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 3462 - "Setting standard mode 0x%x on CRT2\n", ModeNo); 3463 - 3464 - } 3465 - 3466 - SiS_UnLockCRT2(SiS_Pr); 3467 - 3468 - if(!SiS_Pr->UseCustomMode) { 3469 - if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return false; 3470 - } else { 3471 - ModeIdIndex = 0; 3472 - } 3473 - 3474 - SiS_GetVBType(SiS_Pr); 3475 - 3476 - SiS_InitVB(SiS_Pr); 3477 - if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 3478 - if(SiS_Pr->ChipType >= SIS_315H) { 3479 - SiS_ResetVB(SiS_Pr); 3480 - SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x32,0x10); 3481 - SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x00,0x0c); 3482 - backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); 3483 - } else { 3484 - backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); 3485 - } 3486 - } 3487 - 3488 - /* Get VB information (connectors, connected devices) */ 3489 - if(!SiS_Pr->UseCustomMode) { 3490 - SiS_GetVBInfo(SiS_Pr, ModeNo, ModeIdIndex, 1); 3491 - } else { 3492 - /* If this is a custom mode, we don't check the modeflag for CRT2Mode */ 3493 - SiS_GetVBInfo(SiS_Pr, ModeNo, ModeIdIndex, 0); 3494 - } 3495 - SiS_SetYPbPr(SiS_Pr); 3496 - SiS_SetTVMode(SiS_Pr, ModeNo, ModeIdIndex); 3497 - SiS_GetLCDResInfo(SiS_Pr, ModeNo, ModeIdIndex); 3498 - SiS_SetLowModeTest(SiS_Pr, ModeNo); 3499 - 3500 - SiS_ResetSegmentRegisters(SiS_Pr); 3501 - 3502 - /* Set mode on CRT2 */ 3503 - if( (SiS_Pr->SiS_VBType & VB_SISVB) || 3504 - (SiS_Pr->SiS_IF_DEF_LVDS == 1) || 3505 - (SiS_Pr->SiS_IF_DEF_CH70xx != 0) || 3506 - (SiS_Pr->SiS_IF_DEF_TRUMPION != 0) ) { 3507 - SiS_SetCRT2Group(SiS_Pr, ModeNo); 3508 - } 3509 - 3510 - SiS_StrangeStuff(SiS_Pr); 3511 - 3512 - SiS_DisplayOn(SiS_Pr); 3513 - SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xFF); 3514 - 3515 - if(SiS_Pr->ChipType >= SIS_315H) { 3516 - if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 3517 - if(!(SiS_IsDualEdge(SiS_Pr))) { 3518 - SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); 3519 - } 3520 - } 3521 - } 3522 - 3523 - if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 3524 - if(SiS_Pr->ChipType >= SIS_315H) { 3525 - if(!SiS_Pr->SiS_ROMNew) { 3526 - if(SiS_IsVAMode(SiS_Pr)) { 3527 - SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01); 3528 - } else { 3529 - SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x35,0xFE); 3530 - } 3531 - } 3532 - 3533 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x38,backupreg); 3534 - 3535 - if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & SetCRT2ToLCD) { 3536 - SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc); 3537 - } 3538 - } else if((SiS_Pr->ChipType == SIS_630) || 3539 - (SiS_Pr->ChipType == SIS_730)) { 3540 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x35,backupreg); 3541 - } 3542 - } 3543 - 3544 - /* SetPitch: Adapt to virtual size & position */ 3545 - SiS_SetPitchCRT2(SiS_Pr, pScrn); 3546 - 3547 - SiS_Handle760(SiS_Pr); 3548 - 3549 - return true; 3550 - } 3551 - 3552 - /*********************************************/ 3553 - /* X.org/XFree86: SiSBIOSSetModeCRT1() */ 3554 - /* for Dual-Head modes */ 3555 - /*********************************************/ 3556 - 3557 - bool 3558 - SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 3559 - DisplayModePtr mode, bool IsCustom) 3560 - { 3561 - SISIOADDRESS BaseAddr = SiS_Pr->IOAddress; 3562 - SISPtr pSiS = SISPTR(pScrn); 3563 - unsigned short ModeIdIndex, ModeNo = 0; 3564 - unsigned char backupreg = 0; 3565 - #ifdef SISDUALHEAD 3566 - SISEntPtr pSiSEnt = pSiS->entityPrivate; 3567 - unsigned char backupcr30, backupcr31, backupcr38, backupcr35, backupp40d=0; 3568 - bool backupcustom; 3569 - #endif 3570 - 3571 - SiS_Pr->UseCustomMode = false; 3572 - 3573 - if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) { 3574 - 3575 - unsigned short temptemp = SiS_Pr->CVDisplay; 3576 - 3577 - if(SiS_Pr->CModeFlag & DoubleScanMode) temptemp >>= 1; 3578 - else if(SiS_Pr->CInfoFlag & InterlaceMode) temptemp <<= 1; 3579 - 3580 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 3581 - "Setting custom mode %dx%d on CRT1\n", 3582 - SiS_Pr->CHDisplay, temptemp); 3583 - ModeNo = 0xfe; 3584 - 3585 - } else { 3586 - 3587 - ModeNo = SiS_GetModeNumber(pScrn, mode, 0); /* don't give VBFlags */ 3588 - if(!ModeNo) return false; 3589 - 3590 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 3591 - "Setting standard mode 0x%x on CRT1\n", ModeNo); 3592 - } 3593 - 3594 - SiSInitPtr(SiS_Pr); 3595 - SiSRegInit(SiS_Pr, BaseAddr); 3596 - SiS_GetSysFlags(SiS_Pr); 3597 - #if defined(i386) || defined(__i386) || defined(__i386__) || defined(__AMD64__) || defined(__amd64__) || defined(__x86_64__) 3598 - SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff); 3599 - #else 3600 - SiS_Pr->SiS_VGAINFO = 0x11; 3601 - #endif 3602 - 3603 - SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86); 3604 - 3605 - SiSInitPCIetc(SiS_Pr); 3606 - SiSSetLVDSetc(SiS_Pr); 3607 - SiSDetermineROMUsage(SiS_Pr); 3608 - 3609 - SiS_UnLockCRT2(SiS_Pr); 3610 - 3611 - if(!SiS_Pr->UseCustomMode) { 3612 - if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return false; 3613 - } else { 3614 - ModeIdIndex = 0; 3615 - } 3616 - 3617 - /* Determine VBType */ 3618 - SiS_GetVBType(SiS_Pr); 3619 - 3620 - SiS_InitVB(SiS_Pr); 3621 - if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 3622 - if(SiS_Pr->ChipType >= SIS_315H) { 3623 - backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); 3624 - } else { 3625 - backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); 3626 - } 3627 - } 3628 - 3629 - /* Get VB information (connectors, connected devices) */ 3630 - /* (We don't care if the current mode is a CRT2 mode) */ 3631 - SiS_GetVBInfo(SiS_Pr, ModeNo, ModeIdIndex, 0); 3632 - SiS_SetYPbPr(SiS_Pr); 3633 - SiS_SetTVMode(SiS_Pr, ModeNo, ModeIdIndex); 3634 - SiS_GetLCDResInfo(SiS_Pr, ModeNo, ModeIdIndex); 3635 - SiS_SetLowModeTest(SiS_Pr, ModeNo); 3636 - 3637 - SiS_OpenCRTC(SiS_Pr); 3638 - 3639 - /* Set mode on CRT1 */ 3640 - SiS_SetCRT1Group(SiS_Pr, ModeNo, ModeIdIndex); 3641 - if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { 3642 - SiS_SetCRT2Group(SiS_Pr, ModeNo); 3643 - } 3644 - 3645 - /* SetPitch: Adapt to virtual size & position */ 3646 - SiS_SetPitchCRT1(SiS_Pr, pScrn); 3647 - 3648 - SiS_HandleCRT1(SiS_Pr); 3649 - 3650 - SiS_StrangeStuff(SiS_Pr); 3651 - 3652 - SiS_CloseCRTC(SiS_Pr); 3653 - 3654 - #ifdef SISDUALHEAD 3655 - if(pSiS->DualHeadMode) { 3656 - pSiSEnt->CRT1ModeNo = ModeNo; 3657 - pSiSEnt->CRT1DMode = mode; 3658 - } 3659 - #endif 3660 - 3661 - if(SiS_Pr->UseCustomMode) { 3662 - SiS_Pr->CRT1UsesCustomMode = true; 3663 - SiS_Pr->CSRClock_CRT1 = SiS_Pr->CSRClock; 3664 - SiS_Pr->CModeFlag_CRT1 = SiS_Pr->CModeFlag; 3665 - } else { 3666 - SiS_Pr->CRT1UsesCustomMode = false; 3667 - } 3668 - 3669 - /* Reset CRT2 if changing mode on CRT1 */ 3670 - #ifdef SISDUALHEAD 3671 - if(pSiS->DualHeadMode) { 3672 - if(pSiSEnt->CRT2ModeNo != -1) { 3673 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 3674 - "(Re-)Setting mode for CRT2\n"); 3675 - backupcustom = SiS_Pr->UseCustomMode; 3676 - backupcr30 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); 3677 - backupcr31 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31); 3678 - backupcr35 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); 3679 - backupcr38 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); 3680 - if(SiS_Pr->SiS_VBType & VB_SISVB) { 3681 - /* Backup LUT-enable */ 3682 - if(pSiSEnt->CRT2ModeSet) { 3683 - backupp40d = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x0d) & 0x08; 3684 - } 3685 - } 3686 - if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { 3687 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x30,pSiSEnt->CRT2CR30); 3688 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x31,pSiSEnt->CRT2CR31); 3689 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x35,pSiSEnt->CRT2CR35); 3690 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x38,pSiSEnt->CRT2CR38); 3691 - } 3692 - 3693 - SiSBIOSSetModeCRT2(SiS_Pr, pSiSEnt->pScrn_1, 3694 - pSiSEnt->CRT2DMode, pSiSEnt->CRT2IsCustom); 3695 - 3696 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x30,backupcr30); 3697 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x31,backupcr31); 3698 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x35,backupcr35); 3699 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x38,backupcr38); 3700 - if(SiS_Pr->SiS_VBType & VB_SISVB) { 3701 - SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0d, ~0x08, backupp40d); 3702 - } 3703 - SiS_Pr->UseCustomMode = backupcustom; 3704 - } 3705 - } 3706 - #endif 3707 - 3708 - /* Warning: From here, the custom mode entries in SiS_Pr are 3709 - * possibly overwritten 3710 - */ 3711 - 3712 - SiS_DisplayOn(SiS_Pr); 3713 - SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xFF); 3714 - 3715 - if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 3716 - if(SiS_Pr->ChipType >= SIS_315H) { 3717 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x38,backupreg); 3718 - } else if((SiS_Pr->ChipType == SIS_630) || 3719 - (SiS_Pr->ChipType == SIS_730)) { 3720 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x35,backupreg); 3721 - } 3722 - } 3723 - 3724 - SiS_Handle760(SiS_Pr); 3725 - 3726 - /* Backup/Set ModeNo in BIOS scratch area */ 3727 - SiS_GetSetModeID(pScrn,ModeNo); 3728 - 3729 - return true; 3730 - } 3731 - #endif /* Linux_XF86 */ 3732 3436 3733 3437 #ifndef GETBITSTR 3734 3438 #define BITMASK(h,l) (((unsigned)(1U << ((h)-(l)+1))-1)<<(l)) ··· 3407 3927 SiS_Pr->CVBlankStart = SiS_Pr->SiS_VGAVDE; 3408 3928 3409 3929 if(SiS_Pr->ChipType < SIS_315H) { 3410 - #ifdef SIS300 3930 + #ifdef CONFIG_FB_SIS_300 3411 3931 tempbx = SiS_Pr->SiS_VGAHT; 3412 3932 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 3413 3933 tempbx = SiS_Pr->PanelHT; ··· 3416 3936 remaining = tempbx % 8; 3417 3937 #endif 3418 3938 } else { 3419 - #ifdef SIS315H 3939 + #ifdef CONFIG_FB_SIS_315 3420 3940 /* OK for LCDA, LVDS */ 3421 3941 tempbx = SiS_Pr->PanelHT - SiS_Pr->PanelXRes; 3422 3942 tempax = SiS_Pr->SiS_VGAHDE; /* not /2 ! */ ··· 3430 3950 SiS_Pr->CHTotal = SiS_Pr->CHBlankEnd = tempbx; 3431 3951 3432 3952 if(SiS_Pr->ChipType < SIS_315H) { 3433 - #ifdef SIS300 3953 + #ifdef CONFIG_FB_SIS_300 3434 3954 if(SiS_Pr->SiS_VGAHDE == SiS_Pr->PanelXRes) { 3435 3955 SiS_Pr->CHSyncStart = SiS_Pr->SiS_VGAHDE + ((SiS_Pr->PanelHRS + 1) & ~1); 3436 3956 SiS_Pr->CHSyncEnd = SiS_Pr->CHSyncStart + SiS_Pr->PanelHRE; ··· 3462 3982 } 3463 3983 #endif 3464 3984 } else { 3465 - #ifdef SIS315H 3985 + #ifdef CONFIG_FB_SIS_315 3466 3986 tempax = VGAHDE; 3467 3987 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 3468 3988 tempbx = SiS_Pr->PanelXRes; ··· 3481 4001 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 3482 4002 tempax = SiS_Pr->PanelYRes; 3483 4003 } else if(SiS_Pr->ChipType < SIS_315H) { 3484 - #ifdef SIS300 4004 + #ifdef CONFIG_FB_SIS_300 3485 4005 /* Stupid hack for 640x400/320x200 */ 3486 4006 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { 3487 4007 if((tempax + tempbx) == 438) tempbx += 16; ··· 3534 4054 if(modeflag & DoubleScanMode) tempax |= 0x80; 3535 4055 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0x5F,tempax); 3536 4056 3537 - #ifdef SIS_XORG_XF86 3538 - #ifdef TWDEBUG 3539 - xf86DrvMsg(0, X_INFO, "%d %d %d %d %d %d %d %d (%d %d %d %d)\n", 3540 - SiS_Pr->CHDisplay, SiS_Pr->CHSyncStart, SiS_Pr->CHSyncEnd, SiS_Pr->CHTotal, 3541 - SiS_Pr->CVDisplay, SiS_Pr->CVSyncStart, SiS_Pr->CVSyncEnd, SiS_Pr->CVTotal, 3542 - SiS_Pr->CHBlankStart, SiS_Pr->CHBlankEnd, SiS_Pr->CVBlankStart, SiS_Pr->CVBlankEnd); 3543 - xf86DrvMsg(0, X_INFO, " {{0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", 3544 - SiS_Pr->CCRT1CRTC[0], SiS_Pr->CCRT1CRTC[1], 3545 - SiS_Pr->CCRT1CRTC[2], SiS_Pr->CCRT1CRTC[3], 3546 - SiS_Pr->CCRT1CRTC[4], SiS_Pr->CCRT1CRTC[5], 3547 - SiS_Pr->CCRT1CRTC[6], SiS_Pr->CCRT1CRTC[7]); 3548 - xf86DrvMsg(0, X_INFO, " 0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", 3549 - SiS_Pr->CCRT1CRTC[8], SiS_Pr->CCRT1CRTC[9], 3550 - SiS_Pr->CCRT1CRTC[10], SiS_Pr->CCRT1CRTC[11], 3551 - SiS_Pr->CCRT1CRTC[12], SiS_Pr->CCRT1CRTC[13], 3552 - SiS_Pr->CCRT1CRTC[14], SiS_Pr->CCRT1CRTC[15]); 3553 - xf86DrvMsg(0, X_INFO, " 0x%02x}},\n", SiS_Pr->CCRT1CRTC[16]); 3554 - #endif 3555 - #endif 3556 4057 } 3557 4058 3558 4059 void 3559 4060 SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, 3560 4061 int xres, int yres, 3561 - #ifdef SIS_XORG_XF86 3562 - DisplayModePtr current 3563 - #endif 3564 - #ifdef SIS_LINUX_KERNEL 3565 4062 struct fb_var_screeninfo *var, bool writeres 3566 - #endif 3567 4063 ) 3568 4064 { 3569 4065 unsigned short HRE, HBE, HRS, HBS, HDE, HT; ··· 3583 4127 3584 4128 D = B - F - C; 3585 4129 3586 - #ifdef SIS_XORG_XF86 3587 - current->HDisplay = (E * 8); 3588 - current->HSyncStart = (E * 8) + (F * 8); 3589 - current->HSyncEnd = (E * 8) + (F * 8) + (C * 8); 3590 - current->HTotal = (E * 8) + (F * 8) + (C * 8) + (D * 8); 3591 - #ifdef TWDEBUG 3592 - xf86DrvMsg(0, X_INFO, 3593 - "H: A %d B %d C %d D %d E %d F %d HT %d HDE %d HRS %d HBS %d HBE %d HRE %d\n", 3594 - A, B, C, D, E, F, HT, HDE, HRS, HBS, HBE, HRE); 3595 - #else 3596 - (void)VBS; (void)HBS; (void)A; 3597 - #endif 3598 - #endif 3599 - #ifdef SIS_LINUX_KERNEL 3600 4130 if(writeres) var->xres = xres = E * 8; 3601 4131 var->left_margin = D * 8; 3602 4132 var->right_margin = F * 8; 3603 4133 var->hsync_len = C * 8; 3604 - #endif 3605 4134 3606 4135 /* Vertical */ 3607 4136 sr_data = crdata[13]; ··· 3633 4192 3634 4193 D = B - F - C; 3635 4194 3636 - #ifdef SIS_XORG_XF86 3637 - current->VDisplay = VDE + 1; 3638 - current->VSyncStart = VRS + 1; 3639 - current->VSyncEnd = ((VRS & ~0x1f) | VRE) + 1; 3640 - if(VRE <= (VRS & 0x1f)) current->VSyncEnd += 32; 3641 - current->VTotal = E + D + C + F; 3642 - #if 0 3643 - current->VDisplay = E; 3644 - current->VSyncStart = E + D; 3645 - current->VSyncEnd = E + D + C; 3646 - current->VTotal = E + D + C + F; 3647 - #endif 3648 - #ifdef TWDEBUG 3649 - xf86DrvMsg(0, X_INFO, 3650 - "V: A %d B %d C %d D %d E %d F %d VT %d VDE %d VRS %d VBS %d VBE %d VRE %d\n", 3651 - A, B, C, D, E, F, VT, VDE, VRS, VBS, VBE, VRE); 3652 - #endif 3653 - #endif 3654 - #ifdef SIS_LINUX_KERNEL 3655 4195 if(writeres) var->yres = yres = E; 3656 4196 var->upper_margin = D; 3657 4197 var->lower_margin = F; 3658 4198 var->vsync_len = C; 3659 - #endif 3660 4199 3661 4200 if((xres == 320) && ((yres == 200) || (yres == 240))) { 3662 4201 /* Terrible hack, but correct CRTC data for ··· 3645 4224 * a negative D. The CRT controller does not 3646 4225 * seem to like correcting HRE to 50) 3647 4226 */ 3648 - #ifdef SIS_XORG_XF86 3649 - current->HDisplay = 320; 3650 - current->HSyncStart = 328; 3651 - current->HSyncEnd = 376; 3652 - current->HTotal = 400; 3653 - #endif 3654 - #ifdef SIS_LINUX_KERNEL 3655 4227 var->left_margin = (400 - 376); 3656 4228 var->right_margin = (328 - 320); 3657 4229 var->hsync_len = (376 - 328); 3658 - #endif 3659 4230 3660 4231 } 3661 4232
+4 -59
drivers/video/sis/init.h
··· 53 53 #ifndef _INIT_H_ 54 54 #define _INIT_H_ 55 55 56 - #include "osdef.h" 57 56 #include "initdef.h" 58 57 59 - #ifdef SIS_XORG_XF86 60 - #include "sis.h" 61 - #define SIS_NEED_inSISREG 62 - #define SIS_NEED_inSISREGW 63 - #define SIS_NEED_inSISREGL 64 - #define SIS_NEED_outSISREG 65 - #define SIS_NEED_outSISREGW 66 - #define SIS_NEED_outSISREGL 67 - #include "sis_regs.h" 68 - #endif 69 - 70 - #ifdef SIS_LINUX_KERNEL 71 58 #include "vgatypes.h" 72 59 #include "vstruct.h" 73 60 #ifdef SIS_CP ··· 65 78 #include <linux/fb.h> 66 79 #include "sis.h" 67 80 #include <video/sisfb.h> 68 - #endif 69 81 70 82 /* Mode numbers */ 71 83 static const unsigned short ModeIndex_320x200[] = {0x59, 0x41, 0x00, 0x4f}; ··· 272 286 { 1280, 854, 8,16} /* 0x22 */ 273 287 }; 274 288 275 - #if defined(SIS300) || defined(SIS315H) 289 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 276 290 static const struct SiS_StandTable_S SiS_StandTable[]= 277 291 { 278 292 /* 0x00: MD_0_200 */ ··· 1507 1521 }; 1508 1522 1509 1523 bool SiSInitPtr(struct SiS_Private *SiS_Pr); 1510 - #ifdef SIS_XORG_XF86 1511 - unsigned short SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, 1512 - int Depth, bool FSTN, int LCDwith, int LCDheight); 1513 - #endif 1514 1524 unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, 1515 1525 int VDisplay, int Depth, bool FSTN, 1516 1526 unsigned short CustomT, int LCDwith, int LCDheight, ··· 1532 1550 void SiS_DisplayOn(struct SiS_Private *SiS_Pr); 1533 1551 void SiS_DisplayOff(struct SiS_Private *SiS_Pr); 1534 1552 void SiSRegInit(struct SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr); 1535 - #ifndef SIS_LINUX_KERNEL 1536 - void SiSSetLVDSetc(struct SiS_Private *SiS_Pr); 1537 - #endif 1538 1553 void SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable); 1539 1554 void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable); 1540 1555 unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1541 1556 unsigned short ModeIdIndex); 1542 1557 bool SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr); 1543 - #ifndef SIS_LINUX_KERNEL 1544 - void SiS_GetVBType(struct SiS_Private *SiS_Pr); 1545 - #endif 1546 1558 1547 1559 bool SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, 1548 1560 unsigned short *ModeIdIndex); ··· 1548 1572 unsigned short ModeIdIndex); 1549 1573 unsigned short SiS_GetOffset(struct SiS_Private *SiS_Pr,unsigned short ModeNo, 1550 1574 unsigned short ModeIdIndex, unsigned short RRTI); 1551 - #ifdef SIS300 1575 + #ifdef CONFIG_FB_SIS_300 1552 1576 void SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *idx1, 1553 1577 unsigned short *idx2); 1554 1578 unsigned short SiS_GetFIFOThresholdB300(unsigned short idx1, unsigned short idx2); 1555 1579 unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index); 1556 1580 #endif 1557 1581 void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 1558 - #ifdef SIS_XORG_XF86 1559 - bool SiSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo, 1560 - bool dosetpitch); 1561 - bool SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 1562 - DisplayModePtr mode, bool IsCustom); 1563 - bool SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 1564 - DisplayModePtr mode, bool IsCustom); 1565 - bool SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 1566 - DisplayModePtr mode, bool IsCustom); 1567 - #endif 1568 - #ifdef SIS_LINUX_KERNEL 1569 1582 bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 1570 - #endif 1571 1583 void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); 1572 1584 void SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1573 1585 unsigned short ModeIdIndex); 1574 - #ifdef SIS_XORG_XF86 1575 - void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres, 1576 - int yres, DisplayModePtr current); 1577 - #endif 1578 - #ifdef SIS_LINUX_KERNEL 1579 1586 void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres, 1580 1587 int yres, struct fb_var_screeninfo *var, bool writeres); 1581 - #endif 1582 1588 1583 1589 /* From init301.c: */ 1584 1590 extern void SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, ··· 1584 1626 extern bool SiS_IsVAMode(struct SiS_Private *); 1585 1627 extern bool SiS_IsDualEdge(struct SiS_Private *); 1586 1628 1587 - #ifdef SIS_XORG_XF86 1588 - /* From other modules: */ 1589 - extern unsigned short SiS_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, 1590 - unsigned int VBFlags); 1591 - extern unsigned char SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, unsigned short offset, 1592 - unsigned char value); 1593 - extern unsigned char SiS_GetSetModeID(ScrnInfoPtr pScrn, unsigned char id); 1594 - extern unsigned short SiS_GetModeNumber(ScrnInfoPtr pScrn, DisplayModePtr mode, 1595 - unsigned int VBFlags); 1596 - #endif 1597 - 1598 - #ifdef SIS_LINUX_KERNEL 1599 - #ifdef SIS300 1629 + #ifdef CONFIG_FB_SIS_300 1600 1630 extern unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg); 1601 1631 extern void sisfb_write_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg, 1602 1632 unsigned int val); 1603 1633 #endif 1604 - #ifdef SIS315H 1634 + #ifdef CONFIG_FB_SIS_315 1605 1635 extern void sisfb_write_nbridge_pci_byte(struct SiS_Private *SiS_Pr, int reg, 1606 1636 unsigned char val); 1607 1637 extern unsigned int sisfb_read_mio_pci_word(struct SiS_Private *SiS_Pr, int reg); 1608 - #endif 1609 1638 #endif 1610 1639 1611 1640 #endif
+141 -326
drivers/video/sis/init301.c
··· 75 75 76 76 #include "init301.h" 77 77 78 - #ifdef SIS300 78 + #ifdef CONFIG_FB_SIS_300 79 79 #include "oem300.h" 80 80 #endif 81 81 82 - #ifdef SIS315H 82 + #ifdef CONFIG_FB_SIS_315 83 83 #include "oem310.h" 84 84 #endif 85 85 ··· 87 87 #define SiS_I2CDELAYSHORT 150 88 88 89 89 static unsigned short SiS_GetBIOSLCDResInfo(struct SiS_Private *SiS_Pr); 90 - #ifdef SIS_LINUX_KERNEL 91 90 static void SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 92 - #endif 93 91 94 92 /*********************************************/ 95 93 /* HELPER: Lock/Unlock CRT2 */ ··· 104 106 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01); 105 107 } 106 108 107 - #ifdef SIS_LINUX_KERNEL 108 109 static 109 - #endif 110 110 void 111 111 SiS_LockCRT2(struct SiS_Private *SiS_Pr) 112 112 { ··· 134 138 /* HELPER: Get Pointer to LCD structure */ 135 139 /*********************************************/ 136 140 137 - #ifdef SIS315H 141 + #ifdef CONFIG_FB_SIS_315 138 142 static unsigned char * 139 143 GetLCDStructPtr661(struct SiS_Private *SiS_Pr) 140 144 { ··· 400 404 /* HELPER: GET SOME DATA FROM BIOS ROM */ 401 405 /*********************************************/ 402 406 403 - #ifdef SIS300 407 + #ifdef CONFIG_FB_SIS_300 404 408 static bool 405 409 SiS_CR36BIOSWord23b(struct SiS_Private *SiS_Pr) 406 410 { ··· 445 449 SiS_GetReg(SiS_Pr->SiS_P3c4, 0x05); 446 450 } 447 451 448 - #if defined(SIS300) || defined(SIS315H) 452 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 449 453 static void 450 454 SiS_GenericDelay(struct SiS_Private *SiS_Pr, unsigned short delay) 451 455 { ··· 453 457 } 454 458 #endif 455 459 456 - #ifdef SIS315H 460 + #ifdef CONFIG_FB_SIS_315 457 461 static void 458 462 SiS_LongDelay(struct SiS_Private *SiS_Pr, unsigned short delay) 459 463 { ··· 463 467 } 464 468 #endif 465 469 466 - #if defined(SIS300) || defined(SIS315H) 470 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 467 471 static void 468 472 SiS_ShortDelay(struct SiS_Private *SiS_Pr, unsigned short delay) 469 473 { ··· 476 480 static void 477 481 SiS_PanelDelay(struct SiS_Private *SiS_Pr, unsigned short DelayTime) 478 482 { 479 - #if defined(SIS300) || defined(SIS315H) 483 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 480 484 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 481 485 unsigned short PanelID, DelayIndex, Delay=0; 482 486 #endif 483 487 484 488 if(SiS_Pr->ChipType < SIS_315H) { 485 489 486 - #ifdef SIS300 490 + #ifdef CONFIG_FB_SIS_300 487 491 488 492 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); 489 493 if(SiS_Pr->SiS_VBType & VB_SISVB) { ··· 509 513 } 510 514 SiS_ShortDelay(SiS_Pr, Delay); 511 515 512 - #endif /* SIS300 */ 516 + #endif /* CONFIG_FB_SIS_300 */ 513 517 514 518 } else { 515 519 516 - #ifdef SIS315H 520 + #ifdef CONFIG_FB_SIS_315 517 521 518 522 if((SiS_Pr->ChipType >= SIS_661) || 519 523 (SiS_Pr->ChipType <= SIS_315PRO) || ··· 575 579 576 580 } 577 581 578 - #endif /* SIS315H */ 582 + #endif /* CONFIG_FB_SIS_315 */ 579 583 580 584 } 581 585 } 582 586 583 - #ifdef SIS315H 587 + #ifdef CONFIG_FB_SIS_315 584 588 static void 585 589 SiS_PanelDelayLoop(struct SiS_Private *SiS_Pr, unsigned short DelayTime, unsigned short DelayLoop) 586 590 { ··· 609 613 while((!(SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08)) && --watchdog); 610 614 } 611 615 612 - #if defined(SIS300) || defined(SIS315H) 616 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 613 617 static void 614 618 SiS_WaitRetrace2(struct SiS_Private *SiS_Pr, unsigned short reg) 615 619 { ··· 626 630 SiS_WaitVBRetrace(struct SiS_Private *SiS_Pr) 627 631 { 628 632 if(SiS_Pr->ChipType < SIS_315H) { 629 - #ifdef SIS300 633 + #ifdef CONFIG_FB_SIS_300 630 634 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 631 635 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x20)) return; 632 636 } ··· 637 641 } 638 642 #endif 639 643 } else { 640 - #ifdef SIS315H 644 + #ifdef CONFIG_FB_SIS_315 641 645 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x40)) { 642 646 SiS_WaitRetrace1(SiS_Pr); 643 647 } else { ··· 682 686 /* HELPER: MISC */ 683 687 /*********************************************/ 684 688 685 - #ifdef SIS300 689 + #ifdef CONFIG_FB_SIS_300 686 690 static bool 687 691 SiS_Is301B(struct SiS_Private *SiS_Pr) 688 692 { ··· 704 708 bool 705 709 SiS_IsDualEdge(struct SiS_Private *SiS_Pr) 706 710 { 707 - #ifdef SIS315H 711 + #ifdef CONFIG_FB_SIS_315 708 712 if(SiS_Pr->ChipType >= SIS_315H) { 709 713 if((SiS_Pr->ChipType != SIS_650) || (SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0)) { 710 714 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableDualEdge) return true; ··· 717 721 bool 718 722 SiS_IsVAMode(struct SiS_Private *SiS_Pr) 719 723 { 720 - #ifdef SIS315H 724 + #ifdef CONFIG_FB_SIS_315 721 725 unsigned short flag; 722 726 723 727 if(SiS_Pr->ChipType >= SIS_315H) { ··· 728 732 return false; 729 733 } 730 734 731 - #ifdef SIS315H 735 + #ifdef CONFIG_FB_SIS_315 732 736 static bool 733 737 SiS_IsVAorLCD(struct SiS_Private *SiS_Pr) 734 738 { ··· 741 745 static bool 742 746 SiS_IsDualLink(struct SiS_Private *SiS_Pr) 743 747 { 744 - #ifdef SIS315H 748 + #ifdef CONFIG_FB_SIS_315 745 749 if(SiS_Pr->ChipType >= SIS_315H) { 746 750 if((SiS_CRT2IsLCD(SiS_Pr)) || 747 751 (SiS_IsVAMode(SiS_Pr))) { ··· 752 756 return false; 753 757 } 754 758 755 - #ifdef SIS315H 759 + #ifdef CONFIG_FB_SIS_315 756 760 static bool 757 761 SiS_TVEnabled(struct SiS_Private *SiS_Pr) 758 762 { ··· 764 768 } 765 769 #endif 766 770 767 - #ifdef SIS315H 771 + #ifdef CONFIG_FB_SIS_315 768 772 static bool 769 773 SiS_LCDAEnabled(struct SiS_Private *SiS_Pr) 770 774 { ··· 773 777 } 774 778 #endif 775 779 776 - #ifdef SIS315H 780 + #ifdef CONFIG_FB_SIS_315 777 781 static bool 778 782 SiS_WeHaveBacklightCtrl(struct SiS_Private *SiS_Pr) 779 783 { ··· 784 788 } 785 789 #endif 786 790 787 - #ifdef SIS315H 791 + #ifdef CONFIG_FB_SIS_315 788 792 static bool 789 793 SiS_IsNotM650orLater(struct SiS_Private *SiS_Pr) 790 794 { ··· 800 804 } 801 805 #endif 802 806 803 - #ifdef SIS315H 807 + #ifdef CONFIG_FB_SIS_315 804 808 static bool 805 809 SiS_IsYPbPr(struct SiS_Private *SiS_Pr) 806 810 { ··· 812 816 } 813 817 #endif 814 818 815 - #ifdef SIS315H 819 + #ifdef CONFIG_FB_SIS_315 816 820 static bool 817 821 SiS_IsChScart(struct SiS_Private *SiS_Pr) 818 822 { ··· 824 828 } 825 829 #endif 826 830 827 - #ifdef SIS315H 831 + #ifdef CONFIG_FB_SIS_315 828 832 static bool 829 833 SiS_IsTVOrYPbPrOrScart(struct SiS_Private *SiS_Pr) 830 834 { ··· 844 848 } 845 849 #endif 846 850 847 - #ifdef SIS315H 851 + #ifdef CONFIG_FB_SIS_315 848 852 static bool 849 853 SiS_IsLCDOrLCDA(struct SiS_Private *SiS_Pr) 850 854 { ··· 910 914 /*********************************************/ 911 915 912 916 /* Setup general purpose IO for Chrontel communication */ 913 - #ifdef SIS300 917 + #ifdef CONFIG_FB_SIS_300 914 918 void 915 919 SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo) 916 920 { ··· 919 923 920 924 if(!(SiS_Pr->SiS_ChSW)) return; 921 925 922 - #ifdef SIS_LINUX_KERNEL 923 926 acpibase = sisfb_read_lpc_pci_dword(SiS_Pr, 0x74); 924 - #else 925 - acpibase = pciReadLong(0x00000800, 0x74); 926 - #endif 927 927 acpibase &= 0xFFFF; 928 928 if(!acpibase) return; 929 929 temp = SiS_GetRegShort((acpibase + 0x3c)); /* ACPI register 0x3c: GP Event 1 I/O mode select */ ··· 961 969 tempax &= (DriverMode | LoadDACFlag | SetNotSimuMode | SetPALTV); 962 970 tempbx |= tempax; 963 971 964 - #ifdef SIS315H 972 + #ifdef CONFIG_FB_SIS_315 965 973 if(SiS_Pr->ChipType >= SIS_315H) { 966 974 if(SiS_Pr->SiS_VBType & VB_SISLCDA) { 967 975 if(ModeNo == 0x03) { ··· 1011 1019 } 1012 1020 } 1013 1021 1014 - #endif /* SIS315H */ 1022 + #endif /* CONFIG_FB_SIS_315 */ 1015 1023 1016 1024 if(!(SiS_Pr->SiS_VBType & VB_SISVGA2)) { 1017 1025 tempbx &= ~(SetCRT2ToRAMDAC); ··· 1146 1154 1147 1155 SiS_Pr->SiS_VBInfo = tempbx; 1148 1156 1149 - #ifdef SIS300 1157 + #ifdef CONFIG_FB_SIS_300 1150 1158 if(SiS_Pr->ChipType == SIS_630) { 1151 1159 SiS_SetChrontelGPIO(SiS_Pr, SiS_Pr->SiS_VBInfo); 1152 1160 } 1153 1161 #endif 1154 1162 1155 - #ifdef SIS_LINUX_KERNEL 1156 1163 #if 0 1157 1164 printk(KERN_DEBUG "sisfb: (init301: VBInfo= 0x%04x, SetFlag=0x%04x)\n", 1158 1165 SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag); 1159 - #endif 1160 - #endif 1161 - #ifdef SIS_XORG_XF86 1162 - #ifdef TWDEBUG 1163 - xf86DrvMsg(0, X_PROBED, "(init301: VBInfo=0x%04x, SetFlag=0x%04x)\n", 1164 - SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag); 1165 - #endif 1166 1166 #endif 1167 1167 } 1168 1168 ··· 1399 1415 } 1400 1416 1401 1417 SiS_Pr->SiS_VBInfo &= ~SetPALTV; 1402 - 1403 - #ifdef SIS_XORG_XF86 1404 - #ifdef TWDEBUG 1405 - xf86DrvMsg(0, X_INFO, "(init301: TVMode %x, VBInfo %x)\n", SiS_Pr->SiS_TVMode, SiS_Pr->SiS_VBInfo); 1406 - #endif 1407 - #endif 1408 1418 } 1409 1419 1410 1420 /*********************************************/ ··· 1421 1443 static void 1422 1444 SiS_GetLCDInfoBIOS(struct SiS_Private *SiS_Pr) 1423 1445 { 1424 - #ifdef SIS315H 1446 + #ifdef CONFIG_FB_SIS_315 1425 1447 unsigned char *ROMAddr; 1426 1448 unsigned short temp; 1427 - 1428 - #ifdef SIS_XORG_XF86 1429 - #ifdef TWDEBUG 1430 - xf86DrvMsg(0, X_INFO, "Paneldata driver: [%d %d] [H %d %d] [V %d %d] [C %d 0x%02x 0x%02x]\n", 1431 - SiS_Pr->PanelHT, SiS_Pr->PanelVT, 1432 - SiS_Pr->PanelHRS, SiS_Pr->PanelHRE, 1433 - SiS_Pr->PanelVRS, SiS_Pr->PanelVRE, 1434 - SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].CLOCK, 1435 - SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_A, 1436 - SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_B); 1437 - #endif 1438 - #endif 1439 1449 1440 1450 if((ROMAddr = GetLCDStructPtr661(SiS_Pr))) { 1441 1451 if((temp = SISGETROMW(6)) != SiS_Pr->PanelHT) { ··· 1445 1479 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_A = ROMAddr[19]; 1446 1480 SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].SR2C = 1447 1481 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_B = ROMAddr[20]; 1448 - 1449 - #ifdef SIS_XORG_XF86 1450 - #ifdef TWDEBUG 1451 - xf86DrvMsg(0, X_INFO, "Paneldata BIOS: [%d %d] [H %d %d] [V %d %d] [C %d 0x%02x 0x%02x]\n", 1452 - SiS_Pr->PanelHT, SiS_Pr->PanelVT, 1453 - SiS_Pr->PanelHRS, SiS_Pr->PanelHRE, 1454 - SiS_Pr->PanelVRS, SiS_Pr->PanelVRE, 1455 - SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].CLOCK, 1456 - SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_A, 1457 - SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_B); 1458 - #endif 1459 - #endif 1460 1482 1461 1483 } 1462 1484 #endif ··· 1471 1517 { 1472 1518 unsigned short temp,modeflag,resinfo=0,modexres=0,modeyres=0; 1473 1519 bool panelcanscale = false; 1474 - #ifdef SIS300 1520 + #ifdef CONFIG_FB_SIS_300 1475 1521 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 1476 1522 static const unsigned char SiS300SeriesLCDRes[] = 1477 1523 { 0, 1, 2, 3, 7, 4, 5, 8, 1478 1524 0, 0, 10, 0, 0, 0, 0, 15 }; 1479 1525 #endif 1480 - #ifdef SIS315H 1526 + #ifdef CONFIG_FB_SIS_315 1481 1527 unsigned char *myptr = NULL; 1482 1528 #endif 1483 1529 ··· 1516 1562 SiS_Pr->SiS_LCDTypeInfo = (temp & 0x0F) - 1; 1517 1563 } 1518 1564 temp &= 0x0f; 1519 - #ifdef SIS300 1565 + #ifdef CONFIG_FB_SIS_300 1520 1566 if(SiS_Pr->ChipType < SIS_315H) { 1521 1567 /* Very old BIOSes only know 7 sizes (NetVista 2179, 1.01g) */ 1522 1568 if(SiS_Pr->SiS_VBType & VB_SIS301) { ··· 1528 1574 #endif 1529 1575 1530 1576 /* Translate to our internal types */ 1531 - #ifdef SIS315H 1577 + #ifdef CONFIG_FB_SIS_315 1532 1578 if(SiS_Pr->ChipType == SIS_550) { 1533 1579 if (temp == Panel310_1152x768) temp = Panel_320x240_2; /* Verified working */ 1534 1580 else if(temp == Panel310_320x240_2) temp = Panel_320x240_2; ··· 1551 1597 1552 1598 SiS_Pr->SiS_LCDResInfo = temp; 1553 1599 1554 - #ifdef SIS300 1600 + #ifdef CONFIG_FB_SIS_300 1555 1601 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 1556 1602 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { 1557 1603 SiS_Pr->SiS_LCDResInfo = Panel_Barco1366; ··· 1593 1639 else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD; 1594 1640 1595 1641 /* Dual link, Pass 1:1 BIOS default, etc. */ 1596 - #ifdef SIS315H 1642 + #ifdef CONFIG_FB_SIS_315 1597 1643 if(SiS_Pr->ChipType >= SIS_661) { 1598 1644 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 1599 1645 if(temp & 0x08) SiS_Pr->SiS_LCDInfo |= LCDPass11; ··· 2030 2076 } 2031 2077 } 2032 2078 2033 - #ifdef SIS300 2079 + #ifdef CONFIG_FB_SIS_300 2034 2080 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 2035 2081 if(SiS_Pr->SiS_CustomT == CUT_PANEL848 || SiS_Pr->SiS_CustomT == CUT_PANEL856) { 2036 2082 SiS_Pr->SiS_LCDInfo = 0x80 | 0x40 | 0x20; /* neg h/v sync, RGB24(D0 = 0) */ ··· 2140 2186 SiS_Pr->SiS_SetFlag |= LCDVESATiming; 2141 2187 } 2142 2188 2143 - #ifdef SIS_LINUX_KERNEL 2144 2189 #if 0 2145 2190 printk(KERN_DEBUG "sisfb: (LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x)\n", 2146 2191 SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo); 2147 - #endif 2148 - #endif 2149 - #ifdef SIS_XORG_XF86 2150 - xf86DrvMsgVerb(0, X_PROBED, 4, 2151 - "(init301: LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x SetFlag=0x%04x)\n", 2152 - SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo, SiS_Pr->SiS_SetFlag); 2153 2192 #endif 2154 2193 } 2155 2194 ··· 2306 2359 VCLKIndex = SiS_Pr->PanelVCLKIdx315; 2307 2360 } 2308 2361 2309 - #ifdef SIS300 2362 + #ifdef CONFIG_FB_SIS_300 2310 2363 /* Special Timing: Barco iQ Pro R series */ 2311 2364 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) VCLKIndex = 0x44; 2312 2365 ··· 2357 2410 2358 2411 } 2359 2412 2360 - #ifdef SIS_XORG_XF86 2361 - #ifdef TWDEBUG 2362 - xf86DrvMsg(0, X_INFO, "VCLKIndex %d (0x%x)\n", VCLKIndex, VCLKIndex); 2363 - #endif 2364 - #endif 2365 - 2366 2413 return VCLKIndex; 2367 2414 } 2368 2415 ··· 2369 2428 { 2370 2429 unsigned short i, j, modeflag, tempah=0; 2371 2430 short tempcl; 2372 - #if defined(SIS300) || defined(SIS315H) 2431 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 2373 2432 unsigned short tempbl; 2374 2433 #endif 2375 - #ifdef SIS315H 2434 + #ifdef CONFIG_FB_SIS_315 2376 2435 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 2377 2436 unsigned short tempah2, tempbl2; 2378 2437 #endif ··· 2395 2454 2396 2455 if(SiS_Pr->ChipType < SIS_315H) { 2397 2456 2398 - #ifdef SIS300 /* ---- 300 series ---- */ 2457 + #ifdef CONFIG_FB_SIS_300 /* ---- 300 series ---- */ 2399 2458 2400 2459 /* For 301BDH: (with LCD via LVDS) */ 2401 2460 if(SiS_Pr->SiS_VBType & VB_NoLCD) { ··· 2418 2477 2419 2478 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0xA0; 2420 2479 2421 - #endif /* SIS300 */ 2480 + #endif /* CONFIG_FB_SIS_300 */ 2422 2481 2423 2482 } else { 2424 2483 2425 - #ifdef SIS315H /* ------- 315/330 series ------ */ 2484 + #ifdef CONFIG_FB_SIS_315 /* ------- 315/330 series ------ */ 2426 2485 2427 2486 if(ModeNo > 0x13) { 2428 2487 tempcl -= ModeVGA; ··· 2435 2494 2436 2495 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0x50; 2437 2496 2438 - #endif /* SIS315H */ 2497 + #endif /* CONFIG_FB_SIS_315 */ 2439 2498 2440 2499 } 2441 2500 ··· 2444 2503 if(SiS_Pr->ChipType < SIS_315H) { 2445 2504 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); 2446 2505 } else { 2447 - #ifdef SIS315H 2506 + #ifdef CONFIG_FB_SIS_315 2448 2507 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 2449 2508 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); 2450 2509 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { ··· 2525 2584 2526 2585 if(SiS_Pr->ChipType >= SIS_315H) { 2527 2586 2528 - #ifdef SIS315H 2587 + #ifdef CONFIG_FB_SIS_315 2529 2588 /* LVDS can only be slave in 8bpp modes */ 2530 2589 tempah = 0x80; 2531 2590 if((modeflag & CRT2Mode) && (SiS_Pr->SiS_ModeType > ModeVGA)) { ··· 2545 2604 2546 2605 } else { 2547 2606 2548 - #ifdef SIS300 2607 + #ifdef CONFIG_FB_SIS_300 2549 2608 tempah = 0; 2550 2609 if( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) && (SiS_Pr->SiS_ModeType > ModeVGA) ) { 2551 2610 tempah |= 0x02; ··· 2567 2626 2568 2627 if(SiS_Pr->ChipType >= SIS_315H) { 2569 2628 2570 - #ifdef SIS315H 2629 + #ifdef CONFIG_FB_SIS_315 2571 2630 /* unsigned char bridgerev = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01); */ 2572 2631 2573 2632 /* The following is nearly unpreditable and varies from machine ··· 2659 2718 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,tempbl,tempah); 2660 2719 } 2661 2720 2662 - #endif /* SIS315H */ 2721 + #endif /* CONFIG_FB_SIS_315 */ 2663 2722 2664 2723 } else if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 2665 2724 2666 - #ifdef SIS300 2725 + #ifdef CONFIG_FB_SIS_300 2667 2726 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); 2668 2727 2669 2728 if((SiS_Pr->SiS_VBInfo & DisableCRT2Display) || ··· 2686 2745 2687 2746 } else { /* LVDS */ 2688 2747 2689 - #ifdef SIS315H 2748 + #ifdef CONFIG_FB_SIS_315 2690 2749 if(SiS_Pr->ChipType >= SIS_315H) { 2691 2750 2692 2751 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { ··· 2872 2931 } 2873 2932 } 2874 2933 2875 - #ifdef SIS315H 2934 + #ifdef CONFIG_FB_SIS_315 2876 2935 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { 2877 2936 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { 2878 2937 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { ··· 2977 3036 case Panel_1280x1024: tempbx = 24; break; 2978 3037 case Panel_1400x1050: tempbx = 26; break; 2979 3038 case Panel_1600x1200: tempbx = 28; break; 2980 - #ifdef SIS300 3039 + #ifdef CONFIG_FB_SIS_300 2981 3040 case Panel_Barco1366: tempbx = 80; break; 2982 3041 #endif 2983 3042 } ··· 2994 3053 2995 3054 if(SiS_Pr->SiS_LCDInfo & LCDPass11) tempbx = 30; 2996 3055 2997 - #ifdef SIS300 3056 + #ifdef CONFIG_FB_SIS_300 2998 3057 if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { 2999 3058 tempbx = 82; 3000 3059 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; ··· 3130 3189 3131 3190 if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { 3132 3191 3133 - #ifdef SIS315H 3192 + #ifdef CONFIG_FB_SIS_315 3134 3193 SiS_CalcPanelLinkTiming(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 3135 3194 SiS_CalcLCDACRT1Timing(SiS_Pr, ModeNo, ModeIdIndex); 3136 3195 #endif ··· 3155 3214 case 16: LVDSData = SiS_Pr->SiS_LVDS800x600Data_1; break; 3156 3215 case 18: LVDSData = SiS_Pr->SiS_LVDS1024x600Data_1; break; 3157 3216 case 20: LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1; break; 3158 - #ifdef SIS300 3217 + #ifdef CONFIG_FB_SIS_300 3159 3218 case 80: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_1; break; 3160 3219 case 81: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_2; break; 3161 3220 case 82: LVDSData = SiS_Pr->SiS_LVDSBARCO1024Data_1; break; ··· 3189 3248 (SiS_Pr->SiS_SetFlag & SetDOSMode) ) { 3190 3249 SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes; 3191 3250 SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes; 3192 - #ifdef SIS300 3251 + #ifdef CONFIG_FB_SIS_300 3193 3252 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { 3194 3253 if(ResIndex < 0x08) { 3195 3254 SiS_Pr->SiS_HDE = 1280; ··· 3211 3270 unsigned short resinfo, CRT2Index, ResIndex; 3212 3271 const struct SiS_LCDData *LCDPtr = NULL; 3213 3272 const struct SiS_TVData *TVPtr = NULL; 3214 - #ifdef SIS315H 3273 + #ifdef CONFIG_FB_SIS_315 3215 3274 short resinfo661; 3216 3275 #endif 3217 3276 ··· 3224 3283 } else { 3225 3284 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; 3226 3285 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; 3227 - #ifdef SIS315H 3286 + #ifdef CONFIG_FB_SIS_315 3228 3287 resinfo661 = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].ROMMODEIDX661; 3229 3288 if( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && 3230 3289 (SiS_Pr->SiS_SetFlag & LCDVESATiming) && ··· 3401 3460 3402 3461 } else if( (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) && (romptr) && (ROMAddr) ) { 3403 3462 3404 - #ifdef SIS315H 3463 + #ifdef CONFIG_FB_SIS_315 3405 3464 SiS_Pr->SiS_RVBHCMAX = ROMAddr[romptr]; 3406 3465 SiS_Pr->SiS_RVBHCFACT = ROMAddr[romptr+1]; 3407 3466 SiS_Pr->SiS_VGAHT = ROMAddr[romptr+2] | ((ROMAddr[romptr+3] & 0x0f) << 8); ··· 3461 3520 case Panel_1680x1050 : 3462 3521 case Panel_1680x1050 + 32: LCDPtr = SiS_Pr->SiS_LCD1680x1050Data; break; 3463 3522 case 100 : LCDPtr = SiS_Pr->SiS_NoScaleData; break; 3464 - #ifdef SIS315H 3523 + #ifdef CONFIG_FB_SIS_315 3465 3524 case 200 : LCDPtr = SiS310_ExtCompaq1280x1024Data; break; 3466 3525 case 201 : LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data; break; 3467 3526 #endif 3468 3527 default : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data; break; 3469 3528 } 3470 - 3471 - #ifdef SIS_XORG_XF86 3472 - #ifdef TWDEBUG 3473 - xf86DrvMsg(0, X_INFO, "GetCRT2Data: Index %d ResIndex %d\n", CRT2Index, ResIndex); 3474 - #endif 3475 - #endif 3476 3529 3477 3530 SiS_Pr->SiS_RVBHCMAX = (LCDPtr+ResIndex)->RVBHCMAX; 3478 3531 SiS_Pr->SiS_RVBHCFACT = (LCDPtr+ResIndex)->RVBHCFACT; ··· 3559 3624 { 3560 3625 const struct SiS_LVDSDes *PanelDesPtr = NULL; 3561 3626 3562 - #ifdef SIS300 3627 + #ifdef CONFIG_FB_SIS_300 3563 3628 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { 3564 3629 3565 3630 if(SiS_Pr->ChipType < SIS_315H) { ··· 3631 3696 3632 3697 if((SiS_Pr->SiS_VBType & VB_SIS30xBLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { 3633 3698 3634 - #ifdef SIS315H 3699 + #ifdef CONFIG_FB_SIS_315 3635 3700 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { 3636 3701 /* non-pass 1:1 only, see above */ 3637 3702 if(SiS_Pr->SiS_VGAHDE != SiS_Pr->PanelXRes) { ··· 3706 3771 } else { 3707 3772 3708 3773 if(SiS_Pr->ChipType < SIS_315H) { 3709 - #ifdef SIS300 3774 + #ifdef CONFIG_FB_SIS_300 3710 3775 switch(SiS_Pr->SiS_LCDResInfo) { 3711 3776 case Panel_800x600: 3712 3777 if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { ··· 3751 3816 } 3752 3817 #endif 3753 3818 } else { 3754 - #ifdef SIS315H 3819 + #ifdef CONFIG_FB_SIS_315 3755 3820 switch(SiS_Pr->SiS_LCDResInfo) { 3756 3821 case Panel_1024x768: 3757 3822 case Panel_1280x1024: ··· 3779 3844 if(SiS_Pr->ChipType < SIS_315H) { 3780 3845 if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 320; 3781 3846 } else { 3782 - #ifdef SIS315H 3847 + #ifdef CONFIG_FB_SIS_315 3783 3848 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) SiS_Pr->SiS_LCDHDES = 480; 3784 3849 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) SiS_Pr->SiS_LCDHDES = 804; 3785 3850 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) SiS_Pr->SiS_LCDHDES = 704; ··· 3801 3866 /* DISABLE VIDEO BRIDGE */ 3802 3867 /*********************************************/ 3803 3868 3804 - #ifdef SIS315H 3869 + #ifdef CONFIG_FB_SIS_315 3805 3870 static int 3806 3871 SiS_HandlePWD(struct SiS_Private *SiS_Pr) 3807 3872 { ··· 3826 3891 ret = 1; 3827 3892 } 3828 3893 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x27,0x7f,temp); 3829 - #ifdef SIS_XORG_XF86 3830 - #ifdef TWDEBUG 3831 - xf86DrvMsg(0, 0, "Setting PWD %x\n", temp); 3832 - #endif 3833 - #endif 3834 3894 } 3835 3895 #endif 3836 3896 return ret; ··· 3839 3909 void 3840 3910 SiS_DisableBridge(struct SiS_Private *SiS_Pr) 3841 3911 { 3842 - #ifdef SIS315H 3912 + #ifdef CONFIG_FB_SIS_315 3843 3913 unsigned short tempah, pushax=0, modenum; 3844 3914 #endif 3845 3915 unsigned short temp=0; ··· 3850 3920 3851 3921 if(SiS_Pr->ChipType < SIS_315H) { 3852 3922 3853 - #ifdef SIS300 /* 300 series */ 3923 + #ifdef CONFIG_FB_SIS_300 /* 300 series */ 3854 3924 3855 3925 if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { 3856 3926 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { ··· 3883 3953 } 3884 3954 } 3885 3955 3886 - #endif /* SIS300 */ 3956 + #endif /* CONFIG_FB_SIS_300 */ 3887 3957 3888 3958 } else { 3889 3959 3890 - #ifdef SIS315H /* 315 series */ 3960 + #ifdef CONFIG_FB_SIS_315 /* 315 series */ 3891 3961 3892 3962 int didpwd = 0; 3893 3963 bool custom1 = (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) || ··· 4011 4081 4012 4082 } 4013 4083 4014 - #endif /* SIS315H */ 4084 + #endif /* CONFIG_FB_SIS_315 */ 4015 4085 4016 4086 } 4017 4087 4018 4088 } else { /* ============ For 301 ================ */ 4019 4089 4020 4090 if(SiS_Pr->ChipType < SIS_315H) { 4021 - #ifdef SIS300 4091 + #ifdef CONFIG_FB_SIS_300 4022 4092 if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { 4023 4093 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); 4024 4094 SiS_PanelDelay(SiS_Pr, 3); ··· 4041 4111 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); 4042 4112 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); 4043 4113 } else { 4044 - #ifdef SIS300 4114 + #ifdef CONFIG_FB_SIS_300 4045 4115 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); /* disable CRT2 */ 4046 4116 if( (!(SiS_CRT2IsLCD(SiS_Pr))) || 4047 4117 (!(SiS_CR36BIOSWord23d(SiS_Pr))) ) { ··· 4057 4127 4058 4128 if(SiS_Pr->ChipType < SIS_315H) { 4059 4129 4060 - #ifdef SIS300 /* 300 series */ 4130 + #ifdef CONFIG_FB_SIS_300 /* 300 series */ 4061 4131 4062 4132 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { 4063 4133 SiS_SetCH700x(SiS_Pr,0x0E,0x09); ··· 4101 4171 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); 4102 4172 } 4103 4173 4104 - #endif /* SIS300 */ 4174 + #endif /* CONFIG_FB_SIS_300 */ 4105 4175 4106 4176 } else { 4107 4177 4108 - #ifdef SIS315H /* 315 series */ 4178 + #ifdef CONFIG_FB_SIS_315 /* 315 series */ 4109 4179 4110 4180 if(!(SiS_IsNotM650orLater(SiS_Pr))) { 4111 4181 /*if(SiS_Pr->ChipType < SIS_340) { */ /* XGI needs this */ ··· 4218 4288 } 4219 4289 } 4220 4290 4221 - #endif /* SIS315H */ 4291 + #endif /* CONFIG_FB_SIS_315 */ 4222 4292 4223 4293 } /* 315 series */ 4224 4294 ··· 4234 4304 * from outside the context of a mode switch! 4235 4305 * MUST call getVBType before calling this 4236 4306 */ 4237 - #ifdef SIS_LINUX_KERNEL 4238 4307 static 4239 - #endif 4240 4308 void 4241 4309 SiS_EnableBridge(struct SiS_Private *SiS_Pr) 4242 4310 { 4243 4311 unsigned short temp=0, tempah; 4244 - #ifdef SIS315H 4312 + #ifdef CONFIG_FB_SIS_315 4245 4313 unsigned short temp1, pushax=0; 4246 4314 bool delaylong = false; 4247 4315 #endif ··· 4250 4322 4251 4323 if(SiS_Pr->ChipType < SIS_315H) { 4252 4324 4253 - #ifdef SIS300 /* 300 series */ 4325 + #ifdef CONFIG_FB_SIS_300 /* 300 series */ 4254 4326 4255 4327 if(SiS_CRT2IsLCD(SiS_Pr)) { 4256 4328 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { ··· 4313 4385 } 4314 4386 4315 4387 4316 - #endif /* SIS300 */ 4388 + #endif /* CONFIG_FB_SIS_300 */ 4317 4389 4318 4390 } else { 4319 4391 4320 - #ifdef SIS315H /* 315 series */ 4392 + #ifdef CONFIG_FB_SIS_315 /* 315 series */ 4321 4393 4322 4394 #ifdef SET_EMI 4323 4395 unsigned char r30=0, r31=0, r32=0, r33=0, cr36=0; ··· 4616 4688 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); 4617 4689 } 4618 4690 4619 - #endif /* SIS315H */ 4691 + #endif /* CONFIG_FB_SIS_315 */ 4620 4692 4621 4693 } 4622 4694 ··· 4667 4739 4668 4740 if(SiS_Pr->ChipType < SIS_315H) { 4669 4741 4670 - #ifdef SIS300 /* 300 series */ 4742 + #ifdef CONFIG_FB_SIS_300 /* 300 series */ 4671 4743 4672 4744 if(SiS_CRT2IsLCD(SiS_Pr)) { 4673 4745 if(SiS_Pr->ChipType == SIS_730) { ··· 4711 4783 } 4712 4784 } 4713 4785 4714 - #endif /* SIS300 */ 4786 + #endif /* CONFIG_FB_SIS_300 */ 4715 4787 4716 4788 } else { 4717 4789 4718 - #ifdef SIS315H /* 315 series */ 4790 + #ifdef CONFIG_FB_SIS_315 /* 315 series */ 4719 4791 4720 4792 if(!(SiS_IsNotM650orLater(SiS_Pr))) { 4721 4793 /*if(SiS_Pr->ChipType < SIS_340) {*/ /* XGI needs this */ ··· 4809 4881 } 4810 4882 } 4811 4883 4812 - #endif /* SIS315H */ 4884 + #endif /* CONFIG_FB_SIS_315 */ 4813 4885 4814 4886 } /* 310 series */ 4815 4887 ··· 4899 4971 4900 4972 if(SiS_Pr->ChipType < SIS_315H) { 4901 4973 4902 - #ifdef SIS300 /* ---- 300 series --- */ 4974 + #ifdef CONFIG_FB_SIS_300 /* ---- 300 series --- */ 4903 4975 4904 4976 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { /* 630 - 301B(-DH) */ 4905 4977 ··· 4928 5000 4929 5001 } 4930 5002 4931 - #endif /* SIS300 */ 5003 + #endif /* CONFIG_FB_SIS_300 */ 4932 5004 4933 5005 } else { 4934 5006 4935 - #ifdef SIS315H /* ------- 315 series ------ */ 5007 + #ifdef CONFIG_FB_SIS_315 /* ------- 315 series ------ */ 4936 5008 4937 5009 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { /* 315 - LVDS */ 4938 5010 ··· 5004 5076 } 5005 5077 5006 5078 } 5007 - #endif /* SIS315H */ 5079 + #endif /* CONFIG_FB_SIS_315 */ 5008 5080 } 5009 5081 } 5010 5082 } 5011 5083 5012 5084 /* Set CRT2 FIFO on 300/540/630/730 */ 5013 - #ifdef SIS300 5085 + #ifdef CONFIG_FB_SIS_300 5014 5086 static void 5015 5087 SiS_SetCRT2FIFO_300(struct SiS_Private *SiS_Pr,unsigned short ModeNo) 5016 5088 { ··· 5082 5154 5083 5155 } else { 5084 5156 5085 - #ifdef SIS_LINUX_KERNEL 5086 5157 pci50 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0x50); 5087 5158 pciA0 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0xa0); 5088 - #else 5089 - pci50 = pciReadLong(0x00000000, 0x50); 5090 - pciA0 = pciReadLong(0x00000000, 0xA0); 5091 - #endif 5092 5159 5093 5160 if(SiS_Pr->ChipType == SIS_730) { 5094 5161 ··· 5185 5262 #endif 5186 5263 5187 5264 /* Set CRT2 FIFO on 315/330 series */ 5188 - #ifdef SIS315H 5265 + #ifdef CONFIG_FB_SIS_315 5189 5266 static void 5190 5267 SiS_SetCRT2FIFO_310(struct SiS_Private *SiS_Pr) 5191 5268 { ··· 5343 5420 5344 5421 temp = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); 5345 5422 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); /* ? */ 5346 - 5347 - #ifdef SIS_XORG_XF86 5348 - #ifdef TWDEBUG 5349 - xf86DrvMsg(0, X_INFO, "%d %d %d %d %d %d %d %d (%d %d %d %d)\n", 5350 - SiS_Pr->CHDisplay, SiS_Pr->CHSyncStart, SiS_Pr->CHSyncEnd, SiS_Pr->CHTotal, 5351 - SiS_Pr->CVDisplay, SiS_Pr->CVSyncStart, SiS_Pr->CVSyncEnd, SiS_Pr->CVTotal, 5352 - SiS_Pr->CHBlankStart, SiS_Pr->CHBlankEnd, SiS_Pr->CVBlankStart, SiS_Pr->CVBlankEnd); 5353 - 5354 - xf86DrvMsg(0, X_INFO, " {{0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", 5355 - SiS_Pr->CCRT1CRTC[0], SiS_Pr->CCRT1CRTC[1], 5356 - SiS_Pr->CCRT1CRTC[2], SiS_Pr->CCRT1CRTC[3], 5357 - SiS_Pr->CCRT1CRTC[4], SiS_Pr->CCRT1CRTC[5], 5358 - SiS_Pr->CCRT1CRTC[6], SiS_Pr->CCRT1CRTC[7]); 5359 - xf86DrvMsg(0, X_INFO, " 0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", 5360 - SiS_Pr->CCRT1CRTC[8], SiS_Pr->CCRT1CRTC[9], 5361 - SiS_Pr->CCRT1CRTC[10], SiS_Pr->CCRT1CRTC[11], 5362 - SiS_Pr->CCRT1CRTC[12], SiS_Pr->CCRT1CRTC[13], 5363 - SiS_Pr->CCRT1CRTC[14], SiS_Pr->CCRT1CRTC[15]); 5364 - xf86DrvMsg(0, X_INFO, " 0x%02x}},\n", SiS_Pr->CCRT1CRTC[16]); 5365 - #endif 5366 - #endif 5367 5423 } 5368 5424 5369 5425 /* Setup panel link ··· 5357 5455 unsigned short push2, tempax, tempbx, tempcx, temp; 5358 5456 unsigned int tempeax = 0, tempebx, tempecx, tempvcfact = 0; 5359 5457 bool islvds = false, issis = false, chkdclkfirst = false; 5360 - #ifdef SIS300 5458 + #ifdef CONFIG_FB_SIS_300 5361 5459 unsigned short crt2crtc = 0; 5362 5460 #endif 5363 - #ifdef SIS315H 5461 + #ifdef CONFIG_FB_SIS_315 5364 5462 unsigned short pushcx; 5365 5463 #endif 5366 5464 5367 5465 if(ModeNo <= 0x13) { 5368 5466 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; 5369 5467 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; 5370 - #ifdef SIS300 5468 + #ifdef CONFIG_FB_SIS_300 5371 5469 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; 5372 5470 #endif 5373 5471 } else if(SiS_Pr->UseCustomMode) { ··· 5375 5473 } else { 5376 5474 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; 5377 5475 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; 5378 - #ifdef SIS300 5476 + #ifdef CONFIG_FB_SIS_300 5379 5477 crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; 5380 5478 #endif 5381 5479 } ··· 5396 5494 } 5397 5495 } 5398 5496 5399 - #ifdef SIS315H 5497 + #ifdef CONFIG_FB_SIS_315 5400 5498 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { 5401 5499 if(IS_SIS330) { 5402 5500 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); ··· 5646 5744 5647 5745 if(SiS_Pr->ChipType < SIS_315H) { 5648 5746 5649 - #ifdef SIS300 /* 300 series */ 5747 + #ifdef CONFIG_FB_SIS_300 /* 300 series */ 5650 5748 tempeax = SiS_Pr->SiS_VGAVDE << 6; 5651 5749 temp = (tempeax % (unsigned int)SiS_Pr->SiS_VDE); 5652 5750 tempeax = tempeax / (unsigned int)SiS_Pr->SiS_VDE; ··· 5657 5755 temp = (unsigned short)(tempeax & 0x00FF); 5658 5756 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1E,temp); /* BPLVCFACT */ 5659 5757 tempvcfact = temp; 5660 - #endif /* SIS300 */ 5758 + #endif /* CONFIG_FB_SIS_300 */ 5661 5759 5662 5760 } else { 5663 5761 5664 - #ifdef SIS315H /* 315 series */ 5762 + #ifdef CONFIG_FB_SIS_315 /* 315 series */ 5665 5763 tempeax = SiS_Pr->SiS_VGAVDE << 18; 5666 5764 tempebx = SiS_Pr->SiS_VDE; 5667 5765 temp = (tempeax % tempebx); ··· 5747 5845 temp = (unsigned short)(tempecx & 0x00FF); 5748 5846 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x23,temp); 5749 5847 5750 - #ifdef SIS315H 5848 + #ifdef CONFIG_FB_SIS_315 5751 5849 if(SiS_Pr->ChipType >= SIS_315H) { 5752 5850 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { 5753 5851 if((islvds) || (SiS_Pr->SiS_VBInfo & VB_SISLVDS)) { ··· 5765 5863 } 5766 5864 #endif 5767 5865 5768 - #ifdef SIS300 5866 + #ifdef CONFIG_FB_SIS_300 5769 5867 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { 5770 5868 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 5771 5869 unsigned char *trumpdata; ··· 5801 5899 } 5802 5900 #endif 5803 5901 5804 - #ifdef SIS315H 5902 + #ifdef CONFIG_FB_SIS_315 5805 5903 if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) { 5806 5904 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x25,0x00); 5807 5905 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x26,0x00); ··· 5901 5999 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,0x0a); 5902 6000 } 5903 6001 } 5904 - #endif /* SIS315H */ 6002 + #endif /* CONFIG_FB_SIS_315 */ 5905 6003 } 5906 6004 5907 6005 /* Set Part 1 */ ··· 5909 6007 SiS_SetGroup1(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, 5910 6008 unsigned short RefreshRateTableIndex) 5911 6009 { 5912 - #if defined(SIS300) || defined(SIS315H) 6010 + #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 5913 6011 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 5914 6012 #endif 5915 6013 unsigned short temp=0, tempax=0, tempbx=0, tempcx=0, bridgeadd=0; 5916 6014 unsigned short pushbx=0, CRT1Index=0, modeflag, resinfo=0; 5917 - #ifdef SIS315H 6015 + #ifdef CONFIG_FB_SIS_315 5918 6016 unsigned short tempbl=0; 5919 6017 #endif 5920 6018 ··· 5940 6038 (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ) { 5941 6039 5942 6040 if(SiS_Pr->ChipType < SIS_315H ) { 5943 - #ifdef SIS300 6041 + #ifdef CONFIG_FB_SIS_300 5944 6042 SiS_SetCRT2FIFO_300(SiS_Pr, ModeNo); 5945 6043 #endif 5946 6044 } else { 5947 - #ifdef SIS315H 6045 + #ifdef CONFIG_FB_SIS_315 5948 6046 SiS_SetCRT2FIFO_310(SiS_Pr); 5949 6047 #endif 5950 6048 } ··· 5953 6051 5954 6052 if(SiS_Pr->ChipType < SIS_315H ) { 5955 6053 5956 - #ifdef SIS300 /* ------------- 300 series --------------*/ 6054 + #ifdef CONFIG_FB_SIS_300 /* ------------- 300 series --------------*/ 5957 6055 5958 6056 temp = (SiS_Pr->SiS_VGAHT - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */ 5959 6057 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,temp); /* CRT2 Horizontal Total */ ··· 5972 6070 5973 6071 bridgeadd = 12; 5974 6072 5975 - #endif /* SIS300 */ 6073 + #endif /* CONFIG_FB_SIS_300 */ 5976 6074 5977 6075 } else { 5978 6076 5979 - #ifdef SIS315H /* ------------------- 315/330 series --------------- */ 6077 + #ifdef CONFIG_FB_SIS_315 /* ------------------- 315/330 series --------------- */ 5980 6078 5981 6079 tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HT 0x08,0x09 */ 5982 6080 if(modeflag & HalfDCLK) { ··· 6027 6125 } 6028 6126 } 6029 6127 6030 - #endif /* SIS315H */ 6128 + #endif /* CONFIG_FB_SIS_315 */ 6031 6129 6032 6130 } /* 315/330 series */ 6033 6131 ··· 6158 6256 6159 6257 if(SiS_Pr->ChipType < SIS_315H) { 6160 6258 6161 - #ifdef SIS300 /* ---------- 300 series -------------- */ 6259 + #ifdef CONFIG_FB_SIS_300 /* ---------- 300 series -------------- */ 6162 6260 6163 6261 if(SiS_Pr->SiS_VBType & VB_SISVB) { 6164 6262 temp = 0x20; ··· 6212 6310 6213 6311 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* Panel Link Delay Compensation; (Software Command Reset; Power Saving) */ 6214 6312 6215 - #endif /* SIS300 */ 6313 + #endif /* CONFIG_FB_SIS_300 */ 6216 6314 6217 6315 } else { 6218 6316 6219 - #ifdef SIS315H /* --------------- 315/330 series ---------------*/ 6317 + #ifdef CONFIG_FB_SIS_315 /* --------------- 315/330 series ---------------*/ 6220 6318 6221 6319 if(SiS_Pr->ChipType < SIS_661) { 6222 6320 ··· 6251 6349 if(modeflag & HalfDCLK) tempax |= 0x40; 6252 6350 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2C,0x3f,tempax); 6253 6351 6254 - #endif /* SIS315H */ 6352 + #endif /* CONFIG_FB_SIS_315 */ 6255 6353 6256 6354 } 6257 6355 ··· 6283 6381 /* SET PART 2 REGISTER GROUP */ 6284 6382 /*********************************************/ 6285 6383 6286 - #ifdef SIS315H 6384 + #ifdef CONFIG_FB_SIS_315 6287 6385 static unsigned char * 6288 6386 SiS_GetGroup2CLVXPtr(struct SiS_Private *SiS_Pr, int tabletype) 6289 6387 { ··· 6380 6478 } 6381 6479 #endif 6382 6480 6383 - #ifdef SIS300 6481 + #ifdef CONFIG_FB_SIS_300 6384 6482 static void 6385 6483 SiS_Group2LCDSpecial(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short crt2crtc) 6386 6484 { ··· 6592 6690 unsigned int longtemp, PhaseIndex; 6593 6691 bool newtvphase; 6594 6692 const unsigned char *TimingPoint; 6595 - #ifdef SIS315H 6693 + #ifdef CONFIG_FB_SIS_315 6596 6694 unsigned short resindex, CRT2Index; 6597 6695 const struct SiS_Part2PortTbl *CRT2Part2Ptr = NULL; 6598 6696 ··· 6971 7069 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x17,0xFB); 6972 7070 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x18,0xDF); 6973 7071 6974 - #ifdef SIS315H 7072 + #ifdef CONFIG_FB_SIS_315 6975 7073 if(SiS_GetCRT2Part2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, 6976 7074 &CRT2Index, &resindex)) { 6977 7075 switch(CRT2Index) { ··· 7032 7130 7033 7131 /* Non-expanding: lcdvdes = tempcx = VT-1; lcdvdee = tempbx = VDE-1 */ 7034 7132 7035 - #ifdef SIS_XORG_XF86 7036 - #ifdef TWDEBUG 7037 - xf86DrvMsg(0, X_INFO, "lcdvdes 0x%x lcdvdee 0x%x\n", tempcx, tempbx); 7038 - #endif 7039 - #endif 7040 - 7041 7133 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,tempcx); /* lcdvdes */ 7042 7134 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,tempbx); /* lcdvdee */ 7043 7135 ··· 7080 7184 tempbx = SiS_Pr->CVSyncStart; 7081 7185 } 7082 7186 7083 - #ifdef SIS_XORG_XF86 7084 - #ifdef TWDEBUG 7085 - xf86DrvMsg(0, X_INFO, "lcdvrs 0x%x\n", tempbx); 7086 - #endif 7087 - #endif 7088 - 7089 7187 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,tempbx); /* lcdvrs */ 7090 7188 7091 7189 temp = (tempbx >> 4) & 0xF0; ··· 7091 7201 temp |= (SiS_Pr->CVSyncEnd & 0x0f); 7092 7202 } 7093 7203 7094 - #ifdef SIS_XORG_XF86 7095 - #ifdef TWDEBUG 7096 - xf86DrvMsg(0, X_INFO, "lcdvre[3:0] 0x%x\n", (temp & 0x0f)); 7097 - #endif 7098 - #endif 7099 - 7100 7204 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); 7101 7205 7102 - #ifdef SIS300 7206 + #ifdef CONFIG_FB_SIS_300 7103 7207 SiS_Group2LCDSpecial(SiS_Pr, ModeNo, crt2crtc); 7104 7208 #endif 7105 7209 ··· 7129 7245 tempax >>= 1; 7130 7246 } 7131 7247 7132 - #ifdef SIS_XORG_XF86 7133 - #ifdef TWDEBUG 7134 - xf86DrvMsg(0, X_INFO, "lcdhdee 0x%x\n", tempbx); 7135 - #endif 7136 - #endif 7137 - 7138 7248 tempbx += bridgeoffset; 7139 7249 7140 7250 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,tempbx); /* lcdhdee */ ··· 7154 7276 tempbx += bridgeoffset; 7155 7277 } 7156 7278 7157 - #ifdef SIS_XORG_XF86 7158 - #ifdef TWDEBUG 7159 - xf86DrvMsg(0, X_INFO, "lcdhrs 0x%x\n", tempbx); 7160 - #endif 7161 - #endif 7162 - 7163 7279 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1C,tempbx); /* lcdhrs */ 7164 7280 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0x0F,((tempbx >> 4) & 0xf0)); 7165 7281 ··· 7172 7300 tempbx += bridgeoffset; 7173 7301 } 7174 7302 7175 - #ifdef SIS_XORG_XF86 7176 - #ifdef TWDEBUG 7177 - xf86DrvMsg(0, X_INFO, "lcdhre 0x%x\n", tempbx); 7178 - #endif 7179 - #endif 7180 - 7181 7303 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,tempbx); /* lcdhre */ 7182 7304 7183 7305 SiS_SetGroup2_Tail(SiS_Pr, ModeNo); 7184 7306 7185 - #ifdef SIS300 7307 + #ifdef CONFIG_FB_SIS_300 7186 7308 SiS_Set300Part2Regs(SiS_Pr, ModeIdIndex, RefreshRateTableIndex, ModeNo); 7187 7309 #endif 7188 - #ifdef SIS315H 7310 + #ifdef CONFIG_FB_SIS_315 7189 7311 } /* CRT2-LCD from table */ 7190 7312 #endif 7191 7313 } ··· 7248 7382 /* SET PART 4 REGISTER GROUP */ 7249 7383 /*********************************************/ 7250 7384 7251 - #ifdef SIS315H 7385 + #ifdef CONFIG_FB_SIS_315 7252 7386 #if 0 7253 7387 static void 7254 7388 SiS_ShiftXPos(struct SiS_Private *SiS_Pr, int shift) ··· 7877 8011 7878 8012 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { 7879 8013 7880 - #ifdef SIS300 8014 + #ifdef CONFIG_FB_SIS_300 7881 8015 7882 8016 /* Chrontel 7005 - I assume that it does not come with a 315 series chip */ 7883 8017 ··· 7990 8124 7991 8125 /* Chrontel 7019 - assumed that it does not come with a 300 series chip */ 7992 8126 7993 - #ifdef SIS315H 8127 + #ifdef CONFIG_FB_SIS_315 7994 8128 7995 8129 unsigned short temp; 7996 8130 ··· 8041 8175 8042 8176 } 8043 8177 8044 - #ifdef SIS315H /* ----------- 315 series only ---------- */ 8178 + #ifdef CONFIG_FB_SIS_315 /* ----------- 315 series only ---------- */ 8045 8179 8046 8180 void 8047 8181 SiS_Chrontel701xBLOn(struct SiS_Private *SiS_Pr) ··· 8523 8657 bool 8524 8658 SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo) 8525 8659 { 8526 - #ifdef SIS300 8660 + #ifdef CONFIG_FB_SIS_300 8527 8661 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 8528 8662 #endif 8529 8663 unsigned short ModeIdIndex, RefreshRateTableIndex; ··· 8569 8703 SiS_GetLVDSDesData(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8570 8704 } 8571 8705 8572 - #ifdef SIS_XORG_XF86 8573 - #ifdef TWDEBUG 8574 - xf86DrvMsg(0, X_INFO, "(init301: LCDHDES 0x%03x LCDVDES 0x%03x)\n", SiS_Pr->SiS_LCDHDES, SiS_Pr->SiS_LCDVDES); 8575 - xf86DrvMsg(0, X_INFO, "(init301: HDE 0x%03x VDE 0x%03x)\n", SiS_Pr->SiS_HDE, SiS_Pr->SiS_VDE); 8576 - xf86DrvMsg(0, X_INFO, "(init301: VGAHDE 0x%03x VGAVDE 0x%03x)\n", SiS_Pr->SiS_VGAHDE, SiS_Pr->SiS_VGAVDE); 8577 - xf86DrvMsg(0, X_INFO, "(init301: HT 0x%03x VT 0x%03x)\n", SiS_Pr->SiS_HT, SiS_Pr->SiS_VT); 8578 - xf86DrvMsg(0, X_INFO, "(init301: VGAHT 0x%03x VGAVT 0x%03x)\n", SiS_Pr->SiS_VGAHT, SiS_Pr->SiS_VGAVT); 8579 - #endif 8580 - #endif 8581 - 8582 8706 if(SiS_Pr->SiS_SetFlag & LowModeTests) { 8583 8707 SiS_SetGroup1(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8584 8708 } ··· 8578 8722 if(SiS_Pr->SiS_SetFlag & LowModeTests) { 8579 8723 8580 8724 SiS_SetGroup2(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8581 - #ifdef SIS315H 8725 + #ifdef CONFIG_FB_SIS_315 8582 8726 SiS_SetGroup2_C_ELV(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8583 8727 #endif 8584 8728 SiS_SetGroup3(SiS_Pr, ModeNo, ModeIdIndex); 8585 8729 SiS_SetGroup4(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8586 - #ifdef SIS315H 8730 + #ifdef CONFIG_FB_SIS_315 8587 8731 SiS_SetGroup4_C_ELV(SiS_Pr, ModeNo, ModeIdIndex); 8588 8732 #endif 8589 8733 SiS_SetGroup5(SiS_Pr, ModeNo, ModeIdIndex); ··· 8614 8758 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { 8615 8759 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { 8616 8760 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { 8617 - #ifdef SIS315H 8761 + #ifdef CONFIG_FB_SIS_315 8618 8762 SiS_SetCH701xForLCD(SiS_Pr); 8619 8763 #endif 8620 8764 } ··· 8627 8771 8628 8772 } 8629 8773 8630 - #ifdef SIS300 8774 + #ifdef CONFIG_FB_SIS_300 8631 8775 if(SiS_Pr->ChipType < SIS_315H) { 8632 8776 if(SiS_Pr->SiS_SetFlag & LowModeTests) { 8633 8777 if(SiS_Pr->SiS_UseOEM) { ··· 8650 8794 } 8651 8795 #endif 8652 8796 8653 - #ifdef SIS315H 8797 + #ifdef CONFIG_FB_SIS_315 8654 8798 if(SiS_Pr->ChipType >= SIS_315H) { 8655 8799 if(SiS_Pr->SiS_SetFlag & LowModeTests) { 8656 8800 if(SiS_Pr->ChipType < SIS_661) { ··· 8729 8873 } 8730 8874 } 8731 8875 8732 - #ifdef SIS300 8876 + #ifdef CONFIG_FB_SIS_300 8733 8877 static unsigned char * 8734 8878 SiS_SetTrumpBlockLoop(struct SiS_Private *SiS_Pr, unsigned char *dataptr) 8735 8879 { ··· 8779 8923 dataptr = SiS_SetTrumpBlockLoop(SiS_Pr, dataptr); 8780 8924 if(!dataptr) return false; 8781 8925 } 8782 - #ifdef SIS_XORG_XF86 8783 - #ifdef TWDEBUG 8784 - xf86DrvMsg(0, X_INFO, "Trumpion block success\n"); 8785 - #endif 8786 - #endif 8787 8926 return true; 8788 8927 } 8789 8928 #endif ··· 8853 9002 SiS_SetChReg(SiS_Pr, reg, val, 0); 8854 9003 } 8855 9004 8856 - #ifdef SIS_LINUX_KERNEL 8857 9005 static 8858 - #endif 8859 9006 void 8860 9007 SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val) 8861 9008 { ··· 8940 9091 8941 9092 /* Read from Chrontel 70xx */ 8942 9093 /* Parameter is [Register no (S7-S0)] */ 8943 - #ifdef SIS_LINUX_KERNEL 8944 9094 static 8945 - #endif 8946 9095 unsigned short 8947 9096 SiS_GetCH70xx(struct SiS_Private *SiS_Pr, unsigned short tempbx) 8948 9097 { ··· 8961 9114 } 8962 9115 8963 9116 /* Our own DDC functions */ 8964 - #ifndef SIS_XORG_XF86 8965 9117 static 8966 - #endif 8967 9118 unsigned short 8968 9119 SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, 8969 9120 unsigned short adaptnum, unsigned short DDCdatatype, bool checkcr32, ··· 9069 9224 9070 9225 SiS_SetupDDCN(SiS_Pr); 9071 9226 9072 - #ifdef SIS_XORG_XF86 9073 - #ifdef TWDEBUG 9074 - xf86DrvMsg(0, X_INFO, "DDC Port %x Index %x Shift %d\n", 9075 - SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, temp); 9076 - #endif 9077 - #endif 9078 9227 return 0; 9079 9228 } 9080 9229 ··· 9131 9292 SiS_SetSwitchDDC2(SiS_Pr); 9132 9293 if(SiS_PrepareDDC(SiS_Pr)) { 9133 9294 SiS_SetStop(SiS_Pr); 9134 - #ifdef SIS_XORG_XF86 9135 - #ifdef TWDEBUG 9136 - xf86DrvMsg(0, X_INFO, "Probe: Prepare failed\n"); 9137 - #endif 9138 - #endif 9139 9295 return 0xFFFF; 9140 9296 } 9141 9297 mask = 0xf0; ··· 9144 9310 } else { 9145 9311 failed = true; 9146 9312 ret = 0xFFFF; 9147 - #ifdef SIS_XORG_XF86 9148 - #ifdef TWDEBUG 9149 - xf86DrvMsg(0, X_INFO, "Probe: Read 1 failed\n"); 9150 - #endif 9151 - #endif 9152 9313 } 9153 9314 } 9154 9315 if(!failed) { ··· 9153 9324 if(temp == value) ret = 0; 9154 9325 else { 9155 9326 ret = 0xFFFF; 9156 - #ifdef SIS_XORG_XF86 9157 - #ifdef TWDEBUG 9158 - xf86DrvMsg(0, X_INFO, "Probe: Read 2 failed\n"); 9159 - #endif 9160 - #endif 9161 9327 if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { 9162 9328 if(temp == 0x30) ret = 0; 9163 9329 } ··· 9162 9338 return ret; 9163 9339 } 9164 9340 9165 - #ifndef SIS_XORG_XF86 9166 9341 static 9167 - #endif 9168 9342 unsigned short 9169 9343 SiS_ProbeDDC(struct SiS_Private *SiS_Pr) 9170 9344 { ··· 9179 9357 return flag; 9180 9358 } 9181 9359 9182 - #ifndef SIS_XORG_XF86 9183 9360 static 9184 - #endif 9185 9361 unsigned short 9186 9362 SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, unsigned char *buffer) 9187 9363 { ··· 9426 9606 temp = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); 9427 9607 } while((!(temp & SiS_Pr->SiS_DDC_Clk)) && --watchdog); 9428 9608 if (!watchdog) { 9429 - #ifdef SIS_XORG_XF86 9430 - #ifdef TWDEBUG 9431 - xf86DrvMsg(0, X_INFO, "SetClkHigh failed\n"); 9432 - #endif 9433 - #endif 9434 9609 return 0xFFFF; 9435 9610 } 9436 9611 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT); ··· 9456 9641 9457 9642 /* =============== SiS 315/330 O.E.M. ================= */ 9458 9643 9459 - #ifdef SIS315H 9644 + #ifdef CONFIG_FB_SIS_315 9460 9645 9461 9646 static unsigned short 9462 9647 GetRAMDACromptr(struct SiS_Private *SiS_Pr) ··· 10644 10829 10645 10830 /* ================= SiS 300 O.E.M. ================== */ 10646 10831 10647 - #ifdef SIS300 10832 + #ifdef CONFIG_FB_SIS_300 10648 10833 10649 10834 static void 10650 10835 SetOEMLCDData2(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex,
+7 -36
drivers/video/sis/init301.h
··· 53 53 #ifndef _INIT301_H_ 54 54 #define _INIT301_H_ 55 55 56 - #include "osdef.h" 57 56 #include "initdef.h" 58 57 59 - #ifdef SIS_XORG_XF86 60 - #include "sis.h" 61 - #include "sis_regs.h" 62 - #endif 63 - 64 - #ifdef SIS_LINUX_KERNEL 65 58 #include "vgatypes.h" 66 59 #include "vstruct.h" 67 60 #ifdef SIS_CP ··· 65 72 #include <linux/fb.h> 66 73 #include "sis.h" 67 74 #include <video/sisfb.h> 68 - #endif 69 75 70 76 static const unsigned char SiS_YPbPrTable[3][64] = { 71 77 { ··· 229 237 0xFF,0xFF, 230 238 }; 231 239 232 - #ifdef SIS315H 240 + #ifdef CONFIG_FB_SIS_315 233 241 /* 661 et al LCD data structure (2.03.00) */ 234 242 static const unsigned char SiS_LCDStruct661[] = { 235 243 /* 1024x768 */ ··· 271 279 }; 272 280 #endif 273 281 274 - #ifdef SIS300 282 + #ifdef CONFIG_FB_SIS_300 275 283 static unsigned char SiS300_TrumpionData[14][80] = { 276 284 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02, 277 285 0x20,0x03,0x0B,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x10,0x00,0x00,0x04,0x23, ··· 348 356 #endif 349 357 350 358 void SiS_UnLockCRT2(struct SiS_Private *SiS_Pr); 351 - #ifndef SIS_LINUX_KERNEL 352 - void SiS_LockCRT2(struct SiS_Private *SiS_Pr); 353 - #endif 354 359 void SiS_EnableCRT2(struct SiS_Private *SiS_Pr); 355 360 unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 356 361 void SiS_WaitRetrace1(struct SiS_Private *SiS_Pr); ··· 364 375 unsigned short RefreshRateTableIndex); 365 376 unsigned short SiS_GetResInfo(struct SiS_Private *SiS_Pr,unsigned short ModeNo,unsigned short ModeIdIndex); 366 377 void SiS_DisableBridge(struct SiS_Private *SiS_Pr); 367 - #ifndef SIS_LINUX_KERNEL 368 - void SiS_EnableBridge(struct SiS_Private *SiS_Pr); 369 - #endif 370 378 bool SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 371 379 void SiS_SiS30xBLOn(struct SiS_Private *SiS_Pr); 372 380 void SiS_SiS30xBLOff(struct SiS_Private *SiS_Pr); ··· 372 386 unsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempax); 373 387 void SiS_SetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 374 388 unsigned short SiS_GetCH701x(struct SiS_Private *SiS_Pr, unsigned short tempax); 375 - #ifndef SIS_LINUX_KERNEL 376 - void SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 377 - unsigned short SiS_GetCH70xx(struct SiS_Private *SiS_Pr, unsigned short tempax); 378 - #endif 379 389 void SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, 380 390 unsigned char orval,unsigned short andval); 381 - #ifdef SIS315H 391 + #ifdef CONFIG_FB_SIS_315 382 392 static void SiS_Chrontel701xOn(struct SiS_Private *SiS_Pr); 383 393 static void SiS_Chrontel701xOff(struct SiS_Private *SiS_Pr); 384 394 static void SiS_ChrontelInitTVVSync(struct SiS_Private *SiS_Pr); ··· 383 401 void SiS_Chrontel701xBLOff(struct SiS_Private *SiS_Pr); 384 402 #endif /* 315 */ 385 403 386 - #ifdef SIS300 404 + #ifdef CONFIG_FB_SIS_300 387 405 static bool SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *dataptr); 388 406 void SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo); 389 407 #endif ··· 394 412 unsigned short adaptnum, unsigned short DDCdatatype, 395 413 unsigned char *buffer, unsigned int VBFlags2); 396 414 397 - #ifdef SIS_XORG_XF86 398 - unsigned short SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, 399 - int VGAEngine, unsigned short adaptnum, unsigned short DDCdatatype, 400 - bool checkcr32, unsigned int VBFlags2); 401 - unsigned short SiS_ProbeDDC(struct SiS_Private *SiS_Pr); 402 - unsigned short SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, 403 - unsigned char *buffer); 404 - #else 405 415 static unsigned short SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, 406 416 int VGAEngine, unsigned short adaptnum, unsigned short DDCdatatype, 407 417 bool checkcr32, unsigned int VBFlags2); 408 418 static unsigned short SiS_ProbeDDC(struct SiS_Private *SiS_Pr); 409 419 static unsigned short SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, 410 420 unsigned char *buffer); 411 - #endif 412 421 static void SiS_SetSwitchDDC2(struct SiS_Private *SiS_Pr); 413 422 static unsigned short SiS_SetStart(struct SiS_Private *SiS_Pr); 414 423 static unsigned short SiS_SetStop(struct SiS_Private *SiS_Pr); ··· 414 441 static void SiS_SendACK(struct SiS_Private *SiS_Pr, unsigned short yesno); 415 442 static unsigned short SiS_DoProbeDDC(struct SiS_Private *SiS_Pr); 416 443 417 - #ifdef SIS300 444 + #ifdef CONFIG_FB_SIS_300 418 445 static void SiS_OEM300Setting(struct SiS_Private *SiS_Pr, 419 446 unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefTabindex); 420 447 static void SetOEMLCDData2(struct SiS_Private *SiS_Pr, 421 448 unsigned short ModeNo, unsigned short ModeIdIndex,unsigned short RefTableIndex); 422 449 #endif 423 - #ifdef SIS315H 450 + #ifdef CONFIG_FB_SIS_315 424 451 static void SiS_OEM310Setting(struct SiS_Private *SiS_Pr, 425 452 unsigned short ModeNo,unsigned short ModeIdIndex, unsigned short RRTI); 426 453 static void SiS_OEM661Setting(struct SiS_Private *SiS_Pr, ··· 455 482 extern void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); 456 483 extern unsigned short SiS_GetRefCRTVCLK(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); 457 484 extern unsigned short SiS_GetRefCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); 458 - #ifdef SIS300 485 + #ifdef CONFIG_FB_SIS_300 459 486 extern void SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *tempbx, 460 487 unsigned short *tempcl); 461 488 extern unsigned short SiS_GetFIFOThresholdB300(unsigned short tempbx, unsigned short tempcl); 462 489 extern unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index); 463 - #ifdef SIS_LINUX_KERNEL 464 490 extern unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg); 465 491 extern unsigned int sisfb_read_lpc_pci_dword(struct SiS_Private *SiS_Pr, int reg); 466 - #endif 467 492 #endif 468 493 469 494 #endif
+3 -4
drivers/video/sis/initextlfb.c
··· 25 25 * Author: Thomas Winischhofer <thomas@winischhofer.net> 26 26 */ 27 27 28 - #include "osdef.h" 29 28 #include "initdef.h" 30 29 #include "vgatypes.h" 31 30 #include "vstruct.h" ··· 58 59 59 60 if(rateindex > 0) rateindex--; 60 61 61 - #ifdef SIS315H 62 + #ifdef CONFIG_FB_SIS_315 62 63 switch(ModeNo) { 63 64 case 0x5a: ModeNo = 0x50; break; 64 65 case 0x5b: ModeNo = 0x56; ··· 102 103 103 104 if(rateindex > 0) rateindex--; 104 105 105 - #ifdef SIS315H 106 + #ifdef CONFIG_FB_SIS_315 106 107 switch(ModeNo) { 107 108 case 0x5a: ModeNo = 0x50; break; 108 109 case 0x5b: ModeNo = 0x56; ··· 186 187 187 188 if(rateindex > 0) rateindex--; 188 189 189 - #ifdef SIS315H 190 + #ifdef CONFIG_FB_SIS_315 190 191 switch(ModeNo) { 191 192 case 0x5a: ModeNo = 0x50; break; 192 193 case 0x5b: ModeNo = 0x56;
-133
drivers/video/sis/osdef.h
··· 1 - /* $XFree86$ */ 2 - /* $XdotOrg$ */ 3 - /* 4 - * OS depending defines 5 - * 6 - * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria 7 - * 8 - * If distributed as part of the Linux kernel, the following license terms 9 - * apply: 10 - * 11 - * * This program is free software; you can redistribute it and/or modify 12 - * * it under the terms of the GNU General Public License as published by 13 - * * the Free Software Foundation; either version 2 of the named License, 14 - * * or any later version. 15 - * * 16 - * * This program is distributed in the hope that it will be useful, 17 - * * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 - * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 - * * GNU General Public License for more details. 20 - * * 21 - * * You should have received a copy of the GNU General Public License 22 - * * along with this program; if not, write to the Free Software 23 - * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA 24 - * 25 - * Otherwise, the following license terms apply: 26 - * 27 - * * Redistribution and use in source and binary forms, with or without 28 - * * modification, are permitted provided that the following conditions 29 - * * are met: 30 - * * 1) Redistributions of source code must retain the above copyright 31 - * * notice, this list of conditions and the following disclaimer. 32 - * * 2) Redistributions in binary form must reproduce the above copyright 33 - * * notice, this list of conditions and the following disclaimer in the 34 - * * documentation and/or other materials provided with the distribution. 35 - * * 3) The name of the author may not be used to endorse or promote products 36 - * * derived from this software without specific prior written permission. 37 - * * 38 - * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 39 - * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 40 - * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 41 - * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 42 - * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 43 - * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 44 - * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 45 - * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 46 - * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 47 - * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 48 - * 49 - * Author: Thomas Winischhofer <thomas@winischhofer.net> 50 - * Silicon Integrated Systems, Inc. (used by permission) 51 - * 52 - */ 53 - 54 - #ifndef _SIS_OSDEF_H_ 55 - #define _SIS_OSDEF_H_ 56 - 57 - /* The choices are: */ 58 - #define SIS_LINUX_KERNEL /* Linux kernel framebuffer */ 59 - #undef SIS_XORG_XF86 /* XFree86/X.org */ 60 - 61 - #ifdef OutPortByte 62 - #undef OutPortByte 63 - #endif 64 - 65 - #ifdef OutPortWord 66 - #undef OutPortWord 67 - #endif 68 - 69 - #ifdef OutPortLong 70 - #undef OutPortLong 71 - #endif 72 - 73 - #ifdef InPortByte 74 - #undef InPortByte 75 - #endif 76 - 77 - #ifdef InPortWord 78 - #undef InPortWord 79 - #endif 80 - 81 - #ifdef InPortLong 82 - #undef InPortLong 83 - #endif 84 - 85 - /**********************************************************************/ 86 - /* LINUX KERNEL */ 87 - /**********************************************************************/ 88 - 89 - #ifdef SIS_LINUX_KERNEL 90 - 91 - #ifdef CONFIG_FB_SIS_300 92 - #define SIS300 93 - #endif 94 - 95 - #ifdef CONFIG_FB_SIS_315 96 - #define SIS315H 97 - #endif 98 - 99 - #if !defined(SIS300) && !defined(SIS315H) 100 - #warning Neither CONFIG_FB_SIS_300 nor CONFIG_FB_SIS_315 is set 101 - #warning sisfb will not work! 102 - #endif 103 - 104 - #define OutPortByte(p,v) outb((u8)(v),(SISIOADDRESS)(p)) 105 - #define OutPortWord(p,v) outw((u16)(v),(SISIOADDRESS)(p)) 106 - #define OutPortLong(p,v) outl((u32)(v),(SISIOADDRESS)(p)) 107 - #define InPortByte(p) inb((SISIOADDRESS)(p)) 108 - #define InPortWord(p) inw((SISIOADDRESS)(p)) 109 - #define InPortLong(p) inl((SISIOADDRESS)(p)) 110 - #define SiS_SetMemory(MemoryAddress,MemorySize,value) memset_io(MemoryAddress, value, MemorySize) 111 - 112 - #endif /* LINUX_KERNEL */ 113 - 114 - /**********************************************************************/ 115 - /* XFree86/X.org */ 116 - /**********************************************************************/ 117 - 118 - #ifdef SIS_XORG_XF86 119 - 120 - #define SIS300 121 - #define SIS315H 122 - 123 - #define OutPortByte(p,v) outSISREG((IOADDRESS)(p),(CARD8)(v)) 124 - #define OutPortWord(p,v) outSISREGW((IOADDRESS)(p),(CARD16)(v)) 125 - #define OutPortLong(p,v) outSISREGL((IOADDRESS)(p),(CARD32)(v)) 126 - #define InPortByte(p) inSISREG((IOADDRESS)(p)) 127 - #define InPortWord(p) inSISREGW((IOADDRESS)(p)) 128 - #define InPortLong(p) inSISREGL((IOADDRESS)(p)) 129 - #define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize) 130 - 131 - #endif /* XF86 */ 132 - 133 - #endif /* _OSDEF_H_ */
-1
drivers/video/sis/sis.h
··· 24 24 #ifndef _SIS_H_ 25 25 #define _SIS_H_ 26 26 27 - #include "osdef.h" 28 27 #include <video/sisfb.h> 29 28 30 29 #include "vgatypes.h"
+5 -25
drivers/video/sis/sis_main.c
··· 60 60 #include "sis.h" 61 61 #include "sis_main.h" 62 62 63 + #if !defined(CONFIG_FB_SIS_300) && !defined(CONFIG_FB_SIS_315) 64 + #warning Neither CONFIG_FB_SIS_300 nor CONFIG_FB_SIS_315 is set 65 + #warning sisfb will not work! 66 + #endif 67 + 63 68 static void sisfb_handle_command(struct sis_video_info *ivideo, 64 69 struct sisfb_cmd *sisfb_command); 65 70 ··· 4119 4114 if(sisfb_check_rom(rom_base, ivideo)) { 4120 4115 4121 4116 if((myrombase = vmalloc(65536))) { 4122 - 4123 - /* Work around bug in pci/rom.c: Folks forgot to check 4124 - * whether the size retrieved from the BIOS image eventually 4125 - * is larger than the mapped size 4126 - */ 4127 - if(pci_resource_len(pdev, PCI_ROM_RESOURCE) < romsize) 4128 - romsize = pci_resource_len(pdev, PCI_ROM_RESOURCE); 4129 - 4130 4117 memcpy_fromio(myrombase, rom_base, 4131 4118 (romsize > 65536) ? 65536 : romsize); 4132 4119 } ··· 4151 4154 break; 4152 4155 4153 4156 } 4154 - 4155 - #else 4156 - 4157 - pci_read_config_dword(pdev, PCI_ROM_ADDRESS, &temp); 4158 - pci_write_config_dword(pdev, PCI_ROM_ADDRESS, 4159 - (ivideo->video_base & PCI_ROM_ADDRESS_MASK) | PCI_ROM_ADDRESS_ENABLE); 4160 - 4161 - rom_base = ioremap(ivideo->video_base, 65536); 4162 - if(rom_base) { 4163 - if(sisfb_check_rom(rom_base, ivideo)) { 4164 - if((myrombase = vmalloc(65536))) 4165 - memcpy_fromio(myrombase, rom_base, 65536); 4166 - } 4167 - iounmap(rom_base); 4168 - } 4169 - 4170 - pci_write_config_dword(pdev, PCI_ROM_ADDRESS, temp); 4171 4157 4172 4158 #endif 4173 4159
-11
drivers/video/sis/vgatypes.h
··· 55 55 56 56 #define SISIOMEMTYPE 57 57 58 - #ifdef SIS_LINUX_KERNEL 59 58 typedef unsigned long SISIOADDRESS; 60 59 #include <linux/types.h> /* Need __iomem */ 61 60 #undef SISIOMEMTYPE 62 61 #define SISIOMEMTYPE __iomem 63 - #endif 64 - 65 - #ifdef SIS_XORG_XF86 66 - #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,0,0,0) 67 - typedef unsigned long IOADDRESS; 68 - typedef unsigned long SISIOADDRESS; 69 - #else 70 - typedef IOADDRESS SISIOADDRESS; 71 - #endif 72 - #endif 73 62 74 63 typedef enum _SIS_CHIP_TYPE { 75 64 SIS_VGALegacy = 0,
-12
drivers/video/sis/vstruct.h
··· 233 233 { 234 234 unsigned char ChipType; 235 235 unsigned char ChipRevision; 236 - #ifdef SIS_XORG_XF86 237 - PCITAG PciTag; 238 - #endif 239 - #ifdef SIS_LINUX_KERNEL 240 236 void *ivideo; 241 - #endif 242 237 unsigned char *VirtualRomBase; 243 238 bool UseROM; 244 - #ifdef SIS_LINUX_KERNEL 245 239 unsigned char SISIOMEMTYPE *VideoMemoryAddress; 246 240 unsigned int VideoMemorySize; 247 - #endif 248 241 SISIOADDRESS IOAddress; 249 242 SISIOADDRESS IOAddress2; /* For dual chip XGI volari */ 250 243 251 - #ifdef SIS_LINUX_KERNEL 252 244 SISIOADDRESS RelIO; 253 - #endif 254 245 SISIOADDRESS SiS_P3c4; 255 246 SISIOADDRESS SiS_P3d4; 256 247 SISIOADDRESS SiS_P3c0; ··· 271 280 unsigned short SiS_IF_DEF_FSTN; 272 281 unsigned short SiS_SysFlags; 273 282 unsigned char SiS_VGAINFO; 274 - #ifdef SIS_XORG_XF86 275 - unsigned short SiS_CP1, SiS_CP2, SiS_CP3, SiS_CP4; 276 - #endif 277 283 bool SiS_UseROM; 278 284 bool SiS_ROMNew; 279 285 bool SiS_XGIROM;
+1
include/linux/fb.h
··· 1122 1122 1123 1123 /* drivers/video/fbcmap.c */ 1124 1124 extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); 1125 + extern int fb_alloc_cmap_gfp(struct fb_cmap *cmap, int len, int transp, gfp_t flags); 1125 1126 extern void fb_dealloc_cmap(struct fb_cmap *cmap); 1126 1127 extern int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to); 1127 1128 extern int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to);
-1
include/video/da8xx-fb.h
··· 99 99 #define FBIPUT_COLOR _IOW('F', 6, int) 100 100 #define FBIPUT_HSYNC _IOW('F', 9, int) 101 101 #define FBIPUT_VSYNC _IOW('F', 10, int) 102 - #define FBIO_WAITFORVSYNC _IOW('F', 0x20, u_int32_t) 103 102 104 103 #endif /* ifndef DA8XX_FB_H */ 105 104