All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Cc: "Ville Syrjälä" <ville.syrjala@nokia.com>
Subject: [PATCH 14/15] DSS2: Reject scaling settings when they cannot be supported
Date: Fri, 08 Jan 2010 13:22:48 +0000	[thread overview]
Message-ID: <1262956969-1664-15-git-send-email-tomi.valkeinen@nokia.com> (raw)
In-Reply-To: <1262956969-1664-14-git-send-email-tomi.valkeinen@nokia.com>

From: Ville Syrj채l채 <ville.syrjala@nokia.com>

If the scaling ratio is below 0.5 video output width can't be identical
to the display width. Reject such settings.

Signed-off-by: Ville Syrj채l채 <ville.syrjala@nokia.com>
---
 drivers/video/omap2/dss/dispc.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index e2e0f9a..de8bfba 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1454,7 +1454,10 @@ static unsigned long calc_fclk_five_taps(u16 width, u16 height,
 		do_div(tmp, 2 * out_height * ppl);
 		fclk = tmp;
 
-		if (height > 2 * out_height && ppl != out_width) {
+		if (height > 2 * out_height) {
+			if (ppl = out_width)
+				return 0;
+
 			tmp = pclk * (height - 2 * out_height) * out_width;
 			do_div(tmp, 2 * out_height * (ppl - out_width));
 			fclk = max(fclk, (u32) tmp);
@@ -1634,7 +1637,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
 		DSSDBG("required fclk rate = %lu Hz\n", fclk);
 		DSSDBG("current fclk rate = %lu Hz\n", dispc_fclk_rate());
 
-		if (fclk > dispc_fclk_rate()) {
+		if (!fclk || fclk > dispc_fclk_rate()) {
 			DSSERR("failed to set up scaling, "
 					"required fclk rate = %lu Hz, "
 					"current fclk rate = %lu Hz\n",
-- 
1.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Cc: "Ville Syrjälä" <ville.syrjala@nokia.com>
Subject: [PATCH 14/15] DSS2: Reject scaling settings when they cannot be supported
Date: Fri,  8 Jan 2010 15:22:48 +0200	[thread overview]
Message-ID: <1262956969-1664-15-git-send-email-tomi.valkeinen@nokia.com> (raw)
In-Reply-To: <1262956969-1664-14-git-send-email-tomi.valkeinen@nokia.com>

From: Ville Syrjälä <ville.syrjala@nokia.com>

If the scaling ratio is below 0.5 video output width can't be identical
to the display width. Reject such settings.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
---
 drivers/video/omap2/dss/dispc.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index e2e0f9a..de8bfba 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1454,7 +1454,10 @@ static unsigned long calc_fclk_five_taps(u16 width, u16 height,
 		do_div(tmp, 2 * out_height * ppl);
 		fclk = tmp;
 
-		if (height > 2 * out_height && ppl != out_width) {
+		if (height > 2 * out_height) {
+			if (ppl == out_width)
+				return 0;
+
 			tmp = pclk * (height - 2 * out_height) * out_width;
 			do_div(tmp, 2 * out_height * (ppl - out_width));
 			fclk = max(fclk, (u32) tmp);
@@ -1634,7 +1637,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
 		DSSDBG("required fclk rate = %lu Hz\n", fclk);
 		DSSDBG("current fclk rate = %lu Hz\n", dispc_fclk_rate());
 
-		if (fclk > dispc_fclk_rate()) {
+		if (!fclk || fclk > dispc_fclk_rate()) {
 			DSSERR("failed to set up scaling, "
 					"required fclk rate = %lu Hz, "
 					"current fclk rate = %lu Hz\n",
-- 
1.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-01-08 13:22 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-08 13:22 [PATCH 00/15] OMAP DSS fixes Tomi Valkeinen
2010-01-08 13:22 ` Tomi Valkeinen
2010-01-08 13:22 ` [PATCH 01/15] OMAP: DSS2: DSI: fix VC channels in send_short and send_null Tomi Valkeinen
2010-01-08 13:22   ` Tomi Valkeinen
2010-01-08 13:22   ` [PATCH 02/15] OMAP: DSS2: DSI: print debug DCS cmd in hex Tomi Valkeinen
2010-01-08 13:22     ` Tomi Valkeinen
2010-01-08 13:22     ` [PATCH 03/15] OMAP: DSS2: Collect interrupt statistics Tomi Valkeinen
2010-01-08 13:22       ` Tomi Valkeinen
2010-01-08 13:22       ` [PATCH 04/15] OMAP: DSS2: Fix crash when panel doesn't define enable_te() Tomi Valkeinen
2010-01-08 13:22         ` Tomi Valkeinen
2010-01-08 13:22         ` [PATCH 05/15] OMAP: DSS2: RFBI: convert to new kfifo API Tomi Valkeinen
2010-01-08 13:22           ` Tomi Valkeinen
2010-01-08 13:22           ` [PATCH 06/15] OMAP: OMAPFB: fix clk_get for RFBI Tomi Valkeinen
2010-01-08 13:22             ` Tomi Valkeinen
2010-01-08 13:22             ` [PATCH 07/15] OMAP: OMAPFB: add dummy release function for omapdss Tomi Valkeinen
2010-01-08 13:22               ` Tomi Valkeinen
2010-01-08 13:22               ` [PATCH 08/15] MAINTAINERS: change omapfb maintainer Tomi Valkeinen
2010-01-08 13:22                 ` Tomi Valkeinen
2010-01-08 13:22                 ` [PATCH 09/15] MAINTAINERS: Combine DSS2 and OMAPFB2 into one entry Tomi Valkeinen
2010-01-08 13:22                   ` Tomi Valkeinen
2010-01-08 13:22                   ` [PATCH 10/15] OMAP: DSS2: Fix compile warning Tomi Valkeinen
2010-01-08 13:22                     ` Tomi Valkeinen
2010-01-08 13:22                     ` [PATCH 11/15] video/omap: add __init/__exit macros to drivers/video/omap/lcd_htcherald.c Tomi Valkeinen
2010-01-08 13:22                       ` Tomi Valkeinen
2010-01-08 13:22                       ` [PATCH 12/15] OMAP: DSS2: OMAPFB: fix omapfb_free_fbmem() Tomi Valkeinen
2010-01-08 13:22                         ` Tomi Valkeinen
2010-01-08 13:22                         ` [PATCH 13/15] OMAP: DSS2: Make check-delay-loops consistent Tomi Valkeinen
2010-01-08 13:22                           ` Tomi Valkeinen
2010-01-08 13:22                           ` Tomi Valkeinen [this message]
2010-01-08 13:22                             ` [PATCH 14/15] DSS2: Reject scaling settings when they cannot be supported Tomi Valkeinen
2010-01-08 13:22                             ` [PATCH 15/15] OMAP: DSS2: OMAPFB: fix crash when panel driver was not loaded Tomi Valkeinen
2010-01-08 13:22                               ` Tomi Valkeinen
2010-01-11 11:46                   ` [PATCH 09/15] MAINTAINERS: Combine DSS2 and OMAPFB2 into one Grazvydas Ignotas
2010-01-11 11:46                     ` [PATCH 09/15] MAINTAINERS: Combine DSS2 and OMAPFB2 into one entry Grazvydas Ignotas
2010-01-08 16:52           ` [PATCH 05/15] OMAP: DSS2: RFBI: convert to new kfifo API Tony Lindgren
2010-01-08 16:52             ` Tony Lindgren
2010-01-11  9:09             ` Tomi Valkeinen
2010-01-11  9:09               ` Tomi Valkeinen
2010-01-11  9:25               ` Sergey Lapin
2010-01-11  9:25                 ` Sergey Lapin
2010-01-12 10:35                 ` Tomi Valkeinen
2010-01-12 10:35                   ` Tomi Valkeinen
2010-01-08 13:29   ` [PATCH 01/15] OMAP: DSS2: DSI: fix VC channels in send_short Aguirre, Sergio
2010-01-08 13:29     ` [PATCH 01/15] OMAP: DSS2: DSI: fix VC channels in send_short and send_null Aguirre, Sergio
2010-01-08 13:33     ` [PATCH 01/15] OMAP: DSS2: DSI: fix VC channels in send_short Tomi Valkeinen
2010-01-08 13:33       ` [PATCH 01/15] OMAP: DSS2: DSI: fix VC channels in send_short and send_null Tomi Valkeinen

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=1262956969-1664-15-git-send-email-tomi.valkeinen@nokia.com \
    --to=tomi.valkeinen@nokia.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=ville.syrjala@nokia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.