diff options
author | Ben Nizette <bn@niasdigital.com> | 2009-06-16 18:34:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 22:47:58 -0400 |
commit | 97b9a5a28b5fd02ceb3fcccee05e39dd62e4f474 (patch) | |
tree | 4f015ebdf8662960a115d666fe0d9ba65de0fb3e /drivers/video/atmel_lcdfb.c | |
parent | 4113819eb360555a91a8291f37bbbe9d26c5b275 (diff) |
atmel-lcdc: fix pixclock upper bound detection
AFAICT the code which checks that the requested pixclock value is within
bounds is incorrect. It ensures that the lcdc core clock is at least
(bytes per pixel) times higher than the pixel clock rather than just
greater than or equal to.
There are tighter restrictions on the pixclock value as a function of bus
width for STN panels but even then it isn't a simple relationship as
currently checked for. IMO either something like the below patch should
be applied or else more detailed checking logic should be implemented
which takes in to account the panel type as well.
Signed-off-by: Ben Nizette <bn@niasdigital.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Cc: Daniel Glockner <dg@emlix.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/atmel_lcdfb.c')
-rw-r--r-- | drivers/video/atmel_lcdfb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 2fb63f6ea2f1..5afd64482f55 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c | |||
@@ -345,7 +345,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var, | |||
345 | dev_dbg(dev, " bpp: %u\n", var->bits_per_pixel); | 345 | dev_dbg(dev, " bpp: %u\n", var->bits_per_pixel); |
346 | dev_dbg(dev, " clk: %lu KHz\n", clk_value_khz); | 346 | dev_dbg(dev, " clk: %lu KHz\n", clk_value_khz); |
347 | 347 | ||
348 | if ((PICOS2KHZ(var->pixclock) * var->bits_per_pixel / 8) > clk_value_khz) { | 348 | if (PICOS2KHZ(var->pixclock) > clk_value_khz) { |
349 | dev_err(dev, "%lu KHz pixel clock is too fast\n", PICOS2KHZ(var->pixclock)); | 349 | dev_err(dev, "%lu KHz pixel clock is too fast\n", PICOS2KHZ(var->pixclock)); |
350 | return -EINVAL; | 350 | return -EINVAL; |
351 | } | 351 | } |