summaryrefslogtreecommitdiff
path: root/include/drm
diff options
context:
space:
mode:
authorRobert Morell <rmorell@nvidia.com>2011-03-17 17:54:39 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:48:13 -0800
commit627c235be502ea07cf66fac921af372e15164be9 (patch)
treea20b749659bfeb26f1d503c983d57ae37ac034e2 /include/drm
parentbb7122aad0e248dedf2067e7672755ec9dab430e (diff)
drm_fixed: Add dfixed_frac
This helper macro retrieves the fractional part of a fixed20_12 20.12 fixed-point number. bug 818525 Original-Change-Id: Ia43a7bd3029a4d09ad7801099cbe2a52a4fc9c04 Signed-off-by: Robert Morell <rmorell@nvidia.com> Reviewed-on: http://git-master/r/40525 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R3ad51cd6fb0e1dadbc25807bf12894a9b81e94d3
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)
{