public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland@amd.com>
To: "Arthur Grillo" <arthurgrillo@riseup.net>,
	"Rodrigo Siqueira" <rodrigosiqueiramelo@gmail.com>,
	"Melissa Wen" <melissa.srw@gmail.com>,
	"Maíra Canal" <mairacanal@riseup.net>,
	"Haneen Mohammed" <hamohammed.sa@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	pekka.paalanen@haloniitty.fi,
	"Louis Chauvet" <louis.chauvet@bootlin.com>
Cc: 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 <pekka.paalanen@collabora.com>
Subject: Re: [PATCH 1/7] drm: Fix drm_fixp2int_round() making it add 0.5
Date: Fri, 8 Mar 2024 15:57:00 -0500	[thread overview]
Message-ID: <0255d007-6929-4366-b47e-0826e13b86e8@amd.com> (raw)
In-Reply-To: <20240306-louis-vkms-conv-v1-1-5bfe7d129fdd@riseup.net>

On 2024-03-06 15:03, 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/
> 
> Suggested-by: Pekka Paalanen <pekka.paalanen@collabora.com>
> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

I had a different jab at this [1], but your patch is cleaner.

https://patchwork.freedesktop.org/patch/579978/?series=123446&rev=4

Harry

> ---
>   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)));
> +	return drm_fixp2int(a + DRM_FIXED_ONE / 2);
>   }
>   
>   static inline int drm_fixp2int_ceil(s64 a)
> 

  reply	other threads:[~2024-03-08 20:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 20:03 [PATCH 0/7] Additions to "Reimplement line-per-line pixel conversion for plane reading" series Arthur Grillo
2024-03-06 20:03 ` [PATCH 1/7] drm: Fix drm_fixp2int_round() making it add 0.5 Arthur Grillo
2024-03-08 20:57   ` Harry Wentland [this message]
2024-03-12 18:27   ` Melissa Wen
2024-03-13 18:47     ` Arthur Grillo
2024-03-14 12:59       ` Melissa Wen
2024-03-14 13:29         ` Pekka Paalanen
2024-03-14 13:31         ` Melissa Wen
2024-03-14 13:37           ` Harry Wentland
2024-03-16 11:59     ` Arthur Grillo
2024-03-16 14:10       ` Melissa Wen
2024-03-06 20:03 ` [PATCH 2/7] drm/vkms: Add comments Arthur Grillo
2024-03-12 20:20   ` Melissa Wen
2024-03-06 20:03 ` [PATCH 3/7] drm/vkmm: Use drm_fixed api Arthur Grillo
2024-03-06 20:03 ` [PATCH 4/7] drm/vkms: Fix compilation issues Arthur Grillo
2024-03-07  0:03   ` Louis Chauvet
2024-03-07 11:43     ` Arthur Grillo
2024-03-06 20:03 ` [PATCH 5/7] drm/vkms: Add comments to format tests Arthur Grillo
2024-03-06 20:03 ` [PATCH 6/7] drm/vkms: Change the gray RGB representation Arthur Grillo
2024-03-12 20:16   ` Melissa Wen
2024-03-06 20:03 ` [PATCH 7/7] drm/vkms: Add how to run the Kunit tests Arthur Grillo
2024-03-08 20:38 ` [PATCH 0/7] Additions to "Reimplement line-per-line pixel conversion for plane reading" series Maíra Canal
2024-03-09 11:58   ` Louis Chauvet
2024-03-12 20:26   ` Melissa Wen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0255d007-6929-4366-b47e-0826e13b86e8@amd.com \
    --to=harry.wentland@amd.com \
    --cc=airlied@gmail.com \
    --cc=arthurgrillo@riseup.net \
    --cc=corbet@lwn.net \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=jeremie.dautheribes@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=louis.chauvet@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mairacanal@riseup.net \
    --cc=marcheu@google.com \
    --cc=melissa.srw@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=mripard@kernel.org \
    --cc=nicolejadeyee@google.com \
    --cc=pekka.paalanen@collabora.com \
    --cc=pekka.paalanen@haloniitty.fi \
    --cc=rodrigosiqueiramelo@gmail.com \
    --cc=seanpaul@google.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox