diff options
author | Ville Syrjälä <ville.syrjala@nokia.com> | 2010-01-08 04:56:41 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-01-12 05:10:19 -0500 |
commit | 2d9c5597ad1408885fdef5838aa27a8a0ee9e915 (patch) | |
tree | 896ac2b767482c64802068232705c2298515fdae | |
parent | 24be78b32f0a6e14aead3eac89d768a361b091b3 (diff) |
OMAP: DSS2: Reject scaling settings when they cannot be supported
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>
Acked-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
-rw-r--r-- | 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 e2e0f9ae735..de8bfbac9e2 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, | |||
1454 | do_div(tmp, 2 * out_height * ppl); | 1454 | do_div(tmp, 2 * out_height * ppl); |
1455 | fclk = tmp; | 1455 | fclk = tmp; |
1456 | 1456 | ||
1457 | if (height > 2 * out_height && ppl != out_width) { | 1457 | if (height > 2 * out_height) { |
1458 | if (ppl == out_width) | ||
1459 | return 0; | ||
1460 | |||
1458 | tmp = pclk * (height - 2 * out_height) * out_width; | 1461 | tmp = pclk * (height - 2 * out_height) * out_width; |
1459 | do_div(tmp, 2 * out_height * (ppl - out_width)); | 1462 | do_div(tmp, 2 * out_height * (ppl - out_width)); |
1460 | fclk = max(fclk, (u32) tmp); | 1463 | fclk = max(fclk, (u32) tmp); |
@@ -1634,7 +1637,7 @@ static int _dispc_setup_plane(enum omap_plane plane, | |||
1634 | DSSDBG("required fclk rate = %lu Hz\n", fclk); | 1637 | DSSDBG("required fclk rate = %lu Hz\n", fclk); |
1635 | DSSDBG("current fclk rate = %lu Hz\n", dispc_fclk_rate()); | 1638 | DSSDBG("current fclk rate = %lu Hz\n", dispc_fclk_rate()); |
1636 | 1639 | ||
1637 | if (fclk > dispc_fclk_rate()) { | 1640 | if (!fclk || fclk > dispc_fclk_rate()) { |
1638 | DSSERR("failed to set up scaling, " | 1641 | DSSERR("failed to set up scaling, " |
1639 | "required fclk rate = %lu Hz, " | 1642 | "required fclk rate = %lu Hz, " |
1640 | "current fclk rate = %lu Hz\n", | 1643 | "current fclk rate = %lu Hz\n", |