diff options
-rw-r--r-- | drivers/video/i810/i810_main.c | 52 |
1 files changed, 35 insertions, 17 deletions
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c index 6f11989f54e3..78feded40945 100644 --- a/drivers/video/i810/i810_main.c +++ b/drivers/video/i810/i810_main.c | |||
@@ -95,18 +95,18 @@ static struct pci_driver i810fb_driver = { | |||
95 | static char *mode_option __devinitdata = NULL; | 95 | static char *mode_option __devinitdata = NULL; |
96 | static int vram __devinitdata = 4; | 96 | static int vram __devinitdata = 4; |
97 | static int bpp __devinitdata = 8; | 97 | static int bpp __devinitdata = 8; |
98 | static int mtrr __devinitdata = 0; | 98 | static int mtrr __devinitdata; |
99 | static int accel __devinitdata = 0; | 99 | static int accel __devinitdata; |
100 | static int hsync1 __devinitdata = 0; | 100 | static int hsync1 __devinitdata; |
101 | static int hsync2 __devinitdata = 0; | 101 | static int hsync2 __devinitdata; |
102 | static int vsync1 __devinitdata = 0; | 102 | static int vsync1 __devinitdata; |
103 | static int vsync2 __devinitdata = 0; | 103 | static int vsync2 __devinitdata; |
104 | static int xres __devinitdata = 640; | 104 | static int xres __devinitdata; |
105 | static int yres __devinitdata = 480; | 105 | static int yres __devinitdata; |
106 | static int vyres __devinitdata = 0; | 106 | static int vyres __devinitdata; |
107 | static int sync __devinitdata = 0; | 107 | static int sync __devinitdata; |
108 | static int ext_vga __devinitdata = 0; | 108 | static int ext_vga __devinitdata; |
109 | static int dcolor __devinitdata = 0; | 109 | static int dcolor __devinitdata; |
110 | 110 | ||
111 | /*------------------------------------------------------------*/ | 111 | /*------------------------------------------------------------*/ |
112 | 112 | ||
@@ -1725,12 +1725,21 @@ static void __devinit i810_init_defaults(struct i810fb_par *par, | |||
1725 | if (bpp < 8) | 1725 | if (bpp < 8) |
1726 | bpp = 8; | 1726 | bpp = 8; |
1727 | 1727 | ||
1728 | par->i810fb_ops = i810fb_ops; | ||
1729 | |||
1730 | if (xres) | ||
1731 | info->var.xres = xres; | ||
1732 | else | ||
1733 | info->var.xres = 640; | ||
1734 | |||
1735 | if (yres) | ||
1736 | info->var.yres = yres; | ||
1737 | else | ||
1738 | info->var.yres = 480; | ||
1739 | |||
1728 | if (!vyres) | 1740 | if (!vyres) |
1729 | vyres = (vram << 20)/(xres*bpp >> 3); | 1741 | vyres = (vram << 20)/(info->var.xres*bpp >> 3); |
1730 | 1742 | ||
1731 | par->i810fb_ops = i810fb_ops; | ||
1732 | info->var.xres = xres; | ||
1733 | info->var.yres = yres; | ||
1734 | info->var.yres_virtual = vyres; | 1743 | info->var.yres_virtual = vyres; |
1735 | info->var.bits_per_pixel = bpp; | 1744 | info->var.bits_per_pixel = bpp; |
1736 | 1745 | ||
@@ -1862,7 +1871,16 @@ static void __devinit i810fb_find_init_mode(struct fb_info *info) | |||
1862 | fb_videomode_to_modelist(specs->modedb, specs->modedb_len, | 1871 | fb_videomode_to_modelist(specs->modedb, specs->modedb_len, |
1863 | &info->modelist); | 1872 | &info->modelist); |
1864 | if (specs->modedb != NULL) { | 1873 | if (specs->modedb != NULL) { |
1865 | if (specs->misc & FB_MISC_1ST_DETAIL) { | 1874 | if (xres && yres) { |
1875 | struct fb_videomode *m; | ||
1876 | |||
1877 | if ((m = fb_find_best_mode(&var, &info->modelist))) { | ||
1878 | mode = *m; | ||
1879 | found = 1; | ||
1880 | } | ||
1881 | } | ||
1882 | |||
1883 | if (!found && specs->misc & FB_MISC_1ST_DETAIL) { | ||
1866 | for (i = 0; i < specs->modedb_len; i++) { | 1884 | for (i = 0; i < specs->modedb_len; i++) { |
1867 | if (specs->modedb[i].flag & FB_MODE_IS_FIRST) { | 1885 | if (specs->modedb[i].flag & FB_MODE_IS_FIRST) { |
1868 | mode = specs->modedb[i]; | 1886 | mode = specs->modedb[i]; |