[PATCH v13 13/13] gpu: ipu-v3: Use generic macro for rounding closest to specified value
From: Devarsh Thakkar
Date: Fri Jun 07 2024 - 09:37:43 EST
Use generic macro round_closest_up() for rounding closest to specified
value instead of using local macro round_closest().
There is no change from functionality point of view as round_closest_up()
is functionally same as the previously used local macro round_closest().
Signed-off-by: Devarsh Thakkar <devarsht@xxxxxx>
---
V9-V13: No change
V8: Update commit message
V1->V7 : (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