diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-28 16:09:57 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-28 16:09:57 -0700 |
commit | 2604f6da1afb56fae5930b58349e43a2b0345933 (patch) | |
tree | 1744196a8cf6bf3edfd7ad63c6a10f1609bd206a /drivers | |
parent | 18c8baff8fe151ea02e00047afc369ee31939e9b (diff) | |
parent | 0f7ad450394560a6b6c72115e04bf7afd6230e70 (diff) |
Automatic merge of master.kernel.org:/home/rmk/linux-2.6-rmk.git
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/amba-clcd.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index acdba0c67fb..3e386fd4c5c 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c @@ -125,11 +125,11 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var) case 2: case 4: case 8: - var->red.length = 8; + var->red.length = var->bits_per_pixel; var->red.offset = 0; - var->green.length = 8; + var->green.length = var->bits_per_pixel; var->green.offset = 0; - var->blue.length = 8; + var->blue.length = var->bits_per_pixel; var->blue.offset = 0; break; case 16: @@ -146,7 +146,7 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var) var->blue.offset = 10; } break; - case 24: + case 32: if (fb->panel->cntl & CNTL_LCDTFT) { var->red.length = 8; var->green.length = 8; @@ -178,6 +178,12 @@ static int clcdfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) if (fb->board->check) ret = fb->board->check(fb, var); + + if (ret == 0 && + var->xres_virtual * var->bits_per_pixel / 8 * + var->yres_virtual > fb->fb.fix.smem_len) + ret = -EINVAL; + if (ret == 0) ret = clcdfb_set_bitfields(fb, var); |