]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/vkms: Fix RGB565 pixel conversion
authorMaíra Canal <mcanal@igalia.com>
Fri, 12 May 2023 10:40:45 +0000 (07:40 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jul 2023 17:39:35 +0000 (19:39 +0200)
commit0573f5510bd4a98ac9003288c80cf5d3097f9d8c
tree3988e11f55e1baab8f0120e91525cf5c4a0a0800
parent20e04b01270a5f1269979af847d94952fd911b4e
drm/vkms: Fix RGB565 pixel conversion

[ Upstream commit ab87f558dcfb2562c3497e89600dec798a446665 ]

Currently, the pixel conversion isn't rounding the fixed-point values
before assigning it to the RGB coefficients, which is causing the IGT
pixel-format tests to fail. So, use the drm_fixp2int_round() fixed-point
helper to round the values when assigning it to the RGB coefficients.

Tested with igt@kms_plane@pixel-format and igt@kms_plane@pixel-format-source-clamping.

[v2]:
    * Use drm_fixp2int_round() to fix the pixel conversion instead of
      casting the values to s32 (Melissa Wen).

Fixes: 89b03aeaef16 ("drm/vkms: fix 32bit compilation error by replacing macros")
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-2-mcanal@igalia.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/vkms/vkms_formats.c