From: Melissa Wen <mwen@igalia.com>
To: Arthur Grillo <arthurgrillo@riseup.net>
Cc: "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>,
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: Sat, 16 Mar 2024 11:10:34 -0300 [thread overview]
Message-ID: <1950f7fb-d326-4074-ba7c-8c5622eebb2e@igalia.com> (raw)
In-Reply-To: <2aa81b6b-0eb1-46d6-8e36-3bd43b8961c4@riseup.net>
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 <pekka.paalanen@collabora.com>
>>> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
>>> ---
>>> 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
>>>
next prev parent reply other threads:[~2024-03-16 14:11 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
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 [this message]
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=1950f7fb-d326-4074-ba7c-8c5622eebb2e@igalia.com \
--to=mwen@igalia.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
all inboxes | Powered by JetHome®