Received: by 2002:ab2:6486:0:b0:1ef:eae8:a797 with SMTP id de6csp298364lqb; Sat, 16 Mar 2024 05:00:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVfeuC8I6DqXNy/4RSPHLdNcwO418geER6aypNmJqIWys/bnGj+cVOm5rvA87IquqQGd5qHG9l8heFwjn0tLrDnWW8nsrrWVumxvVFwYA== X-Google-Smtp-Source: AGHT+IGY5XBDDcF/UOFgswJOqri9qsZ5UxrmZyLj4McjlEck8QOtrGP5RRqbl3tpVA1j59CqW2sa X-Received: by 2002:a19:8c01:0:b0:512:fab6:6df6 with SMTP id o1-20020a198c01000000b00512fab66df6mr5175171lfd.4.1710590406894; Sat, 16 Mar 2024 05:00:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710590406; cv=pass; d=google.com; s=arc-20160816; b=ERql7TlnaH+R6THzgbfci3/YsGcWGBXbPGBm/ptQrnszb+hzNne5Co66DVviKnqt+l GID4ZJRt5shOHbWXJ+Sf5EGzQt6r0VlUJYjKADREg4A8D9J5re/eJ580w+M6NOcZdzdB sTReqSQmm0YLGbsWTIV1wWCRAo5Zm2vKIWrBQtyZ72m53lYyh1Ko5mATSk9GzmweC/NB +EU+LvwGa4Zg0hwZ4l0gzYFksdq5BbAc7sGcjnVQ4RLKt+C3KjydQ95DAA3dV4yAy+r7 sa1QpN24LBXC9BJy753WZKP5fCIoE0GmA9uurWKvKJT8t9ZTbbJz3acCfFxLBXtuQmuH /kWw== 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:references:cc:to :content-language:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Lq25l/MUtv2Z46o+hj4Gt9gYzR3Ee/KiWyBmtOq5SBg=; fh=xU1Xo75OboFecYuojUhEgDQaHiBMh0M3AfqqmDUEw8A=; b=ivpvobXCmeND3ylwl3ZDgM/SpOwsHP3/4o3NrdM+zK1OsNuQq0dN9Fr1O9lepW09kx Zj9rA9aTkeAjwv7Z8/2jZ0IAyz4CxzQUp1vsb/w6ECN2T7bHh5fNrBYNl0zGDAcojfso VbDujIStsxUkLxCISmzghQmOJFunrnRGKW7Q52WhNo7oD5owu0+hiucANT1lEefdfX37 oMxmELMeO8XMqrwksiFuX+lU7BEs2QU5m0s76nfsFU3ZpdkaszaiByurlIm4Z7hlUyPO 9dKC4E/duywSw8uaBGyxdDsWfiibBRBtMbp4EW2CJzD/IyUG9qvz1sW7SKBlipxtl3YF 0zgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@riseup.net header.s=squak header.b=f64dPdfa; arc=pass (i=1 spf=pass spfdomain=riseup.net dkim=pass dkdomain=riseup.net dmarc=pass fromdomain=riseup.net); spf=pass (google.com: domain of linux-kernel+bounces-105173-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105173-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=riseup.net Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s25-20020a1709066c9900b00a46ab84ec1dsi201948ejr.727.2024.03.16.05.00.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Mar 2024 05:00:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105173-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=@riseup.net header.s=squak header.b=f64dPdfa; arc=pass (i=1 spf=pass spfdomain=riseup.net dkim=pass dkdomain=riseup.net dmarc=pass fromdomain=riseup.net); spf=pass (google.com: domain of linux-kernel+bounces-105173-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105173-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=riseup.net 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 96DCF1F21997 for ; Sat, 16 Mar 2024 12:00:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F40D51799D; Sat, 16 Mar 2024 12:00:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=riseup.net header.i=@riseup.net header.b="f64dPdfa" Received: from mx0.riseup.net (mx0.riseup.net [198.252.153.6]) (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 7844217722 for ; Sat, 16 Mar 2024 11:59:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.252.153.6 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710590400; cv=none; b=SZoiYKB30e5wVNkdliBuz0bY41nF1bgVMPWU1ExE7OerVpWWAXVh6bJAmAX6AzI0SykmqCywih24SO/jNwWfPiGpn/xBRd/k4RSLTNmWOmK4NwVW6PDNLlL8Ma1F+whW3HRQ8fQbG5uI2IQfyNSPBzIUaHcFlPgrXyT8zt4SgsM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710590400; c=relaxed/simple; bh=WQmxlTwntkNSsllxZyg/C1a/cT0ISfU7jYv4Gvy4DNg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=P5qZKKWMJtj/LvPzFxlTfDI0ZFZJjGZEg5+SHT4FHLOUcdT8x7+cjQPKF9/zlxw3pB5P7tCu4k5KQr5SSShP10XKiICAYHNrivyyEUltQyYuuQCCFnrC37rL2oyhE5R7Bc615NsAw0Z5hSic2xTy5wdCXPSUGKe9Z+9NIcvLXqs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riseup.net; spf=pass smtp.mailfrom=riseup.net; dkim=pass (1024-bit key) header.d=riseup.net header.i=@riseup.net header.b=f64dPdfa; arc=none smtp.client-ip=198.252.153.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riseup.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riseup.net Received: from fews02-sea.riseup.net (fews02-sea-pn.riseup.net [10.0.1.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx0.riseup.net (Postfix) with ESMTPS id 4Txfn31qT3z9vDX; Sat, 16 Mar 2024 11:59:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1710590391; bh=WQmxlTwntkNSsllxZyg/C1a/cT0ISfU7jYv4Gvy4DNg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=f64dPdfaX8zGoyN4b9rG4CEgoLbOj3lPAZkAPG7E0t67dZoFJkjm5J3cT6tgbIKQ9 gXM+AK3QTLvRv6WAx5a3Q/93n/+uH7tp9c+yzfyIka6lfkSJoYEN31v/szESXHoMK6 10LDCYhAvPFNsFVqv9VzzRgzlbfZrPlt4MDgyymI= X-Riseup-User-ID: 6C74F281042F65B51CCBE0B3DA10EC412235F4C595D00882D3E048DA1DED345E Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4Txfmv1rZqzFtSW; Sat, 16 Mar 2024 11:59:42 +0000 (UTC) Message-ID: <2aa81b6b-0eb1-46d6-8e36-3bd43b8961c4@riseup.net> Date: Sat, 16 Mar 2024 08:59:40 -0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH 1/7] drm: Fix drm_fixp2int_round() making it add 0.5 Content-Language: en-US To: Melissa Wen Cc: Rodrigo Siqueira , Melissa Wen , =?UTF-8?Q?Ma=C3=ADra_Canal?= , Haneen Mohammed , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Jonathan Corbet , pekka.paalanen@haloniitty.fi, Louis Chauvet , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, jeremie.dautheribes@bootlin.com, miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com, seanpaul@google.com, marcheu@google.com, nicolejadeyee@google.com, Pekka Paalanen References: <20240306-louis-vkms-conv-v1-0-5bfe7d129fdd@riseup.net> <20240306-louis-vkms-conv-v1-1-5bfe7d129fdd@riseup.net> From: Arthur Grillo In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/03/24 15:27, Melissa Wen wrote: > On 03/06, Arthur Grillo wrote: >> As well noted by Pekka[1], the rounding of drm_fixp2int_round is wrong. >> To round a number, you need to add 0.5 to the number and floor that, >> drm_fixp2int_round() is adding 0.0000076. Make it add 0.5. >> >> [1]: https://lore.kernel.org/all/20240301135327.22efe0dd.pekka.paalanen@collabora.com/ >> > Hi Arthur, > > thanks for addressing this issue. > > Please, add a fix tag to the commit that you are fixing, so we can > easily backport. Might be this commit: > https://cgit.freedesktop.org/drm/drm-misc/commit/drivers/gpu/drm/vkms?id=ab87f558dcfb2562c3497e89600dec798a446665 Wouldn't be this commit instead? https://cgit.freedesktop.org/drm/drm-misc/commit/?id=8b25320887d7feac98875546ea0f521628b745bb Best Regards, ~Arthur Grillo >> Suggested-by: Pekka Paalanen >> Signed-off-by: Arthur Grillo >> --- >> include/drm/drm_fixed.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/include/drm/drm_fixed.h b/include/drm/drm_fixed.h >> index 0c9f917a4d4b..de3a79909ac9 100644 >> --- a/include/drm/drm_fixed.h >> +++ b/include/drm/drm_fixed.h >> @@ -90,7 +90,7 @@ static inline int drm_fixp2int(s64 a) >> >> static inline int drm_fixp2int_round(s64 a) >> { >> - return drm_fixp2int(a + (1 << (DRM_FIXED_POINT_HALF - 1))); > Also, this is the only usage of DRM_FIXED_POINT_HALF. Can you also > remove it as it won't be used anymore? > >> + return drm_fixp2int(a + DRM_FIXED_ONE / 2); > Would this division be equivalent to just shifting 1ULL by 31 instead of > 32 as done in DRM_FIXED_ONE? > > Melissa > >> } >> >> static inline int drm_fixp2int_ceil(s64 a) >> >> -- >> 2.43.0 >>