2024-05-10 08:39:00

by Devarsh Thakkar

[permalink] [raw]
Subject: [PATCH RESEND v7 8/8] gpu: ipu-v3: Use generic macro for rounding to nearest multiple

Use generic macro round_closest_up for rounding to nearest multiple instead
of using local function.

Signed-off-by: Devarsh Thakkar <[email protected]>
---
V1->V6 (No change, patch introduced in V7)
---
drivers/gpu/ipu-v3/ipu-image-convert.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c
index 841316582ea9..5192a8b5c02c 100644
--- a/drivers/gpu/ipu-v3/ipu-image-convert.c
+++ b/drivers/gpu/ipu-v3/ipu-image-convert.c
@@ -477,8 +477,6 @@ static int calc_image_resize_coefficients(struct ipu_image_convert_ctx *ctx,
return 0;
}

-#define round_closest(x, y) round_down((x) + (y)/2, (y))
-
/*
* Find the best aligned seam position for the given column / row index.
* Rotation and image offsets are out of scope.
@@ -565,7 +563,7 @@ static void find_best_seam(struct ipu_image_convert_ctx *ctx,
* The closest input sample position that we could actually
* start the input tile at, 19.13 fixed point.
*/
- in_pos_aligned = round_closest(in_pos, 8192U * in_align);
+ in_pos_aligned = round_closest_up(in_pos, 8192U * in_align);
/* Convert 19.13 fixed point to integer */
in_pos_rounded = in_pos_aligned / 8192U;

--
2.39.1