linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
To: Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Russell King <linux@arm.linux.org.uk>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-fbdev@vger.kernel.org, Dmitry Torokhov <dtor@google.com>,
	Anatol Pomazau <anatol@google.com>,
	Jonathan Richardson <jonathar@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Ray Jui <rjui@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Arun Ramamurthy <arun.ramamurthy@broadcom.com>
Subject: [PATCH] video: ARM CLCD: Correcting timing checks for STN and TFT dispalys
Date: Wed, 25 Feb 2015 21:01:22 +0000	[thread overview]
Message-ID: <1424898082-1522-4-git-send-email-arun.ramamurthy@broadcom.com> (raw)
In-Reply-To: <1424898082-1522-1-git-send-email-arun.ramamurthy@broadcom.com>

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 <rjui@broadcom.com>
Reviewed-by: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
---
 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


  parent reply	other threads:[~2015-02-25 21:01 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 21:01 [PATCH] video: ARM CLCD: Added dt support to set tim2 register Arun Ramamurthy
     [not found] ` <1424898082-1522-1-git-send-email-arun.ramamurthy-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-02-25 21:01   ` [PATCH] video: ARM CLCD: Added support for FBIOPAN_DISPLAY and virtual y resolution Arun Ramamurthy
2015-03-02 16:08     ` Pawel Moll
2015-03-02 16:11       ` Russell King - ARM Linux
2015-03-02 19:09         ` Arun Ramamurthy
2015-03-02 19:12           ` Russell King - ARM Linux
     [not found]           ` <54F4B57F.3030306-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-03-02 23:22             ` Rob Herring
     [not found]               ` <CAL_JsqKMP4JxQ-Q5V1skcaKPdhC4v-joOrNyn++tMfat8arMKA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-04  0:31                 ` Arun Ramamurthy
2015-03-02 16:11   ` [PATCH] video: ARM CLCD: Added dt support to set tim2 register Pawel Moll
2015-03-02 19:09     ` Arun Ramamurthy
2015-03-03 10:02       ` Pawel Moll
     [not found]         ` <1425376977.3092.26.camel-5wv7dgnIgG8@public.gmane.org>
2015-03-03 10:22           ` Pawel Moll
     [not found]             ` <1425378127.3092.38.camel-5wv7dgnIgG8@public.gmane.org>
2015-03-04  0:37               ` Arun Ramamurthy
2015-03-05 10:59                 ` Pawel Moll
2015-03-09 16:16             ` Russell King - ARM Linux
2015-02-25 21:01 ` [PATCH] video: ARM CLCD: Added support for FBIO_WAITFORVSYNC Arun Ramamurthy
     [not found]   ` <1424898082-1522-3-git-send-email-arun.ramamurthy-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-03-02 16:00     ` Pawel Moll
2015-03-02 19:09       ` Arun Ramamurthy
2015-03-03 10:01         ` Pawel Moll
2015-03-04  0:35           ` Arun Ramamurthy
     [not found]       ` <1425312029.3092.1.camel-5wv7dgnIgG8@public.gmane.org>
2015-03-02 23:27         ` Rob Herring
2015-03-04  0:31           ` Arun Ramamurthy
2015-03-02 23:29     ` Rob Herring
     [not found]       ` <CAL_JsqJfA3Pxvdux-Um9nFoaZpRh30S9d1TQid_TchDH_qo7Ow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-04  0:33         ` Arun Ramamurthy
2015-02-25 21:01 ` Arun Ramamurthy [this message]
2016-02-10 13:58 ` [PATCH] video: ARM CLCD: Added dt support to set tim2 register Linus Walleij
2016-02-10 17:48   ` Ray Jui
     [not found]     ` <a005c107-0b15-65ec-eede-a713ee1a8bd9-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2016-02-15 13:25       ` Linus Walleij
     [not found]         ` <CAE_wzQ-s4-T8wDJjwtLkr73_1j8JpRVxBaBJRfskMeACdUxPig@mail.gmail.com>
2016-02-17 17:42           ` Ray Jui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424898082-1522-4-git-send-email-arun.ramamurthy@broadcom.com \
    --to=arun.ramamurthy@broadcom.com \
    --cc=anatol@google.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dtor@google.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jonathar@broadcom.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).