aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2008-07-23 21:31:07 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 10:47:36 -0700
commitf330c4b1961d730ef15ac184e4b7f1c25847d0ae (patch)
tree4751dc03a194a3b8471d8e8a3af41762959d04ff /drivers/video
parenta4af1798d768ab2f12ab623e21ad68dc8c248005 (diff)
tridentfb: y-panning fixes
The Trident cards uses only 20-bit address of screen start in double words. This allows addressing for only 4MB of video memory so check this. Also remove some redundant checks and assignments. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/tridentfb.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c
index 1c3f0ba4b33..138140bdb49 100644
--- a/drivers/video/tridentfb.c
+++ b/drivers/video/tridentfb.c
@@ -870,8 +870,10 @@ static int tridentfb_check_var(struct fb_var_screeninfo *var,
line_length = var->xres_virtual * bpp / 8;
}
- if (var->yres > var->yres_virtual)
- var->yres_virtual = var->yres;
+ /* datasheet specifies how to set panning only up to 4 MB */
+ if (line_length * (var->yres_virtual - var->yres) > (4 << 20))
+ var->yres_virtual = ((4 << 20) / line_length) + var->yres;
+
if (line_length * var->yres_virtual > info->fix.smem_len)
return -EINVAL;
@@ -944,8 +946,6 @@ static int tridentfb_pan_display(struct fb_var_screeninfo *var,
debug("enter\n");
offset = (var->xoffset + (var->yoffset * var->xres_virtual))
* var->bits_per_pixel / 32;
- info->var.xoffset = var->xoffset;
- info->var.yoffset = var->yoffset;
set_screen_start(par, offset);
debug("exit\n");
return 0;
@@ -1225,7 +1225,6 @@ static int tridentfb_setcolreg(unsigned regno, unsigned red, unsigned green,
((blue & 0xFF00) >> 8);
}
-/* debug("exit\n"); */
return 0;
}