summaryrefslogtreecommitdiffstats
path: root/include/drm/drm_fixed.h
diff options
context:
space:
mode:
authorRobert Morell2012-04-25 11:45:01 +0200
committerDave Airlie2012-04-27 10:29:35 +0200
commitf7f6c340f9d8f11bee50aef647b8578348957936 (patch)
tree3c4593baa3a02dd6f06070bf5bcb459b3cf94ee3 /include/drm/drm_fixed.h
parentgma500: Set the mapping mask (diff)
downloadkernel-qcow2-linux-f7f6c340f9d8f11bee50aef647b8578348957936.tar.gz
kernel-qcow2-linux-f7f6c340f9d8f11bee50aef647b8578348957936.tar.xz
kernel-qcow2-linux-f7f6c340f9d8f11bee50aef647b8578348957936.zip
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 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)
{