aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/omap2/dss
diff options
context:
space:
mode:
authorVille Syrjälä2010-01-08 11:56:41 +0200
committerTomi Valkeinen2010-01-12 12:10:19 +0200
commit2d9c5597ad1408885fdef5838aa27a8a0ee9e915 (patch)
tree896ac2b767482c64802068232705c2298515fdae /drivers/video/omap2/dss
parent24be78b32f0a6e14aead3eac89d768a361b091b3 (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>
Diffstat (limited to 'drivers/video/omap2/dss')
-rw-r--r--drivers/video/omap2/dss/dispc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index e2e0f9ae7353..de8bfbac9e26 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",