aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev/omap2/dss/dispc.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2014-10-03 11:14:09 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-02-26 05:15:13 -0500
commit4e1d3ca0836b6b44c358c5ace79aa15a091a4142 (patch)
treea71c7575f7227d9c9cf01db2cd3f3e54f3fa032b /drivers/video/fbdev/omap2/dss/dispc.c
parent386f167c69ca1c6920581f2cb78be8a1f6691539 (diff)
OMAPDSS: DISPC: fix div by zero issue in overlay scaling
omapdrm doesn't always configure the overlays correctly, causing the overlay setup functions to be called with zero timings. This leads to division by zero error. This happens, for example, when a HDMI cable is not connected, but a user tries to setup a plane with scaling. Fixing omapdrm is a big job, so for now let's check for the bad timings in DISPC and return an error. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/fbdev/omap2/dss/dispc.c')
-rw-r--r--drivers/video/fbdev/omap2/dss/dispc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/video/fbdev/omap2/dss/dispc.c b/drivers/video/fbdev/omap2/dss/dispc.c
index 8805266a52f4..1123111d3940 100644
--- a/drivers/video/fbdev/omap2/dss/dispc.c
+++ b/drivers/video/fbdev/omap2/dss/dispc.c
@@ -2322,6 +2322,11 @@ static int dispc_ovl_calc_scaling(unsigned long pclk, unsigned long lclk,
2322 if (width == out_width && height == out_height) 2322 if (width == out_width && height == out_height)
2323 return 0; 2323 return 0;
2324 2324
2325 if (pclk == 0 || mgr_timings->pixelclock == 0) {
2326 DSSERR("cannot calculate scaling settings: pclk is zero\n");
2327 return -EINVAL;
2328 }
2329
2325 if ((caps & OMAP_DSS_OVL_CAP_SCALE) == 0) 2330 if ((caps & OMAP_DSS_OVL_CAP_SCALE) == 0)
2326 return -EINVAL; 2331 return -EINVAL;
2327 2332