summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLiu Ying <Ying.Liu@freescale.com>2013-09-22 12:37:39 +0800
committerPeng Fushi <fushi.peng@freescale.com>2014-08-28 16:50:42 +0800
commite981dc5973778ba260011662464269b8d3870bb0 (patch)
tree37ff078c4f76a703d6d950a6a4431e8d2e8583c5 /drivers
parent267695f5b9db21a1fcdf1145c791c1f28b444e4d (diff)
ENGR00280663-2 IPUv3 device: check downsize ratio overflow
IPUv3 IC task downsize scaling ratio cannot exceed or be equal to 8:1. This patch makes the code return error code if the ratio overflows. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mxc/ipu3/ipu_device.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/mxc/ipu3/ipu_device.c b/drivers/mxc/ipu3/ipu_device.c
index 384feeb60db1..0506038b0d4a 100644
--- a/drivers/mxc/ipu3/ipu_device.c
+++ b/drivers/mxc/ipu3/ipu_device.c
@@ -664,6 +664,12 @@ static void dump_check_err(struct device *dev, int err)
case IPU_CHECK_ERR_SPLIT_WITH_ROT:
dev_err(dev, "not support split mode with rotation\n");
break;
+ case IPU_CHECK_ERR_W_DOWNSIZE_OVER:
+ dev_err(dev, "horizontal downsizing ratio overflow\n");
+ break;
+ case IPU_CHECK_ERR_H_DOWNSIZE_OVER:
+ dev_err(dev, "vertical downsizing ratio overflow\n");
+ break;
default:
break;
}
@@ -965,6 +971,16 @@ static int check_task(struct ipu_task_entry *t)
&t->set.o_off, &t->set.o_uoff,
&t->set.o_voff, &t->set.ostride);
+ if (t->output.crop.w * 8 <= t->input.crop.w) {
+ ret = IPU_CHECK_ERR_W_DOWNSIZE_OVER;
+ goto done;
+ }
+
+ if (t->output.crop.h * 8 <= t->input.crop.h) {
+ ret = IPU_CHECK_ERR_H_DOWNSIZE_OVER;
+ goto done;
+ }
+
if ((IPU_PIX_FMT_TILED_NV12 == t->input.format) ||
(IPU_PIX_FMT_TILED_NV12F == t->input.format)) {
if ((t->input.crop.w > soc_max_in_width(1)) ||