aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-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 1c3f0ba4b33a..138140bdb495 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,
870 line_length = var->xres_virtual * bpp / 8; 870 line_length = var->xres_virtual * bpp / 8;
871 } 871 }
872 872
873 if (var->yres > var->yres_virtual) 873 /* datasheet specifies how to set panning only up to 4 MB */
874 var->yres_virtual = var->yres; 874 if (line_length * (var->yres_virtual - var->yres) > (4 << 20))
875 var->yres_virtual = ((4 << 20) / line_length) + var->yres;
876
875 if (line_length * var->yres_virtual > info->fix.smem_len) 877 if (line_length * var->yres_virtual > info->fix.smem_len)
876 return -EINVAL; 878 return -EINVAL;
877 879
@@ -944,8 +946,6 @@ static int tridentfb_pan_display(struct fb_var_screeninfo *var,
944 debug("enter\n"); 946 debug("enter\n");
945 offset = (var->xoffset + (var->yoffset * var->xres_virtual)) 947 offset = (var->xoffset + (var->yoffset * var->xres_virtual))
946 * var->bits_per_pixel / 32; 948 * var->bits_per_pixel / 32;
947 info->var.xoffset = var->xoffset;
948 info->var.yoffset = var->yoffset;
949 set_screen_start(par, offset); 949 set_screen_start(par, offset);
950 debug("exit\n"); 950 debug("exit\n");
951 return 0; 951 return 0;
@@ -1225,7 +1225,6 @@ static int tridentfb_setcolreg(unsigned regno, unsigned red, unsigned green,
1225 ((blue & 0xFF00) >> 8); 1225 ((blue & 0xFF00) >> 8);
1226 } 1226 }
1227 1227
1228/* debug("exit\n"); */
1229 return 0; 1228 return 0;
1230} 1229}
1231 1230