public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Devarsh Thakkar <devarsht@ti.com>
To: <mchehab@kernel.org>, <hverkuil-cisco@xs4all.nl>,
	<linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<benjamin.gaignard@collabora.com>,
	<sebastian.fricke@collabora.com>, <p.zabel@pengutronix.de>,
	<airlied@gmail.com>, <daniel@ffwll.ch>,
	<dri-devel@lists.freedesktop.org>
Cc: <laurent.pinchart@ideasonboard.com>, <praneeth@ti.com>,
	<nm@ti.com>, <vigneshr@ti.com>, <a-bhatia1@ti.com>,
	<j-luthra@ti.com>, <b-brnich@ti.com>, <detheridge@ti.com>,
	<p-mantena@ti.com>, <vijayp@ti.com>, <devarsht@ti.com>,
	<andrzej.p@collabora.com>, <nicolas@ndufresne.ca>,
	<akpm@linux-foundation.org>, <gregkh@linuxfoundation.org>,
	<andriy.shevchenko@linux.intel.com>, <adobriyan@gmail.com>,
	<jani.nikula@intel.com>
Subject: [PATCH v11 11/11] gpu: ipu-v3: Use generic macro for rounding closest to specified value
Date: Fri, 31 May 2024 22:50:40 +0530	[thread overview]
Message-ID: <20240531172040.1316875-1-devarsht@ti.com> (raw)
In-Reply-To: <20240531170229.1270828-1-devarsht@ti.com>

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@ti.com>
---
V11: No change
V10: No change
V9: 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


      parent reply	other threads:[~2024-05-31 17:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31 17:02 [PATCH v11 00/11] Add V4L2 M2M Driver for E5010 JPEG Encoder Devarsh Thakkar
2024-05-31 17:06 ` [PATCH v11 01/11] media: dt-bindings: Add Imagination " Devarsh Thakkar
2024-05-31 17:08 ` [PATCH v11 02/11] media: imagination: Add E5010 JPEG Encoder driver Devarsh Thakkar
2024-05-31 17:09 ` [PATCH v11 03/11] media: v4l2-jpeg: Export reference quantization and huffman tables Devarsh Thakkar
2024-05-31 17:09 ` [PATCH v11 04/11] media: imagination: Use exported tables from v4l2-jpeg core Devarsh Thakkar
2024-05-31 17:11 ` [PATCH v11 05/11] media: verisilicon : Use exported tables from v4l2-jpeg for hantro codec Devarsh Thakkar
2024-05-31 17:11 ` [PATCH v11 06/11] math.h: Add macros for rounding to closest value Devarsh Thakkar
2024-05-31 17:42   ` Andy Shevchenko
2024-05-31 17:12 ` [PATCH v11 07/11] Documentation: core-api: Add math.h macros and functions Devarsh Thakkar
2024-05-31 17:41   ` Andy Shevchenko
2024-05-31 18:31   ` Randy Dunlap
2024-06-01 16:41     ` Devarsh Thakkar
2024-05-31 17:13 ` [PATCH v11 08/11] lib: add basic KUnit test for lib/math Devarsh Thakkar
2024-05-31 17:39   ` Andy Shevchenko
2024-05-31 17:16 ` [PATCH v11 09/11] lib: math_kunit: Add tests for new macros related to rounding to nearest value Devarsh Thakkar
2024-05-31 17:43   ` Andy Shevchenko
2024-05-31 17:18 ` [PATCH v11 10/11] media: imagination: Round to closest multiple for cropping region Devarsh Thakkar
2024-05-31 17:20 ` Devarsh Thakkar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240531172040.1316875-1-devarsht@ti.com \
    --to=devarsht@ti.com \
    --cc=a-bhatia1@ti.com \
    --cc=adobriyan@gmail.com \
    --cc=airlied@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andrzej.p@collabora.com \
    --cc=b-brnich@ti.com \
    --cc=benjamin.gaignard@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=detheridge@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=j-luthra@ti.com \
    --cc=jani.nikula@intel.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nicolas@ndufresne.ca \
    --cc=nm@ti.com \
    --cc=p-mantena@ti.com \
    --cc=p.zabel@pengutronix.de \
    --cc=praneeth@ti.com \
    --cc=sebastian.fricke@collabora.com \
    --cc=vigneshr@ti.com \
    --cc=vijayp@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox