summaryrefslogtreecommitdiff
path: root/include/drm
diff options
context:
space:
mode:
authorRobert Morell <rmorell@nvidia.com>2012-04-25 13:45:01 +0400
committerDave Airlie <airlied@redhat.com>2012-04-27 12:29:35 +0400
commitf7f6c340f9d8f11bee50aef647b8578348957936 (patch)
tree3c4593baa3a02dd6f06070bf5bcb459b3cf94ee3 /include/drm
parent398b4706896ee8d8e72f215a089b58637add5c92 (diff)
downloadlinux-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')
-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 4a08a664ff1f..0ead502e17d2 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)
{