diff options
Diffstat (limited to 'drivers/video/via/viafbdev.c')
-rw-r--r-- | drivers/video/via/viafbdev.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 410de33f5778..ce7783b63f6a 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -80,6 +80,15 @@ static void viafb_fill_var_color_info(struct fb_var_screeninfo *var, u8 depth) | |||
80 | var->green.length = 8; | 80 | var->green.length = 8; |
81 | var->blue.length = 8; | 81 | var->blue.length = 8; |
82 | break; | 82 | break; |
83 | case 15: | ||
84 | var->bits_per_pixel = 16; | ||
85 | var->red.offset = 10; | ||
86 | var->green.offset = 5; | ||
87 | var->blue.offset = 0; | ||
88 | var->red.length = 5; | ||
89 | var->green.length = 5; | ||
90 | var->blue.length = 5; | ||
91 | break; | ||
83 | case 16: | 92 | case 16: |
84 | var->bits_per_pixel = 16; | 93 | var->bits_per_pixel = 16; |
85 | var->red.offset = 11; | 94 | var->red.offset = 11; |
@@ -98,6 +107,15 @@ static void viafb_fill_var_color_info(struct fb_var_screeninfo *var, u8 depth) | |||
98 | var->green.length = 8; | 107 | var->green.length = 8; |
99 | var->blue.length = 8; | 108 | var->blue.length = 8; |
100 | break; | 109 | break; |
110 | case 30: | ||
111 | var->bits_per_pixel = 32; | ||
112 | var->red.offset = 20; | ||
113 | var->green.offset = 10; | ||
114 | var->blue.offset = 0; | ||
115 | var->red.length = 10; | ||
116 | var->green.length = 10; | ||
117 | var->blue.length = 10; | ||
118 | break; | ||
101 | } | 119 | } |
102 | } | 120 | } |
103 | 121 | ||
@@ -171,6 +189,10 @@ static int viafb_check_var(struct fb_var_screeninfo *var, | |||
171 | return -EINVAL; | 189 | return -EINVAL; |
172 | else if (!depth) | 190 | else if (!depth) |
173 | depth = 24; | 191 | depth = 24; |
192 | else if (depth == 15 && viafb_dual_fb && ppar->iga_path == IGA1) | ||
193 | depth = 15; | ||
194 | else if (depth == 30) | ||
195 | depth = 30; | ||
174 | else if (depth <= 8) | 196 | else if (depth <= 8) |
175 | depth = 8; | 197 | depth = 8; |
176 | else if (depth <= 16) | 198 | else if (depth <= 16) |
@@ -1811,19 +1833,6 @@ static int __devinit via_pci_probe(struct pci_dev *pdev, | |||
1811 | viafb_second_virtual_yres = viafb_second_yres; | 1833 | viafb_second_virtual_yres = viafb_second_yres; |
1812 | } | 1834 | } |
1813 | 1835 | ||
1814 | switch (viafb_bpp) { | ||
1815 | case 0 ... 8: | ||
1816 | viafb_bpp = 8; | ||
1817 | break; | ||
1818 | case 9 ... 16: | ||
1819 | viafb_bpp = 16; | ||
1820 | break; | ||
1821 | case 17 ... 32: | ||
1822 | viafb_bpp = 32; | ||
1823 | break; | ||
1824 | default: | ||
1825 | viafb_bpp = 8; | ||
1826 | } | ||
1827 | default_var.xres = default_xres; | 1836 | default_var.xres = default_xres; |
1828 | default_var.yres = default_yres; | 1837 | default_var.yres = default_yres; |
1829 | switch (default_xres) { | 1838 | switch (default_xres) { |
@@ -1836,8 +1845,6 @@ static int __devinit via_pci_probe(struct pci_dev *pdev, | |||
1836 | } | 1845 | } |
1837 | default_var.yres_virtual = default_yres; | 1846 | default_var.yres_virtual = default_yres; |
1838 | default_var.bits_per_pixel = viafb_bpp; | 1847 | default_var.bits_per_pixel = viafb_bpp; |
1839 | if (default_var.bits_per_pixel == 15) | ||
1840 | default_var.bits_per_pixel = 16; | ||
1841 | default_var.pixclock = | 1848 | default_var.pixclock = |
1842 | viafb_get_pixclock(default_xres, default_yres, viafb_refresh); | 1849 | viafb_get_pixclock(default_xres, default_yres, viafb_refresh); |
1843 | default_var.left_margin = (default_xres >> 3) & 0xf8; | 1850 | default_var.left_margin = (default_xres >> 3) & 0xf8; |
@@ -1847,7 +1854,6 @@ static int __devinit via_pci_probe(struct pci_dev *pdev, | |||
1847 | default_var.hsync_len = default_var.left_margin; | 1854 | default_var.hsync_len = default_var.left_margin; |
1848 | default_var.vsync_len = 4; | 1855 | default_var.vsync_len = 4; |
1849 | viafb_setup_fixinfo(&viafbinfo->fix, viaparinfo); | 1856 | viafb_setup_fixinfo(&viafbinfo->fix, viaparinfo); |
1850 | viafb_check_var(&default_var, viafbinfo); | ||
1851 | viafbinfo->var = default_var; | 1857 | viafbinfo->var = default_var; |
1852 | 1858 | ||
1853 | if (viafb_dual_fb) { | 1859 | if (viafb_dual_fb) { |
@@ -1883,8 +1889,6 @@ static int __devinit via_pci_probe(struct pci_dev *pdev, | |||
1883 | default_var.yres = viafb_second_yres; | 1889 | default_var.yres = viafb_second_yres; |
1884 | default_var.xres_virtual = viafb_second_virtual_xres; | 1890 | default_var.xres_virtual = viafb_second_virtual_xres; |
1885 | default_var.yres_virtual = viafb_second_virtual_yres; | 1891 | default_var.yres_virtual = viafb_second_virtual_yres; |
1886 | if (viafb_bpp1 != viafb_bpp) | ||
1887 | viafb_bpp1 = viafb_bpp; | ||
1888 | default_var.bits_per_pixel = viafb_bpp1; | 1892 | default_var.bits_per_pixel = viafb_bpp1; |
1889 | default_var.pixclock = | 1893 | default_var.pixclock = |
1890 | viafb_get_pixclock(viafb_second_xres, viafb_second_yres, | 1894 | viafb_get_pixclock(viafb_second_xres, viafb_second_yres, |
@@ -1904,6 +1908,7 @@ static int __devinit via_pci_probe(struct pci_dev *pdev, | |||
1904 | &viafbinfo1->fix); | 1908 | &viafbinfo1->fix); |
1905 | } | 1909 | } |
1906 | 1910 | ||
1911 | viafb_check_var(&viafbinfo->var, viafbinfo); | ||
1907 | viafb_update_fix(viafbinfo); | 1912 | viafb_update_fix(viafbinfo); |
1908 | viaparinfo->depth = fb_get_color_depth(&viafbinfo->var, | 1913 | viaparinfo->depth = fb_get_color_depth(&viafbinfo->var, |
1909 | &viafbinfo->fix); | 1914 | &viafbinfo->fix); |
@@ -2070,6 +2075,8 @@ static int __init viafb_init(void) | |||
2070 | #endif | 2075 | #endif |
2071 | if (parse_mode(viafb_mode, &dummy, &dummy) | 2076 | if (parse_mode(viafb_mode, &dummy, &dummy) |
2072 | || parse_mode(viafb_mode1, &dummy, &dummy) | 2077 | || parse_mode(viafb_mode1, &dummy, &dummy) |
2078 | || viafb_bpp < 0 || viafb_bpp > 32 | ||
2079 | || viafb_bpp1 < 0 || viafb_bpp1 > 32 | ||
2073 | || parse_active_dev()) | 2080 | || parse_active_dev()) |
2074 | return -EINVAL; | 2081 | return -EINVAL; |
2075 | 2082 | ||