diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2005-09-09 16:04:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 16:58:00 -0400 |
commit | b8c909454f046b59065c6997b651fe20cd90c0f4 (patch) | |
tree | 2a8e03fe69c1b02dc610f57208d693e05b95969c /drivers/video/nvidia | |
parent | 094bb659f53b6d90aab6067268d6d14f1f352d30 (diff) |
[PATCH] fbdev: Fix greater than 1 bit monochrome color handling
Currently, fbcon assumes that the visual FB_VISUAL_MONO* is always 1 bit.
According to Geert, there are old hardware where it's possible to have
monochrome at 8-bit, but has only 2 colors, black - 0x00 and white - 0xff.
Fix color handlers (fb_get_color_depth, and get_color) for this special case.
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/nvidia')
-rw-r--r-- | drivers/video/nvidia/nvidia.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c index af99ea96012e..32952204ce33 100644 --- a/drivers/video/nvidia/nvidia.c +++ b/drivers/video/nvidia/nvidia.c | |||
@@ -658,7 +658,7 @@ static int nvidia_calc_regs(struct fb_info *info) | |||
658 | { | 658 | { |
659 | struct nvidia_par *par = info->par; | 659 | struct nvidia_par *par = info->par; |
660 | struct _riva_hw_state *state = &par->ModeReg; | 660 | struct _riva_hw_state *state = &par->ModeReg; |
661 | int i, depth = fb_get_color_depth(&info->var); | 661 | int i, depth = fb_get_color_depth(&info->var, &info->fix); |
662 | int h_display = info->var.xres / 8 - 1; | 662 | int h_display = info->var.xres / 8 - 1; |
663 | int h_start = (info->var.xres + info->var.right_margin) / 8 - 1; | 663 | int h_start = (info->var.xres + info->var.right_margin) / 8 - 1; |
664 | int h_end = (info->var.xres + info->var.right_margin + | 664 | int h_end = (info->var.xres + info->var.right_margin + |
@@ -978,6 +978,9 @@ static int nvidiafb_set_par(struct fb_info *info) | |||
978 | !par->twoHeads) | 978 | !par->twoHeads) |
979 | par->FPDither = 0; | 979 | par->FPDither = 0; |
980 | 980 | ||
981 | info->fix.visual = (info->var.bits_per_pixel == 8) ? | ||
982 | FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR; | ||
983 | |||
981 | nvidia_init_vga(info); | 984 | nvidia_init_vga(info); |
982 | nvidia_calc_regs(info); | 985 | nvidia_calc_regs(info); |
983 | nvidia_write_regs(par); | 986 | nvidia_write_regs(par); |
@@ -992,9 +995,6 @@ static int nvidiafb_set_par(struct fb_info *info) | |||
992 | NVWriteCrtc(par, 0x11, 0x00); | 995 | NVWriteCrtc(par, 0x11, 0x00); |
993 | info->fix.line_length = (info->var.xres_virtual * | 996 | info->fix.line_length = (info->var.xres_virtual * |
994 | info->var.bits_per_pixel) >> 3; | 997 | info->var.bits_per_pixel) >> 3; |
995 | info->fix.visual = (info->var.bits_per_pixel == 8) ? | ||
996 | FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR; | ||
997 | |||
998 | if (info->var.accel_flags) { | 998 | if (info->var.accel_flags) { |
999 | info->fbops->fb_imageblit = nvidiafb_imageblit; | 999 | info->fbops->fb_imageblit = nvidiafb_imageblit; |
1000 | info->fbops->fb_fillrect = nvidiafb_fillrect; | 1000 | info->fbops->fb_fillrect = nvidiafb_fillrect; |