浏览代码

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: 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>
Vitaly Prosyak 7 年之前
父节点
当前提交
508f60e36a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/gpu/drm/amd/display/dc/basics/conversion.c

+ 1 - 1
drivers/gpu/drm/amd/display/dc/basics/conversion.c

@@ -46,7 +46,7 @@ uint16_t fixed_point_to_int_frac(
 			arg));
 			arg));
 
 
 	if (d <= (uint16_t)(1 << integer_bits) - (1 / (uint16_t)divisor))
 	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(
 			dal_fixed31_32_mul_int(
 				arg,
 				arg,
 				divisor));
 				divisor));