aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/ipu-v3/ipu-image-convert.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c
index 4dfdbd1adf0d..e744f3527ce1 100644
--- a/drivers/gpu/ipu-v3/ipu-image-convert.c
+++ b/drivers/gpu/ipu-v3/ipu-image-convert.c
@@ -400,12 +400,14 @@ static int calc_image_resize_coefficients(struct ipu_image_convert_ctx *ctx,
400 if (WARN_ON(resized_width == 0 || resized_height == 0)) 400 if (WARN_ON(resized_width == 0 || resized_height == 0))
401 return -EINVAL; 401 return -EINVAL;
402 402
403 while (downsized_width >= resized_width * 2) { 403 while (downsized_width > 1024 ||
404 downsized_width >= resized_width * 2) {
404 downsized_width >>= 1; 405 downsized_width >>= 1;
405 downsize_coeff_h++; 406 downsize_coeff_h++;
406 } 407 }
407 408
408 while (downsized_height >= resized_height * 2) { 409 while (downsized_height > 1024 ||
410 downsized_height >= resized_height * 2) {
409 downsized_height >>= 1; 411 downsized_height >>= 1;
410 downsize_coeff_v++; 412 downsize_coeff_v++;
411 } 413 }