Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp352023lqo; Fri, 10 May 2024 01:39:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV5aoTEHcy9UzXl4d12poJa9bY2ElQPV/2CyVsrO5mHsjWt+ytJF8x8k03qHzLOfFaS2KURlgV1yEXx8o3m8lygOjSfjwWJG2txhC85dQ== X-Google-Smtp-Source: AGHT+IF9v/OHrkRjXdeul6rQvUUMKvgotCfW4SQjyUZmEO+B8/laMLY87tYF0c69cWseJTXlOtgU X-Received: by 2002:a17:906:5291:b0:a59:9f88:f1f1 with SMTP id a640c23a62f3a-a5a2d1de7b1mr197343066b.19.1715330340054; Fri, 10 May 2024 01:39:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715330340; cv=pass; d=google.com; s=arc-20160816; b=OpfZtaQUHV/v603b1Z7Jiqy5Gou9PfyLU32pld5+7Snrh5tWufOLYHJFnyaq0lzb1k xuTY+BizBCmKXX6e3thInpqYqRKsTIXrhi8a4VVcgiF8dk/tlnMjVbVBwg1J3cn4pir7 4EuCw2/0K1N7srj9eJiXeZRsqyE2z3SMauF/aNE616Bp3+BI3wfLHT3u/sGZj2+R9iDB pQ8ZRwIiqCCCQVrvSBOyqg/ugxbwUo1xMm7ncAOHX8f+m3la7QlhdEY1U8Jwe8CkCga6 ukdKSVkxlFqrrw38MgJ8p9tO4mtQ+dBdLS6bITGZakcQXfJoIlIXtGpvvJNyd+BtMcbq DwGQ== 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=aMNcaysqDJDn+h1D5ugEv/Q4TocmhRT2g7o4pHDXixo=; fh=IZZR8bK8XOm4TZZqMP3UEtOvxc3YUC3byeSJBE1C+Bg=; b=zpcCvyqdlBJ8A6XQIpf9JSFHKUnHS0g6TH1OeDzT+Xzb5ltQ7wUbnWpU5pRMYwmE4I yv1AqlDpH2GgwEtZlX1mc0ywtlmdBwWDysXAfuwAaeP7NHo89fLLv6hRBeCvWjEA2pQj 2OzFC9s0I5lB+Iu1SmLMzhvVwyMnsKOMzVU/Jf0nyCc1v3832ggNLGwGmOg/WrI7aLEX nVSODkKnJISotSugEX+bbmnLCmkyzwDEGx9q2LkWDw9cMWRAIKBoAHoChRu1lWc4RD62 b34O8GxDvBoseM/xK6awgq8efaXYoDpBCeXwP3iPNqNOffVZsmp5u4uZOlUbcaftRrSv 9kww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=w9e8OHgE; 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-175452-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175452-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17946a7asi164750166b.173.2024.05.10.01.38.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 01:39:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175452-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=w9e8OHgE; 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-175452-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175452-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C52291F21BEA for ; Fri, 10 May 2024 08:38:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B21DF15E813; Fri, 10 May 2024 08:38:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="w9e8OHgE" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (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 4ADB910A3E; Fri, 10 May 2024 08:38:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715330329; cv=none; b=G8wbqZdCBQ2aa5DEavCjdenO8hrRZJMbNINyyGRIVyoJvFgzG/65NuuGLdyjPI2lpRzMAB94kXhO1ebUaBbrS3fl758czUO2eurr5DLwtGq1Cm2IzeZYuyKzZ14/KBDnheEef0JXbrywB25X5c7CpU2AudMLv889byUuhR1eh+M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715330329; c=relaxed/simple; bh=KyiYvMhETDO/noTBCSz8ORoc9EKNT/4TwTv3zc5evPk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mUvxb3YbChW8ZjAGeUPyxe8WpsNeaBwtBaZYBttGHvNLp4NyiDIrPneMHQhcDQW+6RKykSaQyBQQ39W12+wvF+daeOX7yB9byS0xW6xIVWR7XPKfW3QCWDBReP9lSKH8HcFqVnBEdUaaXle+hOH5exa4ZcWUTCaFD661yp1ViTE= 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=w9e8OHgE; arc=none smtp.client-ip=198.47.19.141 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 fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 44A8cZgW126229; Fri, 10 May 2024 03:38:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1715330315; bh=aMNcaysqDJDn+h1D5ugEv/Q4TocmhRT2g7o4pHDXixo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=w9e8OHgE+W/QQIfdMvuYrukXbRv7k0h8sAYoA/2TFm0LhiWu3La7dtYXnSsi/6mAs 2QKjFzz0jyTXH4uAlpJGa1UaFCDQApE9NRN8TB5zFmM2W8XLJqPGMz0shMYv/EJf2g IugIXJGgOodGeB30nOxn6zxZDQJVeO7jXSTEDzNw= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 44A8cZZv024341 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 10 May 2024 03:38:35 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 10 May 2024 03:38:35 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE103.ent.ti.com (10.64.6.24) 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, 10 May 2024 03:38:34 -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 44A8cYSU108820; Fri, 10 May 2024 03:38:34 -0500 From: Devarsh Thakkar To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , Subject: [PATCH RESEND v7 8/8] gpu: ipu-v3: Use generic macro for rounding to nearest multiple Date: Fri, 10 May 2024 14:08:33 +0530 Message-ID: <20240510083833.1284309-1-devarsht@ti.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240510082603.1263256-1> References: <20240510082603.1263256-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