diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2015-03-17 09:31:10 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2015-06-17 08:38:44 -0400 |
commit | ab6b2582b8f931f8f324fbf7bcb8338b8fc1eded (patch) | |
tree | ac55ad8baccf611a3aee8d5f99fc9b5a2bb17ea8 | |
parent | f5a734827b07dc907ae95698f91d4b1eaafe9a8a (diff) |
OMAPDSS: DISPC: add check for scaling limits
On OMAP3/AM43xx some scaling factors cause underflows/synclosts. After
studying this, I found that sometimes the driver uses three-tap scaling
with downscaling factor smaller than x0.5. This causes issues, as x0.5
is the limit for three-tap scaling.
The driver has FEAT_PARAM_DOWNSCALE parameter, but that seems to be for
five-tap scaling, which allows scaling down to x0.25.
This patch adds checks for both horizontal and vertical scaling. For
horizontal the HW always uses 5 taps, so the limit is x0.25.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | drivers/video/fbdev/omap2/dss/dispc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/video/fbdev/omap2/dss/dispc.c b/drivers/video/fbdev/omap2/dss/dispc.c index cc61513afdb4..ddce8fcfc5c1 100644 --- a/drivers/video/fbdev/omap2/dss/dispc.c +++ b/drivers/video/fbdev/omap2/dss/dispc.c | |||
@@ -2326,6 +2326,21 @@ again: | |||
2326 | error = (error || in_width > maxsinglelinewidth * 2 || | 2326 | error = (error || in_width > maxsinglelinewidth * 2 || |
2327 | (in_width > maxsinglelinewidth && *five_taps) || | 2327 | (in_width > maxsinglelinewidth && *five_taps) || |
2328 | !*core_clk || *core_clk > dispc_core_clk_rate()); | 2328 | !*core_clk || *core_clk > dispc_core_clk_rate()); |
2329 | |||
2330 | if (!error) { | ||
2331 | /* verify that we're inside the limits of scaler */ | ||
2332 | if (in_width / 4 > out_width) | ||
2333 | error = 1; | ||
2334 | |||
2335 | if (*five_taps) { | ||
2336 | if (in_height / 4 > out_height) | ||
2337 | error = 1; | ||
2338 | } else { | ||
2339 | if (in_height / 2 > out_height) | ||
2340 | error = 1; | ||
2341 | } | ||
2342 | } | ||
2343 | |||
2329 | if (error) { | 2344 | if (error) { |
2330 | if (*decim_x == *decim_y) { | 2345 | if (*decim_x == *decim_y) { |
2331 | *decim_x = min_factor; | 2346 | *decim_x = min_factor; |