video: imxfb: Fix the maximum value for yres
Subsystems (2)
PATCH 1/1 video: imxfb: Fix the maximum value for yres
MX27 and MX25 have 10 bits in the YMAX field of LCDC Size Register.
Fix the maximum value for yres.
Signed-off-by Fabio Estevam <[email protected]>
--- drivers/video/imxfb.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/video/imxfb.c +3 -1
@@ -55,8 +55,10 @@#ifdef CONFIG_ARCH_MX1 #define SIZE_YMAX (y) ((y) & 0x1ff) +#define YMAX_MASK 0x1ff#else #define SIZE_YMAX (y) ((y) & 0x3ff) +#define YMAX_MASK 0x3ff#endif #define LCDC_VPW 0x08
@@ -623,7 +625,7 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *infif (var->right_margin >255 )printk (KERN_ERR "%s: invalid right_margin %d\n" , info->fix.id, var->right_margin); -if (var->yres <1 || var->yres >511 ) +if (var->yres <1 || var->yres >YMAX_MASK )printk (KERN_ERR "%s: invalid yres %d\n" , info->fix.id, var->yres);if (var->vsync_len >100 )
Signature · 1 line
1.6.0.4
PATCH 1/1 video: imxfb: Fix the maximum value for yres
Hello.
Quoted 5 lines · Fabio Estevam
MX27 and MX25 have 10 bits in the YMAX field of LCDC Size Register.
Fix the maximum value for yres.
Signed-off-by Fabio Estevam <[email protected]>
[...]
drivers/video/imxfb.c line 62
Quoted 13 lines
drivers/video/imxfb.c +2
-0@@ -55,8 +55,10 @@#ifdef CONFIG_ARCH_MX1 #define SIZE_YMAX (y) ((y) & 0x1ff) +#define YMAX_MASK 0x1ff#else #define SIZE_YMAX (y) ((y) & 0x3ff) +#define YMAX_MASK 0x3ff#endif
I'd done the following, to avoid the code duplication:
#ifdef CONFIG_ARCH_MX1
#define YMAX_MASK 0x1ff
#else
#define YMAX_MASK 0x3ff
#endif
#define SIZE_YMAX(y) ((y) & YMAX_MASK)
WBR, Sergei