From 93c256335b52ce0ab0bfdfdaa04da65051ebf506 Mon Sep 17 00:00:00 2001 From: Yu Qiaowei Date: Wed, 5 Jan 2022 10:49:09 +0800 Subject: [PATCH] video: rockchip: rga3: Fix wrong scaling check Signed-off-by: Yu Qiaowei Change-Id: I3159ef8c8a7a425e0106666477b0b5eaa6131d7d --- drivers/video/rockchip/rga3/rga3_reg_info.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/rockchip/rga3/rga3_reg_info.c b/drivers/video/rockchip/rga3/rga3_reg_info.c index 5fa1bf906f7c..64e1e2af75c2 100644 --- a/drivers/video/rockchip/rga3/rga3_reg_info.c +++ b/drivers/video/rockchip/rga3/rga3_reg_info.c @@ -1635,11 +1635,11 @@ static int rga3_scale_check(const struct rga3_req *req) win0_daw = req->win0.dst_act_w; win0_dah = req->win0.dst_act_h; - if (((win0_saw >> 3) >= win0_daw) || ((win0_sah >> 3) >= win0_dah)) { + if (((win0_saw >> 3) > win0_daw) || ((win0_sah >> 3) > win0_dah)) { pr_info("win0 unsupported to scaling less than 1/8 times.\n"); return -EINVAL; } - if (((win0_daw >> 3) >= win0_saw) || ((win0_dah >> 3) >= win0_sah)) { + if (((win0_daw >> 3) > win0_saw) || ((win0_dah >> 3) > win0_sah)) { pr_info("win0 unsupported to scaling more than 8 times.\n"); return -EINVAL; } @@ -1650,11 +1650,11 @@ static int rga3_scale_check(const struct rga3_req *req) win1_daw = req->win1.dst_act_w; win1_dah = req->win1.dst_act_h; - if (((win1_saw >> 3) >= win1_daw) || ((win1_sah >> 3) >= win1_dah)) { + if (((win1_saw >> 3) > win1_daw) || ((win1_sah >> 3) > win1_dah)) { pr_info("win1 unsupported to scaling less than 1/8 times.\n"); return -EINVAL; } - if (((win1_daw >> 3) >= win1_saw) || ((win1_dah >> 3) >= win1_sah)) { + if (((win1_daw >> 3) > win1_saw) || ((win1_dah >> 3) > win1_sah)) { pr_info("win1 unsupported to scaling more than 8 times.\n"); return -EINVAL; }