* [PATCH] video: imxfb: Fix the maximum value for yres
@ 2010-12-23 17:17 Fabio Estevam
2010-12-23 18:42 ` Sergei Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2010-12-23 17:17 UTC (permalink / raw)
To: linux-arm-kernel
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 <fabio.estevam@freescale.com>
---
drivers/video/imxfb.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index 5c363d0..5d2d337 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -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 *inf
if (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)
--
1.6.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] video: imxfb: Fix the maximum value for yres
2010-12-23 17:17 [PATCH] video: imxfb: Fix the maximum value for yres Fabio Estevam
@ 2010-12-23 18:42 ` Sergei Shtylyov
0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2010-12-23 18:42 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
Fabio Estevam wrote:
> 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 <fabio.estevam@freescale.com>
[...]
> diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
> index 5c363d0..5d2d337 100644
> --- a/drivers/video/imxfb.c
> +++ b/drivers/video/imxfb.c
> @@ -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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-23 18:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-23 17:17 [PATCH] video: imxfb: Fix the maximum value for yres Fabio Estevam
2010-12-23 18:42 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).