aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/atmel_lcdfb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/atmel_lcdfb.c')
-rw-r--r--drivers/video/atmel_lcdfb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index d38fd5217422..f8d0a57a07cb 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -372,6 +372,13 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
372 var->transp.offset = var->transp.length = 0; 372 var->transp.offset = var->transp.length = 0;
373 var->xoffset = var->yoffset = 0; 373 var->xoffset = var->yoffset = 0;
374 374
375 if (info->fix.smem_len) {
376 unsigned int smem_len = (var->xres_virtual * var->yres_virtual
377 * ((var->bits_per_pixel + 7) / 8));
378 if (smem_len > info->fix.smem_len)
379 return -EINVAL;
380 }
381
375 /* Saturate vertical and horizontal timings at maximum values */ 382 /* Saturate vertical and horizontal timings at maximum values */
376 var->vsync_len = min_t(u32, var->vsync_len, 383 var->vsync_len = min_t(u32, var->vsync_len,
377 (ATMEL_LCDC_VPW >> ATMEL_LCDC_VPW_OFFSET) + 1); 384 (ATMEL_LCDC_VPW >> ATMEL_LCDC_VPW_OFFSET) + 1);