Received: by 2002:ab2:6486:0:b0:1ef:eae8:a797 with SMTP id de6csp361307lqb; Sat, 16 Mar 2024 07:11:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVW7pBEjuYIV2V4k67g/7TRj5kmG8tf/XEiQv4+AyiH6AmuwMeMYXsrIWzQrsMmM5juqR6Wvrm7ygjcplm4H1tGTdGHZAfjGbB/y6kFDA== X-Google-Smtp-Source: AGHT+IHTpEjEXU4OmHRzGKt3BpdVs0wclVPgZOxnK8n80MxjUdqFi41M96g67Dgo9GnYJnnF8ee/ X-Received: by 2002:a05:6358:590c:b0:17e:de1f:290 with SMTP id g12-20020a056358590c00b0017ede1f0290mr253399rwf.25.1710598290315; Sat, 16 Mar 2024 07:11:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710598290; cv=pass; d=google.com; s=arc-20160816; b=Ye3Oi9Hq/aiFyezz5jM3USptZfD09xIgH+h+BCLRYa70ybl9B3AT0WWFx4JpV433Pz 0IC1uBdrwS9+VXyM+9W2kjONCbPoteObWJMwUyDFfxJQK9W+A9K+ISRLh5vNUtd65DGA I0GQBmMxfNAA31Japgufs2Q2pKvqnhb1n5aMy0wi3cgy2MGpvrH+5C68xYpEbcDBGJ+s qZ2oJNKRDEuac1Xylg/Yt+/wlbj45dFERQdEX/y2GutE4xQbewqIUfgZ9rwE9UhzjCcF foWtgCp2c7CP53U8JoRjrqcTiWdW5Pau2pGHujv7SQpGjwiCYLucS2v+f21mJBmzz6R2 orQA== 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=KdHqSaYihPn5FB720GQj2s6e6OT+vaWHkLMQ10Tlf5U=; fh=TrxLl93YVmuS+lpe9jwTKiSa3xc92tTbPZPOvGoEV2I=; b=pHqT4nhKX1yjYG07Cw0WHSi6S/7caKpaqYZPBU2M1YdN6btsBSiWiaEuyuRI+8eRUB 4hJsphpArpYQhiSimdzt9aJWvjWjSauI7Rv3YvvrTbfPJxxXVJRGZbuML1YEvURo6fiJ MPPx1/V1sgm5SbaXrk0zsOwh9e9yydNXVzWKk8iS3MAVKIxliDkd9TmScmiYJO+dquX0 AhEyLdmj5HlFoO9cVgXHwS1GiR4wVgKejGkYgK3ZOHnpflLbhbsmorN2LV3aXbdLiQca cDrs4zbCwVl2jT0G76ZZdynY5lamAvbC9PLer7MZNuXMWUPSYH0y4r81xzHVw91PLPsO VDWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b="FLN/sEIB"; arc=pass (i=1 spf=pass spfdomain=igalia.com dkim=pass dkdomain=igalia.com); spf=pass (google.com: domain of linux-kernel+bounces-105198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105198-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l6-20020a635706000000b005dbec91be93si4632794pgb.595.2024.03.16.07.11.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Mar 2024 07:11:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b="FLN/sEIB"; arc=pass (i=1 spf=pass spfdomain=igalia.com dkim=pass dkdomain=igalia.com); spf=pass (google.com: domain of linux-kernel+bounces-105198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105198-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 87197B212CC for ; Sat, 16 Mar 2024 14:11:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9D951AAA5; Sat, 16 Mar 2024 14:11:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="FLN/sEIB" Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) (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 2F63114290 for ; Sat, 16 Mar 2024 14:11:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.97.179.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710598279; cv=none; b=idLWDp7WVZYhtCL7KKksnjM53c+4CzPJR3jdjnOopIbokWEON5xPGG5Imlx7eDHOa22AEvwEzNK/CvE6sZOieDTZ0t3ipMY1JFgkaDF44NteNMLRPcHDzdDPxwdIpH90pcclPh3bNMvWrsr23ljIzxVQSRJ6XAQG4aPRV+7OOmE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710598279; c=relaxed/simple; bh=Wb9CHEmPPCeq2+LNqemXs1xf0viC8ZW+ktqvjLjwKeY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=K2/n0Htrc+xYmhKoDmq8MWhBpa7rNEOjI8l4dFgP1Wul1DTE7U9jCmvgaebm4Rf0vMrjPldgzcaNeL9RNMJVwf7DCpHXrRn4666p2Lhl1Ab6VXHGCTfwJBMdMhmMFBXjI8+eNghIHc1oZ4oLWh8e/G0crMT2xjCmGWDDI29tiYM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=FLN/sEIB; arc=none smtp.client-ip=213.97.179.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=KdHqSaYihPn5FB720GQj2s6e6OT+vaWHkLMQ10Tlf5U=; b=FLN/sEIBe7DtAcqD80jbTa/MT+ 2oM1hX2RwwJjw5gcYnjVhh5yIZDVgI11ghnTr7zL+JIhiXSNKoIr86u5BqKmhJcAcyKqq7+D9JU2D 7s5Ls3iebh+Qzz1v6OkepMpkONJeFzJwiRShTA2LeV3xbBeMJUMaZak5Kc6QMuEcVE1hGKMVUcZW2 JxHKBIk67H24X4zvSa3Wr60cl6Qj+HGDTEBks18y+zIoRBeTlVsqwDvrhV1Ue7VtNUbS8OMgzwaVv 8RBH8yON97dmuyvIu6H9fpqiNbL9XnkkKcCukMdnVocYMKwVq13XjSeQ8lJGP1SqikDeUjRucrFFM YaWzYkug==; Received: from [189.6.17.125] (helo=[192.168.0.55]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1rlUkH-00BGTR-2S; Sat, 16 Mar 2024 15:10:45 +0100 Message-ID: <1950f7fb-d326-4074-ba7c-8c5622eebb2e@igalia.com> Date: Sat, 16 Mar 2024 11:10:34 -0300 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 1/7] drm: Fix drm_fixp2int_round() making it add 0.5 To: Arthur Grillo 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> <2aa81b6b-0eb1-46d6-8e36-3bd43b8961c4@riseup.net> Content-Language: en-US From: Melissa Wen In-Reply-To: <2aa81b6b-0eb1-46d6-8e36-3bd43b8961c4@riseup.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 16/03/2024 08:59, Arthur Grillo wrote: > > 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 Yes, you're right! Melissa > > 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 >>>