Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp33205lqo; Thu, 9 May 2024 11:42:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVX8yCOIkSg2bhHuLLecyhEHuSpqvT6YDWWM0vIK9V/TEN4NNr5SOEgKGQsraBTuAu/ouTp4jSuhscPh9HEx6nPGKuVovZFnzEwTndA8Q== X-Google-Smtp-Source: AGHT+IFTRmZENSh3QIei9mN6XOpllbb6+iOZka8ycMr6GxOZ47NlHOhbDAhacHI7H097QxjnYIqx X-Received: by 2002:a05:6358:249d:b0:183:ddb0:eb03 with SMTP id e5c5f4694b2df-193bb2ae024mr34077655d.21.1715280122671; Thu, 09 May 2024 11:42:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715280122; cv=pass; d=google.com; s=arc-20160816; b=TWgVYvPvPEMPLXqLL+2be80ijV21wWtkOmdomwRMJqT44bmCuK0ejRP/R5+QRvwLG3 eYfSoWxuh5ocIHdgCB/vVrgjB3OMKqiUYpOrLiGcfigQ1TyqHRLSeWa8i6GDYYybQHZ+ uRvBuaVYWoKn81MIE+ZlkFu9CTVvNd/Z5FEomaR/7BhgXlxUS9hgvaD9ZL9bfZSmpeOU eri4rSAdQ8Dp/TDRsJvvHEaN+Pz88UX5zSuVdIy6aQhWksznOxrLeKA/kYFy9LK/xfjz b+B8KmM5UUiosFx3RU6rdiTkXQcMjw1oAAR0AP1DV1PQYAwQYVyeP04pqFoxnf/3Gzsg isyQ== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=aMNcaysqDJDn+h1D5ugEv/Q4TocmhRT2g7o4pHDXixo=; fh=IZZR8bK8XOm4TZZqMP3UEtOvxc3YUC3byeSJBE1C+Bg=; b=N90z1BlGcC1RUfqr7YtNwXfSS58Gg/KRqJAORjA+WtP7kNU1qR+ToxUkjByU1pv9qr iZ5agGaXzjXNqNvYT0ktihJJbnae+48W79qsk0UcEW1aRirJdnd5IiQi6mmErHEi+KC8 BLb/xVKt63FFIJxToFdq3fYmGiLEArgQHdwbvMxCYhZuIi4PjgP4Lp5zyhv22hhFzQMY s7SrPPBYfvPvFWqtN4ij/kYtygBir23IxDOgV+RhIYHrvyjpvlBx/Y5auWTOS8GkRPVv tQndiSfU1Gby/FE5vYnv7Hmh7QqOne90KWVr/9apJBLmqsH10x746gGW2eQPuK4yr5f8 9IIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=l4O12OvF; 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-174784-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174784-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 41be03b00d2f7-6341404fa4asi2026218a12.894.2024.05.09.11.42.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 11:42:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174784-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=l4O12OvF; 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-174784-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174784-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 0E782280DCB for ; Thu, 9 May 2024 18:41:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B278A84A27; Thu, 9 May 2024 18:40:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="l4O12OvF" 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 624EE7F464; Thu, 9 May 2024 18:40:24 +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=1715280025; cv=none; b=Mnip7EOASOJopHr8stijz/z4x4YmwNy4AZEGea1vZALcQOyfK7JlqMcG9h6EtSCJDb3QFMMsJNyDLePmdsJ79ACuErrbtKf3qlTUf9Nn7JnXKWnUPhOJ4TzaCjosgH4tCwrImj+FLn2f2QYbK6YVwq0NMLxH0JfolA0LDyzPc+s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715280025; c=relaxed/simple; bh=KyiYvMhETDO/noTBCSz8ORoc9EKNT/4TwTv3zc5evPk=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Rwygd8pF3vNpqomGhsNYqFStct5H3ysvUbCxy1Pp5NvY2XmSMvLKqpndSBNIxQmtRChmocjO8D4szNJ/gCTOSErJVaIQS9FYly1V5AhaUVuBlxFSrJuv+qfS35qWMEDFPKnGeXxrO/Cfq1n8+ozOAg+UGGSknvRuIAqtVj9exSs= 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=l4O12OvF; 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 fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 449IeCwH059877; Thu, 9 May 2024 13:40:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1715280012; bh=aMNcaysqDJDn+h1D5ugEv/Q4TocmhRT2g7o4pHDXixo=; h=From:To:CC:Subject:Date; b=l4O12OvFcUPsy8dMLaXN0DGXhKBtkvcCCBIzSVNQLeejlbIbypSyde7w63neEf3UN w8MuW4kx4Bvg2A6JnMhOxMW/tk0DZ/P/iDeniKChGtU4oLrfrUPp5ZZqdiH09HpsmK 2Wu9xoAL9qCQSQ27Y3i16FP+nfurCTA7iEAc1254= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 449IeCLN070670 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 9 May 2024 13:40:12 -0500 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 9 May 2024 13:40:11 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) 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 via Frontend Transport; Thu, 9 May 2024 13:40:11 -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 449IeBEc006178; Thu, 9 May 2024 13:40:11 -0500 From: Devarsh Thakkar To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , Subject: [PATCH v7 8/8] gpu: ipu-v3: Use generic macro for rounding to nearest multiple Date: Fri, 10 May 2024 00:10:10 +0530 Message-ID: <20240509184010.4065359-1-devarsht@ti.com> X-Mailer: git-send-email 2.39.1 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 to nearest multiple instead of using local function. Signed-off-by: Devarsh Thakkar --- 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