summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/dml
diff options
context:
space:
mode:
authorCharlene Liu <charlene.liu@amd.com>2019-05-16 22:52:46 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-06-11 12:49:21 -0500
commit327e4f12104e01b2ebd995178d09438ec6c86858 (patch)
tree26d62f521671762b9334fda24d2deb02ff7b7b3d /drivers/gpu/drm/amd/display/dc/dml
parent6e5155ae6b66054db35d8f3c64f9863b9d0466c1 (diff)
drm/amd/display: add some math functions for dcn_calc_math
Implement floor, ceil, and fabs Signed-off-by: Charlene Liu <charlene.liu@amd.com> Reviewed-by: Charlene Liu <Charlene.Liu@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dml')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h b/drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h
index e8ce08567cd8..eca140da13d8 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h
+++ b/drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h
@@ -129,4 +129,12 @@ static inline unsigned int dml_round_to_multiple(unsigned int num,
else
return (num - remainder);
}
+static inline double dml_abs(double a)
+{
+ if (a > 0)
+ return a;
+ else
+ return (a*(-1));
+}
+
#endif