]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/vkms: Round fixp2int conversion in lerp_u16
authorHarry Wentland <harry.wentland@amd.com>
Fri, 20 Dec 2024 04:33:08 +0000 (21:33 -0700)
committerLouis Chauvet <louis.chauvet@bootlin.com>
Tue, 25 Feb 2025 15:15:55 +0000 (16:15 +0100)
fixp2int always rounds down, fixp2int_ceil rounds up. We need
the new fixp2int_round.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241220043410.416867-3-alex.hung@amd.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
drivers/gpu/drm/vkms/vkms_composer.c

index b20ac170572622b34ba76b1a9c5dd626ca5da6fa..fa269d279e2570297f7a67d3ef265b0e486a83f3 100644 (file)
@@ -67,7 +67,7 @@ static u16 lerp_u16(u16 a, u16 b, s64 t)
 
        s64 delta = drm_fixp_mul(b_fp - a_fp, t);
 
-       return drm_fixp2int(a_fp + delta);
+       return drm_fixp2int_round(a_fp + delta);
 }
 
 static s64 get_lut_index(const struct vkms_color_lut *lut, u16 channel_value)