Skip to content

Commit

Permalink
[PATCH] ARM: Fix AMBA CLCD fb driver for 32bpp
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King committed Apr 28, 2005
1 parent c4d12b9 commit 82235e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion drivers/video/amba-clcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion include/asm-arm/hardware/amba_clcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 82235e9

Please sign in to comment.