drm/amd/display: Correct fixed point calculation.
authorVitaly Prosyak <[email protected]>
Fri, 24 Nov 2017 21:52:33 +0000 (15:52 -0600)
committerAlex Deucher <[email protected]>
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 <[email protected]>
Reviewed-by: Roman Li <[email protected]>
Reviewed-by: Krunoslav Kovac <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/display/dc/basics/conversion.c

index 23c9a0ec01817c6a23be8fdbbd5ecbdf5816c585..310964915a83801c9cc914af3d5291a231ab7c38 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));