drm/amd/display: Correct fixed point calculation.
authorVitaly Prosyak <vitaly.prosyak@amd.com>
Fri, 24 Nov 2017 21:52:33 +0000 (15:52 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 14 Dec 2017 15:57:36 +0000 (10:57 -0500)
When convert from fixed31_32 to other fixed point
format use math operation round instead of floor.

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/basics/conversion.c

index 23c9a0e..3109649 100644 (file)
@@ -46,7 +46,7 @@ uint16_t fixed_point_to_int_frac(
                        arg));
 
        if (d <= (uint16_t)(1 << integer_bits) - (1 / (uint16_t)divisor))
-               numerator = (uint16_t)dal_fixed31_32_floor(
+               numerator = (uint16_t)dal_fixed31_32_round(
                        dal_fixed31_32_mul_int(
                                arg,
                                divisor));