Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1110121lqo; Fri, 17 May 2024 10:56:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWE85K2YGH1NLcbuAkl5t8dExGa8S3YfIhv2YQ/lHebaJfDuthac4l/2iPs6EsdnYV7hDu8U7CzxVwBAW7nuMIyeI/I04RV2N8jWLfV+Q== X-Google-Smtp-Source: AGHT+IFfljTwtwuCGVWZBs9+oxVIX14/jOdiHzCSupVlfWBOoT5b1AnMoFjdpwfCsZgBYdHi2Xqw X-Received: by 2002:aa7:8e92:0:b0:6f6:7c17:704f with SMTP id d2e1a72fcca58-6f67c1770b1mr5496933b3a.5.1715968600102; Fri, 17 May 2024 10:56:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715968600; cv=pass; d=google.com; s=arc-20160816; b=LpK3vvsUmM31xqGL7TZgpplPoTirIsBSWQAvY9bOHNrdYqWTLm30VDMqBmqjd6DYIp bfhc5D+flDLi8u4egVBDa9QBPljCJkF35mh6ksPqlDQRgTQPcEA15u496bXSHN4O63c8 l62Bb8Xca5HneyWCR63ttr9ZUz0HlHZT8N8lK+z1QpkA/6yeBgAd5Xd5Gr73n9RJAO1H LosRCSg2u0A1HALf4QT77AW5o7cMpGIZa8YnVj5AcP0df1BBUOFe/5+jHF7rmYXvIQv7 IfeOB9QpS1PPpVPfB9yGDGGZU00OX7WpemEtcQiOxX6zpHt+T6uFYuLCu/4Ot4B4zjWJ LDjg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Z0Jtv/ACxyCng0G72W+TurXG21YdGWxQxYgqPeRPW3k=; fh=IZZR8bK8XOm4TZZqMP3UEtOvxc3YUC3byeSJBE1C+Bg=; b=QQNcfdLu5xFsuLpWlYYUFYwD2XKpcP2R9m/hVHDnFOMezfLtcgliFhiVmxq0zxyqMy ksPEyiP4Y45vu6dV3wYY/BcIzBemPcL1ElqpvcTOfLkUlLeoq52EuAPuA7mhAaxy4KJR iHqjO+nNnwoFPF1/2Pd6kXKgsHEFokHUd5zCiuKt7sdPU1xqXY0hTlEftmUSFVTpt/Da lUUctvyxMUVBl4SNhmLhAUW2shbfvcDpXS1DHlhNm3FRDXj3B7fkS4B/KvXEexXdH3ds E96NOcZw4AkpA0MN6D2HCHDJLtlLV4zWSckZWEzcl8fE0YOsY47kFGUJBFbWF4nKYUeE fjRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=wBHbaq7T; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-182479-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182479-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2a728e8si18333987b3a.14.2024.05.17.10.56.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 10:56:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182479-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=wBHbaq7T; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-182479-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182479-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 25703285AAB for ; Fri, 17 May 2024 17:53:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CC1415957E; Fri, 17 May 2024 17:41:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="wBHbaq7T" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C2E6158D8E; Fri, 17 May 2024 17:41:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715967672; cv=none; b=mKbKWN0ucHi/AOaLwbikrr/ZkN5vHZBw9fIA/B1xWw8McuBv2YGOY1ktxEyIyz+PHiQY+/CONXaSk8glYXudDBlaTjJbI5TPrSNQkmEdyel2WkLTi3Ejirfou3Br+dj9NAyzG6wP/3qWfniu1ZSEXb3Ky7SPq8tpgtL1LoI5XFY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715967672; c=relaxed/simple; bh=XvaXRpk5jVDfaLF6Tcl6t3qPRumZhLNoAB2RuaBv05A=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=s4fWxxmfLIYnCgXcZ5++HAxJpZl6XjwYN7XN3gljwP0I7zzsFw8i9TFYqHN2q38hQ+CU3sE3Kp5d6pOZC8T6B6Q3s7h4zEqJptllS27OdlWs0w+VN6Me3+RL6xPSm3O7+nVQNh2zvo+PFceIAeg8pHklnrnutqu+54hD1utdogY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=wBHbaq7T; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 44HHetIk116593; Fri, 17 May 2024 12:40:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1715967655; bh=Z0Jtv/ACxyCng0G72W+TurXG21YdGWxQxYgqPeRPW3k=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=wBHbaq7T/IS+g9pzSpRs30RDyFKtefn5kA+Uq+ATKfcReki/7cvkxH0fiNs5/VVby UQYjJ+bPjhHSAAyIqa3TsAyId34uF4XwOsk/EICVTXzIz+d4bvKJtEdqrEkQLwTmtb O9VCao4US2juAc96sMtZ+/Mxf6/7jpvSKfLdXWP8= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 44HHetkw031054 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 May 2024 12:40:55 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 17 May 2024 12:40:55 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 17 May 2024 12:40:55 -0500 Received: from localhost (ti.dhcp.ti.com [172.24.227.95] (may be forged)) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 44HHesjK018723; Fri, 17 May 2024 12:40:55 -0500 From: Devarsh Thakkar To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , Subject: [PATCH v8 10/10] gpu: ipu-v3: Use generic macro for rounding closest to specified value Date: Fri, 17 May 2024 23:10:54 +0530 Message-ID: <20240517174054.812332-1-devarsht@ti.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240517171532.748684-1-devarsht@ti.com> References: <20240517171532.748684-1-devarsht@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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 --- 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