Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s3fb: driver fixes

This fixes broken fbcon on Virge VX in 24 bpp mode, and contains several
other small updates.

Signed-off-by: Ondrej Zajicek <santiago@crfreenet.org>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Ondrej Zajicek and committed by
Linus Torvalds
249bdbbf 4941cb7a

+18 -15
+8 -4
Documentation/fb/s3fb.txt
··· 35 35 * suspend/resume support 36 36 * DPMS support 37 37 38 - Text mode is supported even in higher resolutions, but there is limitation 39 - to lower pixclocks (maximum between 50-60 MHz, depending on specific hardware). 40 - This limitation is not enforced by driver. Text mode supports 8bit wide fonts 41 - only (hardware limitation) and 16bit tall fonts (driver limitation). 38 + Text mode is supported even in higher resolutions, but there is limitation to 39 + lower pixclocks (maximum usually between 50-60 MHz, depending on specific 40 + hardware, i get best results from plain S3 Trio32 card - about 75 MHz). This 41 + limitation is not enforced by driver. Text mode supports 8bit wide fonts only 42 + (hardware limitation) and 16bit tall fonts (driver limitation). Text mode 43 + support is broken on S3 Trio64 V2/DX. 42 44 43 45 There are two 4 bpp modes. First mode (selected if nonstd == 0) is mode with 44 46 packed pixels, high nibble first. Second mode (selected if nonstd == 1) is mode ··· 75 73 ========== 76 74 77 75 * cursor disable in text mode doesn't work 76 + * text mode broken on S3 Trio64 V2/DX 77 + 78 78 79 79 -- 80 80 Ondrej Zajicek <santiago@crfreenet.org>
+10 -11
drivers/video/s3fb.c
··· 65 65 66 66 67 67 static const struct svga_pll s3_pll = {3, 129, 3, 33, 0, 3, 68 - 60000, 240000, 14318}; 68 + 35000, 240000, 14318}; 69 69 70 70 static const int s3_memsizes[] = {4096, 0, 3072, 8192, 2048, 6144, 1024, 512}; 71 71 ··· 331 331 { 332 332 u16 m, n, r; 333 333 u8 regval; 334 + int rv; 334 335 335 - svga_compute_pll(&s3_pll, 1000000000 / pixclock, &m, &n, &r, info->node); 336 + rv = svga_compute_pll(&s3_pll, 1000000000 / pixclock, &m, &n, &r, info->node); 337 + if (rv < 0) { 338 + printk(KERN_ERR "fb%d: cannot set requested pixclock, keeping old value\n", info->node); 339 + return; 340 + } 336 341 337 342 /* Set VGA misc register */ 338 343 regval = vga_r(NULL, VGA_MIS_R); ··· 715 710 break; 716 711 case 16: 717 712 if (regno >= 16) 718 - return -EINVAL; 713 + return 0; 719 714 720 715 if (fb->var.green.length == 5) 721 716 ((u32*)fb->pseudo_palette)[regno] = ((red & 0xF800) >> 1) | ··· 728 723 case 24: 729 724 case 32: 730 725 if (regno >= 16) 731 - return -EINVAL; 726 + return 0; 732 727 733 - ((u32*)fb->pseudo_palette)[regno] = ((transp & 0xFF00) << 16) | ((red & 0xFF00) << 8) | 728 + ((u32*)fb->pseudo_palette)[regno] = ((red & 0xFF00) << 8) | 734 729 (green & 0xFF00) | ((blue & 0xFF00) >> 8); 735 730 break; 736 731 default: ··· 782 777 static int s3fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { 783 778 784 779 unsigned int offset; 785 - 786 - /* Validate the offsets */ 787 - if ((var->xoffset + var->xres) > var->xres_virtual) 788 - return -EINVAL; 789 - if ((var->yoffset + var->yres) > var->yres_virtual) 790 - return -EINVAL; 791 780 792 781 /* Calculate the offset */ 793 782 if (var->bits_per_pixel == 0) {