Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'fbdev-v4.17' of git://github.com/bzolnier/linux

Pull fbdev updates from Bartlomiej Zolnierkiewicz:
"There is nothing really major here, just a couple of small bugfixes,
improvements and cleanups:

- make it possible to load radeonfb driver when offb driver is loaded
first (Mathieu Malaterre)

- fix memory leak in offb driver (Mathieu Malaterre)

- fix unaligned access in udlfb driver (Ladislav Michl)

- convert atmel_lcdfb driver to use GPIO descriptors (Ludovic
Desroches)

- avoid mismatched prototypes in sisfb driver (Arnd Bergmann)

- remove VLA usage from viafb driver (Gustavo A. R. Silva)

- add missing help text to FB_I810_I2 config option (Ulf Magnusson)

- misc fixes (Gustavo A. R. Silva, Colin Ian King, Markus Elfring)

- remove dead code from s3c-fb driver for Exynos and S5PV210
platforms

- misc cleanups (Corentin Labbe, Ladislav Michl, Ulf Magnusson,
Vladimir Zapolskiy, Markus Elfring)"

* tag 'fbdev-v4.17' of git://github.com/bzolnier/linux: (32 commits)
video: fbdev: s3c-fb: remove dead platform code for Exynos and S5PV210 platforms
video: au1100fb: Delete an unnecessary variable initialisation in au1100fb_drv_probe()
video: au1100fb: Improve a size determination in au1100fb_drv_probe()
video: au1100fb: Delete an error message for a failed memory allocation in au1100fb_drv_probe()
video/console/sticore: Delete an error message for a failed memory allocation in sti_try_rom_generic()
video: ARM CLCD: Improve a size determination in clcdfb_probe()
video: ARM CLCD: Delete an error message for a failed memory allocation in clcdfb_probe()
video: matroxfb: Delete an error message for a failed memory allocation in matroxfb_crtc2_probe()
video: s3c-fb: Improve a size determination in s3c_fb_probe()
video: s3c-fb: Delete an error message for a failed memory allocation in s3c_fb_probe()
video: fsl-diu-fb: Delete an error message for a failed memory allocation in fsl_diu_init()
video: ssd1307fb: Improve a size determination in ssd1307fb_probe()
video: smscufx: Delete an error message for a failed memory allocation in ufx_realloc_framebuffer()
video: smscufx: Return an error code only as a constant in ufx_realloc_framebuffer()
video: smscufx: Less checks in ufx_usb_probe() after error detection
video: udlfb: Return an error code only as a constant in dlfb_realloc_framebuffer()
video/fbdev/stifb: Delete an error message for a failed memory allocation in stifb_init_fb()
video/fbdev/stifb: Return -ENOMEM after a failed kzalloc() in stifb_init_fb()
video: fbdev: aty128fb: use true and false for boolean values
fbdev: aty: fix missing indentation in if statement
...

+609 -818
-3
drivers/video/Kconfig
··· 9 9 config HAVE_FB_ATMEL 10 10 bool 11 11 12 - config SH_LCD_MIPI_DSI 13 - bool 14 - 15 12 source "drivers/char/agp/Kconfig" 16 13 17 14 source "drivers/gpu/vga/Kconfig"
+1 -3
drivers/video/console/sticore.c
··· 827 827 } 828 828 829 829 sti = kzalloc(sizeof(*sti), GFP_KERNEL); 830 - if (!sti) { 831 - printk(KERN_ERR "Not enough memory !\n"); 830 + if (!sti) 832 831 return NULL; 833 - } 834 832 835 833 spin_lock_init(&sti->lock); 836 834
+6 -2
drivers/video/fbdev/Kconfig
··· 1053 1053 bool "Enable DDC Support" 1054 1054 depends on FB_I810 && FB_I810_GTF 1055 1055 select FB_DDC 1056 + help 1057 + Add DDC/I2C support for i810fb. This will allow the driver to get 1058 + display information, especially for monitors with fickle timings. 1059 + 1060 + If unsure, say Y. 1056 1061 1057 1062 config FB_LE80578 1058 1063 tristate "Intel LE80578 (Vermilion) support" ··· 1922 1917 1923 1918 config FB_S3C 1924 1919 tristate "Samsung S3C framebuffer support" 1925 - depends on FB && (CPU_S3C2416 || ARCH_S3C64XX || \ 1926 - ARCH_S5PV210 || ARCH_EXYNOS) 1920 + depends on FB && (CPU_S3C2416 || ARCH_S3C64XX) 1927 1921 select FB_CFB_FILLRECT 1928 1922 select FB_CFB_COPYAREA 1929 1923 select FB_CFB_IMAGEBLIT
+1 -2
drivers/video/fbdev/amba-clcd.c
··· 967 967 goto out; 968 968 } 969 969 970 - fb = kzalloc(sizeof(struct clcd_fb), GFP_KERNEL); 970 + fb = kzalloc(sizeof(*fb), GFP_KERNEL); 971 971 if (!fb) { 972 - printk(KERN_INFO "CLCD: could not allocate new clcd_fb struct\n"); 973 972 ret = -ENOMEM; 974 973 goto free_region; 975 974 }
+12 -19
drivers/video/fbdev/atmel_lcdfb.c
··· 18 18 #include <linux/delay.h> 19 19 #include <linux/backlight.h> 20 20 #include <linux/gfp.h> 21 + #include <linux/gpio/consumer.h> 21 22 #include <linux/module.h> 22 23 #include <linux/of.h> 23 24 #include <linux/of_device.h> 24 - #include <linux/of_gpio.h> 25 25 #include <video/of_display_timing.h> 26 26 #include <linux/regulator/consumer.h> 27 27 #include <video/videomode.h> ··· 61 61 }; 62 62 63 63 struct atmel_lcdfb_power_ctrl_gpio { 64 - int gpio; 65 - int active_low; 64 + struct gpio_desc *gpiod; 66 65 67 66 struct list_head list; 68 67 }; ··· 1017 1018 struct atmel_lcdfb_power_ctrl_gpio *og; 1018 1019 1019 1020 list_for_each_entry(og, &pdata->pwr_gpios, list) 1020 - gpio_set_value(og->gpio, on); 1021 + gpiod_set_value(og->gpiod, on); 1021 1022 } 1022 1023 1023 1024 static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo) ··· 1030 1031 struct device_node *display_np; 1031 1032 struct device_node *timings_np; 1032 1033 struct display_timings *timings; 1033 - enum of_gpio_flags flags; 1034 1034 struct atmel_lcdfb_power_ctrl_gpio *og; 1035 1035 bool is_gpio_power = false; 1036 + struct gpio_desc *gpiod; 1036 1037 int ret = -ENOENT; 1037 - int i, gpio; 1038 + int i; 1038 1039 1039 1040 sinfo->config = (struct atmel_lcdfb_config*) 1040 1041 of_match_device(atmel_lcdfb_dt_ids, dev)->data; ··· 1071 1072 1072 1073 INIT_LIST_HEAD(&pdata->pwr_gpios); 1073 1074 ret = -ENOMEM; 1074 - for (i = 0; i < of_gpio_named_count(display_np, "atmel,power-control-gpio"); i++) { 1075 - gpio = of_get_named_gpio_flags(display_np, "atmel,power-control-gpio", 1076 - i, &flags); 1077 - if (gpio < 0) 1075 + for (i = 0; i < gpiod_count(dev, "atmel,power-control"); i++) { 1076 + gpiod = devm_gpiod_get_index(dev, "atmel,power-control", 1077 + i, GPIOD_ASIS); 1078 + if (IS_ERR(gpiod)) 1078 1079 continue; 1079 1080 1080 1081 og = devm_kzalloc(dev, sizeof(*og), GFP_KERNEL); 1081 1082 if (!og) 1082 1083 goto put_display_node; 1083 1084 1084 - og->gpio = gpio; 1085 - og->active_low = flags & OF_GPIO_ACTIVE_LOW; 1085 + og->gpiod = gpiod; 1086 1086 is_gpio_power = true; 1087 - ret = devm_gpio_request(dev, gpio, "lcd-power-control-gpio"); 1088 - if (ret) { 1089 - dev_err(dev, "request gpio %d failed\n", gpio); 1090 - goto put_display_node; 1091 - } 1092 1087 1093 - ret = gpio_direction_output(gpio, og->active_low); 1088 + ret = gpiod_direction_output(gpiod, gpiod_is_active_low(gpiod)); 1094 1089 if (ret) { 1095 - dev_err(dev, "set direction output gpio %d failed\n", gpio); 1090 + dev_err(dev, "set direction output gpio atmel,power-control[%d] failed\n", i); 1096 1091 goto put_display_node; 1097 1092 } 1098 1093 list_add(&og->list, &pdata->pwr_gpios);
+1 -1
drivers/video/fbdev/aty/aty128fb.c
··· 1716 1716 continue; 1717 1717 } 1718 1718 if(!strncmp(this_opt, "nomtrr", 6)) { 1719 - mtrr = 0; 1719 + mtrr = false; 1720 1720 continue; 1721 1721 } 1722 1722 #ifdef CONFIG_PPC_PMAC
+1 -1
drivers/video/fbdev/aty/mach64_ct.c
··· 180 180 dsp_on = ((multiplier << vshift) + divider) / divider; 181 181 tmp = ((ras_multiplier << xshift) + ras_divider) / ras_divider; 182 182 if (dsp_on < tmp) 183 - dsp_on = tmp; 183 + dsp_on = tmp; 184 184 dsp_on = dsp_on + (tmp * 2) + (pll->xclkpagefaultdelay << xshift); 185 185 } 186 186
+21
drivers/video/fbdev/aty/radeon_base.c
··· 2255 2255 .read = radeon_show_edid2, 2256 2256 }; 2257 2257 2258 + static int radeon_kick_out_firmware_fb(struct pci_dev *pdev) 2259 + { 2260 + struct apertures_struct *ap; 2261 + 2262 + ap = alloc_apertures(1); 2263 + if (!ap) 2264 + return -ENOMEM; 2265 + 2266 + ap->ranges[0].base = pci_resource_start(pdev, 0); 2267 + ap->ranges[0].size = pci_resource_len(pdev, 0); 2268 + 2269 + remove_conflicting_framebuffers(ap, KBUILD_MODNAME, false); 2270 + 2271 + kfree(ap); 2272 + 2273 + return 0; 2274 + } 2258 2275 2259 2276 static int radeonfb_pci_register(struct pci_dev *pdev, 2260 2277 const struct pci_device_id *ent) ··· 2324 2307 /* Set base addrs */ 2325 2308 rinfo->fb_base_phys = pci_resource_start (pdev, 0); 2326 2309 rinfo->mmio_base_phys = pci_resource_start (pdev, 2); 2310 + 2311 + ret = radeon_kick_out_firmware_fb(pdev); 2312 + if (ret) 2313 + return ret; 2327 2314 2328 2315 /* request the mem regions */ 2329 2316 ret = pci_request_region(pdev, 0, "radeonfb framebuffer");
+3 -6
drivers/video/fbdev/au1100fb.c
··· 410 410 411 411 static int au1100fb_drv_probe(struct platform_device *dev) 412 412 { 413 - struct au1100fb_device *fbdev = NULL; 413 + struct au1100fb_device *fbdev; 414 414 struct resource *regs_res; 415 415 unsigned long page; 416 416 struct clk *c; 417 417 418 418 /* Allocate new device private */ 419 - fbdev = devm_kzalloc(&dev->dev, sizeof(struct au1100fb_device), 420 - GFP_KERNEL); 421 - if (!fbdev) { 422 - print_err("fail to allocate device private record"); 419 + fbdev = devm_kzalloc(&dev->dev, sizeof(*fbdev), GFP_KERNEL); 420 + if (!fbdev) 423 421 return -ENOMEM; 424 - } 425 422 426 423 if (au1100fb_setup(fbdev)) 427 424 goto failed;
+1 -5
drivers/video/fbdev/fsl-diu-fb.c
··· 1960 1960 1961 1961 of_node_put(np); 1962 1962 coherence_data = vmalloc(coherence_data_size); 1963 - if (!coherence_data) { 1964 - pr_err("fsl-diu-fb: could not allocate coherence data " 1965 - "(size=%zu)\n", coherence_data_size); 1963 + if (!coherence_data) 1966 1964 return -ENOMEM; 1967 - } 1968 - 1969 1965 #endif 1970 1966 1971 1967 ret = platform_driver_register(&fsl_diu_driver);
+2 -3
drivers/video/fbdev/matrox/matroxfb_crtc2.c
··· 696 696 if (!minfo->devflags.crtc2) 697 697 return NULL; 698 698 m2info = kzalloc(sizeof(*m2info), GFP_KERNEL); 699 - if (!m2info) { 700 - printk(KERN_ERR "matroxfb_crtc2: Not enough memory for CRTC2 control structs\n"); 699 + if (!m2info) 701 700 return NULL; 702 - } 701 + 703 702 m2info->primary_dev = minfo; 704 703 if (matroxfb_dh_registerfb(m2info)) { 705 704 kfree(m2info);
+2
drivers/video/fbdev/offb.c
··· 280 280 if (info->screen_base) 281 281 iounmap(info->screen_base); 282 282 release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size); 283 + fb_dealloc_cmap(&info->cmap); 283 284 framebuffer_release(info); 284 285 } 285 286 ··· 519 518 return; 520 519 521 520 out_err: 521 + fb_dealloc_cmap(&info->cmap); 522 522 iounmap(info->screen_base); 523 523 out_aper: 524 524 iounmap(par->cmap_adr);
+2 -166
drivers/video/fbdev/s3c-fb.c
··· 1383 1383 return -EINVAL; 1384 1384 } 1385 1385 1386 - sfb = devm_kzalloc(dev, sizeof(struct s3c_fb), GFP_KERNEL); 1387 - if (!sfb) { 1388 - dev_err(dev, "no memory for framebuffers\n"); 1386 + sfb = devm_kzalloc(dev, sizeof(*sfb), GFP_KERNEL); 1387 + if (!sfb) 1389 1388 return -ENOMEM; 1390 - } 1391 1389 1392 1390 dev_dbg(dev, "allocate new framebuffer %p\n", sfb); 1393 1391 ··· 1714 1716 }, 1715 1717 }; 1716 1718 1717 - static struct s3c_fb_win_variant s3c_fb_data_s5p_wins[] = { 1718 - [0] = { 1719 - .has_osd_c = 1, 1720 - .osd_size_off = 0x8, 1721 - .palette_sz = 256, 1722 - .valid_bpp = (VALID_BPP1248 | VALID_BPP(13) | 1723 - VALID_BPP(15) | VALID_BPP(16) | 1724 - VALID_BPP(18) | VALID_BPP(19) | 1725 - VALID_BPP(24) | VALID_BPP(25) | 1726 - VALID_BPP(32)), 1727 - }, 1728 - [1] = { 1729 - .has_osd_c = 1, 1730 - .has_osd_d = 1, 1731 - .osd_size_off = 0xc, 1732 - .has_osd_alpha = 1, 1733 - .palette_sz = 256, 1734 - .valid_bpp = (VALID_BPP1248 | VALID_BPP(13) | 1735 - VALID_BPP(15) | VALID_BPP(16) | 1736 - VALID_BPP(18) | VALID_BPP(19) | 1737 - VALID_BPP(24) | VALID_BPP(25) | 1738 - VALID_BPP(32)), 1739 - }, 1740 - [2] = { 1741 - .has_osd_c = 1, 1742 - .has_osd_d = 1, 1743 - .osd_size_off = 0xc, 1744 - .has_osd_alpha = 1, 1745 - .palette_sz = 256, 1746 - .valid_bpp = (VALID_BPP1248 | VALID_BPP(13) | 1747 - VALID_BPP(15) | VALID_BPP(16) | 1748 - VALID_BPP(18) | VALID_BPP(19) | 1749 - VALID_BPP(24) | VALID_BPP(25) | 1750 - VALID_BPP(32)), 1751 - }, 1752 - [3] = { 1753 - .has_osd_c = 1, 1754 - .has_osd_alpha = 1, 1755 - .palette_sz = 256, 1756 - .valid_bpp = (VALID_BPP1248 | VALID_BPP(13) | 1757 - VALID_BPP(15) | VALID_BPP(16) | 1758 - VALID_BPP(18) | VALID_BPP(19) | 1759 - VALID_BPP(24) | VALID_BPP(25) | 1760 - VALID_BPP(32)), 1761 - }, 1762 - [4] = { 1763 - .has_osd_c = 1, 1764 - .has_osd_alpha = 1, 1765 - .palette_sz = 256, 1766 - .valid_bpp = (VALID_BPP1248 | VALID_BPP(13) | 1767 - VALID_BPP(15) | VALID_BPP(16) | 1768 - VALID_BPP(18) | VALID_BPP(19) | 1769 - VALID_BPP(24) | VALID_BPP(25) | 1770 - VALID_BPP(32)), 1771 - }, 1772 - }; 1773 - 1774 1719 static struct s3c_fb_driverdata s3c_fb_data_64xx = { 1775 1720 .variant = { 1776 1721 .nr_windows = 5, ··· 1743 1802 .win[2] = &s3c_fb_data_64xx_wins[2], 1744 1803 .win[3] = &s3c_fb_data_64xx_wins[3], 1745 1804 .win[4] = &s3c_fb_data_64xx_wins[4], 1746 - }; 1747 - 1748 - static struct s3c_fb_driverdata s3c_fb_data_s5pv210 = { 1749 - .variant = { 1750 - .nr_windows = 5, 1751 - .vidtcon = VIDTCON0, 1752 - .wincon = WINCON(0), 1753 - .winmap = WINxMAP(0), 1754 - .keycon = WKEYCON, 1755 - .osd = VIDOSD_BASE, 1756 - .osd_stride = 16, 1757 - .buf_start = VIDW_BUF_START(0), 1758 - .buf_size = VIDW_BUF_SIZE(0), 1759 - .buf_end = VIDW_BUF_END(0), 1760 - 1761 - .palette = { 1762 - [0] = 0x2400, 1763 - [1] = 0x2800, 1764 - [2] = 0x2c00, 1765 - [3] = 0x3000, 1766 - [4] = 0x3400, 1767 - }, 1768 - 1769 - .has_shadowcon = 1, 1770 - .has_blendcon = 1, 1771 - .has_clksel = 1, 1772 - .has_fixvclk = 1, 1773 - }, 1774 - .win[0] = &s3c_fb_data_s5p_wins[0], 1775 - .win[1] = &s3c_fb_data_s5p_wins[1], 1776 - .win[2] = &s3c_fb_data_s5p_wins[2], 1777 - .win[3] = &s3c_fb_data_s5p_wins[3], 1778 - .win[4] = &s3c_fb_data_s5p_wins[4], 1779 - }; 1780 - 1781 - static struct s3c_fb_driverdata s3c_fb_data_exynos4 = { 1782 - .variant = { 1783 - .nr_windows = 5, 1784 - .vidtcon = VIDTCON0, 1785 - .wincon = WINCON(0), 1786 - .winmap = WINxMAP(0), 1787 - .keycon = WKEYCON, 1788 - .osd = VIDOSD_BASE, 1789 - .osd_stride = 16, 1790 - .buf_start = VIDW_BUF_START(0), 1791 - .buf_size = VIDW_BUF_SIZE(0), 1792 - .buf_end = VIDW_BUF_END(0), 1793 - 1794 - .palette = { 1795 - [0] = 0x2400, 1796 - [1] = 0x2800, 1797 - [2] = 0x2c00, 1798 - [3] = 0x3000, 1799 - [4] = 0x3400, 1800 - }, 1801 - 1802 - .has_shadowcon = 1, 1803 - .has_blendcon = 1, 1804 - .has_fixvclk = 1, 1805 - }, 1806 - .win[0] = &s3c_fb_data_s5p_wins[0], 1807 - .win[1] = &s3c_fb_data_s5p_wins[1], 1808 - .win[2] = &s3c_fb_data_s5p_wins[2], 1809 - .win[3] = &s3c_fb_data_s5p_wins[3], 1810 - .win[4] = &s3c_fb_data_s5p_wins[4], 1811 - }; 1812 - 1813 - static struct s3c_fb_driverdata s3c_fb_data_exynos5 = { 1814 - .variant = { 1815 - .nr_windows = 5, 1816 - .vidtcon = FIMD_V8_VIDTCON0, 1817 - .wincon = WINCON(0), 1818 - .winmap = WINxMAP(0), 1819 - .keycon = WKEYCON, 1820 - .osd = VIDOSD_BASE, 1821 - .osd_stride = 16, 1822 - .buf_start = VIDW_BUF_START(0), 1823 - .buf_size = VIDW_BUF_SIZE(0), 1824 - .buf_end = VIDW_BUF_END(0), 1825 - 1826 - .palette = { 1827 - [0] = 0x2400, 1828 - [1] = 0x2800, 1829 - [2] = 0x2c00, 1830 - [3] = 0x3000, 1831 - [4] = 0x3400, 1832 - }, 1833 - .has_shadowcon = 1, 1834 - .has_blendcon = 1, 1835 - .has_fixvclk = 1, 1836 - }, 1837 - .win[0] = &s3c_fb_data_s5p_wins[0], 1838 - .win[1] = &s3c_fb_data_s5p_wins[1], 1839 - .win[2] = &s3c_fb_data_s5p_wins[2], 1840 - .win[3] = &s3c_fb_data_s5p_wins[3], 1841 - .win[4] = &s3c_fb_data_s5p_wins[4], 1842 1805 }; 1843 1806 1844 1807 /* S3C2443/S3C2416 style hardware */ ··· 1786 1941 { 1787 1942 .name = "s3c-fb", 1788 1943 .driver_data = (unsigned long)&s3c_fb_data_64xx, 1789 - }, { 1790 - .name = "s5pv210-fb", 1791 - .driver_data = (unsigned long)&s3c_fb_data_s5pv210, 1792 - }, { 1793 - .name = "exynos4-fb", 1794 - .driver_data = (unsigned long)&s3c_fb_data_exynos4, 1795 - }, { 1796 - .name = "exynos5-fb", 1797 - .driver_data = (unsigned long)&s3c_fb_data_exynos5, 1798 1944 }, { 1799 1945 .name = "s3c2443-fb", 1800 1946 .driver_data = (unsigned long)&s3c_fb_data_s3c2443,
-76
drivers/video/fbdev/sis/init.h
··· 1461 1461 0x00}} 1462 1462 }; 1463 1463 1464 - bool SiSInitPtr(struct SiS_Private *SiS_Pr); 1465 - unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, 1466 - int VDisplay, int Depth, bool FSTN, 1467 - unsigned short CustomT, int LCDwith, int LCDheight, 1468 - unsigned int VBFlags2); 1469 - unsigned short SiS_GetModeID_TV(int VGAEngine, unsigned int VBFlags, int HDisplay, 1470 - int VDisplay, int Depth, unsigned int VBFlags2); 1471 - unsigned short SiS_GetModeID_VGA2(int VGAEngine, unsigned int VBFlags, int HDisplay, 1472 - int VDisplay, int Depth, unsigned int VBFlags2); 1473 - 1474 - void SiS_DisplayOn(struct SiS_Private *SiS_Pr); 1475 - void SiS_DisplayOff(struct SiS_Private *SiS_Pr); 1476 - void SiSRegInit(struct SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr); 1477 - void SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable); 1478 - void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable); 1479 - unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1480 - unsigned short ModeIdIndex); 1481 - bool SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr); 1482 - 1483 - bool SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, 1484 - unsigned short *ModeIdIndex); 1485 - unsigned short SiS_GetModePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1486 - unsigned short ModeIdIndex); 1487 - unsigned short SiS_GetRefCRTVCLK(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); 1488 - unsigned short SiS_GetRefCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); 1489 - unsigned short SiS_GetColorDepth(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1490 - unsigned short ModeIdIndex); 1491 - unsigned short SiS_GetOffset(struct SiS_Private *SiS_Pr,unsigned short ModeNo, 1492 - unsigned short ModeIdIndex, unsigned short RRTI); 1493 - #ifdef CONFIG_FB_SIS_300 1494 - void SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *idx1, 1495 - unsigned short *idx2); 1496 - unsigned short SiS_GetFIFOThresholdB300(unsigned short idx1, unsigned short idx2); 1497 - unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index); 1498 - #endif 1499 - void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 1500 - bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 1501 - void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); 1502 - void SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1503 - unsigned short ModeIdIndex); 1504 - void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres, 1505 - int yres, struct fb_var_screeninfo *var, bool writeres); 1506 - 1507 - /* From init301.c: */ 1508 - extern void SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1509 - unsigned short ModeIdIndex, int chkcrt2mode); 1510 - extern void SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1511 - unsigned short ModeIdIndex); 1512 - extern void SiS_SetYPbPr(struct SiS_Private *SiS_Pr); 1513 - extern void SiS_SetTVMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1514 - unsigned short ModeIdIndex); 1515 - extern void SiS_UnLockCRT2(struct SiS_Private *SiS_Pr); 1516 - extern void SiS_DisableBridge(struct SiS_Private *); 1517 - extern bool SiS_SetCRT2Group(struct SiS_Private *, unsigned short); 1518 - extern unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1519 - unsigned short ModeIdIndex); 1520 - extern void SiS_WaitRetrace1(struct SiS_Private *SiS_Pr); 1521 - extern unsigned short SiS_GetResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1522 - unsigned short ModeIdIndex); 1523 - extern unsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempax); 1524 - extern unsigned short SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1525 - unsigned short ModeIdIndex, unsigned short RRTI); 1526 - extern bool SiS_IsVAMode(struct SiS_Private *); 1527 - extern bool SiS_IsDualEdge(struct SiS_Private *); 1528 - 1529 - #ifdef CONFIG_FB_SIS_300 1530 - extern unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg); 1531 - extern void sisfb_write_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg, 1532 - unsigned int val); 1533 - #endif 1534 - #ifdef CONFIG_FB_SIS_315 1535 - extern void sisfb_write_nbridge_pci_byte(struct SiS_Private *SiS_Pr, int reg, 1536 - unsigned char val); 1537 - extern unsigned int sisfb_read_mio_pci_word(struct SiS_Private *SiS_Pr, int reg); 1538 - #endif 1539 - 1540 1464 #endif 1541 1465
+326
drivers/video/fbdev/sis/init301.c
··· 82 82 #define SiS_I2CDELAY 1000 83 83 #define SiS_I2CDELAYSHORT 150 84 84 85 + static const unsigned char SiS_YPbPrTable[3][64] = { 86 + { 87 + 0x17,0x1d,0x03,0x09,0x05,0x06,0x0c,0x0c, 88 + 0x94,0x49,0x01,0x0a,0x06,0x0d,0x04,0x0a, 89 + 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b, 90 + 0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17, 91 + 0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02, 92 + 0x03,0x0a,0x65,0x9d /*0x8d*/,0x08,0x92,0x8f,0x40, 93 + 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x53 /*0x50*/, 94 + 0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00 95 + }, 96 + { 97 + 0x33,0x06,0x06,0x09,0x0b,0x0c,0x0c,0x0c, 98 + 0x98,0x0a,0x01,0x0d,0x06,0x0d,0x04,0x0a, 99 + 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f, 100 + 0x0c,0x50,0xb2,0x9f,0x16,0x59,0x4f,0x13, 101 + 0xad,0x11,0xad,0x1d,0x40,0x8a,0x3d,0xb8, 102 + 0x51,0x5e,0x60,0x49,0x7d,0x92,0x0f,0x40, 103 + 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x4e, 104 + 0x43,0x41,0x11,0x00,0xfc,0xff,0x32,0x00 105 + }, 106 + { 107 + #if 0 /* OK, but sticks to left edge */ 108 + 0x13,0x1d,0xe8,0x09,0x09,0xed,0x0c,0x0c, 109 + 0x98,0x0a,0x01,0x0c,0x06,0x0d,0x04,0x0a, 110 + 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f, 111 + 0xed,0x50,0x70,0x9f,0x16,0x59,0x21 /*0x2b*/,0x13, 112 + 0x27,0x0b,0x27,0xfc,0x30,0x27,0x1c,0xb0, 113 + 0x4b,0x4b,0x65 /*0x6f*/,0x2f,0x63,0x92,0x0f,0x40, 114 + 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x27, 115 + 0x00,0x40,0x11,0x00,0xfc,0xff,0x32,0x00 116 + #endif 117 + #if 1 /* Perfect */ 118 + 0x23,0x2d,0xe8,0x09,0x09,0xed,0x0c,0x0c, 119 + 0x98,0x0a,0x01,0x0c,0x06,0x0d,0x04,0x0a, 120 + 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f, 121 + 0xed,0x50,0x70,0x9f,0x16,0x59,0x60,0x13, 122 + 0x27,0x0b,0x27,0xfc,0x30,0x27,0x1c,0xb0, 123 + 0x4b,0x4b,0x6f,0x2f,0x63,0x92,0x0f,0x40, 124 + 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x73, 125 + 0x00,0x40,0x11,0x00,0xfc,0xff,0x32,0x00 126 + #endif 127 + } 128 + }; 129 + 130 + static const unsigned char SiS_TVPhase[] = 131 + { 132 + 0x21,0xED,0xBA,0x08, /* 0x00 SiS_NTSCPhase */ 133 + 0x2A,0x05,0xE3,0x00, /* 0x01 SiS_PALPhase */ 134 + 0x21,0xE4,0x2E,0x9B, /* 0x02 SiS_PALMPhase */ 135 + 0x21,0xF4,0x3E,0xBA, /* 0x03 SiS_PALNPhase */ 136 + 0x1E,0x8B,0xA2,0xA7, 137 + 0x1E,0x83,0x0A,0xE0, /* 0x05 SiS_SpecialPhaseM */ 138 + 0x00,0x00,0x00,0x00, 139 + 0x00,0x00,0x00,0x00, 140 + 0x21,0xF0,0x7B,0xD6, /* 0x08 SiS_NTSCPhase2 */ 141 + 0x2A,0x09,0x86,0xE9, /* 0x09 SiS_PALPhase2 */ 142 + 0x21,0xE6,0xEF,0xA4, /* 0x0a SiS_PALMPhase2 */ 143 + 0x21,0xF6,0x94,0x46, /* 0x0b SiS_PALNPhase2 */ 144 + 0x1E,0x8B,0xA2,0xA7, 145 + 0x1E,0x83,0x0A,0xE0, /* 0x0d SiS_SpecialPhaseM */ 146 + 0x00,0x00,0x00,0x00, 147 + 0x00,0x00,0x00,0x00, 148 + 0x1e,0x8c,0x5c,0x7a, /* 0x10 SiS_SpecialPhase */ 149 + 0x25,0xd4,0xfd,0x5e /* 0x11 SiS_SpecialPhaseJ */ 150 + }; 151 + 152 + static const unsigned char SiS_HiTVGroup3_1[] = { 153 + 0x00, 0x14, 0x15, 0x25, 0x55, 0x15, 0x0b, 0x13, 154 + 0xb1, 0x41, 0x62, 0x62, 0xff, 0xf4, 0x45, 0xa6, 155 + 0x25, 0x2f, 0x67, 0xf6, 0xbf, 0xff, 0x8e, 0x20, 156 + 0xac, 0xda, 0x60, 0xfe, 0x6a, 0x9a, 0x06, 0x10, 157 + 0xd1, 0x04, 0x18, 0x0a, 0xff, 0x80, 0x00, 0x80, 158 + 0x3b, 0x77, 0x00, 0xef, 0xe0, 0x10, 0xb0, 0xe0, 159 + 0x10, 0x4f, 0x0f, 0x0f, 0x05, 0x0f, 0x08, 0x6e, 160 + 0x1a, 0x1f, 0x25, 0x2a, 0x4c, 0xaa, 0x01 161 + }; 162 + 163 + static const unsigned char SiS_HiTVGroup3_2[] = { 164 + 0x00, 0x14, 0x15, 0x25, 0x55, 0x15, 0x0b, 0x7a, 165 + 0x54, 0x41, 0xe7, 0xe7, 0xff, 0xf4, 0x45, 0xa6, 166 + 0x25, 0x2f, 0x67, 0xf6, 0xbf, 0xff, 0x8e, 0x20, 167 + 0xac, 0x6a, 0x60, 0x2b, 0x52, 0xcd, 0x61, 0x10, 168 + 0x51, 0x04, 0x18, 0x0a, 0x1f, 0x80, 0x00, 0x80, 169 + 0xff, 0xa4, 0x04, 0x2b, 0x94, 0x21, 0x72, 0x94, 170 + 0x26, 0x05, 0x01, 0x0f, 0xed, 0x0f, 0x0a, 0x64, 171 + 0x18, 0x1d, 0x23, 0x28, 0x4c, 0xaa, 0x01 172 + }; 173 + 174 + /* 301C / 302ELV extended Part2 TV registers (4 tap scaler) */ 175 + 176 + static const unsigned char SiS_Part2CLVX_1[] = { 177 + 0x00,0x00, 178 + 0x00,0x20,0x00,0x00,0x7F,0x20,0x02,0x7F,0x7D,0x20,0x04,0x7F,0x7D,0x1F,0x06,0x7E, 179 + 0x7C,0x1D,0x09,0x7E,0x7C,0x1B,0x0B,0x7E,0x7C,0x19,0x0E,0x7D,0x7C,0x17,0x11,0x7C, 180 + 0x7C,0x14,0x14,0x7C,0x7C,0x11,0x17,0x7C,0x7D,0x0E,0x19,0x7C,0x7E,0x0B,0x1B,0x7C, 181 + 0x7E,0x09,0x1D,0x7C,0x7F,0x06,0x1F,0x7C,0x7F,0x04,0x20,0x7D,0x00,0x02,0x20,0x7E 182 + }; 183 + 184 + static const unsigned char SiS_Part2CLVX_2[] = { 185 + 0x00,0x00, 186 + 0x00,0x20,0x00,0x00,0x7F,0x20,0x02,0x7F,0x7D,0x20,0x04,0x7F,0x7D,0x1F,0x06,0x7E, 187 + 0x7C,0x1D,0x09,0x7E,0x7C,0x1B,0x0B,0x7E,0x7C,0x19,0x0E,0x7D,0x7C,0x17,0x11,0x7C, 188 + 0x7C,0x14,0x14,0x7C,0x7C,0x11,0x17,0x7C,0x7D,0x0E,0x19,0x7C,0x7E,0x0B,0x1B,0x7C, 189 + 0x7E,0x09,0x1D,0x7C,0x7F,0x06,0x1F,0x7C,0x7F,0x04,0x20,0x7D,0x00,0x02,0x20,0x7E 190 + }; 191 + 192 + static const unsigned char SiS_Part2CLVX_3[] = { /* NTSC, 525i, 525p */ 193 + 0xE0,0x01, 194 + 0x04,0x1A,0x04,0x7E,0x03,0x1A,0x06,0x7D,0x01,0x1A,0x08,0x7D,0x00,0x19,0x0A,0x7D, 195 + 0x7F,0x19,0x0C,0x7C,0x7E,0x18,0x0E,0x7C,0x7E,0x17,0x10,0x7B,0x7D,0x15,0x12,0x7C, 196 + 0x7D,0x13,0x13,0x7D,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x7D,0x7C,0x0E,0x18,0x7E, 197 + 0x7D,0x0C,0x19,0x7E,0x7D,0x0A,0x19,0x00,0x7D,0x08,0x1A,0x01,0x7E,0x06,0x1A,0x02, 198 + 0x58,0x02, 199 + 0x07,0x14,0x07,0x7E,0x06,0x14,0x09,0x7D,0x05,0x14,0x0A,0x7D,0x04,0x13,0x0B,0x7E, 200 + 0x03,0x13,0x0C,0x7E,0x02,0x12,0x0D,0x7F,0x01,0x12,0x0E,0x7F,0x01,0x11,0x0F,0x7F, 201 + 0x00,0x10,0x10,0x00,0x7F,0x0F,0x11,0x01,0x7F,0x0E,0x12,0x01,0x7E,0x0D,0x12,0x03, 202 + 0x7E,0x0C,0x13,0x03,0x7E,0x0B,0x13,0x04,0x7E,0x0A,0x14,0x04,0x7D,0x09,0x14,0x06, 203 + 0x00,0x03, 204 + 0x09,0x0F,0x09,0x7F,0x08,0x0F,0x09,0x00,0x07,0x0F,0x0A,0x00,0x06,0x0F,0x0A,0x01, 205 + 0x06,0x0E,0x0B,0x01,0x05,0x0E,0x0B,0x02,0x04,0x0E,0x0C,0x02,0x04,0x0D,0x0C,0x03, 206 + 0x03,0x0D,0x0D,0x03,0x02,0x0C,0x0D,0x05,0x02,0x0C,0x0E,0x04,0x01,0x0B,0x0E,0x06, 207 + 0x01,0x0B,0x0E,0x06,0x00,0x0A,0x0F,0x07,0x00,0x0A,0x0F,0x07,0x00,0x09,0x0F,0x08, 208 + 0xFF,0xFF 209 + }; 210 + 211 + static const unsigned char SiS_Part2CLVX_4[] = { /* PAL */ 212 + 0x58,0x02, 213 + 0x05,0x19,0x05,0x7D,0x03,0x19,0x06,0x7E,0x02,0x19,0x08,0x7D,0x01,0x18,0x0A,0x7D, 214 + 0x00,0x18,0x0C,0x7C,0x7F,0x17,0x0E,0x7C,0x7E,0x16,0x0F,0x7D,0x7E,0x14,0x11,0x7D, 215 + 0x7D,0x13,0x13,0x7D,0x7D,0x11,0x14,0x7E,0x7D,0x0F,0x16,0x7E,0x7D,0x0E,0x17,0x7E, 216 + 0x7D,0x0C,0x18,0x7F,0x7D,0x0A,0x18,0x01,0x7D,0x08,0x19,0x02,0x7D,0x06,0x19,0x04, 217 + 0x00,0x03, 218 + 0x08,0x12,0x08,0x7E,0x07,0x12,0x09,0x7E,0x06,0x12,0x0A,0x7E,0x05,0x11,0x0B,0x7F, 219 + 0x04,0x11,0x0C,0x7F,0x03,0x11,0x0C,0x00,0x03,0x10,0x0D,0x00,0x02,0x0F,0x0E,0x01, 220 + 0x01,0x0F,0x0F,0x01,0x01,0x0E,0x0F,0x02,0x00,0x0D,0x10,0x03,0x7F,0x0C,0x11,0x04, 221 + 0x7F,0x0C,0x11,0x04,0x7F,0x0B,0x11,0x05,0x7E,0x0A,0x12,0x06,0x7E,0x09,0x12,0x07, 222 + 0x40,0x02, 223 + 0x04,0x1A,0x04,0x7E,0x02,0x1B,0x05,0x7E,0x01,0x1A,0x07,0x7E,0x00,0x1A,0x09,0x7D, 224 + 0x7F,0x19,0x0B,0x7D,0x7E,0x18,0x0D,0x7D,0x7D,0x17,0x10,0x7C,0x7D,0x15,0x12,0x7C, 225 + 0x7C,0x14,0x14,0x7C,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x7D,0x7C,0x0D,0x18,0x7F, 226 + 0x7D,0x0B,0x19,0x7F,0x7D,0x09,0x1A,0x00,0x7D,0x07,0x1A,0x02,0x7E,0x05,0x1B,0x02, 227 + 0xFF,0xFF 228 + }; 229 + 230 + static const unsigned char SiS_Part2CLVX_5[] = { /* 750p */ 231 + 0x00,0x03, 232 + 0x05,0x19,0x05,0x7D,0x03,0x19,0x06,0x7E,0x02,0x19,0x08,0x7D,0x01,0x18,0x0A,0x7D, 233 + 0x00,0x18,0x0C,0x7C,0x7F,0x17,0x0E,0x7C,0x7E,0x16,0x0F,0x7D,0x7E,0x14,0x11,0x7D, 234 + 0x7D,0x13,0x13,0x7D,0x7D,0x11,0x14,0x7E,0x7D,0x0F,0x16,0x7E,0x7D,0x0E,0x17,0x7E, 235 + 0x7D,0x0C,0x18,0x7F,0x7D,0x0A,0x18,0x01,0x7D,0x08,0x19,0x02,0x7D,0x06,0x19,0x04, 236 + 0xFF,0xFF 237 + }; 238 + 239 + static const unsigned char SiS_Part2CLVX_6[] = { /* 1080i */ 240 + 0x00,0x04, 241 + 0x04,0x1A,0x04,0x7E,0x02,0x1B,0x05,0x7E,0x01,0x1A,0x07,0x7E,0x00,0x1A,0x09,0x7D, 242 + 0x7F,0x19,0x0B,0x7D,0x7E,0x18,0x0D,0x7D,0x7D,0x17,0x10,0x7C,0x7D,0x15,0x12,0x7C, 243 + 0x7C,0x14,0x14,0x7C,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x7D,0x7C,0x0D,0x18,0x7F, 244 + 0x7D,0x0B,0x19,0x7F,0x7D,0x09,0x1A,0x00,0x7D,0x07,0x1A,0x02,0x7E,0x05,0x1B,0x02, 245 + 0xFF,0xFF, 246 + }; 247 + 248 + #ifdef CONFIG_FB_SIS_315 249 + /* 661 et al LCD data structure (2.03.00) */ 250 + static const unsigned char SiS_LCDStruct661[] = { 251 + /* 1024x768 */ 252 + /* type|CR37| HDE | VDE | HT | VT | hss | hse */ 253 + 0x02,0xC0,0x00,0x04,0x00,0x03,0x40,0x05,0x26,0x03,0x10,0x00,0x88, 254 + 0x00,0x02,0x00,0x06,0x00,0x41,0x5A,0x64,0x00,0x00,0x00,0x00,0x04, 255 + /* | vss | vse |clck| clock |CRT2DataP|CRT2DataP|idx */ 256 + /* VESA non-VESA noscale */ 257 + /* 1280x1024 */ 258 + 0x03,0xC0,0x00,0x05,0x00,0x04,0x98,0x06,0x2A,0x04,0x30,0x00,0x70, 259 + 0x00,0x01,0x00,0x03,0x00,0x6C,0xF8,0x2F,0x00,0x00,0x00,0x00,0x08, 260 + /* 1400x1050 */ 261 + 0x09,0x20,0x78,0x05,0x1A,0x04,0x98,0x06,0x2A,0x04,0x18,0x00,0x38, 262 + 0x00,0x01,0x00,0x03,0x00,0x6C,0xF8,0x2F,0x00,0x00,0x00,0x00,0x09, 263 + /* 1600x1200 */ 264 + 0x0B,0xE0,0x40,0x06,0xB0,0x04,0x70,0x08,0xE2,0x04,0x40,0x00,0xC0, 265 + 0x00,0x01,0x00,0x03,0x00,0xA2,0x70,0x24,0x00,0x00,0x00,0x00,0x0A, 266 + /* 1280x768 (_2) */ 267 + 0x0A,0xE0,0x00,0x05,0x00,0x03,0x7C,0x06,0x26,0x03,0x30,0x00,0x70, 268 + 0x00,0x03,0x00,0x06,0x00,0x4D,0xC8,0x48,0x00,0x00,0x00,0x00,0x06, 269 + /* 1280x720 */ 270 + 0x0E,0xE0,0x00,0x05,0xD0,0x02,0x80,0x05,0x26,0x03,0x10,0x00,0x20, 271 + 0x00,0x01,0x00,0x06,0x00,0x45,0x9C,0x62,0x00,0x00,0x00,0x00,0x05, 272 + /* 1280x800 (_2) */ 273 + 0x0C,0xE0,0x00,0x05,0x20,0x03,0x10,0x06,0x2C,0x03,0x30,0x00,0x70, 274 + 0x00,0x04,0x00,0x03,0x00,0x49,0xCE,0x1E,0x00,0x00,0x00,0x00,0x09, 275 + /* 1680x1050 */ 276 + 0x0D,0xE0,0x90,0x06,0x1A,0x04,0x6C,0x07,0x2A,0x04,0x1A,0x00,0x4C, 277 + 0x00,0x03,0x00,0x06,0x00,0x79,0xBE,0x44,0x00,0x00,0x00,0x00,0x06, 278 + /* 1280x800_3 */ 279 + 0x0C,0xE0,0x00,0x05,0x20,0x03,0xAA,0x05,0x2E,0x03,0x30,0x00,0x50, 280 + 0x00,0x04,0x00,0x03,0x00,0x47,0xA9,0x10,0x00,0x00,0x00,0x00,0x07, 281 + /* 800x600 */ 282 + 0x01,0xC0,0x20,0x03,0x58,0x02,0x20,0x04,0x74,0x02,0x2A,0x00,0x80, 283 + 0x00,0x06,0x00,0x04,0x00,0x28,0x63,0x4B,0x00,0x00,0x00,0x00,0x00, 284 + /* 1280x854 */ 285 + 0x08,0xE0,0x00,0x05,0x56,0x03,0x80,0x06,0x5d,0x03,0x10,0x00,0x70, 286 + 0x00,0x01,0x00,0x03,0x00,0x54,0x75,0x13,0x00,0x00,0x00,0x00,0x08 287 + }; 288 + #endif 289 + 290 + #ifdef CONFIG_FB_SIS_300 291 + static unsigned char SiS300_TrumpionData[14][80] = { 292 + { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02, 293 + 0x20,0x03,0x0B,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x10,0x00,0x00,0x04,0x23, 294 + 0x00,0x00,0x03,0x28,0x03,0x10,0x05,0x08,0x40,0x10,0x00,0x10,0x04,0x23,0x00,0x23, 295 + 0x03,0x11,0x60,0xBC,0x01,0xFF,0x03,0xFF,0x19,0x01,0x00,0x05,0x09,0x04,0x04,0x05, 296 + 0x04,0x0C,0x09,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5A,0x01,0xBE,0x01,0x00 }, 297 + { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x27,0x00,0x80,0x02, 298 + 0x20,0x03,0x07,0x00,0x5E,0x01,0x0D,0x02,0x60,0x0C,0x30,0x11,0x00,0x00,0x04,0x23, 299 + 0x00,0x00,0x03,0x80,0x03,0x28,0x06,0x08,0x40,0x11,0x00,0x11,0x04,0x23,0x00,0x23, 300 + 0x03,0x11,0x60,0x90,0x01,0xFF,0x0F,0xF4,0x19,0x01,0x00,0x05,0x01,0x00,0x04,0x05, 301 + 0x04,0x0C,0x02,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEC,0x57,0x01,0xBE,0x01,0x00 }, 302 + { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x8A,0x00,0xD8,0x02, 303 + 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23, 304 + 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23, 305 + 0x03,0x11,0x60,0xD9,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05, 306 + 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x59,0x01,0xBE,0x01,0x00 }, 307 + { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x72,0x00,0xD8,0x02, 308 + 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23, 309 + 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23, 310 + 0x03,0x11,0x60,0xDA,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05, 311 + 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 }, 312 + { 0x02,0x0A,0x02,0x00,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02, 313 + 0x20,0x03,0x16,0x00,0xE0,0x01,0x0D,0x02,0x60,0x0C,0x30,0x98,0x00,0x00,0x04,0x23, 314 + 0x00,0x01,0x03,0x45,0x03,0x48,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x23,0x00,0x23, 315 + 0x03,0x11,0x60,0xF4,0x01,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x05,0x01,0x00,0x05,0x05, 316 + 0x04,0x0C,0x08,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 }, 317 + { 0x02,0x0A,0x02,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0xBF,0x00,0x20,0x03, 318 + 0x20,0x04,0x0D,0x00,0x58,0x02,0x71,0x02,0x80,0x0C,0x30,0x9A,0x00,0xFA,0x03,0x1D, 319 + 0x00,0x01,0x03,0x22,0x03,0x28,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x1D,0x00,0x1D, 320 + 0x03,0x11,0x60,0x39,0x03,0x40,0x05,0xF4,0x18,0x07,0x02,0x06,0x04,0x01,0x06,0x0B, 321 + 0x02,0x0A,0x20,0x19,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 }, 322 + { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0xEF,0x00,0x00,0x04, 323 + 0x40,0x05,0x13,0x00,0x00,0x03,0x26,0x03,0x88,0x0C,0x30,0x90,0x00,0x00,0x04,0x23, 324 + 0x00,0x01,0x03,0x24,0x03,0x28,0x06,0x08,0x40,0x90,0x00,0x90,0x04,0x23,0x00,0x23, 325 + 0x03,0x11,0x60,0x40,0x05,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x08,0x01,0x00,0x08,0x01, 326 + 0x00,0x08,0x01,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 }, 327 + /* variant 2 */ 328 + { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02, 329 + 0x20,0x03,0x15,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x18,0x00,0x00,0x04,0x23, 330 + 0x00,0x01,0x03,0x44,0x03,0x28,0x06,0x08,0x40,0x18,0x00,0x18,0x04,0x23,0x00,0x23, 331 + 0x03,0x11,0x60,0xA6,0x01,0xFF,0x03,0xFF,0x19,0x01,0x00,0x05,0x13,0x04,0x04,0x05, 332 + 0x04,0x0C,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 }, 333 + { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02, 334 + 0x20,0x03,0x15,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x18,0x00,0x00,0x04,0x23, 335 + 0x00,0x01,0x03,0x44,0x03,0x28,0x06,0x08,0x40,0x18,0x00,0x18,0x04,0x23,0x00,0x23, 336 + 0x03,0x11,0x60,0xA6,0x01,0xFF,0x03,0xFF,0x19,0x01,0x00,0x05,0x13,0x04,0x04,0x05, 337 + 0x04,0x0C,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 }, 338 + { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x8A,0x00,0xD8,0x02, 339 + 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23, 340 + 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23, 341 + 0x03,0x11,0x60,0xDA,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05, 342 + 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 }, 343 + { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x72,0x00,0xD8,0x02, 344 + 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23, 345 + 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23, 346 + 0x03,0x11,0x60,0xDA,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05, 347 + 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 }, 348 + { 0x02,0x0A,0x02,0x00,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02, 349 + 0x20,0x03,0x16,0x00,0xE0,0x01,0x0D,0x02,0x60,0x0C,0x30,0x98,0x00,0x00,0x04,0x23, 350 + 0x00,0x01,0x03,0x45,0x03,0x48,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x23,0x00,0x23, 351 + 0x03,0x11,0x60,0xF4,0x01,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x05,0x01,0x00,0x05,0x05, 352 + 0x04,0x0C,0x08,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEA,0x58,0x01,0xBE,0x01,0x00 }, 353 + { 0x02,0x0A,0x02,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0xBF,0x00,0x20,0x03, 354 + 0x20,0x04,0x0D,0x00,0x58,0x02,0x71,0x02,0x80,0x0C,0x30,0x9A,0x00,0xFA,0x03,0x1D, 355 + 0x00,0x01,0x03,0x22,0x03,0x28,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x1D,0x00,0x1D, 356 + 0x03,0x11,0x60,0x39,0x03,0x40,0x05,0xF4,0x18,0x07,0x02,0x06,0x04,0x01,0x06,0x0B, 357 + 0x02,0x0A,0x20,0x19,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEA,0x58,0x01,0xBE,0x01,0x00 }, 358 + { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0xEF,0x00,0x00,0x04, 359 + 0x40,0x05,0x13,0x00,0x00,0x03,0x26,0x03,0x88,0x0C,0x30,0x90,0x00,0x00,0x04,0x23, 360 + 0x00,0x01,0x03,0x24,0x03,0x28,0x06,0x08,0x40,0x90,0x00,0x90,0x04,0x23,0x00,0x23, 361 + 0x03,0x11,0x60,0x40,0x05,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x08,0x01,0x00,0x08,0x01, 362 + 0x00,0x08,0x01,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEA,0x58,0x01,0xBE,0x01,0x00 } 363 + }; 364 + #endif 365 + 366 + #ifdef CONFIG_FB_SIS_315 367 + static void SiS_Chrontel701xOn(struct SiS_Private *SiS_Pr); 368 + static void SiS_Chrontel701xOff(struct SiS_Private *SiS_Pr); 369 + static void SiS_ChrontelInitTVVSync(struct SiS_Private *SiS_Pr); 370 + static void SiS_ChrontelDoSomething1(struct SiS_Private *SiS_Pr); 371 + #endif /* 315 */ 372 + 373 + #ifdef CONFIG_FB_SIS_300 374 + static bool SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *dataptr); 375 + #endif 376 + 377 + static unsigned short SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, 378 + int VGAEngine, unsigned short adaptnum, unsigned short DDCdatatype, 379 + bool checkcr32, unsigned int VBFlags2); 380 + static unsigned short SiS_ProbeDDC(struct SiS_Private *SiS_Pr); 381 + static unsigned short SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, 382 + unsigned char *buffer); 383 + static void SiS_SetSwitchDDC2(struct SiS_Private *SiS_Pr); 384 + static unsigned short SiS_SetStart(struct SiS_Private *SiS_Pr); 385 + static unsigned short SiS_SetStop(struct SiS_Private *SiS_Pr); 386 + static unsigned short SiS_SetSCLKLow(struct SiS_Private *SiS_Pr); 387 + static unsigned short SiS_SetSCLKHigh(struct SiS_Private *SiS_Pr); 388 + static unsigned short SiS_ReadDDC2Data(struct SiS_Private *SiS_Pr); 389 + static unsigned short SiS_WriteDDC2Data(struct SiS_Private *SiS_Pr, unsigned short tempax); 390 + static unsigned short SiS_CheckACK(struct SiS_Private *SiS_Pr); 391 + static unsigned short SiS_WriteDABDDC(struct SiS_Private *SiS_Pr); 392 + static unsigned short SiS_PrepareReadDDC(struct SiS_Private *SiS_Pr); 393 + static unsigned short SiS_PrepareDDC(struct SiS_Private *SiS_Pr); 394 + static void SiS_SendACK(struct SiS_Private *SiS_Pr, unsigned short yesno); 395 + static unsigned short SiS_DoProbeDDC(struct SiS_Private *SiS_Pr); 396 + 397 + #ifdef CONFIG_FB_SIS_300 398 + static void SiS_OEM300Setting(struct SiS_Private *SiS_Pr, 399 + unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefTabindex); 400 + static void SetOEMLCDData2(struct SiS_Private *SiS_Pr, 401 + unsigned short ModeNo, unsigned short ModeIdIndex,unsigned short RefTableIndex); 402 + #endif 403 + #ifdef CONFIG_FB_SIS_315 404 + static void SiS_OEM310Setting(struct SiS_Private *SiS_Pr, 405 + unsigned short ModeNo,unsigned short ModeIdIndex, unsigned short RRTI); 406 + static void SiS_OEM661Setting(struct SiS_Private *SiS_Pr, 407 + unsigned short ModeNo,unsigned short ModeIdIndex, unsigned short RRTI); 408 + static void SiS_FinalizeLCD(struct SiS_Private *, unsigned short, unsigned short); 409 + #endif 410 + 85 411 static unsigned short SiS_GetBIOSLCDResInfo(struct SiS_Private *SiS_Pr); 86 412 static void SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 87 413
-320
drivers/video/fbdev/sis/init301.h
··· 66 66 #include "sis.h" 67 67 #include <video/sisfb.h> 68 68 69 - static const unsigned char SiS_YPbPrTable[3][64] = { 70 - { 71 - 0x17,0x1d,0x03,0x09,0x05,0x06,0x0c,0x0c, 72 - 0x94,0x49,0x01,0x0a,0x06,0x0d,0x04,0x0a, 73 - 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b, 74 - 0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17, 75 - 0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02, 76 - 0x03,0x0a,0x65,0x9d /*0x8d*/,0x08,0x92,0x8f,0x40, 77 - 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x53 /*0x50*/, 78 - 0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00 79 - }, 80 - { 81 - 0x33,0x06,0x06,0x09,0x0b,0x0c,0x0c,0x0c, 82 - 0x98,0x0a,0x01,0x0d,0x06,0x0d,0x04,0x0a, 83 - 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f, 84 - 0x0c,0x50,0xb2,0x9f,0x16,0x59,0x4f,0x13, 85 - 0xad,0x11,0xad,0x1d,0x40,0x8a,0x3d,0xb8, 86 - 0x51,0x5e,0x60,0x49,0x7d,0x92,0x0f,0x40, 87 - 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x4e, 88 - 0x43,0x41,0x11,0x00,0xfc,0xff,0x32,0x00 89 - }, 90 - { 91 - #if 0 /* OK, but sticks to left edge */ 92 - 0x13,0x1d,0xe8,0x09,0x09,0xed,0x0c,0x0c, 93 - 0x98,0x0a,0x01,0x0c,0x06,0x0d,0x04,0x0a, 94 - 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f, 95 - 0xed,0x50,0x70,0x9f,0x16,0x59,0x21 /*0x2b*/,0x13, 96 - 0x27,0x0b,0x27,0xfc,0x30,0x27,0x1c,0xb0, 97 - 0x4b,0x4b,0x65 /*0x6f*/,0x2f,0x63,0x92,0x0f,0x40, 98 - 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x27, 99 - 0x00,0x40,0x11,0x00,0xfc,0xff,0x32,0x00 100 - #endif 101 - #if 1 /* Perfect */ 102 - 0x23,0x2d,0xe8,0x09,0x09,0xed,0x0c,0x0c, 103 - 0x98,0x0a,0x01,0x0c,0x06,0x0d,0x04,0x0a, 104 - 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f, 105 - 0xed,0x50,0x70,0x9f,0x16,0x59,0x60,0x13, 106 - 0x27,0x0b,0x27,0xfc,0x30,0x27,0x1c,0xb0, 107 - 0x4b,0x4b,0x6f,0x2f,0x63,0x92,0x0f,0x40, 108 - 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x73, 109 - 0x00,0x40,0x11,0x00,0xfc,0xff,0x32,0x00 110 - #endif 111 - } 112 - }; 113 - 114 - static const unsigned char SiS_TVPhase[] = 115 - { 116 - 0x21,0xED,0xBA,0x08, /* 0x00 SiS_NTSCPhase */ 117 - 0x2A,0x05,0xE3,0x00, /* 0x01 SiS_PALPhase */ 118 - 0x21,0xE4,0x2E,0x9B, /* 0x02 SiS_PALMPhase */ 119 - 0x21,0xF4,0x3E,0xBA, /* 0x03 SiS_PALNPhase */ 120 - 0x1E,0x8B,0xA2,0xA7, 121 - 0x1E,0x83,0x0A,0xE0, /* 0x05 SiS_SpecialPhaseM */ 122 - 0x00,0x00,0x00,0x00, 123 - 0x00,0x00,0x00,0x00, 124 - 0x21,0xF0,0x7B,0xD6, /* 0x08 SiS_NTSCPhase2 */ 125 - 0x2A,0x09,0x86,0xE9, /* 0x09 SiS_PALPhase2 */ 126 - 0x21,0xE6,0xEF,0xA4, /* 0x0a SiS_PALMPhase2 */ 127 - 0x21,0xF6,0x94,0x46, /* 0x0b SiS_PALNPhase2 */ 128 - 0x1E,0x8B,0xA2,0xA7, 129 - 0x1E,0x83,0x0A,0xE0, /* 0x0d SiS_SpecialPhaseM */ 130 - 0x00,0x00,0x00,0x00, 131 - 0x00,0x00,0x00,0x00, 132 - 0x1e,0x8c,0x5c,0x7a, /* 0x10 SiS_SpecialPhase */ 133 - 0x25,0xd4,0xfd,0x5e /* 0x11 SiS_SpecialPhaseJ */ 134 - }; 135 - 136 - static const unsigned char SiS_HiTVGroup3_1[] = { 137 - 0x00, 0x14, 0x15, 0x25, 0x55, 0x15, 0x0b, 0x13, 138 - 0xb1, 0x41, 0x62, 0x62, 0xff, 0xf4, 0x45, 0xa6, 139 - 0x25, 0x2f, 0x67, 0xf6, 0xbf, 0xff, 0x8e, 0x20, 140 - 0xac, 0xda, 0x60, 0xfe, 0x6a, 0x9a, 0x06, 0x10, 141 - 0xd1, 0x04, 0x18, 0x0a, 0xff, 0x80, 0x00, 0x80, 142 - 0x3b, 0x77, 0x00, 0xef, 0xe0, 0x10, 0xb0, 0xe0, 143 - 0x10, 0x4f, 0x0f, 0x0f, 0x05, 0x0f, 0x08, 0x6e, 144 - 0x1a, 0x1f, 0x25, 0x2a, 0x4c, 0xaa, 0x01 145 - }; 146 - 147 - static const unsigned char SiS_HiTVGroup3_2[] = { 148 - 0x00, 0x14, 0x15, 0x25, 0x55, 0x15, 0x0b, 0x7a, 149 - 0x54, 0x41, 0xe7, 0xe7, 0xff, 0xf4, 0x45, 0xa6, 150 - 0x25, 0x2f, 0x67, 0xf6, 0xbf, 0xff, 0x8e, 0x20, 151 - 0xac, 0x6a, 0x60, 0x2b, 0x52, 0xcd, 0x61, 0x10, 152 - 0x51, 0x04, 0x18, 0x0a, 0x1f, 0x80, 0x00, 0x80, 153 - 0xff, 0xa4, 0x04, 0x2b, 0x94, 0x21, 0x72, 0x94, 154 - 0x26, 0x05, 0x01, 0x0f, 0xed, 0x0f, 0x0a, 0x64, 155 - 0x18, 0x1d, 0x23, 0x28, 0x4c, 0xaa, 0x01 156 - }; 157 - 158 - /* 301C / 302ELV extended Part2 TV registers (4 tap scaler) */ 159 - 160 - static const unsigned char SiS_Part2CLVX_1[] = { 161 - 0x00,0x00, 162 - 0x00,0x20,0x00,0x00,0x7F,0x20,0x02,0x7F,0x7D,0x20,0x04,0x7F,0x7D,0x1F,0x06,0x7E, 163 - 0x7C,0x1D,0x09,0x7E,0x7C,0x1B,0x0B,0x7E,0x7C,0x19,0x0E,0x7D,0x7C,0x17,0x11,0x7C, 164 - 0x7C,0x14,0x14,0x7C,0x7C,0x11,0x17,0x7C,0x7D,0x0E,0x19,0x7C,0x7E,0x0B,0x1B,0x7C, 165 - 0x7E,0x09,0x1D,0x7C,0x7F,0x06,0x1F,0x7C,0x7F,0x04,0x20,0x7D,0x00,0x02,0x20,0x7E 166 - }; 167 - 168 - static const unsigned char SiS_Part2CLVX_2[] = { 169 - 0x00,0x00, 170 - 0x00,0x20,0x00,0x00,0x7F,0x20,0x02,0x7F,0x7D,0x20,0x04,0x7F,0x7D,0x1F,0x06,0x7E, 171 - 0x7C,0x1D,0x09,0x7E,0x7C,0x1B,0x0B,0x7E,0x7C,0x19,0x0E,0x7D,0x7C,0x17,0x11,0x7C, 172 - 0x7C,0x14,0x14,0x7C,0x7C,0x11,0x17,0x7C,0x7D,0x0E,0x19,0x7C,0x7E,0x0B,0x1B,0x7C, 173 - 0x7E,0x09,0x1D,0x7C,0x7F,0x06,0x1F,0x7C,0x7F,0x04,0x20,0x7D,0x00,0x02,0x20,0x7E 174 - }; 175 - 176 - static const unsigned char SiS_Part2CLVX_3[] = { /* NTSC, 525i, 525p */ 177 - 0xE0,0x01, 178 - 0x04,0x1A,0x04,0x7E,0x03,0x1A,0x06,0x7D,0x01,0x1A,0x08,0x7D,0x00,0x19,0x0A,0x7D, 179 - 0x7F,0x19,0x0C,0x7C,0x7E,0x18,0x0E,0x7C,0x7E,0x17,0x10,0x7B,0x7D,0x15,0x12,0x7C, 180 - 0x7D,0x13,0x13,0x7D,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x7D,0x7C,0x0E,0x18,0x7E, 181 - 0x7D,0x0C,0x19,0x7E,0x7D,0x0A,0x19,0x00,0x7D,0x08,0x1A,0x01,0x7E,0x06,0x1A,0x02, 182 - 0x58,0x02, 183 - 0x07,0x14,0x07,0x7E,0x06,0x14,0x09,0x7D,0x05,0x14,0x0A,0x7D,0x04,0x13,0x0B,0x7E, 184 - 0x03,0x13,0x0C,0x7E,0x02,0x12,0x0D,0x7F,0x01,0x12,0x0E,0x7F,0x01,0x11,0x0F,0x7F, 185 - 0x00,0x10,0x10,0x00,0x7F,0x0F,0x11,0x01,0x7F,0x0E,0x12,0x01,0x7E,0x0D,0x12,0x03, 186 - 0x7E,0x0C,0x13,0x03,0x7E,0x0B,0x13,0x04,0x7E,0x0A,0x14,0x04,0x7D,0x09,0x14,0x06, 187 - 0x00,0x03, 188 - 0x09,0x0F,0x09,0x7F,0x08,0x0F,0x09,0x00,0x07,0x0F,0x0A,0x00,0x06,0x0F,0x0A,0x01, 189 - 0x06,0x0E,0x0B,0x01,0x05,0x0E,0x0B,0x02,0x04,0x0E,0x0C,0x02,0x04,0x0D,0x0C,0x03, 190 - 0x03,0x0D,0x0D,0x03,0x02,0x0C,0x0D,0x05,0x02,0x0C,0x0E,0x04,0x01,0x0B,0x0E,0x06, 191 - 0x01,0x0B,0x0E,0x06,0x00,0x0A,0x0F,0x07,0x00,0x0A,0x0F,0x07,0x00,0x09,0x0F,0x08, 192 - 0xFF,0xFF 193 - }; 194 - 195 - static const unsigned char SiS_Part2CLVX_4[] = { /* PAL */ 196 - 0x58,0x02, 197 - 0x05,0x19,0x05,0x7D,0x03,0x19,0x06,0x7E,0x02,0x19,0x08,0x7D,0x01,0x18,0x0A,0x7D, 198 - 0x00,0x18,0x0C,0x7C,0x7F,0x17,0x0E,0x7C,0x7E,0x16,0x0F,0x7D,0x7E,0x14,0x11,0x7D, 199 - 0x7D,0x13,0x13,0x7D,0x7D,0x11,0x14,0x7E,0x7D,0x0F,0x16,0x7E,0x7D,0x0E,0x17,0x7E, 200 - 0x7D,0x0C,0x18,0x7F,0x7D,0x0A,0x18,0x01,0x7D,0x08,0x19,0x02,0x7D,0x06,0x19,0x04, 201 - 0x00,0x03, 202 - 0x08,0x12,0x08,0x7E,0x07,0x12,0x09,0x7E,0x06,0x12,0x0A,0x7E,0x05,0x11,0x0B,0x7F, 203 - 0x04,0x11,0x0C,0x7F,0x03,0x11,0x0C,0x00,0x03,0x10,0x0D,0x00,0x02,0x0F,0x0E,0x01, 204 - 0x01,0x0F,0x0F,0x01,0x01,0x0E,0x0F,0x02,0x00,0x0D,0x10,0x03,0x7F,0x0C,0x11,0x04, 205 - 0x7F,0x0C,0x11,0x04,0x7F,0x0B,0x11,0x05,0x7E,0x0A,0x12,0x06,0x7E,0x09,0x12,0x07, 206 - 0x40,0x02, 207 - 0x04,0x1A,0x04,0x7E,0x02,0x1B,0x05,0x7E,0x01,0x1A,0x07,0x7E,0x00,0x1A,0x09,0x7D, 208 - 0x7F,0x19,0x0B,0x7D,0x7E,0x18,0x0D,0x7D,0x7D,0x17,0x10,0x7C,0x7D,0x15,0x12,0x7C, 209 - 0x7C,0x14,0x14,0x7C,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x7D,0x7C,0x0D,0x18,0x7F, 210 - 0x7D,0x0B,0x19,0x7F,0x7D,0x09,0x1A,0x00,0x7D,0x07,0x1A,0x02,0x7E,0x05,0x1B,0x02, 211 - 0xFF,0xFF 212 - }; 213 - 214 - static const unsigned char SiS_Part2CLVX_5[] = { /* 750p */ 215 - 0x00,0x03, 216 - 0x05,0x19,0x05,0x7D,0x03,0x19,0x06,0x7E,0x02,0x19,0x08,0x7D,0x01,0x18,0x0A,0x7D, 217 - 0x00,0x18,0x0C,0x7C,0x7F,0x17,0x0E,0x7C,0x7E,0x16,0x0F,0x7D,0x7E,0x14,0x11,0x7D, 218 - 0x7D,0x13,0x13,0x7D,0x7D,0x11,0x14,0x7E,0x7D,0x0F,0x16,0x7E,0x7D,0x0E,0x17,0x7E, 219 - 0x7D,0x0C,0x18,0x7F,0x7D,0x0A,0x18,0x01,0x7D,0x08,0x19,0x02,0x7D,0x06,0x19,0x04, 220 - 0xFF,0xFF 221 - }; 222 - 223 - static const unsigned char SiS_Part2CLVX_6[] = { /* 1080i */ 224 - 0x00,0x04, 225 - 0x04,0x1A,0x04,0x7E,0x02,0x1B,0x05,0x7E,0x01,0x1A,0x07,0x7E,0x00,0x1A,0x09,0x7D, 226 - 0x7F,0x19,0x0B,0x7D,0x7E,0x18,0x0D,0x7D,0x7D,0x17,0x10,0x7C,0x7D,0x15,0x12,0x7C, 227 - 0x7C,0x14,0x14,0x7C,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x7D,0x7C,0x0D,0x18,0x7F, 228 - 0x7D,0x0B,0x19,0x7F,0x7D,0x09,0x1A,0x00,0x7D,0x07,0x1A,0x02,0x7E,0x05,0x1B,0x02, 229 - 0xFF,0xFF, 230 - }; 231 - 232 - #ifdef CONFIG_FB_SIS_315 233 - /* 661 et al LCD data structure (2.03.00) */ 234 - static const unsigned char SiS_LCDStruct661[] = { 235 - /* 1024x768 */ 236 - /* type|CR37| HDE | VDE | HT | VT | hss | hse */ 237 - 0x02,0xC0,0x00,0x04,0x00,0x03,0x40,0x05,0x26,0x03,0x10,0x00,0x88, 238 - 0x00,0x02,0x00,0x06,0x00,0x41,0x5A,0x64,0x00,0x00,0x00,0x00,0x04, 239 - /* | vss | vse |clck| clock |CRT2DataP|CRT2DataP|idx */ 240 - /* VESA non-VESA noscale */ 241 - /* 1280x1024 */ 242 - 0x03,0xC0,0x00,0x05,0x00,0x04,0x98,0x06,0x2A,0x04,0x30,0x00,0x70, 243 - 0x00,0x01,0x00,0x03,0x00,0x6C,0xF8,0x2F,0x00,0x00,0x00,0x00,0x08, 244 - /* 1400x1050 */ 245 - 0x09,0x20,0x78,0x05,0x1A,0x04,0x98,0x06,0x2A,0x04,0x18,0x00,0x38, 246 - 0x00,0x01,0x00,0x03,0x00,0x6C,0xF8,0x2F,0x00,0x00,0x00,0x00,0x09, 247 - /* 1600x1200 */ 248 - 0x0B,0xE0,0x40,0x06,0xB0,0x04,0x70,0x08,0xE2,0x04,0x40,0x00,0xC0, 249 - 0x00,0x01,0x00,0x03,0x00,0xA2,0x70,0x24,0x00,0x00,0x00,0x00,0x0A, 250 - /* 1280x768 (_2) */ 251 - 0x0A,0xE0,0x00,0x05,0x00,0x03,0x7C,0x06,0x26,0x03,0x30,0x00,0x70, 252 - 0x00,0x03,0x00,0x06,0x00,0x4D,0xC8,0x48,0x00,0x00,0x00,0x00,0x06, 253 - /* 1280x720 */ 254 - 0x0E,0xE0,0x00,0x05,0xD0,0x02,0x80,0x05,0x26,0x03,0x10,0x00,0x20, 255 - 0x00,0x01,0x00,0x06,0x00,0x45,0x9C,0x62,0x00,0x00,0x00,0x00,0x05, 256 - /* 1280x800 (_2) */ 257 - 0x0C,0xE0,0x00,0x05,0x20,0x03,0x10,0x06,0x2C,0x03,0x30,0x00,0x70, 258 - 0x00,0x04,0x00,0x03,0x00,0x49,0xCE,0x1E,0x00,0x00,0x00,0x00,0x09, 259 - /* 1680x1050 */ 260 - 0x0D,0xE0,0x90,0x06,0x1A,0x04,0x6C,0x07,0x2A,0x04,0x1A,0x00,0x4C, 261 - 0x00,0x03,0x00,0x06,0x00,0x79,0xBE,0x44,0x00,0x00,0x00,0x00,0x06, 262 - /* 1280x800_3 */ 263 - 0x0C,0xE0,0x00,0x05,0x20,0x03,0xAA,0x05,0x2E,0x03,0x30,0x00,0x50, 264 - 0x00,0x04,0x00,0x03,0x00,0x47,0xA9,0x10,0x00,0x00,0x00,0x00,0x07, 265 - /* 800x600 */ 266 - 0x01,0xC0,0x20,0x03,0x58,0x02,0x20,0x04,0x74,0x02,0x2A,0x00,0x80, 267 - 0x00,0x06,0x00,0x04,0x00,0x28,0x63,0x4B,0x00,0x00,0x00,0x00,0x00, 268 - /* 1280x854 */ 269 - 0x08,0xE0,0x00,0x05,0x56,0x03,0x80,0x06,0x5d,0x03,0x10,0x00,0x70, 270 - 0x00,0x01,0x00,0x03,0x00,0x54,0x75,0x13,0x00,0x00,0x00,0x00,0x08 271 - }; 272 - #endif 273 - 274 - #ifdef CONFIG_FB_SIS_300 275 - static unsigned char SiS300_TrumpionData[14][80] = { 276 - { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02, 277 - 0x20,0x03,0x0B,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x10,0x00,0x00,0x04,0x23, 278 - 0x00,0x00,0x03,0x28,0x03,0x10,0x05,0x08,0x40,0x10,0x00,0x10,0x04,0x23,0x00,0x23, 279 - 0x03,0x11,0x60,0xBC,0x01,0xFF,0x03,0xFF,0x19,0x01,0x00,0x05,0x09,0x04,0x04,0x05, 280 - 0x04,0x0C,0x09,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5A,0x01,0xBE,0x01,0x00 }, 281 - { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x27,0x00,0x80,0x02, 282 - 0x20,0x03,0x07,0x00,0x5E,0x01,0x0D,0x02,0x60,0x0C,0x30,0x11,0x00,0x00,0x04,0x23, 283 - 0x00,0x00,0x03,0x80,0x03,0x28,0x06,0x08,0x40,0x11,0x00,0x11,0x04,0x23,0x00,0x23, 284 - 0x03,0x11,0x60,0x90,0x01,0xFF,0x0F,0xF4,0x19,0x01,0x00,0x05,0x01,0x00,0x04,0x05, 285 - 0x04,0x0C,0x02,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEC,0x57,0x01,0xBE,0x01,0x00 }, 286 - { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x8A,0x00,0xD8,0x02, 287 - 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23, 288 - 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23, 289 - 0x03,0x11,0x60,0xD9,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05, 290 - 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x59,0x01,0xBE,0x01,0x00 }, 291 - { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x72,0x00,0xD8,0x02, 292 - 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23, 293 - 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23, 294 - 0x03,0x11,0x60,0xDA,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05, 295 - 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 }, 296 - { 0x02,0x0A,0x02,0x00,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02, 297 - 0x20,0x03,0x16,0x00,0xE0,0x01,0x0D,0x02,0x60,0x0C,0x30,0x98,0x00,0x00,0x04,0x23, 298 - 0x00,0x01,0x03,0x45,0x03,0x48,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x23,0x00,0x23, 299 - 0x03,0x11,0x60,0xF4,0x01,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x05,0x01,0x00,0x05,0x05, 300 - 0x04,0x0C,0x08,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 }, 301 - { 0x02,0x0A,0x02,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0xBF,0x00,0x20,0x03, 302 - 0x20,0x04,0x0D,0x00,0x58,0x02,0x71,0x02,0x80,0x0C,0x30,0x9A,0x00,0xFA,0x03,0x1D, 303 - 0x00,0x01,0x03,0x22,0x03,0x28,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x1D,0x00,0x1D, 304 - 0x03,0x11,0x60,0x39,0x03,0x40,0x05,0xF4,0x18,0x07,0x02,0x06,0x04,0x01,0x06,0x0B, 305 - 0x02,0x0A,0x20,0x19,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 }, 306 - { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0xEF,0x00,0x00,0x04, 307 - 0x40,0x05,0x13,0x00,0x00,0x03,0x26,0x03,0x88,0x0C,0x30,0x90,0x00,0x00,0x04,0x23, 308 - 0x00,0x01,0x03,0x24,0x03,0x28,0x06,0x08,0x40,0x90,0x00,0x90,0x04,0x23,0x00,0x23, 309 - 0x03,0x11,0x60,0x40,0x05,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x08,0x01,0x00,0x08,0x01, 310 - 0x00,0x08,0x01,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 }, 311 - /* variant 2 */ 312 - { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02, 313 - 0x20,0x03,0x15,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x18,0x00,0x00,0x04,0x23, 314 - 0x00,0x01,0x03,0x44,0x03,0x28,0x06,0x08,0x40,0x18,0x00,0x18,0x04,0x23,0x00,0x23, 315 - 0x03,0x11,0x60,0xA6,0x01,0xFF,0x03,0xFF,0x19,0x01,0x00,0x05,0x13,0x04,0x04,0x05, 316 - 0x04,0x0C,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 }, 317 - { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02, 318 - 0x20,0x03,0x15,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x18,0x00,0x00,0x04,0x23, 319 - 0x00,0x01,0x03,0x44,0x03,0x28,0x06,0x08,0x40,0x18,0x00,0x18,0x04,0x23,0x00,0x23, 320 - 0x03,0x11,0x60,0xA6,0x01,0xFF,0x03,0xFF,0x19,0x01,0x00,0x05,0x13,0x04,0x04,0x05, 321 - 0x04,0x0C,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 }, 322 - { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x8A,0x00,0xD8,0x02, 323 - 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23, 324 - 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23, 325 - 0x03,0x11,0x60,0xDA,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05, 326 - 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 }, 327 - { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x72,0x00,0xD8,0x02, 328 - 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23, 329 - 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23, 330 - 0x03,0x11,0x60,0xDA,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05, 331 - 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 }, 332 - { 0x02,0x0A,0x02,0x00,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02, 333 - 0x20,0x03,0x16,0x00,0xE0,0x01,0x0D,0x02,0x60,0x0C,0x30,0x98,0x00,0x00,0x04,0x23, 334 - 0x00,0x01,0x03,0x45,0x03,0x48,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x23,0x00,0x23, 335 - 0x03,0x11,0x60,0xF4,0x01,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x05,0x01,0x00,0x05,0x05, 336 - 0x04,0x0C,0x08,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEA,0x58,0x01,0xBE,0x01,0x00 }, 337 - { 0x02,0x0A,0x02,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0xBF,0x00,0x20,0x03, 338 - 0x20,0x04,0x0D,0x00,0x58,0x02,0x71,0x02,0x80,0x0C,0x30,0x9A,0x00,0xFA,0x03,0x1D, 339 - 0x00,0x01,0x03,0x22,0x03,0x28,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x1D,0x00,0x1D, 340 - 0x03,0x11,0x60,0x39,0x03,0x40,0x05,0xF4,0x18,0x07,0x02,0x06,0x04,0x01,0x06,0x0B, 341 - 0x02,0x0A,0x20,0x19,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEA,0x58,0x01,0xBE,0x01,0x00 }, 342 - { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0xEF,0x00,0x00,0x04, 343 - 0x40,0x05,0x13,0x00,0x00,0x03,0x26,0x03,0x88,0x0C,0x30,0x90,0x00,0x00,0x04,0x23, 344 - 0x00,0x01,0x03,0x24,0x03,0x28,0x06,0x08,0x40,0x90,0x00,0x90,0x04,0x23,0x00,0x23, 345 - 0x03,0x11,0x60,0x40,0x05,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x08,0x01,0x00,0x08,0x01, 346 - 0x00,0x08,0x01,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEA,0x58,0x01,0xBE,0x01,0x00 } 347 - }; 348 - #endif 349 - 350 69 void SiS_UnLockCRT2(struct SiS_Private *SiS_Pr); 351 70 void SiS_EnableCRT2(struct SiS_Private *SiS_Pr); 352 71 unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); ··· 94 375 void SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, 95 376 unsigned char orval,unsigned short andval); 96 377 #ifdef CONFIG_FB_SIS_315 97 - static void SiS_Chrontel701xOn(struct SiS_Private *SiS_Pr); 98 - static void SiS_Chrontel701xOff(struct SiS_Private *SiS_Pr); 99 - static void SiS_ChrontelInitTVVSync(struct SiS_Private *SiS_Pr); 100 - static void SiS_ChrontelDoSomething1(struct SiS_Private *SiS_Pr); 101 378 void SiS_Chrontel701xBLOn(struct SiS_Private *SiS_Pr); 102 379 void SiS_Chrontel701xBLOff(struct SiS_Private *SiS_Pr); 103 380 #endif /* 315 */ 104 381 105 382 #ifdef CONFIG_FB_SIS_300 106 - static bool SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *dataptr); 107 383 void SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo); 108 384 #endif 109 385 ··· 107 393 unsigned short SiS_HandleDDC(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, 108 394 unsigned short adaptnum, unsigned short DDCdatatype, 109 395 unsigned char *buffer, unsigned int VBFlags2); 110 - 111 - static unsigned short SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, 112 - int VGAEngine, unsigned short adaptnum, unsigned short DDCdatatype, 113 - bool checkcr32, unsigned int VBFlags2); 114 - static unsigned short SiS_ProbeDDC(struct SiS_Private *SiS_Pr); 115 - static unsigned short SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, 116 - unsigned char *buffer); 117 - static void SiS_SetSwitchDDC2(struct SiS_Private *SiS_Pr); 118 - static unsigned short SiS_SetStart(struct SiS_Private *SiS_Pr); 119 - static unsigned short SiS_SetStop(struct SiS_Private *SiS_Pr); 120 - static unsigned short SiS_SetSCLKLow(struct SiS_Private *SiS_Pr); 121 - static unsigned short SiS_SetSCLKHigh(struct SiS_Private *SiS_Pr); 122 - static unsigned short SiS_ReadDDC2Data(struct SiS_Private *SiS_Pr); 123 - static unsigned short SiS_WriteDDC2Data(struct SiS_Private *SiS_Pr, unsigned short tempax); 124 - static unsigned short SiS_CheckACK(struct SiS_Private *SiS_Pr); 125 - static unsigned short SiS_WriteDABDDC(struct SiS_Private *SiS_Pr); 126 - static unsigned short SiS_PrepareReadDDC(struct SiS_Private *SiS_Pr); 127 - static unsigned short SiS_PrepareDDC(struct SiS_Private *SiS_Pr); 128 - static void SiS_SendACK(struct SiS_Private *SiS_Pr, unsigned short yesno); 129 - static unsigned short SiS_DoProbeDDC(struct SiS_Private *SiS_Pr); 130 - 131 - #ifdef CONFIG_FB_SIS_300 132 - static void SiS_OEM300Setting(struct SiS_Private *SiS_Pr, 133 - unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefTabindex); 134 - static void SetOEMLCDData2(struct SiS_Private *SiS_Pr, 135 - unsigned short ModeNo, unsigned short ModeIdIndex,unsigned short RefTableIndex); 136 - #endif 137 - #ifdef CONFIG_FB_SIS_315 138 - static void SiS_OEM310Setting(struct SiS_Private *SiS_Pr, 139 - unsigned short ModeNo,unsigned short ModeIdIndex, unsigned short RRTI); 140 - static void SiS_OEM661Setting(struct SiS_Private *SiS_Pr, 141 - unsigned short ModeNo,unsigned short ModeIdIndex, unsigned short RRTI); 142 - static void SiS_FinalizeLCD(struct SiS_Private *, unsigned short, unsigned short); 143 - #endif 144 396 145 397 extern void SiS_DisplayOff(struct SiS_Private *SiS_Pr); 146 398 extern void SiS_DisplayOn(struct SiS_Private *SiS_Pr);
+131
drivers/video/fbdev/sis/sis.h
··· 28 28 29 29 #include "vgatypes.h" 30 30 #include "vstruct.h" 31 + #include "init.h" 31 32 32 33 #define VER_MAJOR 1 33 34 #define VER_MINOR 8 ··· 322 321 u16 SiS_GetRegShort(SISIOADDRESS); 323 322 u32 SiS_GetRegLong(SISIOADDRESS); 324 323 324 + /* Chrontel TV, DDC and DPMS functions */ 325 + /* from init.c */ 326 + bool SiSInitPtr(struct SiS_Private *SiS_Pr); 327 + unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, 328 + int VDisplay, int Depth, bool FSTN, 329 + unsigned short CustomT, int LCDwith, int LCDheight, 330 + unsigned int VBFlags2); 331 + unsigned short SiS_GetModeID_TV(int VGAEngine, unsigned int VBFlags, int HDisplay, 332 + int VDisplay, int Depth, unsigned int VBFlags2); 333 + unsigned short SiS_GetModeID_VGA2(int VGAEngine, unsigned int VBFlags, int HDisplay, 334 + int VDisplay, int Depth, unsigned int VBFlags2); 335 + 336 + void SiS_DisplayOn(struct SiS_Private *SiS_Pr); 337 + void SiS_DisplayOff(struct SiS_Private *SiS_Pr); 338 + void SiSRegInit(struct SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr); 339 + void SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable); 340 + void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable); 341 + unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 342 + unsigned short ModeIdIndex); 343 + bool SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr); 344 + 345 + bool SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, 346 + unsigned short *ModeIdIndex); 347 + unsigned short SiS_GetModePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 348 + unsigned short ModeIdIndex); 349 + unsigned short SiS_GetRefCRTVCLK(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); 350 + unsigned short SiS_GetRefCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide); 351 + unsigned short SiS_GetColorDepth(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 352 + unsigned short ModeIdIndex); 353 + unsigned short SiS_GetOffset(struct SiS_Private *SiS_Pr,unsigned short ModeNo, 354 + unsigned short ModeIdIndex, unsigned short RRTI); 355 + #ifdef CONFIG_FB_SIS_300 356 + void SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *idx1, 357 + unsigned short *idx2); 358 + unsigned short SiS_GetFIFOThresholdB300(unsigned short idx1, unsigned short idx2); 359 + unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index); 360 + #endif 361 + void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 362 + bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 363 + void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); 364 + void SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 365 + unsigned short ModeIdIndex); 366 + void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres, 367 + int yres, struct fb_var_screeninfo *var, bool writeres); 368 + 369 + /* From init301.c: */ 370 + extern void SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 371 + unsigned short ModeIdIndex, int chkcrt2mode); 372 + extern void SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 373 + unsigned short ModeIdIndex); 374 + extern void SiS_SetYPbPr(struct SiS_Private *SiS_Pr); 375 + extern void SiS_SetTVMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 376 + unsigned short ModeIdIndex); 377 + extern void SiS_UnLockCRT2(struct SiS_Private *SiS_Pr); 378 + extern void SiS_DisableBridge(struct SiS_Private *); 379 + extern bool SiS_SetCRT2Group(struct SiS_Private *, unsigned short); 380 + extern unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 381 + unsigned short ModeIdIndex); 382 + extern void SiS_WaitRetrace1(struct SiS_Private *SiS_Pr); 383 + extern unsigned short SiS_GetResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 384 + unsigned short ModeIdIndex); 385 + extern unsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempax); 386 + extern unsigned short SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 387 + unsigned short ModeIdIndex, unsigned short RRTI); 388 + extern bool SiS_IsVAMode(struct SiS_Private *); 389 + extern bool SiS_IsDualEdge(struct SiS_Private *); 390 + 391 + #ifdef CONFIG_FB_SIS_300 392 + extern unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg); 393 + extern void sisfb_write_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg, 394 + unsigned int val); 395 + #endif 396 + #ifdef CONFIG_FB_SIS_315 397 + extern void sisfb_write_nbridge_pci_byte(struct SiS_Private *SiS_Pr, int reg, 398 + unsigned char val); 399 + extern unsigned int sisfb_read_mio_pci_word(struct SiS_Private *SiS_Pr, int reg); 400 + #endif 401 + 402 + 325 403 /* MMIO access macros */ 326 404 #define MMIO_IN8(base, offset) readb((base+offset)) 327 405 #define MMIO_IN16(base, offset) readw((base+offset)) ··· 662 582 663 583 struct sis_video_info *next; 664 584 }; 585 + 586 + /* from sis_accel.c */ 587 + extern void fbcon_sis_fillrect(struct fb_info *info, 588 + const struct fb_fillrect *rect); 589 + extern void fbcon_sis_copyarea(struct fb_info *info, 590 + const struct fb_copyarea *area); 591 + extern int fbcon_sis_sync(struct fb_info *info); 592 + 593 + /* Internal 2D accelerator functions */ 594 + extern int sisfb_initaccel(struct sis_video_info *ivideo); 595 + extern void sisfb_syncaccel(struct sis_video_info *ivideo); 596 + 597 + /* Internal general routines */ 598 + #ifdef CONFIG_FB_SIS_300 599 + unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg); 600 + void sisfb_write_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg, unsigned int val); 601 + unsigned int sisfb_read_lpc_pci_dword(struct SiS_Private *SiS_Pr, int reg); 602 + #endif 603 + #ifdef CONFIG_FB_SIS_315 604 + void sisfb_write_nbridge_pci_byte(struct SiS_Private *SiS_Pr, int reg, unsigned char val); 605 + unsigned int sisfb_read_mio_pci_word(struct SiS_Private *SiS_Pr, int reg); 606 + #endif 607 + 608 + /* SiS-specific exported functions */ 609 + void sis_malloc(struct sis_memreq *req); 610 + void sis_malloc_new(struct pci_dev *pdev, struct sis_memreq *req); 611 + void sis_free(u32 base); 612 + void sis_free_new(struct pci_dev *pdev, u32 base); 613 + 614 + /* Routines from init.c/init301.c */ 615 + extern unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, 616 + int VDisplay, int Depth, bool FSTN, unsigned short CustomT, 617 + int LCDwith, int LCDheight, unsigned int VBFlags2); 618 + extern unsigned short SiS_GetModeID_TV(int VGAEngine, unsigned int VBFlags, int HDisplay, 619 + int VDisplay, int Depth, unsigned int VBFlags2); 620 + extern unsigned short SiS_GetModeID_VGA2(int VGAEngine, unsigned int VBFlags, int HDisplay, 621 + int VDisplay, int Depth, unsigned int VBFlags2); 622 + extern void SiSRegInit(struct SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr); 623 + extern bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 624 + extern void SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable); 625 + extern void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable); 626 + 627 + extern bool SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr); 628 + 629 + extern bool sisfb_gettotalfrommode(struct SiS_Private *SiS_Pr, unsigned char modeno, 630 + int *htotal, int *vtotal, unsigned char rateindex); 631 + extern int sisfb_mode_rate_to_dclock(struct SiS_Private *SiS_Pr, 632 + unsigned char modeno, unsigned char rateindex); 633 + extern int sisfb_mode_rate_to_ddata(struct SiS_Private *SiS_Pr, unsigned char modeno, 634 + unsigned char rateindex, struct fb_var_screeninfo *var); 635 + 665 636 666 637 #endif
+51
drivers/video/fbdev/sis/sis_main.c
··· 56 56 57 57 #include "sis.h" 58 58 #include "sis_main.h" 59 + #include "init301.h" 59 60 60 61 #if !defined(CONFIG_FB_SIS_300) && !defined(CONFIG_FB_SIS_315) 61 62 #warning Neither CONFIG_FB_SIS_300 nor CONFIG_FB_SIS_315 is set 62 63 #warning sisfb will not work! 63 64 #endif 64 65 66 + /* ---------------------- Prototypes ------------------------- */ 67 + 68 + /* Interface used by the world */ 69 + #ifndef MODULE 70 + static int sisfb_setup(char *options); 71 + #endif 72 + 73 + /* Interface to the low level console driver */ 74 + static int sisfb_init(void); 75 + 76 + /* fbdev routines */ 77 + static int sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, 78 + struct fb_info *info); 79 + 80 + static int sisfb_ioctl(struct fb_info *info, unsigned int cmd, 81 + unsigned long arg); 82 + static int sisfb_set_par(struct fb_info *info); 83 + static int sisfb_blank(int blank, 84 + struct fb_info *info); 85 + 65 86 static void sisfb_handle_command(struct sis_video_info *ivideo, 66 87 struct sisfb_cmd *sisfb_command); 88 + 89 + static void sisfb_search_mode(char *name, bool quiet); 90 + static int sisfb_validate_mode(struct sis_video_info *ivideo, int modeindex, u32 vbflags); 91 + static u8 sisfb_search_refresh_rate(struct sis_video_info *ivideo, unsigned int rate, 92 + int index); 93 + static int sisfb_setcolreg(unsigned regno, unsigned red, unsigned green, 94 + unsigned blue, unsigned transp, 95 + struct fb_info *fb_info); 96 + static int sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive, 97 + struct fb_info *info); 98 + static void sisfb_pre_setmode(struct sis_video_info *ivideo); 99 + static void sisfb_post_setmode(struct sis_video_info *ivideo); 100 + static bool sisfb_CheckVBRetrace(struct sis_video_info *ivideo); 101 + static bool sisfbcheckvretracecrt2(struct sis_video_info *ivideo); 102 + static bool sisfbcheckvretracecrt1(struct sis_video_info *ivideo); 103 + static bool sisfb_bridgeisslave(struct sis_video_info *ivideo); 104 + static void sisfb_detect_VB_connect(struct sis_video_info *ivideo); 105 + static void sisfb_get_VB_type(struct sis_video_info *ivideo); 106 + static void sisfb_set_TVxposoffset(struct sis_video_info *ivideo, int val); 107 + static void sisfb_set_TVyposoffset(struct sis_video_info *ivideo, int val); 108 + 109 + /* Internal heap routines */ 110 + static int sisfb_heap_init(struct sis_video_info *ivideo); 111 + static struct SIS_OH * sisfb_poh_new_node(struct SIS_HEAP *memheap); 112 + static struct SIS_OH * sisfb_poh_allocate(struct SIS_HEAP *memheap, u32 size); 113 + static void sisfb_delete_node(struct SIS_OH *poh); 114 + static void sisfb_insert_node(struct SIS_OH *pohList, struct SIS_OH *poh); 115 + static struct SIS_OH * sisfb_poh_free(struct SIS_HEAP *memheap, u32 base); 116 + static void sisfb_free_node(struct SIS_HEAP *memheap, struct SIS_OH *poh); 117 + 67 118 68 119 /* ------------------ Internal helper routines ----------------- */ 69 120
-117
drivers/video/fbdev/sis/sis_main.h
··· 661 661 } 662 662 }; 663 663 664 - /* ---------------------- Prototypes ------------------------- */ 665 - 666 - /* Interface used by the world */ 667 - #ifndef MODULE 668 - static int sisfb_setup(char *options); 669 664 #endif 670 - 671 - /* Interface to the low level console driver */ 672 - static int sisfb_init(void); 673 - 674 - /* fbdev routines */ 675 - static int sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, 676 - struct fb_info *info); 677 - 678 - static int sisfb_ioctl(struct fb_info *info, unsigned int cmd, 679 - unsigned long arg); 680 - static int sisfb_set_par(struct fb_info *info); 681 - static int sisfb_blank(int blank, 682 - struct fb_info *info); 683 - extern void fbcon_sis_fillrect(struct fb_info *info, 684 - const struct fb_fillrect *rect); 685 - extern void fbcon_sis_copyarea(struct fb_info *info, 686 - const struct fb_copyarea *area); 687 - extern int fbcon_sis_sync(struct fb_info *info); 688 - 689 - /* Internal 2D accelerator functions */ 690 - extern int sisfb_initaccel(struct sis_video_info *ivideo); 691 - extern void sisfb_syncaccel(struct sis_video_info *ivideo); 692 - 693 - /* Internal general routines */ 694 - static void sisfb_search_mode(char *name, bool quiet); 695 - static int sisfb_validate_mode(struct sis_video_info *ivideo, int modeindex, u32 vbflags); 696 - static u8 sisfb_search_refresh_rate(struct sis_video_info *ivideo, unsigned int rate, 697 - int index); 698 - static int sisfb_setcolreg(unsigned regno, unsigned red, unsigned green, 699 - unsigned blue, unsigned transp, 700 - struct fb_info *fb_info); 701 - static int sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive, 702 - struct fb_info *info); 703 - static void sisfb_pre_setmode(struct sis_video_info *ivideo); 704 - static void sisfb_post_setmode(struct sis_video_info *ivideo); 705 - static bool sisfb_CheckVBRetrace(struct sis_video_info *ivideo); 706 - static bool sisfbcheckvretracecrt2(struct sis_video_info *ivideo); 707 - static bool sisfbcheckvretracecrt1(struct sis_video_info *ivideo); 708 - static bool sisfb_bridgeisslave(struct sis_video_info *ivideo); 709 - static void sisfb_detect_VB_connect(struct sis_video_info *ivideo); 710 - static void sisfb_get_VB_type(struct sis_video_info *ivideo); 711 - static void sisfb_set_TVxposoffset(struct sis_video_info *ivideo, int val); 712 - static void sisfb_set_TVyposoffset(struct sis_video_info *ivideo, int val); 713 - #ifdef CONFIG_FB_SIS_300 714 - unsigned int sisfb_read_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg); 715 - void sisfb_write_nbridge_pci_dword(struct SiS_Private *SiS_Pr, int reg, unsigned int val); 716 - unsigned int sisfb_read_lpc_pci_dword(struct SiS_Private *SiS_Pr, int reg); 717 - #endif 718 - #ifdef CONFIG_FB_SIS_315 719 - void sisfb_write_nbridge_pci_byte(struct SiS_Private *SiS_Pr, int reg, unsigned char val); 720 - unsigned int sisfb_read_mio_pci_word(struct SiS_Private *SiS_Pr, int reg); 721 - #endif 722 - 723 - /* SiS-specific exported functions */ 724 - void sis_malloc(struct sis_memreq *req); 725 - void sis_malloc_new(struct pci_dev *pdev, struct sis_memreq *req); 726 - void sis_free(u32 base); 727 - void sis_free_new(struct pci_dev *pdev, u32 base); 728 - 729 - /* Internal heap routines */ 730 - static int sisfb_heap_init(struct sis_video_info *ivideo); 731 - static struct SIS_OH * sisfb_poh_new_node(struct SIS_HEAP *memheap); 732 - static struct SIS_OH * sisfb_poh_allocate(struct SIS_HEAP *memheap, u32 size); 733 - static void sisfb_delete_node(struct SIS_OH *poh); 734 - static void sisfb_insert_node(struct SIS_OH *pohList, struct SIS_OH *poh); 735 - static struct SIS_OH * sisfb_poh_free(struct SIS_HEAP *memheap, u32 base); 736 - static void sisfb_free_node(struct SIS_HEAP *memheap, struct SIS_OH *poh); 737 - 738 - /* Routines from init.c/init301.c */ 739 - extern unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, 740 - int VDisplay, int Depth, bool FSTN, unsigned short CustomT, 741 - int LCDwith, int LCDheight, unsigned int VBFlags2); 742 - extern unsigned short SiS_GetModeID_TV(int VGAEngine, unsigned int VBFlags, int HDisplay, 743 - int VDisplay, int Depth, unsigned int VBFlags2); 744 - extern unsigned short SiS_GetModeID_VGA2(int VGAEngine, unsigned int VBFlags, int HDisplay, 745 - int VDisplay, int Depth, unsigned int VBFlags2); 746 - extern void SiSRegInit(struct SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr); 747 - extern bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 748 - extern void SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable); 749 - extern void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable); 750 - 751 - extern bool SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr); 752 - 753 - extern bool sisfb_gettotalfrommode(struct SiS_Private *SiS_Pr, unsigned char modeno, 754 - int *htotal, int *vtotal, unsigned char rateindex); 755 - extern int sisfb_mode_rate_to_dclock(struct SiS_Private *SiS_Pr, 756 - unsigned char modeno, unsigned char rateindex); 757 - extern int sisfb_mode_rate_to_ddata(struct SiS_Private *SiS_Pr, unsigned char modeno, 758 - unsigned char rateindex, struct fb_var_screeninfo *var); 759 - 760 - /* Chrontel TV, DDC and DPMS functions */ 761 - extern unsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short reg); 762 - extern void SiS_SetCH700x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 763 - extern unsigned short SiS_GetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg); 764 - extern void SiS_SetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val); 765 - extern void SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, 766 - unsigned char myor, unsigned char myand); 767 - extern void SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime); 768 - extern void SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo); 769 - extern unsigned short SiS_HandleDDC(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, 770 - unsigned short adaptnum, unsigned short DDCdatatype, unsigned char *buffer, 771 - unsigned int VBFlags2); 772 - extern unsigned short SiS_ReadDDC1Bit(struct SiS_Private *SiS_Pr); 773 - #ifdef CONFIG_FB_SIS_315 774 - extern void SiS_Chrontel701xBLOn(struct SiS_Private *SiS_Pr); 775 - extern void SiS_Chrontel701xBLOff(struct SiS_Private *SiS_Pr); 776 - #endif 777 - extern void SiS_SiS30xBLOn(struct SiS_Private *SiS_Pr); 778 - extern void SiS_SiS30xBLOff(struct SiS_Private *SiS_Pr); 779 - #endif 780 - 781 -
+22 -37
drivers/video/fbdev/smscufx.c
··· 1293 1293 * Assumes no active clients have framebuffer open */ 1294 1294 static int ufx_realloc_framebuffer(struct ufx_data *dev, struct fb_info *info) 1295 1295 { 1296 - int retval = -ENOMEM; 1297 1296 int old_len = info->fix.smem_len; 1298 1297 int new_len; 1299 1298 unsigned char *old_fb = info->screen_base; ··· 1307 1308 * Alloc system memory for virtual framebuffer 1308 1309 */ 1309 1310 new_fb = vmalloc(new_len); 1310 - if (!new_fb) { 1311 - pr_err("Virtual framebuffer alloc failed"); 1312 - goto error; 1313 - } 1311 + if (!new_fb) 1312 + return -ENOMEM; 1314 1313 1315 1314 if (info->screen_base) { 1316 1315 memcpy(new_fb, old_fb, old_len); ··· 1320 1323 info->fix.smem_start = (unsigned long) new_fb; 1321 1324 info->flags = smscufx_info_flags; 1322 1325 } 1323 - 1324 - retval = 0; 1325 - 1326 - error: 1327 - return retval; 1326 + return 0; 1328 1327 } 1329 1328 1330 1329 /* sets up I2C Controller for 100 Kbps, std. speed, 7-bit addr, master, ··· 1613 1620 { 1614 1621 struct usb_device *usbdev; 1615 1622 struct ufx_data *dev; 1616 - struct fb_info *info = NULL; 1617 - int retval = -ENOMEM; 1623 + struct fb_info *info; 1624 + int retval; 1618 1625 u32 id_rev, fpga_rev; 1619 1626 1620 1627 /* usb initialization */ ··· 1624 1631 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 1625 1632 if (dev == NULL) { 1626 1633 dev_err(&usbdev->dev, "ufx_usb_probe: failed alloc of dev struct\n"); 1627 - goto error; 1634 + return -ENOMEM; 1628 1635 } 1629 1636 1630 1637 /* we need to wait for both usb and fbdev to spin down on disconnect */ ··· 1645 1652 dev_dbg(dev->gdev, "fb_defio enable=%d\n", fb_defio); 1646 1653 1647 1654 if (!ufx_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) { 1648 - retval = -ENOMEM; 1649 1655 dev_err(dev->gdev, "ufx_alloc_urb_list failed\n"); 1650 - goto error; 1656 + goto e_nomem; 1651 1657 } 1652 1658 1653 1659 /* We don't register a new USB class. Our client interface is fbdev */ ··· 1654 1662 /* allocates framebuffer driver structure, not framebuffer memory */ 1655 1663 info = framebuffer_alloc(0, &usbdev->dev); 1656 1664 if (!info) { 1657 - retval = -ENOMEM; 1658 1665 dev_err(dev->gdev, "framebuffer_alloc failed\n"); 1659 - goto error; 1666 + goto e_nomem; 1660 1667 } 1661 1668 1662 1669 dev->info = info; ··· 1666 1675 retval = fb_alloc_cmap(&info->cmap, 256, 0); 1667 1676 if (retval < 0) { 1668 1677 dev_err(dev->gdev, "fb_alloc_cmap failed %x\n", retval); 1669 - goto error; 1678 + goto destroy_modedb; 1670 1679 } 1671 1680 1672 1681 INIT_DELAYED_WORK(&dev->free_framebuffer_work, ··· 1727 1736 return 0; 1728 1737 1729 1738 error: 1730 - if (dev) { 1731 - if (info) { 1732 - if (info->cmap.len != 0) 1733 - fb_dealloc_cmap(&info->cmap); 1734 - if (info->monspecs.modedb) 1735 - fb_destroy_modedb(info->monspecs.modedb); 1736 - vfree(info->screen_base); 1737 - 1738 - fb_destroy_modelist(&info->modelist); 1739 - 1740 - framebuffer_release(info); 1741 - } 1742 - 1743 - kref_put(&dev->kref, ufx_free); /* ref for framebuffer */ 1744 - kref_put(&dev->kref, ufx_free); /* last ref from kref_init */ 1745 - 1746 - /* dev has been deallocated. Do not dereference */ 1747 - } 1748 - 1739 + fb_dealloc_cmap(&info->cmap); 1740 + destroy_modedb: 1741 + fb_destroy_modedb(info->monspecs.modedb); 1742 + vfree(info->screen_base); 1743 + fb_destroy_modelist(&info->modelist); 1744 + framebuffer_release(info); 1745 + put_ref: 1746 + kref_put(&dev->kref, ufx_free); /* ref for framebuffer */ 1747 + kref_put(&dev->kref, ufx_free); /* last ref from kref_init */ 1749 1748 return retval; 1749 + 1750 + e_nomem: 1751 + retval = -ENOMEM; 1752 + goto put_ref; 1750 1753 } 1751 1754 1752 1755 static void ufx_usb_disconnect(struct usb_interface *interface)
+2 -1
drivers/video/fbdev/ssd1307fb.c
··· 628 628 goto fb_alloc_error; 629 629 } 630 630 631 - ssd1307fb_defio = devm_kzalloc(&client->dev, sizeof(struct fb_deferred_io), GFP_KERNEL); 631 + ssd1307fb_defio = devm_kzalloc(&client->dev, sizeof(*ssd1307fb_defio), 632 + GFP_KERNEL); 632 633 if (!ssd1307fb_defio) { 633 634 dev_err(&client->dev, "Couldn't allocate deferred io.\n"); 634 635 ret = -ENOMEM;
+2 -4
drivers/video/fbdev/stifb.c
··· 1126 1126 int bpp, xres, yres; 1127 1127 1128 1128 fb = kzalloc(sizeof(*fb), GFP_ATOMIC); 1129 - if (!fb) { 1130 - printk(KERN_ERR "stifb: Could not allocate stifb structure\n"); 1131 - return -ENODEV; 1132 - } 1129 + if (!fb) 1130 + return -ENOMEM; 1133 1131 1134 1132 info = &fb->info; 1135 1133
+17 -22
drivers/video/fbdev/udlfb.c
··· 428 428 const uint16_t *pixel = *pixel_start_ptr; 429 429 uint32_t dev_addr = *device_address_ptr; 430 430 uint8_t *cmd = *command_buffer_ptr; 431 - const int bpp = 2; 432 431 433 432 while ((pixel_end > pixel) && 434 433 (cmd_buffer_end - MIN_RLX_CMD_BYTES > cmd)) { ··· 440 441 441 442 *cmd++ = 0xAF; 442 443 *cmd++ = 0x6B; 443 - *cmd++ = (uint8_t) ((dev_addr >> 16) & 0xFF); 444 - *cmd++ = (uint8_t) ((dev_addr >> 8) & 0xFF); 445 - *cmd++ = (uint8_t) ((dev_addr) & 0xFF); 444 + *cmd++ = dev_addr >> 16; 445 + *cmd++ = dev_addr >> 8; 446 + *cmd++ = dev_addr; 446 447 447 448 cmd_pixels_count_byte = cmd++; /* we'll know this later */ 448 449 cmd_pixel_start = pixel; ··· 452 453 453 454 cmd_pixel_end = pixel + min(MAX_CMD_PIXELS + 1, 454 455 min((int)(pixel_end - pixel), 455 - (int)(cmd_buffer_end - cmd) / bpp)); 456 + (int)(cmd_buffer_end - cmd) / BPP)); 456 457 457 - prefetch_range((void *) pixel, (cmd_pixel_end - pixel) * bpp); 458 + prefetch_range((void *) pixel, (cmd_pixel_end - pixel) * BPP); 458 459 459 460 while (pixel < cmd_pixel_end) { 460 461 const uint16_t * const repeating_pixel = pixel; 461 462 462 - *(uint16_t *)cmd = cpu_to_be16p(pixel); 463 - cmd += 2; 463 + *cmd++ = *pixel >> 8; 464 + *cmd++ = *pixel; 464 465 pixel++; 465 466 466 467 if (unlikely((pixel < cmd_pixel_end) && ··· 489 490 } 490 491 491 492 *cmd_pixels_count_byte = (pixel - cmd_pixel_start) & 0xFF; 492 - dev_addr += (pixel - cmd_pixel_start) * bpp; 493 + dev_addr += (pixel - cmd_pixel_start) * BPP; 493 494 } 494 495 495 496 if (cmd_buffer_end <= MIN_RLX_CMD_BYTES + cmd) { ··· 1135 1136 */ 1136 1137 static int dlfb_realloc_framebuffer(struct dlfb_data *dlfb, struct fb_info *info) 1137 1138 { 1138 - int retval = -ENOMEM; 1139 1139 int old_len = info->fix.smem_len; 1140 1140 int new_len; 1141 1141 unsigned char *old_fb = info->screen_base; ··· 1150 1152 new_fb = vmalloc(new_len); 1151 1153 if (!new_fb) { 1152 1154 dev_err(info->dev, "Virtual framebuffer alloc failed\n"); 1153 - goto error; 1155 + return -ENOMEM; 1154 1156 } 1155 1157 1156 1158 if (info->screen_base) { ··· 1179 1181 dlfb->backing_buffer = new_back; 1180 1182 } 1181 1183 } 1182 - 1183 - retval = 0; 1184 - 1185 - error: 1186 - return retval; 1184 + return 0; 1187 1185 } 1188 1186 1189 1187 /* ··· 1525 1531 u8 length; 1526 1532 u16 key; 1527 1533 1528 - key = le16_to_cpu(*((u16 *) desc)); 1529 - desc += sizeof(u16); 1530 - length = *desc; 1531 - desc++; 1534 + key = *desc++; 1535 + key |= (u16)*desc++ << 8; 1536 + length = *desc++; 1532 1537 1533 1538 switch (key) { 1534 1539 case 0x0200: { /* max_area */ 1535 - u32 max_area; 1536 - max_area = le32_to_cpu(*((u32 *)desc)); 1540 + u32 max_area = *desc++; 1541 + max_area |= (u32)*desc++ << 8; 1542 + max_area |= (u32)*desc++ << 16; 1543 + max_area |= (u32)*desc++ << 24; 1537 1544 dev_warn(&intf->dev, 1538 1545 "DL chip limited to %d pixel modes\n", 1539 1546 max_area);
+1 -1
drivers/video/fbdev/vermilion/vermilion.c
··· 651 651 } 652 652 653 653 pitch = ALIGN((var->xres * var->bits_per_pixel) >> 3, 0x40); 654 - mem = pitch * var->yres_virtual; 654 + mem = (u64)pitch * var->yres_virtual; 655 655 if (mem > vinfo->vram_contig_size) { 656 656 return -ENOMEM; 657 657 }
+1 -1
drivers/video/fbdev/via/via_aux_sii164.c
··· 36 36 .name = name}; 37 37 /* check vendor id and device id */ 38 38 const u8 id[] = {0x01, 0x00, 0x06, 0x00}, len = ARRAY_SIZE(id); 39 - u8 tmp[len]; 39 + u8 tmp[ARRAY_SIZE(id)]; 40 40 41 41 if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len)) 42 42 return;
+1 -1
drivers/video/fbdev/via/via_aux_vt1631.c
··· 36 36 .name = name}; 37 37 /* check vendor id and device id */ 38 38 const u8 id[] = {0x06, 0x11, 0x91, 0x31}, len = ARRAY_SIZE(id); 39 - u8 tmp[len]; 39 + u8 tmp[ARRAY_SIZE(id)]; 40 40 41 41 if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len)) 42 42 return;
+1 -1
drivers/video/fbdev/via/via_aux_vt1632.c
··· 36 36 .name = name}; 37 37 /* check vendor id and device id */ 38 38 const u8 id[] = {0x06, 0x11, 0x92, 0x31}, len = ARRAY_SIZE(id); 39 - u8 tmp[len]; 39 + u8 tmp[ARRAY_SIZE(id)]; 40 40 41 41 if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len)) 42 42 return;
+1 -1
drivers/video/fbdev/via/via_aux_vt1636.c
··· 36 36 .name = name}; 37 37 /* check vendor id and device id */ 38 38 const u8 id[] = {0x06, 0x11, 0x45, 0x33}, len = ARRAY_SIZE(id); 39 - u8 tmp[len]; 39 + u8 tmp[ARRAY_SIZE(id)]; 40 40 41 41 if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len)) 42 42 return;
-20
drivers/video/of_display_timing.c
··· 244 244 return NULL; 245 245 } 246 246 EXPORT_SYMBOL_GPL(of_get_display_timings); 247 - 248 - /** 249 - * of_display_timings_exist - check if a display-timings node is provided 250 - * @np: device_node with the timing 251 - **/ 252 - int of_display_timings_exist(const struct device_node *np) 253 - { 254 - struct device_node *timings_np; 255 - 256 - if (!np) 257 - return -EINVAL; 258 - 259 - timings_np = of_parse_phandle(np, "display-timings", 0); 260 - if (!timings_np) 261 - return -EINVAL; 262 - 263 - of_node_put(timings_np); 264 - return 1; 265 - } 266 - EXPORT_SYMBOL_GPL(of_display_timings_exist);
-5
include/video/of_display_timing.h
··· 19 19 int of_get_display_timing(const struct device_node *np, const char *name, 20 20 struct display_timing *dt); 21 21 struct display_timings *of_get_display_timings(const struct device_node *np); 22 - int of_display_timings_exist(const struct device_node *np); 23 22 #else 24 23 static inline int of_get_display_timing(const struct device_node *np, 25 24 const char *name, struct display_timing *dt) ··· 29 30 of_get_display_timings(const struct device_node *np) 30 31 { 31 32 return NULL; 32 - } 33 - static inline int of_display_timings_exist(const struct device_node *np) 34 - { 35 - return -ENOSYS; 36 33 } 37 34 #endif 38 35