summaryrefslogtreecommitdiffstats
path: root/include/drm/drm_fixed.h
diff options
context:
space:
mode:
authorRobert Morell <rmorell@nvidia.com>2012-04-25 11:45:01 +0200
committerDave Airlie <airlied@redhat.com>2012-04-27 09:29:35 +0100
commitf7f6c340f9d8f11bee50aef647b8578348957936 (patch)
tree3c4593baa3a02dd6f06070bf5bcb459b3cf94ee3 /include/drm/drm_fixed.h
parent398b4706896ee8d8e72f215a089b58637add5c92 (diff)
downloadlinux-0-day-f7f6c340f9d8f11bee50aef647b8578348957936.tar.gz
linux-0-day-f7f6c340f9d8f11bee50aef647b8578348957936.tar.xz
drm: fixed: Add dfixed_frac
This helper macro retrieves the fractional part of a fixed20_12 20.12 fixed-point number. Signed-off-by: Robert Morell <rmorell@nvidia.com> Signed-off-by: Olof Johansson <olofj@chromium.org> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm/drm_fixed.h')
-rw-r--r--include/drm/drm_fixed.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/drm/drm_fixed.h b/include/drm/drm_fixed.h
index 4a08a664ff1f2..0ead502e17d27 100644
--- a/include/drm/drm_fixed.h
+++ b/include/drm/drm_fixed.h
@@ -37,6 +37,7 @@ typedef union dfixed {
#define dfixed_init(A) { .full = dfixed_const((A)) }
#define dfixed_init_half(A) { .full = dfixed_const_half((A)) }
#define dfixed_trunc(A) ((A).full >> 12)
+#define dfixed_frac(A) ((A).full & ((1 << 12) - 1))
static inline u32 dfixed_floor(fixed20_12 A)
{