summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c9
-rw-r--r--drivers/gpu/drm/amd/display/include/fixed31_32.h3
2 files changed, 12 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);
+}
diff --git a/drivers/gpu/drm/amd/display/include/fixed31_32.h b/drivers/gpu/drm/amd/display/include/fixed31_32.h
index 4badaedbaadd..0de258622c12 100644
--- a/drivers/gpu/drm/amd/display/include/fixed31_32.h
+++ b/drivers/gpu/drm/amd/display/include/fixed31_32.h
@@ -470,4 +470,7 @@ uint32_t dal_fixed31_32_clamp_u0d14(
uint32_t dal_fixed31_32_clamp_u0d10(
struct fixed31_32 arg);
+int32_t dal_fixed31_32_s4d19(
+ struct fixed31_32 arg);
+
#endif