Skip to content

Commit

Permalink
sm501fb: fix timing limits
Browse files Browse the repository at this point in the history
Vertical sync height register can only hold 6 bits.  Fix the hsync start test
to use > instead of >=.  Also add a few clarifying comments.

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ville Syrjala authored and Linus Torvalds committed Mar 5, 2008
1 parent 19d06ef commit 7e53370
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/video/sm501fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,14 @@ static int sm501fb_check_var(struct fb_var_screeninfo *var,

/* check we can fit these values into the registers */

if (var->hsync_len > 255 || var->vsync_len > 255)
if (var->hsync_len > 255 || var->vsync_len > 63)
return -EINVAL;

if ((var->xres + var->right_margin) >= 4096)
/* hdisplay end and hsync start */
if ((var->xres + var->right_margin) > 4096)
return -EINVAL;

/* vdisplay end and vsync start */
if ((var->yres + var->lower_margin) > 2048)
return -EINVAL;

Expand Down

0 comments on commit 7e53370

Please sign in to comment.