提交 a6e59fa8 编写于 作者: K Ken Chalmers 提交者: Alex Deucher

drm/amd/display: WBSCL filter init calculation fixes

* Previous code did some calculations with a mix of normal integers and
  integers aligned as U2.24 fixed-point values.
* There were bugs in the conversion of the final result into the
  S4.19 values required for the registers.
Signed-off-by: NKen Chalmers <ken.chalmers@amd.com>
Reviewed-by: NTony Cheng <Tony.Cheng@amd.com>
Acked-by: NHarry Wentland <harry.wentland@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 f774b339
...@@ -593,3 +593,12 @@ uint32_t dal_fixed31_32_clamp_u0d10( ...@@ -593,3 +593,12 @@ uint32_t dal_fixed31_32_clamp_u0d10(
{ {
return clamp_ux_dy(arg.value, 0, 10, 1); return clamp_ux_dy(arg.value, 0, 10, 1);
} }
int32_t dal_fixed31_32_s4d19(
struct fixed31_32 arg)
{
if (arg.value < 0)
return -(int32_t)ux_dy(dal_fixed31_32_abs(arg).value, 4, 19);
else
return ux_dy(arg.value, 4, 19);
}
...@@ -470,4 +470,7 @@ uint32_t dal_fixed31_32_clamp_u0d14( ...@@ -470,4 +470,7 @@ uint32_t dal_fixed31_32_clamp_u0d14(
uint32_t dal_fixed31_32_clamp_u0d10( uint32_t dal_fixed31_32_clamp_u0d10(
struct fixed31_32 arg); struct fixed31_32 arg);
int32_t dal_fixed31_32_s4d19(
struct fixed31_32 arg);
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册