drm: Add fixed-point helper to get rounded integer values
authorMaíra Canal <mcanal@igalia.com>
Fri, 12 May 2023 10:40:44 +0000 (07:40 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:21:18 +0000 (16:21 +0200)
commit048b7168acf85cb856b0db1d0483584cfff3498f
treeed68e94cdd14281e18f16d2a933e255b70d12ce7
parentfa4ee16e814a41a2afcaa85d443dfa2a923e9e38
drm: Add fixed-point helper to get rounded integer values

[ Upstream commit 8b25320887d7feac98875546ea0f521628b745bb ]

Create a new fixed-point helper to allow us to return the rounded value
of our fixed point value.

[v2]:
    * Create the function drm_fixp2int_round() (Melissa Wen).
[v3]:
    * Use drm_fixp2int() instead of shifting manually (Arthur Grillo).

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Arthur Grillo <arthurgrillo@riseup.net>
Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230512104044.65034-1-mcanal@igalia.com
Stable-dep-of: ab87f558dcfb ("drm/vkms: Fix RGB565 pixel conversion")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/drm/drm_fixed.h