Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1182374lqo; Sat, 11 May 2024 10:49:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVwkHte5ENZU40i4bv2PdnNNf89KHlgoO1iYdJDS8i5BBQKXmbX/tmDp8j/BRpNDUtzP0rRzA7g4/31rewo1tT3NToXYD1wjqke3WEkFw== X-Google-Smtp-Source: AGHT+IGH3u7RGTBah2RJi5N6yiDi7tuSEPCN2cALj2DuV8ue//OYGUVdjkoohJA8l1B/rbWu8kkw X-Received: by 2002:a17:906:a408:b0:a59:ba2b:5921 with SMTP id a640c23a62f3a-a5a2d67f991mr369985866b.72.1715449794809; Sat, 11 May 2024 10:49:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715449794; cv=pass; d=google.com; s=arc-20160816; b=G3KBgOnZ9Hh5x10o2MeVD/ATxobV6NreqYs8MHHOpCZhjzDuFlHF5hSbBzReQKVRhS 7fX5oEvbrZuRg9exqzSyX3BlMFBU2R+41iW2iISBTGeA71UPsw4S8cz21jK9Rnnr7BO6 kpp6c9TRe8B1JEAnMsvkHSiiJB8oAWoidUzixNvv/GbtlMNVOnNyqWk/scJlF1Qnbg22 t4WSghvtv4x9EGybhBOXcn/LxXZfzk394MnfLmtBy5Pb3VM+F/96abjT/sUAQVp23G5Z p1zODivN1R0+zuhlLaU8p7VD1au6jzDuWvsD8cEDK9G3dhUkYx13hFWZMO8Lcrk3JgYk J43g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=4215bRTgwZdqG5KkXJIS7GulsBaMdC4XYJ8YcQUiUgk=; fh=t0+P+GuXHfQSEGKjrF/5L4dtBkoEs4kCEDbY+BnSe2A=; b=AvBUv6xHFzBf01JjMOzfDrep4CAnq8noaohaUqqMCRPe8+5Yk2mkfbm81YWdSZvpZf Eev8qQ5dY3GeQplYPMjBiUP/kODTKgy3C0Tt7qoSjhVNYxoyn4oBVRNWrVUgQuPL8wri cntKoCn+SnIaXBtexRaO0BxgG5xEj+WPk3WZ8mx4K/Fbr0tkJ1DGSOIXkvFdw6MF8S3b yoQjg/4ZEV4FiUqch2Sl+gGiH1huEAoIXvpNAwVjVwzy+FwZDAPtBmBoZ4FlGsIHUth1 yY6+QddXD8TfYB4XmlFmVuvJN9p2dTPZIjiTYOqNxQOCcFkdL1xH03jRsJ0UXnYA0/rl arTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lxV0qPuW; 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-176671-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176671-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a179463c5si330257866b.75.2024.05.11.10.49.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 10:49:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176671-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lxV0qPuW; 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-176671-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176671-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 7E1281F21465 for ; Sat, 11 May 2024 17:49:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35FC61C6B7; Sat, 11 May 2024 17:49:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="lxV0qPuW" 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 B3AF017588; Sat, 11 May 2024 17:49:42 +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=1715449784; cv=none; b=dVpp9tpZ+47j8Lt2Vy8wTy0ihffDjVskSHqtSR3GQFuA6wL67CWsuouHh54BmdQfNgUb58FT3Cr3MtsO8qWSmsngIu9QVi6vFFDCoctCqv89Qnx+N7kfV7o1K3JXVLdsW18ZT5zGAw8dMDJq0ZVt94IqzAU0mLoZ+nntfnpoFc4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715449784; c=relaxed/simple; bh=UBBfH1HEmnpzIn7WkczNqddL1qrZ21c0QYZoSzFGQso=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=MGSl9YBFBQ1hmHWAi1ZUJmQio68jq1HaevRPbDq9Rv9/8sQlZRmoNALFbZ8mTDV/sodP3WaH5ywyiIsYfII/pvszILoju/11ofmIL0M9gXBvjoKd8ThktSNS98o8wfjPqtaUTu9Qwb/G9qeuS6CgkUcc+hV7du9gRyLgF59Ik3A= 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=lxV0qPuW; 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 44BHnQ8f013210; Sat, 11 May 2024 12:49:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1715449766; bh=4215bRTgwZdqG5KkXJIS7GulsBaMdC4XYJ8YcQUiUgk=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=lxV0qPuWTOU6SaCKezg3siI2giP8qdepUnCvfOSUUL+bEsDMjX6bpsSXj5G+14F56 7HxFEEpj6wda3qzhPRVJZESuO0ljZgNSetf9IbJ9kP5qM7LT0Ju5DmhyQjpZKJToxC 9aqF8RdjTTwrNX3wsH9Jld5tfsFkTKyXKQ4gm8EY= 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 44BHnQms031044 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 11 May 2024 12:49:26 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) 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; Sat, 11 May 2024 12:49:26 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE102.ent.ti.com (10.64.6.23) 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; Sat, 11 May 2024 12:49:26 -0500 Received: from [10.249.130.181] ([10.249.130.181]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 44BHnEIi018005; Sat, 11 May 2024 12:49:15 -0500 Message-ID: Date: Sat, 11 May 2024 23:19:13 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 8/8] gpu: ipu-v3: Use generic macro for rounding to nearest multiple To: Andy Shevchenko CC: , , , , , , , , , , , , , , , , , , , , , , , , , References: <20240509184010.4065359-1-devarsht@ti.com> Content-Language: en-US From: Devarsh Thakkar In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Hi Andy, Thanks for the quick review. On 10/05/24 20:33, Andy Shevchenko wrote: > On Fri, May 10, 2024 at 12:10:10AM +0530, Devarsh Thakkar wrote: >> Use generic macro round_closest_up for rounding to nearest multiple instead > > round_closest_up() > > We refer to the functions as func(). > Agreed. Will fix commit msg to use round_closest_up() >> of using local function. > > ... > >> @@ -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; > > Oh, these seems to be better to use either ALIGN*(), or PFN_*() / PAGE_*() > families of macros. What the semantic of 8192 is? > As Laurent mentioned, it looks like the fractional part of the integer. But functionality wise, there is no change with the introduction of this patch. round_closest_up() does exactly the same thing as what the local function round_closest used to do before this patch. Regards Devarsh