summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/basics
diff options
context:
space:
mode:
authorKen Chalmers2018-01-17 20:17:40 +0100
committerAlex Deucher2018-02-19 20:19:29 +0100
commita6e59fa8061b222283c27cafb134fb8f862f0d7c (patch)
tree6df2da947b5d954158cfc0bd6135e99dfaf9ec7e /drivers/gpu/drm/amd/display/dc/basics
parentdrm/amd/display: remove unused function prototypes (diff)
downloadkernel-qcow2-linux-a6e59fa8061b222283c27cafb134fb8f862f0d7c.tar.gz
kernel-qcow2-linux-a6e59fa8061b222283c27cafb134fb8f862f0d7c.tar.xz
kernel-qcow2-linux-a6e59fa8061b222283c27cafb134fb8f862f0d7c.zip
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: Ken Chalmers <ken.chalmers@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/basics')
-rw-r--r--drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c b/drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c
index 011a97f82fb6..8a9bba879207 100644
--- a/drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c
+++ b/drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c
@@ -593,3 +593,12 @@ uint32_t dal_fixed31_32_clamp_u0d10(
{
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);
+}