Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1255539lql; Tue, 12 Mar 2024 11:29:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVquvTr0Q2+ZYdh6eP5OC6S/M6Y0zQiXwmR4k5Fgxj6waqFdOZtkZdogXiJYm+AyntvNpzNaTNWRzq894PfPa3qvfvnem30sxDKIWjzLA== X-Google-Smtp-Source: AGHT+IHJiYj/55a5NmmS9ypuPTP//MmQbgkgEOpZgWHAakQhyv7m/WyR8LVgIXLxO1KGnakCSDzs X-Received: by 2002:a05:6214:964:b0:690:ca65:3393 with SMTP id do4-20020a056214096400b00690ca653393mr3778780qvb.33.1710268168107; Tue, 12 Mar 2024 11:29:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710268168; cv=pass; d=google.com; s=arc-20160816; b=dyu1b6DLd0YD0Q+nTtvHhwdyC8QzBW+wBOjPfJFX/t7l+ZOJTY/pvEECavpCsTN2Tr O/niZvJtQ2rZ+J8VeFrFzGiRAJX4mEhfS61QFyeI62yXY0ynvvmxswu845bMA7kTO2y7 GyHyoSiORUMZvwBm/gEYLjtrTF6w2vd4+BQ6EChwzj8gskn5MskbfNTOLTvD6laoqc6O gK7MoXNWPinVdnDnrEzbwbUjWjszjPFWCb57rmcr7dFk3tc5RgymHORqR3PP9HkKHG6/ JckhheyHAQjp+uRpbL6IlWwZSdvlObF4NRmAZg3X3D8Y0DLkPCjkjPHj/EdpJJeseuN1 Gh9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EnwBgC7sqK5GJPH6z85eAMNz/YmnKPxbu0l4LtLf4hw=; fh=Mp4cB9Qa8fGXYIV3oJCgdjO9rrfYT7+KKdM0339CMFo=; b=rdtm3IG4WEkwDRuRD8WJ/pFUdTW7l6iBLbXYZxc4NUrh9s6O+/+JApklJTV/JctYm6 f9IM8597Vjb6HW/gBtuNMjrWY0TqXDx3tVzsYE/Yg0L29qq6he/8Ig8m3bXypjmOhdx2 bQl3kRYTteYDa0g/7mURR7lQn3je5e422VOnSqyRlAM/3SLoICNu1Olf1v/aFJFv8gjO qyqTEyxw3by3VBvpUmeFM58ZfAj9+NQIL7PzDRb05vUGe2C4gb4RC02eOXyv3Covm1eu FM/icGD1UdBdKHJk4ykU37HKse4P1RNgXoAFbbYTP7ZJS0fwLyr7pGOb2eTD5eTweiUY 4UWw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=LQf6rABS; arc=pass (i=1 spf=pass spfdomain=igalia.com dkim=pass dkdomain=igalia.com); spf=pass (google.com: domain of linux-kernel+bounces-100655-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100655-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ks4-20020a056214310400b006904cabbb7bsi8152143qvb.26.2024.03.12.11.29.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 11:29:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100655-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=LQf6rABS; arc=pass (i=1 spf=pass spfdomain=igalia.com dkim=pass dkdomain=igalia.com); spf=pass (google.com: domain of linux-kernel+bounces-100655-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100655-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D291C1C21B49 for ; Tue, 12 Mar 2024 18:29:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3F667139586; Tue, 12 Mar 2024 18:29: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="LQf6rABS" 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 AA471139571 for ; Tue, 12 Mar 2024 18:29:17 +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=1710268160; cv=none; b=nvDeFCUWCdkmi36eW69RcJRSYHjxGFzDDijv36520wK2MG4pAZqLUnRA11lwlhuJWQ4aWsQi1m2dbh08AoKYgM84LqfnTz1wnvgCSdSbD54PyPPN1UhAyma/sl9xB2h0XLNCMNuzLKeq25tOMSyvZVQG8qx7CPioFpVfYmjQ+Fk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710268160; c=relaxed/simple; bh=IqMBeQoinj3qLZggdtQh3TofdcrNpcwKGbcBsFsYlnQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=td7vyn7jpzOuOfriXN9GrVXdQMtbneswYfq7YA75RkkM6IzEkSyp6vnIpZz7CS2Wc/etmyrmMCI6BRs32lHg4mOfON7gltG3xC6GGwNg+HYOL08drcu/wG21iGCGPtD9zgo1XSdHM6x2NNs/tF2eYLZdiHDAUvaG2xHkiHivrGM= 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=LQf6rABS; 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=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: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=EnwBgC7sqK5GJPH6z85eAMNz/YmnKPxbu0l4LtLf4hw=; b=LQf6rABSpj7A/tRu6vv+CQgxJJ md3j+iAzRXEcQv666Cx8WQL45ZQP+qydKbWITStW9u16qIDnY3GNy8gdvQzcvBgZ5YYRCaMe/5Lgo HHPZeVauQFcaM+m8e9ORliPEannvyx3BMbK9hn9vl6Ku92hZZstdllz9UREH941bGuRNJJXLKUsY2 G2iuOY+Ao4Pyvk4PuEiFkkeQ9Q1yqjche+XyqgaX/TcX4Nd9K7UGxut9vPgRHhL8CxL+Vf0q15hTp YRGt803RpCzBCpcWv7c4Tkm7fkZIFBzAdZ0G5gbAQp7XPVY9VC3esV9XJsZki7WPbxJxSh/LgOEhm fILs/+LA==; Received: from [189.6.17.125] (helo=mail.igalia.com) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1rk6rs-009TZS-BR; Tue, 12 Mar 2024 19:28:52 +0100 Date: Tue, 12 Mar 2024 15:27:38 -0300 From: Melissa Wen To: Arthur Grillo Cc: Rodrigo Siqueira , Melissa Wen , =?utf-8?B?TWHDrXJh?= 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 Subject: Re: [PATCH 1/7] drm: Fix drm_fixp2int_round() making it add 0.5 Message-ID: References: <20240306-louis-vkms-conv-v1-0-5bfe7d129fdd@riseup.net> <20240306-louis-vkms-conv-v1-1-5bfe7d129fdd@riseup.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240306-louis-vkms-conv-v1-1-5bfe7d129fdd@riseup.net> 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 > 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 >