From patchwork Fri Dec 24 12:28:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 431921 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBOCcKlb018867 for ; Fri, 24 Dec 2010 12:38:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752178Ab0LXMiS (ORCPT ); Fri, 24 Dec 2010 07:38:18 -0500 Received: from db3ehsobe001.messaging.microsoft.com ([213.199.154.139]:36916 "EHLO DB3EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752077Ab0LXMiS (ORCPT ); Fri, 24 Dec 2010 07:38:18 -0500 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 24 Dec 2010 12:38:21 +0000 (UTC) X-Greylist: delayed 906 seconds by postgrey-1.27 at vger.kernel.org; Fri, 24 Dec 2010 07:38:17 EST Received: from mail58-db3-R.bigfish.com (10.3.81.248) by DB3EHSOBE001.bigfish.com (10.3.84.21) with Microsoft SMTP Server id 14.1.225.8; Fri, 24 Dec 2010 12:23:08 +0000 Received: from mail58-db3 (localhost.localdomain [127.0.0.1]) by mail58-db3-R.bigfish.com (Postfix) with ESMTP id AEA3815001B8; Fri, 24 Dec 2010 12:23:08 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:de01egw02.freescale.net; RD:de01egw02.freescale.net; EFVD:NLI Received: from mail58-db3 (localhost.localdomain [127.0.0.1]) by mail58-db3 (MessageSwitch) id 1293193388414305_20665; Fri, 24 Dec 2010 12:23:08 +0000 (UTC) Received: from DB3EHSMHS011.bigfish.com (unknown [10.3.81.249]) by mail58-db3.bigfish.com (Postfix) with ESMTP id 588AB490053; Fri, 24 Dec 2010 12:23:08 +0000 (UTC) Received: from de01egw02.freescale.net (192.88.165.103) by DB3EHSMHS011.bigfish.com (10.3.87.111) with Microsoft SMTP Server (TLS) id 14.1.225.8; Fri, 24 Dec 2010 12:23:04 +0000 Received: from az33smr01.freescale.net (az33smr01.freescale.net [10.64.34.199]) by de01egw02.freescale.net (8.14.3/8.14.3) with ESMTP id oBOCN0Pv011893; Fri, 24 Dec 2010 05:23:02 -0700 (MST) Received: from localhost.localdomain ([10.29.240.182]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id oBOCMviX001675; Fri, 24 Dec 2010 06:22:57 -0600 (CST) From: Fabio Estevam To: CC: , , , Fabio Estevam Subject: [PATCH v3] video: imxfb: Fix the maximum value for yres Date: Fri, 24 Dec 2010 10:28:24 -0200 Message-ID: <1293193704-2855-1-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.6.0.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index 5c363d0..1ab2c25 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c @@ -53,11 +53,8 @@ #define LCDC_SIZE 0x04 #define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20) -#ifdef CONFIG_ARCH_MX1 -#define SIZE_YMAX(y) ((y) & 0x1ff) -#else -#define SIZE_YMAX(y) ((y) & 0x3ff) -#endif +#define YMAX_MASK (cpu_is_mx1() ? 0x1ff : 0x3ff) +#define SIZE_YMAX(y) ((y) & YMAX_MASK) #define LCDC_VPW 0x08 #define VPW_VPW(x) ((x) & 0x3ff) @@ -623,7 +620,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)