drm/rockchip: vop2: fix compile warning

[clang] drivers/gpu/drm/rockchip/rockchip_drm_vop2.c:2709:9: warning:
Division by zero [core.DivideZero]

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I95a28037ab52a10e3d2e333b773ade4f8e2e0c87
This commit is contained in:
Sandy Huang
2024-04-28 14:46:40 +08:00
committed by Finley Xiao
parent 5afebb19ce
commit dc39be5e13

View File

@@ -2700,10 +2700,8 @@ static uint16_t vop2_scale_factor(enum scale_mode mode,
/*
* A workaround to avoid zero div.
*/
if ((dst == 1) || (src == 1)) {
dst = dst + 1;
src = src + 1;
}
if (dst < 2)
dst = 2;
if ((mode == SCALE_DOWN) && (filter_mode == VOP2_SCALE_DOWN_BIL)) {
fac = VOP2_BILI_SCL_DN(src, dst);