summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-04-28 10:43:52 +0100
committerRussell King <rmk@dyn-67.arm.linux.org.uk>2005-04-28 10:43:52 +0100
commit82235e9170f19fa327361ee82a76618e60f2db47 (patch)
tree735bdadb8025241a514c672537f231c614010c61
parentc4d12b98ead8bb2437f656c17e7ef065fa160e13 (diff)
downloadlinux-82235e9170f19fa327361ee82a76618e60f2db47.tar.gz
linux-82235e9170f19fa327361ee82a76618e60f2db47.tar.bz2
linux-82235e9170f19fa327361ee82a76618e60f2db47.zip
[PATCH] ARM: Fix AMBA CLCD fb driver for 32bpp
We were supporting 24bpp. However, the pixel organisation in memory was 0RGB, so it was 24bpp in 32bit words. This means we're actually supporting 32bpp and not 24bpp. Also, add a check to ensure that we don't exceed the available framebuffer when changing display resolutions. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--drivers/video/amba-clcd.c8
-rw-r--r--include/asm-arm/hardware/amba_clcd.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c
index 075d3961a119..3e386fd4c5c6 100644
--- a/drivers/video/amba-clcd.c
+++ b/drivers/video/amba-clcd.c
@@ -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);
diff --git a/include/asm-arm/hardware/amba_clcd.h b/include/asm-arm/hardware/amba_clcd.h
index 476b6398ae1e..d6ad33e52ea9 100644
--- a/include/asm-arm/hardware/amba_clcd.h
+++ b/include/asm-arm/hardware/amba_clcd.h
@@ -211,7 +211,7 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
case 16:
val |= CNTL_LCDBPP16;
break;
- case 24:
+ case 32:
val |= CNTL_LCDBPP24;
break;
}