linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] video: imxfb: Fix the maximum value for yres
@ 2010-12-23 19:11 Fabio Estevam
  2010-12-24  0:39 ` Paul Mundt
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2010-12-23 19:11 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>
---
Changes since v1:
- factor out SIZE_YMAX definition
 drivers/video/imxfb.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index 5c363d0..4cddd3b 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -54,10 +54,11 @@
 #define SIZE_XMAX(x)	((((x) >> 4) & 0x3f) << 20)
 
 #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 SIZE_YMAX(y)	((y) & YMAX_MASK)
 
 #define LCDC_VPW	0x08
 #define VPW_VPW(x)	((x) & 0x3ff)
-- 
1.6.0.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] video: imxfb: Fix the maximum value for yres
  2010-12-23 19:11 [PATCH v2] video: imxfb: Fix the maximum value for yres Fabio Estevam
@ 2010-12-24  0:39 ` Paul Mundt
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Mundt @ 2010-12-24  0:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Dec 23, 2010 at 05:11:30PM -0200, 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>
> ---
> Changes since v1:
> - factor out SIZE_YMAX definition
>  drivers/video/imxfb.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
> index 5c363d0..4cddd3b 100644
> --- a/drivers/video/imxfb.c
> +++ b/drivers/video/imxfb.c
> @@ -54,10 +54,11 @@
>  #define SIZE_XMAX(x)	((((x) >> 4) & 0x3f) << 20)
>  
>  #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 SIZE_YMAX(y)	((y) & YMAX_MASK)
>  
>  #define LCDC_VPW	0x08
>  #define VPW_VPW(x)	((x) & 0x3ff)

Do you really want to restrict this by the build-time check? Presumably
you could just do this as:

#define YMAX_MASK	(cpu_is_mx1() ? 0x1ff : 0x3ff)

to support multiple configurations.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-24  0:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-23 19:11 [PATCH v2] video: imxfb: Fix the maximum value for yres Fabio Estevam
2010-12-24  0:39 ` Paul Mundt

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).