Commit 2d9c5597 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Tomi Valkeinen

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: default avatarVille Syrjälä <ville.syrjala@nokia.com>
Acked-by: default avatarTomi Valkeinen <tomi.valkeinen@nokia.com>
parent 24be78b3
...@@ -1454,7 +1454,10 @@ static unsigned long calc_fclk_five_taps(u16 width, u16 height, ...@@ -1454,7 +1454,10 @@ static unsigned long calc_fclk_five_taps(u16 width, u16 height,
do_div(tmp, 2 * out_height * ppl); do_div(tmp, 2 * out_height * ppl);
fclk = tmp; 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; tmp = pclk * (height - 2 * out_height) * out_width;
do_div(tmp, 2 * out_height * (ppl - out_width)); do_div(tmp, 2 * out_height * (ppl - out_width));
fclk = max(fclk, (u32) tmp); fclk = max(fclk, (u32) tmp);
...@@ -1634,7 +1637,7 @@ static int _dispc_setup_plane(enum omap_plane plane, ...@@ -1634,7 +1637,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
DSSDBG("required fclk rate = %lu Hz\n", fclk); DSSDBG("required fclk rate = %lu Hz\n", fclk);
DSSDBG("current fclk rate = %lu Hz\n", dispc_fclk_rate()); 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, " DSSERR("failed to set up scaling, "
"required fclk rate = %lu Hz, " "required fclk rate = %lu Hz, "
"current fclk rate = %lu Hz\n", "current fclk rate = %lu Hz\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment