imxfb: Fix margin settings
authorSascha Hauer <s.hauer@pengutronix.de>
Sat, 14 Feb 2009 15:29:38 +0000 (16:29 +0100)
committerSascha Hauer <s.hauer@pengutronix.de>
Fri, 13 Mar 2009 09:34:24 +0000 (10:34 +0100)
The var->hsync_len, var->right_margin and var->left_margin fields
should contain the real values, not the hardware dependent values.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
drivers/video/imxfb.c

index 9dd27576db711032aa33492cef8c3f6c6578b676..bd1cb75cd14b773191976c7b57e92578fadd7253 100644 (file)
@@ -495,9 +495,9 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
                        info->fix.id, var->lower_margin);
 #endif
 
-       writel(HCR_H_WIDTH(var->hsync_len) |
-               HCR_H_WAIT_1(var->right_margin) |
-               HCR_H_WAIT_2(var->left_margin),
+       writel(HCR_H_WIDTH(var->hsync_len - 1) |
+               HCR_H_WAIT_1(var->right_margin - 1) |
+               HCR_H_WAIT_2(var->left_margin - 3),
                fbi->regs + LCDC_HCR);
 
        writel(VCR_V_WIDTH(var->vsync_len) |