aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2006-01-09 23:53:39 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:01:50 -0500
commitade9185a39aa2bc51f95b4899836e59df671d844 (patch)
tree6a0975b7ac969ad6d0c09524b226d3c01e97ea6b /drivers/video
parentaf5d0f7e2b5e9ef369de2aefe51e14ca1e6928f5 (diff)
[PATCH] nvidiafb: Add boot option 'bpp'
Add boot/module option 'bpp' so user can specify at what color depth to boot into. 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/video')
-rw-r--r--drivers/video/nvidia/nvidia.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c
index 099d64af37be..ae6f2ff70abf 100644
--- a/drivers/video/nvidia/nvidia.c
+++ b/drivers/video/nvidia/nvidia.c
@@ -428,6 +428,7 @@ static int noaccel __devinitdata = 0;
428static int noscale __devinitdata = 0; 428static int noscale __devinitdata = 0;
429static int paneltweak __devinitdata = 0; 429static int paneltweak __devinitdata = 0;
430static int vram __devinitdata = 0; 430static int vram __devinitdata = 0;
431static int bpp __devinitdata = 8;
431#ifdef CONFIG_MTRR 432#ifdef CONFIG_MTRR
432static int nomtrr __devinitdata = 0; 433static int nomtrr __devinitdata = 0;
433#endif 434#endif
@@ -1392,24 +1393,36 @@ static int __devinit nvidia_set_fbinfo(struct fb_info *info)
1392 info->monspecs.modedb_len, &info->modelist); 1393 info->monspecs.modedb_len, &info->modelist);
1393 fb_var_to_videomode(&modedb, &nvidiafb_default_var); 1394 fb_var_to_videomode(&modedb, &nvidiafb_default_var);
1394 1395
1396 switch (bpp) {
1397 case 0 ... 8:
1398 bpp = 8;
1399 break;
1400 case 9 ... 16:
1401 bpp = 16;
1402 break;
1403 default:
1404 bpp = 32;
1405 break;
1406 }
1407
1395 if (specs->modedb != NULL) { 1408 if (specs->modedb != NULL) {
1396 struct fb_videomode *modedb; 1409 struct fb_videomode *modedb;
1397 1410
1398 modedb = fb_find_best_display(specs, &info->modelist); 1411 modedb = fb_find_best_display(specs, &info->modelist);
1399 fb_videomode_to_var(&nvidiafb_default_var, modedb); 1412 fb_videomode_to_var(&nvidiafb_default_var, modedb);
1400 nvidiafb_default_var.bits_per_pixel = 8; 1413 nvidiafb_default_var.bits_per_pixel = bpp;
1401 } else if (par->fpWidth && par->fpHeight) { 1414 } else if (par->fpWidth && par->fpHeight) {
1402 char buf[16]; 1415 char buf[16];
1403 1416
1404 memset(buf, 0, 16); 1417 memset(buf, 0, 16);
1405 snprintf(buf, 15, "%dx%dMR", par->fpWidth, par->fpHeight); 1418 snprintf(buf, 15, "%dx%dMR", par->fpWidth, par->fpHeight);
1406 fb_find_mode(&nvidiafb_default_var, info, buf, specs->modedb, 1419 fb_find_mode(&nvidiafb_default_var, info, buf, specs->modedb,
1407 specs->modedb_len, &modedb, 8); 1420 specs->modedb_len, &modedb, bpp);
1408 } 1421 }
1409 1422
1410 if (mode_option) 1423 if (mode_option)
1411 fb_find_mode(&nvidiafb_default_var, info, mode_option, 1424 fb_find_mode(&nvidiafb_default_var, info, mode_option,
1412 specs->modedb, specs->modedb_len, &modedb, 8); 1425 specs->modedb, specs->modedb_len, &modedb, bpp);
1413 1426
1414 info->var = nvidiafb_default_var; 1427 info->var = nvidiafb_default_var;
1415 info->fix.visual = (info->var.bits_per_pixel == 8) ? 1428 info->fix.visual = (info->var.bits_per_pixel == 8) ?
@@ -1769,6 +1782,8 @@ static int __devinit nvidiafb_setup(char *options)
1769#endif 1782#endif
1770 } else if (!strncmp(this_opt, "fpdither:", 9)) { 1783 } else if (!strncmp(this_opt, "fpdither:", 9)) {
1771 fpdither = simple_strtol(this_opt+9, NULL, 0); 1784 fpdither = simple_strtol(this_opt+9, NULL, 0);
1785 } else if (!strncmp(this_opt, "bpp:", 4)) {
1786 bpp = simple_strtoul(this_opt+4, NULL, 0);
1772 } else 1787 } else
1773 mode_option = this_opt; 1788 mode_option = this_opt;
1774 } 1789 }
@@ -1846,7 +1861,9 @@ MODULE_PARM_DESC(vram,
1846 "(default=0 - remap entire memory)"); 1861 "(default=0 - remap entire memory)");
1847module_param(mode_option, charp, 0); 1862module_param(mode_option, charp, 0);
1848MODULE_PARM_DESC(mode_option, "Specify initial video mode"); 1863MODULE_PARM_DESC(mode_option, "Specify initial video mode");
1849 1864module_param(bpp, int, 0);
1865MODULE_PARM_DESC(bpp, "pixel width in bits"
1866 "(default=8)");
1850#ifdef CONFIG_MTRR 1867#ifdef CONFIG_MTRR
1851module_param(nomtrr, bool, 0); 1868module_param(nomtrr, bool, 0);
1852MODULE_PARM_DESC(nomtrr, "Disables MTRR support (0 or 1=disabled) " 1869MODULE_PARM_DESC(nomtrr, "Disables MTRR support (0 or 1=disabled) "