diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2005-11-07 04:00:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:53:53 -0500 |
commit | 5ee1ef96a0d5c49809c61bdbb30cdda88e1d23cf (patch) | |
tree | dbb520ffd6c6ca8e955b1df70e89697e8b5957e7 /drivers | |
parent | 003cfc0c56977f1c3ce48ddfd2073b7c6d75a5d8 (diff) |
[PATCH] fbdev: Convert a few drivers to use the fb_find_best_display helper
Convert i810fb, nvidiafb and savagefb to use the fb_find_best_display helper
when searching for the initial video mode.
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/i810/i810_main.c | 17 | ||||
-rw-r--r-- | drivers/video/nvidia/nvidia.c | 18 | ||||
-rw-r--r-- | drivers/video/savage/savagefb_driver.c | 21 |
3 files changed, 11 insertions, 45 deletions
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c index 4175b2d8513c..1d148c5a5a4b 100644 --- a/drivers/video/i810/i810_main.c +++ b/drivers/video/i810/i810_main.c | |||
@@ -1871,27 +1871,18 @@ static void __devinit i810fb_find_init_mode(struct fb_info *info) | |||
1871 | fb_videomode_to_modelist(specs->modedb, specs->modedb_len, | 1871 | fb_videomode_to_modelist(specs->modedb, specs->modedb_len, |
1872 | &info->modelist); | 1872 | &info->modelist); |
1873 | if (specs->modedb != NULL) { | 1873 | if (specs->modedb != NULL) { |
1874 | if (xres && yres) { | 1874 | struct fb_videomode *m; |
1875 | struct fb_videomode *m; | ||
1876 | 1875 | ||
1876 | if (xres && yres) { | ||
1877 | if ((m = fb_find_best_mode(&var, &info->modelist))) { | 1877 | if ((m = fb_find_best_mode(&var, &info->modelist))) { |
1878 | mode = *m; | 1878 | mode = *m; |
1879 | found = 1; | 1879 | found = 1; |
1880 | } | 1880 | } |
1881 | } | 1881 | } |
1882 | 1882 | ||
1883 | if (!found && specs->misc & FB_MISC_1ST_DETAIL) { | ||
1884 | for (i = 0; i < specs->modedb_len; i++) { | ||
1885 | if (specs->modedb[i].flag & FB_MODE_IS_FIRST) { | ||
1886 | mode = specs->modedb[i]; | ||
1887 | found = 1; | ||
1888 | break; | ||
1889 | } | ||
1890 | } | ||
1891 | } | ||
1892 | |||
1893 | if (!found) { | 1883 | if (!found) { |
1894 | mode = specs->modedb[0]; | 1884 | m = fb_find_best_display(&info->monspecs, &info->modelist); |
1885 | mode = *m; | ||
1895 | found = 1; | 1886 | found = 1; |
1896 | } | 1887 | } |
1897 | 1888 | ||
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c index cbe165bb181d..0b40a2a721c1 100644 --- a/drivers/video/nvidia/nvidia.c +++ b/drivers/video/nvidia/nvidia.c | |||
@@ -1383,22 +1383,10 @@ static int __devinit nvidia_set_fbinfo(struct fb_info *info) | |||
1383 | fb_var_to_videomode(&modedb, &nvidiafb_default_var); | 1383 | fb_var_to_videomode(&modedb, &nvidiafb_default_var); |
1384 | 1384 | ||
1385 | if (specs->modedb != NULL) { | 1385 | if (specs->modedb != NULL) { |
1386 | /* get preferred timing */ | 1386 | struct fb_videomode *modedb; |
1387 | if (specs->misc & FB_MISC_1ST_DETAIL) { | ||
1388 | int i; | ||
1389 | |||
1390 | for (i = 0; i < specs->modedb_len; i++) { | ||
1391 | if (specs->modedb[i].flag & FB_MODE_IS_FIRST) { | ||
1392 | modedb = specs->modedb[i]; | ||
1393 | break; | ||
1394 | } | ||
1395 | } | ||
1396 | } else { | ||
1397 | /* otherwise, get first mode in database */ | ||
1398 | modedb = specs->modedb[0]; | ||
1399 | } | ||
1400 | 1387 | ||
1401 | fb_videomode_to_var(&nvidiafb_default_var, &modedb); | 1388 | modedb = fb_find_best_display(specs, &info->modelist); |
1389 | fb_videomode_to_var(&nvidiafb_default_var, modedb); | ||
1402 | nvidiafb_default_var.bits_per_pixel = 8; | 1390 | nvidiafb_default_var.bits_per_pixel = 8; |
1403 | } else if (par->fpWidth && par->fpHeight) { | 1391 | } else if (par->fpWidth && par->fpHeight) { |
1404 | char buf[16]; | 1392 | char buf[16]; |
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index 06e989ba3d13..f0dfb35e3191 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c | |||
@@ -2052,24 +2052,11 @@ static int __devinit savagefb_probe (struct pci_dev* dev, | |||
2052 | info->monspecs.modedb, info->monspecs.modedb_len, | 2052 | info->monspecs.modedb, info->monspecs.modedb_len, |
2053 | NULL, 8); | 2053 | NULL, 8); |
2054 | } else if (info->monspecs.modedb != NULL) { | 2054 | } else if (info->monspecs.modedb != NULL) { |
2055 | struct fb_monspecs *specs = &info->monspecs; | 2055 | struct fb_videomode *modedb; |
2056 | struct fb_videomode modedb; | ||
2057 | 2056 | ||
2058 | if (info->monspecs.misc & FB_MISC_1ST_DETAIL) { | 2057 | modedb = fb_find_best_display(&info->monspecs, |
2059 | int i; | 2058 | &info->modelist); |
2060 | 2059 | savage_update_var(&info->var, modedb); | |
2061 | for (i = 0; i < specs->modedb_len; i++) { | ||
2062 | if (specs->modedb[i].flag & FB_MODE_IS_FIRST) { | ||
2063 | modedb = specs->modedb[i]; | ||
2064 | break; | ||
2065 | } | ||
2066 | } | ||
2067 | } else { | ||
2068 | /* otherwise, get first mode in database */ | ||
2069 | modedb = specs->modedb[0]; | ||
2070 | } | ||
2071 | |||
2072 | savage_update_var(&info->var, &modedb); | ||
2073 | } | 2060 | } |
2074 | 2061 | ||
2075 | /* maximize virtual vertical length */ | 2062 | /* maximize virtual vertical length */ |