Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 508f60e3 authored by Vitaly Prosyak's avatar Vitaly Prosyak Committed by Alex Deucher
Browse files

drm/amd/display: Correct fixed point calculation.



When convert from fixed31_32 to other fixed point
format use math operation round instead of floor.

Signed-off-by: default avatarVitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: default avatarRoman Li <Roman.Li@amd.com>
Reviewed-by: default avatarKrunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 40e045a9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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));