Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp600091lqh; Fri, 31 May 2024 10:21:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWg8MJa6rGXsSHyMb7jKNku9qfeDDrUveAn9YNE8YG9aSYpzIA5Ja98tviZ8qkMX9sZVXTQy5J0SYmm9tg/GyGrxJsA+bOp8gabxXrY4w== X-Google-Smtp-Source: AGHT+IHxFfMY4MVP1EErDEjLTaLTPT33FzIrvoKLpWQgmZ/5yGFpl2LJtmd+/DqgS7iSu/KIUsko X-Received: by 2002:a05:6214:418c:b0:6ae:1532:9aaa with SMTP id 6a1803df08f44-6aecd4650d2mr44563286d6.12.1717176067398; Fri, 31 May 2024 10:21:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717176067; cv=pass; d=google.com; s=arc-20160816; b=bBctmlYw+EUgzBDJMqIaI4uS1zL1x/ZrECPQ2oZPQPiysfYf249kqjwzgNcE2yybcP VPpiUxy24MiHB+no8Hptvq1PTb15aa44Jlg1UH+XDtmcrG6HnlNrclIPG6Yt5etT3Tc6 QaPJ0/AonyLEQtvFuQRfCjnZ9bEGHXFIrbaiYZouWIj848tCioabkbqpulgbyKlMKpkX xMyczEBuZeNxxbvIwN/OL90rehaDlx7G80AR2WQNwV3afpGC/MgyY3zS32x2ukr/smEJ Ged7ndvHUSLdIoYKWSnsQg+khSVj+7I1WbSt6XHrfW4ErPXqZn+isAuDwxKRcwvyaJ98 I7Zw== 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=ffVvP1mYCb2bLo8Cs5RU7k30Th3EXnMGIqf8nh7iuwA=; fh=IZZR8bK8XOm4TZZqMP3UEtOvxc3YUC3byeSJBE1C+Bg=; b=dOLbELBTC2y+XaUUvS+20baGeEyrOBOCQY4nYxVeIhEnCZLqVKaY52qn3B71xDW1b9 ETBh1+CPod2zBYsItXf2SnFjTlGAPbYMpUGuOYb7A9f8l2BG69jie0i6MfbeaM/XG+25 UftDOdPBoESzAbhq0p4mXyO4qBc13/YEim3p5BRPyfHClKiab10dXB4oj/7bLPNFjxmM /rLf1Ss6s4rUr+PnRPMHKxKyIbo7MWID4tkYpyZ2w0pi4QMNgegAhUURXnhrSNxSChgj dLlYmCBRSlzGILno7/4JnBxfVm9lZVSmFRqmXZMO23iO4SN0rZu1ZCsRYkwPgPAo1eEh CqaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mJVVGRcm; 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-197246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197246-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b402189si24748316d6.205.2024.05.31.10.21.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 10:21:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mJVVGRcm; 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-197246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197246-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 255A21C25979 for ; Fri, 31 May 2024 17:21:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26A1B179654; Fri, 31 May 2024 17:20:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="mJVVGRcm" 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 D847D55E4C; Fri, 31 May 2024 17:20:56 +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=1717176058; cv=none; b=cEch/pZ5Fzytm1yefxL+hD6BXvWpCWHUTHuovP+Ma+FpZtE+b0KI6+PlATCdu9bLSGzzT/jBEaO5vEgeymJD7dLemz2nPxKVgvHFubeecx/trq31y3NNgXPEVU+oyoovnh2rwiqaWtmPpJumL7lNwx9J1EUPDcCklUPrHzzjSow= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717176058; c=relaxed/simple; bh=tj20nqvryjvkbc1ZO0fV+1fs+C7aPFAQUK8386m03UI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=p9+uEnG2I8ZS1m6Yh19o5qP79z0HejKjOHZdZx9uU+X6k4jGxghgabga0Y/uuEhfBk6JbHXZaSaSbGPe34MY/fJK0jFfW4gS/MLf0IRODxOZoIUTeq4qoS6Om65Fu9YOn4V8sx9F2BZ6PaWplAOXL49qFle0WMuKlEAKfA14OiM= 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=mJVVGRcm; 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 lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 44VHKfav041528; Fri, 31 May 2024 12:20:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1717176041; bh=ffVvP1mYCb2bLo8Cs5RU7k30Th3EXnMGIqf8nh7iuwA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=mJVVGRcmR2VYIKKCJgFhrMcTsFpHOqB/iUsoxfdzBF7ssntCoWD/m0PRl3tQru5v9 I7XufTAHKSttmJV799bKJG1hj0zpdxg7QTUlMQmXpw4F9WV3+dOE7PQjmgWu8UE6zJ e+vPng4EwGStDWSBJ9SN3eBvkoRoKsGL+q9gyHsA= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 44VHKf0N121719 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 31 May 2024 12:20:41 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 31 May 2024 12:20:41 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE105.ent.ti.com (10.64.6.26) 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, 31 May 2024 12:20:41 -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 44VHKe7Q065596; Fri, 31 May 2024 12:20:41 -0500 From: Devarsh Thakkar To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , 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 Message-ID: <20240531172040.1316875-1-devarsht@ti.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240531170229.1270828-1-devarsht@ti.com> References: <20240531170229.1270828-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 --- 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