Received: by 2002:ab2:7853:0:b0:1fa:5c73:8e2d with SMTP id m19csp9181lqp; Thu, 30 May 2024 10:20:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVrZojJ0533WyYHAK+Xw/UHiJV6RyUbRoWawPDkohOrI+cDP4G22vPhZnym5mxSXv8Sno/sbHPb8ImG8+THFM+blxz3neLlK9Fv23Ct+Q== X-Google-Smtp-Source: AGHT+IG8dUKsCTSapdKm3vnVKQt9MktQiXgfyvEVN+NvStVcobaHy5cz9YI8WAvt3w4nZydGjAbL X-Received: by 2002:a17:906:b31a:b0:a63:9430:cf53 with SMTP id a640c23a62f3a-a65e9103affmr179290366b.47.1717089629838; Thu, 30 May 2024 10:20:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717089629; cv=pass; d=google.com; s=arc-20160816; b=JLwmIjMUkeLwsDvoGa5Vh8f3b+Fg/d+fnIKbtQqgtuabSjmhQMiEhBEgGFE1fGzjXR +5bMJCBXDgCM8Qr8wCBkSBmpsBAAQ8cpJbl6Q9eMincJKBxIIujcBmx0MSw+3LjfOVXY xXt7vGLDijhWx19zi8DHvqM4fVoUB5kn7kWdx27dYpWGidJdNRERdNDAFrtN2PZStPsu E9eh+GyczS64I9We46JCYflOsyVFIJ9eiyn6Qcf11AY+IxubqmXTCjFRkojb1++zOuI1 OImldnd7B539EdU8W++QaC9EiKS0rt6P9Jiqw4TDlWM5NVv2BDlP8SLGr8Qnfdk/UZC3 eF1Q== 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=yzX8xGnWsR/OBzBAb36Py2SfhdvyqwDubZ5AlT6laFk=; fh=IZZR8bK8XOm4TZZqMP3UEtOvxc3YUC3byeSJBE1C+Bg=; b=dbR35jHYwFQ9i4l33mWHYRMaoiEiP0+gTCVmkDnyq6NTyumUbSQDHQdhmucRqPVN8o lSJS6Eh/YPYDCF5XcHQ7SM2AUPKF1E0dkCaOT5hya1/F6bgrjYOGNTPoJRoDItuJcEft MhxuGEmI/VAoHoQFbxHbentwLoXz19NhyBQwksoLMWzyXgW8XLU6RI4nz8pFS9pf6zmt Zp+o+OB4uBkjEt4YRKXrSwo69AW23Q5RxiZNP3w1v2LbEe+SyIXgv3xwO8y2XCPTAgMK 7C8k+0o4MfgAu4izxXvcgogsgTWI/EekFImWE1VLV6dRJhMhrmVZr1BTnwNnPT6K2w56 fhHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=tg3geI7T; 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-195727-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195727-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-a6628bb914bsi70137566b.722.2024.05.30.10.20.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 10:20:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195727-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=tg3geI7T; 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-195727-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195727-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 8E0CA1F23F1B for ; Thu, 30 May 2024 17:20:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C3A746444; Thu, 30 May 2024 17:20:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="tg3geI7T" Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 AB6622D05D; Thu, 30 May 2024 17:20:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.249 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717089618; cv=none; b=Ll8E3nHMRVp/0jpEHRx4P7GUdP42VnKB3bZU8r0v7fcSfJUcRN6g9VG48sz4uTEe17qCarHs5IzcSom+W6Tr3fefW/iBNy2VoXfNvh47fItKMgx5jVTHdidtrI0ZiNR4D3KBsT9c88So2mokTFodxLbqtcHtiqa0s9Ju3nOnuEE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717089618; c=relaxed/simple; bh=gcJkTZML9bjHSggEdBQv/CTBlzRC5ardnurEhseoG44=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=X5aqQLY0suUDo1qOoxAmQVNMpzF2sYUgaaaBb5iEgXa+bNb6Xq4gRbn37obKIVbN1X9kg0/lcxvWGJwE21GbZhPs2GePog6EfjiUal3Otj5wh2wpFlHFR8W95MLANzRz52DaYoZH5tI9TnS9Zrjd0JJU1qehh2W9J+AK/lbCqKk= 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=tg3geI7T; arc=none smtp.client-ip=198.47.23.249 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 lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 44UHJvOf089529; Thu, 30 May 2024 12:19:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1717089597; bh=yzX8xGnWsR/OBzBAb36Py2SfhdvyqwDubZ5AlT6laFk=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=tg3geI7Tgxmsxt1AiH9fZgS8KNX5y1fMYFknbvxpz3TQ8NrcZmiLZvzn1JWYjzk+l EkqxRJgP37Z6WOArn93rJHFG3NQzbrk9UEBSQAbfwjtgQjHYAv2gJ+I6e7TCO2pScG r65W7YKQ1iKP1+Oye/qKY6L4xV30xR3zmIn+LmE8= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 44UHJvSp001047 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 30 May 2024 12:19:57 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 30 May 2024 12:19:56 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE108.ent.ti.com (10.64.6.29) 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, 30 May 2024 12:19:56 -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 44UHJtfX022288; Thu, 30 May 2024 12:19:56 -0500 From: Devarsh Thakkar To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , Subject: [PATCH v10 11/11] gpu: ipu-v3: Use generic macro for rounding closest to specified value Date: Thu, 30 May 2024 22:49:55 +0530 Message-ID: <20240530171955.2769314-1-devarsht@ti.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240530165925.2715837-1-devarsht@ti.com> References: <20240530165925.2715837-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 --- 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