Commit 285311b3 authored by Antonino Daplas's avatar Antonino Daplas Committed by Linus Torvalds

[PATCH] nvidiafb: Some chipsets need a buffer pitch divisible by 64

The Geforce2 cards crashes at 800x600-8, but not at 640x480 or 1024x768.
Changing the xres_virtual to be divisible by 64 fixes the problem.
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 71992da3
......@@ -1099,7 +1099,6 @@ static int nvidiafb_check_var(struct fb_var_screeninfo *var,
var->transp.length = 0;
var->xres &= ~7;
var->xres_virtual &= ~7;
if (var->bits_per_pixel <= 8)
var->bits_per_pixel = 8;
......@@ -1179,6 +1178,8 @@ static int nvidiafb_check_var(struct fb_var_screeninfo *var,
if (var->xres_virtual < var->xres)
var->xres_virtual = var->xres;
var->xres_virtual = (var->xres_virtual + 63) & ~63;
vramlen = info->fix.smem_len;
pitch = ((var->xres_virtual * var->bits_per_pixel) + 7) / 8;
memlen = pitch * var->yres_virtual;
......@@ -1212,7 +1213,7 @@ static int nvidiafb_check_var(struct fb_var_screeninfo *var,
var->xres_virtual = 0x7fff;
}
var->xres_virtual &= ~8;
var->xres_virtual &= ~63;
NVTRACE_LEAVE();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment