Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753393AbbBYVCp (ORCPT ); Wed, 25 Feb 2015 16:02:45 -0500 Received: from mail-gw1-out.broadcom.com ([216.31.210.62]:17872 "EHLO mail-gw1-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752835AbbBYVCe (ORCPT ); Wed, 25 Feb 2015 16:02:34 -0500 X-IronPort-AV: E=Sophos;i="5.09,647,1418112000"; d="scan'208";a="58188065" From: Arun Ramamurthy To: Rob Herring , Pawel Moll , "Mark Rutland" , Ian Campbell , Kumar Gala , "Russell King" , Jean-Christophe Plagniol-Villard , Tomi Valkeinen CC: , , , Dmitry Torokhov , "Anatol Pomazau" , Jonathan Richardson , Scott Branden , Ray Jui , , Arun Ramamurthy Subject: [PATCH] video: ARM CLCD: Correcting timing checks for STN and TFT dispalys Date: Wed, 25 Feb 2015 13:01:22 -0800 Message-ID: <1424898082-1522-4-git-send-email-arun.ramamurthy@broadcom.com> X-Mailer: git-send-email 2.3.0 In-Reply-To: <1424898082-1522-1-git-send-email-arun.ramamurthy@broadcom.com> References: <1424898082-1522-1-git-send-email-arun.ramamurthy@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2329 Lines: 63 The minimum values for timing parameters such as left margin, right margin etc are different for STN and TFT dispalys. This commit fixes a check that does not account for this difference. Reviewed-by: Ray Jui Reviewed-by: Scott Branden Signed-off-by: Arun Ramamurthy --- include/linux/amba/clcd.h | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h index 6a3bc2d..0fe8a17 100644 --- a/include/linux/amba/clcd.h +++ b/include/linux/amba/clcd.h @@ -288,16 +288,28 @@ static inline int clcdfb_check(struct clcd_fb *fb, struct fb_var_screeninfo *var var->xres_virtual = var->xres = (var->xres + 15) & ~15; var->yres_virtual = var->yres = (var->yres + 1) & ~1; -#define CHECK(e,l,h) (var->e < l || var->e > h) - if (CHECK(right_margin, (5+1), 256) || /* back porch */ - CHECK(left_margin, (5+1), 256) || /* front porch */ - CHECK(hsync_len, (5+1), 256) || - var->xres > 4096 || - var->lower_margin > 255 || /* back porch */ - var->upper_margin > 255 || /* front porch */ - var->vsync_len > 32 || - var->yres > 1024) - return -EINVAL; +#define CHECK(e, l, h) (var->e < l || var->e > h) + if (!(fb->panel->cntl & CNTL_LCDTFT)) { + if (CHECK(right_margin, (5+1), 256) || /* back porch */ + CHECK(left_margin, (5+1), 256) || /* front porch */ + CHECK(hsync_len, (5+1), 256) || + var->xres > 4096 || + var->lower_margin > 255 || /* back porch */ + var->upper_margin > 255 || /* front porch */ + var->vsync_len > 32 || + var->yres > 1024) + return -EINVAL; + } else { + if (CHECK(right_margin, 1, 256) || /* back porch */ + CHECK(left_margin, 1, 256) || /* front porch */ + CHECK(hsync_len, 1, 256) || + var->xres > 4096 || + var->lower_margin > 255 || /* back porch */ + var->upper_margin > 255 || /* front porch */ + var->vsync_len > 32 || + var->yres > 1024) + return -EINVAL; + } #undef CHECK /* single panel mode: PCD = max(PCD, 1) */ -- 2.3.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/